diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index 47c85008cf..b95ceaba5d 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.50 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.55 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/deploy/docker-compose-prod.yml b/epmet-auth/deploy/docker-compose-prod.yml index 13ddca93b7..0afba96920 100644 --- a/epmet-auth/deploy/docker-compose-prod.yml +++ b/epmet-auth/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.36 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.55 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/deploy/docker-compose-test.yml b/epmet-auth/deploy/docker-compose-test.yml index d15b071181..ff10d2224e 100644 --- a/epmet-auth/deploy/docker-compose-test.yml +++ b/epmet-auth/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.36 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.55 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 22aacf2b62..affb22da4d 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.50 + 0.3.55 com.epmet epmet-cloud @@ -122,6 +122,12 @@ 2.0.0 compile + + com.epmet + oper-crm-client + 2.0.0 + compile + diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java index 0f1c8f6ff7..298fa611bc 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpEnteOrgFormDTO.java @@ -39,5 +39,10 @@ public class GovWxmpEnteOrgFormDTO implements Serializable { @NotBlank(message = "组织id不能为空",groups = {AddUserInternalGroup.class}) private String rootAgencyId; + /** + * desc:小程序appId + */ + private String appId; + } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java index 8bab423dec..55abfd3bce 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWxmpFormDTO.java @@ -19,5 +19,9 @@ public class GovWxmpFormDTO extends LoginCommonFormDTO implements Serializable { */ @NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class}) private String wxCode; + /** + * appId + */ + private String appId; } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java index 8ddfe9edff..3f59baf4d7 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByWxCodeFormDTO.java @@ -29,4 +29,6 @@ public class LoginByWxCodeFormDTO extends LoginCommonFormDTO implements Serializ * 加密算法的初始向量 */ private String iv; + + private String appId; } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ResiWxPhoneFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ResiWxPhoneFormDTO.java index f0148b3c14..f710be379e 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/ResiWxPhoneFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ResiWxPhoneFormDTO.java @@ -32,4 +32,6 @@ public class ResiWxPhoneFormDTO implements Serializable { */ @NotBlank(message = "iv不能为空",groups = {AddUserInternalGroup.class}) private String iv; + + private String appId; } diff --git a/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java b/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java new file mode 100644 index 0000000000..9d74299267 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/redis/CustomerAppWxServiceUtil.java @@ -0,0 +1,124 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.redis; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; +import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAppDTO; +import com.epmet.feign.OperCrmOpenFeignClient; +import com.google.common.collect.Maps; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.SetOperations; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 客户app Redis + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class CustomerAppWxServiceUtil implements ApplicationRunner { + private static Logger logger = LogManager.getLogger(CustomerAppWxServiceUtil.class); + + /** + * 过期时长为30分钟,单位:秒 + */ + private final static long MINUTE_THIRTY_EXPIRE = 60 * 60 * 24 * 7L; + private final static String JSON_STR = "JSON"; + + @Autowired + private RedisUtils redisUtils; + @Autowired + private RedisTemplate redisTemplate; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + + private static Map maServices = Maps.newHashMap(); + + public static WxMaService getWxMaService(String appId) { + WxMaService wxMaService = maServices.get(appId); + if (wxMaService == null){ + logger.error("getMaService appId:{} is not config from customer_app",appId); + } + return wxMaService; + } + /*public String get(String appId) { + String key = RedisKeys.getAppSecretKey(appId); + String secret = (String) redisUtils.get(key); + if (StringUtils.isBlank(secret)) { + CustomerAppSecretFormDTO param = new CustomerAppSecretFormDTO(); + param.setAppId(appId); + Result result = operCrmOpenFeignClient.getSecretByAppId(param); + if (result.success()) { + secret = result.getData(); + if (StringUtils.isNotBlank(secret)) { + redisUtils.set(key, secret, MINUTE_THIRTY_EXPIRE); + } + } + } + return secret; + }*/ + + @Override + public void run(ApplicationArguments args) { + try { + Result> configAllAppResult = operCrmOpenFeignClient.getConfigAllApp(); + logger.info("initWxMa operCrmOpenFeignClient.getConfigAllApp result:{}", JSON.toJSONString(configAllAppResult)); + if (configAllAppResult == null || !configAllAppResult.success()){ + logger.info("initWxMa operCrmOpenFeignClient.getConfigAllApp fail"); + return; + } + String appKey = RedisKeys.getCustomerAppKey(); + SetOperations appSet = redisTemplate.opsForSet(); + Set members = appSet.members(appKey); + + if ( !CollectionUtils.isEmpty(configAllAppResult.getData())) { + //if (!CollectionUtils.isEmpty(members) && CollectionUtils.isEmpty()){ + //todo + //} + maServices = configAllAppResult.getData().stream() + .map(a -> { + WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); + config.setAppid(a.getAppId()); + config.setSecret(a.getSecret()); + config.setMsgDataFormat(JSON_STR); + + WxMaService service = new WxMaServiceImpl(); + service.setWxMaConfig(config); + redisTemplate.opsForSet().add(appKey,a.getSecret()); + return service; + }).collect(Collectors.toMap(s -> s.getWxMaConfig().getAppid(), a -> a)); + + + + } + } catch (Exception e) { + logger.error("init wxMaservice exception",e); + } finally { + logger.info("init wxMaservice end"); + } + } +} diff --git a/epmet-auth/src/main/java/com/epmet/service/LoginService.java b/epmet-auth/src/main/java/com/epmet/service/LoginService.java index 248e7c4d97..a0e429eff9 100644 --- a/epmet-auth/src/main/java/com/epmet/service/LoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/LoginService.java @@ -45,11 +45,12 @@ public interface LoginService { * @return cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult * @param app * @param wxCode + * @param appId 非必填 * @Author yinzuomei * @Description 解析wxCode * @Date 2020/4/19 0:24 **/ - WxMaJscode2SessionResult getWxMaUser(String app, String wxCode); + WxMaJscode2SessionResult getWxMaUser(String app, String wxCode, String appId); /** * @return java.lang.String diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 92f13d1582..d9134aabec 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -19,7 +19,6 @@ import com.epmet.constant.SmsTemplateConstant; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.*; @@ -141,7 +140,7 @@ public class GovLoginServiceImpl implements GovLoginService { @Override public UserTokenResultDTO loginByWxCode(GovWxmpFormDTO formDTO) { //1、解析微信用户 - WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(formDTO.getApp(), formDTO.getWxCode()); + WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(formDTO.getApp(), formDTO.getWxCode(), formDTO.getAppId()); if(null!=wxMaJscode2SessionResult){ logger.info(String.format("app=%s,wxCode=%s,openId=%s",formDTO.getApp(),formDTO.getWxCode(),wxMaJscode2SessionResult.getOpenid())); } @@ -273,7 +272,7 @@ public class GovLoginServiceImpl implements GovLoginService { } CustomerStaffDTO customerStaff = customerStaffDTOResult.getData(); //2、解析微信用户 - WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode()); + WxMaJscode2SessionResult wxMaJscode2SessionResult = loginService.getWxMaUser(LoginConstant.APP_GOV, formDTO.getWxCode(), formDTO.getAppId()); //3、记录staff_wechat,并记录用户激活状态,激活时间 this.savestaffwechat(customerStaff.getUserId(), wxMaJscode2SessionResult.getOpenid()); diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 695c187105..adadb9b626 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -4,6 +4,7 @@ import cn.binarywang.wx.miniapp.api.WxMaService; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; +import com.alibaba.fastjson.JSON; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; @@ -22,6 +23,7 @@ import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.OperAccessOpenFeignClient; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; +import com.epmet.redis.CustomerAppWxServiceUtil; import com.epmet.service.CaptchaService; import com.epmet.service.LoginService; import com.epmet.utils.WxMaServiceUtils; @@ -82,7 +84,7 @@ public class LoginServiceImpl implements LoginService { throw new RenException("参数错误"); } //1、根据wxCode获取微信信息 - WxMaJscode2SessionResult wxMaJscode2SessionResult = this.getWxMaUser(formDTO.getApp(),formDTO.getWxCode()); + WxMaJscode2SessionResult wxMaJscode2SessionResult = this.getWxMaUser(formDTO.getApp(),formDTO.getWxCode(),formDTO.getAppId()); logger.info("openId=[" + wxMaJscode2SessionResult.getOpenid() + "]unionId=[" + wxMaJscode2SessionResult.getUnionid() + "]"); //2、根据openId查询数据库,没有则直接插入一条记录 String userId = this.getUserId(formDTO, wxMaJscode2SessionResult); @@ -109,21 +111,29 @@ public class LoginServiceImpl implements LoginService { * @date 2020/3/14 20:16 */ @Override - public WxMaJscode2SessionResult getWxMaUser(String app,String wxCode) { + public WxMaJscode2SessionResult getWxMaUser(String app,String wxCode,String appId) { WxMaJscode2SessionResult wxMaJscode2SessionResult = null; try { - if (LoginConstant.APP_GOV.equals(app)) { - wxMaJscode2SessionResult = wxMaServiceUtils.govWxMaService().jsCode2SessionInfo(wxCode); - } else if (LoginConstant.APP_OPER.equals(app)) { - wxMaJscode2SessionResult = wxMaServiceUtils.operWxMaService().jsCode2SessionInfo(wxCode); - } else if (LoginConstant.APP_RESI.equals(app)) { - wxMaJscode2SessionResult = wxMaServiceUtils.resiWxMaService().jsCode2SessionInfo(wxCode); + if (StringUtils.isNotBlank(appId)){ + WxMaService wxMaService = CustomerAppWxServiceUtil.getWxMaService(appId); + if (wxMaService == null){ + throw new RenException("解析微信用户信息失败"); + } + wxMaJscode2SessionResult = wxMaService.jsCode2SessionInfo(wxCode); + }else{ + if (LoginConstant.APP_GOV.equals(app)) { + wxMaJscode2SessionResult = wxMaServiceUtils.govWxMaService().jsCode2SessionInfo(wxCode); + } else if (LoginConstant.APP_OPER.equals(app)) { + wxMaJscode2SessionResult = wxMaServiceUtils.operWxMaService().jsCode2SessionInfo(wxCode); + } else if (LoginConstant.APP_RESI.equals(app)) { + wxMaJscode2SessionResult = wxMaServiceUtils.resiWxMaService().jsCode2SessionInfo(wxCode); + } } } catch (WxErrorException e) { - log.error("->[getMaOpenId]::error[{}]", "解析微信code失败"); + log.error("->[getMaOpenId]::error[{}]", "解析微信code失败",e); } if (null == wxMaJscode2SessionResult) { - log.error(String.format("解析微信用户信息失败,app[%s],wxCode[%s]",app,wxCode)); + log.error(String.format("解析微信用户信息失败,app[%s],wxCode[%s],result:[%S]",app,wxCode, JSON.toJSONString(wxMaJscode2SessionResult))); throw new RenException("解析微信用户信息失败"); } else if (StringUtils.isBlank(wxMaJscode2SessionResult.getOpenid())) { log.error(String.format("获取微信openid失败,app[%s],wxCode[%s]",app,wxCode)); @@ -137,7 +147,12 @@ public class LoginServiceImpl implements LoginService { String phone=""; try { ValidatorUtils.validateEntity(formDTO, ResiWxPhoneFormDTO.AddUserInternalGroup.class); - WxMaService wxMaService = wxMaServiceUtils.resiWxMaService(); + WxMaService wxMaService = null; + if (StringUtils.isNotBlank(formDTO.getAppId())){ + wxMaService = CustomerAppWxServiceUtil.getWxMaService(formDTO.getAppId()); + }else{ + wxMaService = wxMaServiceUtils.resiWxMaService(); + } WxMaJscode2SessionResult wxMaJscode2SessionResult = wxMaService.jsCode2SessionInfo(formDTO.getWxCode()); WxMaPhoneNumberInfo phoneNoInfo = wxMaService.getUserService().getPhoneNoInfo(wxMaJscode2SessionResult.getSessionKey(), formDTO.getEncryptedData(), diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index 4cf33e4c25..01d92799d7 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -133,10 +133,6 @@ org.apache.httpcomponents httpmime - - org.apache.httpcomponents - httpmime - diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/ApplicationConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/ApplicationConfig.java new file mode 100644 index 0000000000..a16de46621 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/ApplicationConfig.java @@ -0,0 +1,21 @@ +package com.epmet.commons.tools.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; + +/** + * desc:应用配置 + * @author lyn + * @date 2020/7/22 14:08 + */ +@Configuration +public class ApplicationConfig { + // 设置@Value注解取值不到忽略(不报错) + @Bean + public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() { + PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer(); + c.setIgnoreUnresolvablePlaceholders(true); + return c; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java new file mode 100644 index 0000000000..4d9acf91fa --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/MqConfig.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

+ * https://www.renren.io + *

+ * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.config; + +import lombok.Data; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; + +/** + * 消息网关配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@Configuration +public class MqConfig { + @Value("${elink.mq.appId}") + private String appId; + @Value("${elink.mq.token}") + private String token; + @Value("${elink.mq.host}") + private String host; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java new file mode 100644 index 0000000000..8ccaba98b4 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/MqConstant.java @@ -0,0 +1,20 @@ +package com.epmet.commons.tools.constant; + +/** + * 消息常亮 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/27 9:58 + */ +public interface MqConstant { + + /** + * 加分 plus + */ + String PLUS="plus"; + + /** + * 减分标识 minus + */ + String MINUS="minus"; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index c6d5234ddd..1c0247c8b1 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -50,5 +50,5 @@ public interface NumConstant { String FOUR_STR = "4"; String FIVE_STR = "5"; String POSITIVE_EIGHT_STR = "+8"; - + String EMPTY_STR = ""; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index 58f699d87a..db6dea1b61 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -123,4 +123,14 @@ public interface ServiceConstant { * 微信第三方平台 */ String EPMET_THIRD_SERVER = "epmet-third-server"; + + /** + * 爱心互助 + */ + String EPMET_HEART_SERVER="epmet-heart-server"; + + /** + * 积分银行 + * */ + String EPMET_POINT_SERVER = "epmet-point-server"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index b4a81ce53a..944c8afb2f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -48,4 +48,29 @@ public interface StrConstant { * 中文顿号 */ String COMMA_ZH = "、"; + + /** + * 反斜杠 + */ + String SEPARATOR = "/"; + + /** + * true + */ + String TRUE = "true"; + + /** + * true + */ + String FALSE = "false"; + + /** + * * + */ + String STAR="*"; + + /** + * 空字符串 + */ + String EPMETY_STR=""; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/EventClassDto.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/EventClassDto.java new file mode 100644 index 0000000000..fb82587822 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/EventClassDto.java @@ -0,0 +1,41 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:消息网关事件类型dto + * + * @author lyn + * @date 2020/7/24 18:30 + */ +@Data +public class EventClassDto implements Serializable { + private static final long serialVersionUID = 6923860669547819790L; + /** + * appId + */ + private String appId; + /** + * 事件类型Id + */ + private Integer id; + /** + * 事件标识 + */ + private String eventClass; + /** + * 事件名称 + */ + private String eventClassName; + /** + * 0''未删''1''已删 + */ + private Integer delFlag; + /** + * 事件计数 + */ + private Integer eventCount; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java new file mode 100644 index 0000000000..6e9318549e --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseMsgDTO.java @@ -0,0 +1,35 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; +import org.springframework.stereotype.Component; + +import javax.validation.constraints.NotBlank; + +/** + * 消息网关基础信息 + * + * @author jianjun liu + * @date 2020-07-21 14:33 + **/ +@Data +@Component +public class MqBaseMsgDTO extends MqBaseParamDTO { + private static final long serialVersionUID = 8176470786428432009L; + + /** + * mq的事件类型 + */ + @NotBlank(message = "事件类型不能为空") + private String eventClass; + /** + * 事件code + */ + @NotBlank(message = "事件标识不能为空") + private String eventTag; + /** + * 消息体 + */ + @NotBlank(message = "消息体不能为空") + private String msg; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseParamDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseParamDTO.java new file mode 100644 index 0000000000..9ad8df6cf4 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqBaseParamDTO.java @@ -0,0 +1,18 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 消息网关基础信息 + * + * @author jianjun liu + * @date 2020-07-21 14:33 + **/ +@Data +public class MqBaseParamDTO implements Serializable { + private String appId; + private String token; + private String requestUrl; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqReturnBaseResult.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqReturnBaseResult.java new file mode 100644 index 0000000000..f25e66bcfd --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqReturnBaseResult.java @@ -0,0 +1,19 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:消息网关返回结果 + * + * @author lyn + * @date 2020/7/21 13:38 + */ +@Data +public class MqReturnBaseResult implements Serializable { + private static final long serialVersionUID = -7763308686382363929L; + Integer errCode; + String errMsg; + String data; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqSubscribeFormDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqSubscribeFormDTO.java new file mode 100644 index 0000000000..4eb3a21bc7 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/MqSubscribeFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: 订阅服务参数 实体类 + * + * @date: 2020/6/29 9:06 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +@Data +public class MqSubscribeFormDTO implements Serializable { + + /** + * 消息接收者 + */ + private String belongAppId; + + /** + * 密钥 + */ + private String eventClass; + /** + * 发送内容 + */ + private String eventTag; + + /** + * 是否at所有人 + */ + private String callbackUrl; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/ReceiveMqMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/ReceiveMqMsg.java new file mode 100644 index 0000000000..b78d568924 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/ReceiveMqMsg.java @@ -0,0 +1,21 @@ +package com.epmet.commons.tools.dto.form.mq; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 亿联云消息网关消息回调外层DTO + * + * @author jianjun liu + * @date 2020-07-20 8:58 + **/ +@Data +public class ReceiveMqMsg implements Serializable { + + private static final long serialVersionUID = -2776439983884650701L; + /** + * 消息体 json串 + */ + private String msg; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/ActPointEventMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/ActPointEventMsg.java new file mode 100644 index 0000000000..60db245a07 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/ActPointEventMsg.java @@ -0,0 +1,18 @@ +package com.epmet.commons.tools.dto.form.mq.eventmsg; + +import lombok.Data; + +/** + * 结束活动,发放活动积分消息体 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/27 9:26 + */ +@Data +public class ActPointEventMsg extends BasePointEventMsg{ + /** + * 参与活动的备注 + */ + private String remark; + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java new file mode 100644 index 0000000000..435234f7dd --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java @@ -0,0 +1,45 @@ +package com.epmet.commons.tools.dto.form.mq.eventmsg; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:积分相关事件消息体 + * + * @author lyn + * @date 2020/7/23 16:34 + */ +@Data +public class BasePointEventMsg implements Serializable { + private static final long serialVersionUID = 4037225404113743943L; + + /** + * 操作人机关id + */ + private String opAgencyId; + + /** + * 客户Id + */ + private String customerId; + /** + * 被操作用户id + */ + private String userId; + + /** + * 加减分标识 plus/minus + */ + private String actionFlag; + + /** + * 积分值 + */ + private Integer point; + + /** + * 是否是通用事件,通用事件不走规则 + */ + private Boolean isCommon; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java new file mode 100644 index 0000000000..1dc0b571c5 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/CommonOperateTypeEnum.java @@ -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; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java new file mode 100644 index 0000000000..68347c29f9 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java @@ -0,0 +1,47 @@ +package com.epmet.commons.tools.enums; + +/** + * 系统支持的事件枚举类 + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum EventEnum { + ACTIVE_SEND_POINT("active_send_point", "epmet_heart", "活动发放积分"), + REGISTER_VOLUNTEER("register_volunteer", "epmet_heart", "认证志愿者"), + ACTIVE_INSERT_LIVE("active_insert_live", "epmet_heart", "添加活动实况"), + ; + + private String eventClass; + private String eventTag; + private String eventDesc; + + + EventEnum(String eventTag, String eventClass, String eventDesc) { + this.eventTag = eventTag; + this.eventClass = eventClass; + this.eventDesc = eventDesc; + } + + public static EventEnum getEnum(String eventCode) { + EventEnum[] values = EventEnum.values(); + for (EventEnum value : values) { + if (eventCode != null && value.getEventTag().equals(eventCode)) { + return value; + } + } + return null; + } + + public String getEventTag() { + return eventTag; + } + + public String getEventClass() { + return eventClass; + } + + public String getEventDesc() { + return eventDesc; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java new file mode 100644 index 0000000000..866229d1d9 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/MqMethodPathEnum.java @@ -0,0 +1,43 @@ +package com.epmet.commons.tools.enums; + +/** + * 消息网关方法枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum MqMethodPathEnum { + SEND_MSG("producerService/producer/sendMsg", "发送消息"), + GET_EVENT_LIST("eventClass/getList", "获取事件类型列表"), + + ; + + private String code; + private String name; + + + + MqMethodPathEnum(String code, String name) { + this.code = code; + this.name = name; + } + + public static MqMethodPathEnum getEnum(String code) { + MqMethodPathEnum[] values = MqMethodPathEnum.values(); + for (MqMethodPathEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value; + } + } + return null; + } + + public String getCode() { + return code; + } + + public String getName() { + return name; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 22eb8f38ac..7ec8b301fd 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -49,6 +49,19 @@ public enum EpmetErrorCode { CANNOT_DELETE_PARTY_MEMBER(8111,"该用户已注册党员,不允许删除"), GROUP_LEADER_CAN_EDIT_GROUP_INFO(8112,"只有组长才可以修改小组信息"), INVITE_NEW_MEMBER(8113,"只有讨论中的小组才可以邀请新成员"), + ACT_TITLE_SCAN_FAILED(8114,"活动标题审核失败,请重新编辑"), + ACT_REQ_SCAN_FAILED(8115,"活动报名条件审核失败,请重新编辑"), + ACT_CONTENT_TEXT_SCAN_FAILED(8116,"活动详情内容审核失败,请重新编辑"), + ACT_CONTENT_IMG_SCAN_FAILED(8117,"活动详情图片失败,请重新编辑"), + ACT_COVER_PIC_SCAN_FAILED(8118,"活动封面图片审核失败,请重新编辑"), + ACT_START_TIME_ERROR(8119,"活动预计开始时间应早于活动预计结束时间"), + ACT_SIGN_IN_START_TIME_ERROR(8120,"签到开始时间应早于签到结束时间"), + ACT_SIGN_UP_END_TIME_ERROR(8121,"活动报名截止时间应早于活动预计开始时间"), + ACT_ACTUAL_START_TIME_ERROR(8122,"实际开始时间应早于实际结束时间"), + HAVE_HANDLE(8123,"存在待处理事项,请先处理"), + ACTUAL_TIME(8124,"请录入实际开始时间,实际结束时间"), + ACTUAL_NOT_FINISHED(8125,"请先结束活动"), + CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), NOT_DEL_AGENCY_PER(8205, "该机关存在工作人员,不允许删除"), @@ -68,6 +81,11 @@ public enum EpmetErrorCode { IMG_SCAN_FAILED(8504,"图片审核失败,请重新上传"), PROJECT_IS_CLOSED(8601,"项目已结案"), + // 爱心互助 居民端 + NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"), + NON_CERTIFIED_VOLUNTEER(8511, "活动报名失败,请先认证志愿者"), + ACT_TIME_CONFLICT(8512, "活动时间冲突"), + // 该错误不会提示给前端,只是后端传输错误信息用。 ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index dcf93d3a24..457788f5a9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -254,4 +254,21 @@ public class RedisKeys { return rootPrefix.concat("tags:grid:relationTag:").concat(gridId).concat(StrConstant.COLON).concat(tagId); } + /** + * appId secret 缓存Key + * @return + */ + public static String getCustomerAppKey() { + return rootPrefix.concat("oper:crm:app"); + } + + /** + * 获取生成的用户标识 缓存Key + * @param shortUserId + * @return + */ + public static String getShortUserIdKey(String shortUserId) { + return rootPrefix.concat("oper:user:shorId:").concat(shortUserId); + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index f7f985ed63..2f08f03683 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -10,8 +10,6 @@ package com.epmet.commons.tools.redis; import com.epmet.commons.tools.constant.NumConstant; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.dao.DataAccessException; -import org.springframework.data.redis.connection.RedisConnection; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.core.*; import org.springframework.data.redis.support.atomic.RedisAtomicLong; @@ -316,4 +314,13 @@ public class RedisUtils { return redisTemplate.opsForZSet().incrementScore(key, value, delta); } + /** + * @Description 判断key是否存在 + * @param key + * @return + */ + public Boolean hasKey(String key) { + return redisTemplate.hasKey(key); + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index f60e8fd2d7..d7c2098221 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -488,4 +488,26 @@ public class DateUtils { return format.format(timestamp * 1000); } + public static Date minStrToSecondDate(String minStr){ + if(StringUtils.isNotBlank(minStr)&&minStr.length()==16){ + String date=minStr.concat(":00"); + System.out.println(date); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + return format.parse(date); + } catch (ParseException e) { + e.printStackTrace(); + } + } + return null; + } + + public static Integer calculateMin(Date startDate,Date endDate){ + long start=startDate.getTime(); + long end=endDate.getTime(); + // 计算差多少分钟 + int minutes = (int) ((end - start) / (1000 * 60)); + System.out.println("两个时间之间的分钟差为:" + minutes); + return minutes; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 84b0edbcd0..151ad8e10d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -17,24 +17,36 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.client.utils.URIBuilder; +import org.apache.http.config.Registry; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.entity.mime.HttpMultipartMode; import org.apache.http.entity.mime.MultipartEntityBuilder; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; import org.apache.http.message.BasicNameValuePair; import org.apache.http.util.EntityUtils; import org.springframework.util.CollectionUtils; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -54,6 +66,28 @@ public class HttpClientManager { * HttpClient对象 */ private static CloseableHttpClient httpclient = HttpClients.custom().disableAutomaticRetries().build(); + private static CloseableHttpClient httpsClient; + + static { + try { + // 采用绕过验证的方式处理https请求 + SSLContext sslcontext = createIgnoreVerifySSL(); + // 设置协议http和https对应的处理socket链接工厂的对象 + Registry socketFactoryRegistry = RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.INSTANCE) + .register("https", new SSLConnectionSocketFactory(sslcontext, + SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER)) + .build(); + PoolingHttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager( + socketFactoryRegistry); + HttpClients.custom().setConnectionManager(connManager); + + // 创建自定义的httpclient对象 + httpsClient = HttpClients.custom().setConnectionManager(connManager).build(); + } catch (Exception e) { + e.printStackTrace(); + } + } /*** 超时设置 ****/ private static RequestConfig requestConfig = RequestConfig.custom() @@ -77,7 +111,7 @@ public class HttpClientManager { * * @author: jianjun liu */ - public Result sendPost(String url, Map paramsMap) { + public Result sendPost(String url, Map paramsMap) { try { HttpPost httppost = new HttpPost(url); @@ -91,9 +125,8 @@ public class HttpClientManager { UrlEncodedFormEntity urlEncodedFormEntity = new UrlEncodedFormEntity(list, "utf-8"); httppost.setEntity(urlEncodedFormEntity); - return execute(httppost); + return execute(httppost, false); } catch (Exception e) { - e.printStackTrace(); log.error("send exception", e); return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } @@ -118,7 +151,7 @@ public class HttpClientManager { StringEntity se = new StringEntity(jsonStrParam, "utf-8"); httppost.setEntity(se); } - return execute(httppost); + return execute(httppost, false); } catch (Exception e) { log.error("send exception", e); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); @@ -152,13 +185,38 @@ public class HttpClientManager { // HttpEntity reqEntity = MultipartEntityBuilder.create() // .addPart("media", fileBody).build(); // httppost.setEntity(reqEntity); - return execute(httppost); + return execute(httppost,false); } catch (Exception e) { log.error("send exception", e); throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } } + /** + * desc: https发送json post 请求 + * param: url,jsonStrParam + * return: Result + * date: 2019/2/21 9:12 + * + * @author: jianjun liu + */ + public Result sendPostByHttps(String url, String jsonStrParam) { + try { + HttpPost httppost = new HttpPost(url); + httppost.setConfig(requestConfig); + httppost.addHeader("Content-Type", "application/json"); + if (StringUtils.isNotEmpty(jsonStrParam)) { + StringEntity se = new StringEntity(jsonStrParam, "utf-8"); + httppost.setEntity(se); + } + return execute(httppost, true); + } catch (Exception e) { + log.error("sendPostByHttps exception", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + + } + /** * desc: 发送钉钉群消息 简版 * param: url,jsonStrParam @@ -176,10 +234,10 @@ public class HttpClientManager { Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256")); byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); - String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)),"UTF-8"); + String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8"); DingTalkTextMsg msg = new DingTalkTextMsg(); msg.setContent(content); - url = url.concat("×tamp="+timestamp+"&sign="+sign); + url = url.concat("×tamp=" + timestamp + "&sign=" + sign); String jsonStrParam = msg.getMsgContent(); return sendPostByJSON(url, jsonStrParam); } catch (Exception e) { @@ -208,24 +266,28 @@ public class HttpClientManager { } HttpGet httpGet = new HttpGet(builder.build()); httpGet.setConfig(requestConfig); - return execute(httpGet); + return execute(httpGet, false); } catch (Exception e) { log.error("sendGet exception", e); return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } } - private Result execute(HttpRequestBase httpMethod) { + private Result execute(HttpRequestBase httpMethod, boolean isHttps) { CloseableHttpResponse response = null; try { - response = httpclient.execute(httpMethod); - log.debug("http send response:{}", JSON.toJSONString(response)); + if (isHttps) { + response = httpsClient.execute(httpMethod); + } else { + response = httpclient.execute(httpMethod); + } if (response != null && response.getStatusLine() != null) { if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { String result = EntityUtils.toString(response.getEntity()); return new Result().ok(result); } else { - log.warn("execute http method fail,httpStatus:{0}", response.getStatusLine().getStatusCode()); + log.warn("execute http method fail,httpStatus:{}", response.getStatusLine().getStatusCode()); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), "请求失败httpStatus:" + response.getStatusLine().getStatusCode()); } } } catch (Exception e) { @@ -365,6 +427,30 @@ public class HttpClientManager { return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } + private static SSLContext createIgnoreVerifySSL() throws NoSuchAlgorithmException, KeyManagementException { + SSLContext sc = SSLContext.getInstance("SSLv3"); + + // 实现一个X509TrustManager接口,用于绕过验证,不用修改里面的方法 + X509TrustManager trustManager = new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] paramArrayOfX509Certificate, + String paramString) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] paramArrayOfX509Certificate, + String paramString) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return null; + } + }; + + sc.init(null, new TrustManager[]{trustManager}, null); + return sc; + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java new file mode 100644 index 0000000000..1da80ff672 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/Md5Util.java @@ -0,0 +1,149 @@ +package com.epmet.commons.tools.utils; + +import lombok.extern.slf4j.Slf4j; + +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; + +@Slf4j +public class Md5Util { + /** + * 加密盐 值 + */ + public static final String SALT = "EPMET_UMD_SALT"; + + public static String md5(String string) { + if (string == null || string.trim().length() == 0) { + return null; + } + try { + return getMD5(string.getBytes("GBK")); + } catch (UnsupportedEncodingException e) { + log.error( "md5 is error,msg={0}", e); + return null; + } + } + + private static final char hexDigits[] = { // 用来将字节转换成 16 进制表示的字符 + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; + + private static String getMD5(byte[] source) { + String s = null; + try { + MessageDigest md = MessageDigest.getInstance("MD5"); + md.update(source); + byte tmp[] = md.digest(); // MD5 的计算结果是一个 128 位的长整数, + // 用字节表示就是 16 个字节 + char str[] = new char[16 * 2]; // 每个字节用 16 进制表示的话,使用两个字符, + // 所以表示成 16 进制需要 32 个字符 + int k = 0; // 表示转换结果中对应的字符位置 + for (int i = 0; i < 16; i++) { // 从第一个字节开始,对 MD5 的每一个字节 + // 转换成 16 进制字符的转换 + byte byte0 = tmp[i]; // 取第 i 个字节 + str[k++] = hexDigits[byte0 >>> 4 & 0xf]; // 取字节中高 4 位的数字转换, + // >>> 为逻辑右移,将符号位一起右移 + str[k++] = hexDigits[byte0 & 0xf]; // 取字节中低 4 位的数字转换 + } + s = new String(str); // 换后的结果转换为字符串 + + } catch (Exception e) { + log.error("getMD5 is error,msg={0}", e); + } + return s; + } + + private static String byteArrayToHexString(byte b[]) { + StringBuffer resultSb = new StringBuffer(); + for (int i = 0; i < b.length; i++) + resultSb.append(byteToHexString(b[i])); + + return resultSb.toString(); + } + + private static String byteToHexString(byte b) { + int n = b; + if (n < 0) + n += 256; + int d1 = n / 16; + int d2 = n % 16; + return hexDigits[d1] + "" + hexDigits[d2]; + } + + public static String MD5Encode(String origin, String charsetname) { + String resultString = null; + try { + resultString = new String(origin); + MessageDigest md = MessageDigest.getInstance("MD5"); + if (charsetname == null || "".equals(charsetname)) + resultString = byteArrayToHexString(md.digest(resultString + .getBytes())); + else + resultString = byteArrayToHexString(md.digest(resultString + .getBytes(charsetname))); + } catch (Exception e) { + log.error("MD5Encode is error,msg={0}", e); + } + return resultString; + } + + + public static void main(String[] args) { + for (int i = 0; i < 5; i++) { + String uuid = "03a1dcd8cb1811eabac1c03fd56f7847"; + System.out.println(get12Char(uuid)); + } + } + + /** + * 获取短字符 + * + * @param str + * @return 大写 + */ + public static String get12Char(String str) { + String arr[] = ShortText(str); + String rst = (arr[0] + arr[1]).toUpperCase(); + return rst.substring(0, 4) + rst.substring(4, 8) + rst.substring(8, 12); + } + + private static String[] ShortText(String string) { + String[] chars = new String[]{ // 要使用生成URL的字符 + "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", + "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", + "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", + "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"}; + + String hex = ""; + + MessageDigest md = null; + try { + md = MessageDigest.getInstance("MD5"); + hex = byteArrayToHexString(md.digest(SALT.concat(string) + .getBytes("utf-8"))); + } catch (Exception e) { + e.printStackTrace(); + } + + int hexLen = hex.length(); + int subHexLen = hexLen / 8; + String[] ShortStr = new String[4]; + + for (int i = 0; i < subHexLen; i++) { + String outChars = ""; + int j = i + 1; + String subHex = hex.substring(i * 8, j * 8); + long idx = Long.valueOf("3FFFFFFF", 16) & Long.valueOf(subHex, 16); + + for (int k = 0; k < 6; k++) { + int index = (int) (Long.valueOf("0000003D", 16) & idx); + outChars += chars[index]; + idx = idx >> 5; + } + ShortStr[i] = outChars; + } + + return ShortStr; + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java index a39a45309e..ef7a3257a6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ScanContentUtils.java @@ -18,7 +18,6 @@ import java.util.List; * 扫描内容工具类 * * @author jianjun liu - * @email liujianjun@yunzongnet.com * @date 2020-06-08 8:28 **/ @Slf4j diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java new file mode 100644 index 0000000000..dede8d5706 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/SendMqMsgUtils.java @@ -0,0 +1,114 @@ +package com.epmet.commons.tools.utils; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.config.MqConfig; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.EventClassDto; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.MqReturnBaseResult; +import com.epmet.commons.tools.enums.MqMethodPathEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ValidateException; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 发送亿联云消息工具类 + * + * @author jianjun liu + * @date 2020-06-08 8:28 + **/ +@Slf4j +@Component +public class SendMqMsgUtils { + private static MqConfig mqConfig; + + /** + * desc:发送mq消息 + * + * @return + */ + public static Result sendMsg(MqBaseMsgDTO msg) { + if (mqConfig == null) { + mqConfig = SpringContextUtils.getBean(MqConfig.class); + } + log.debug("sendMsg param:{}", JSON.toJSONString(msg)); + try { + // TODO + ValidatorUtils.validateEntity(msg, DefaultGroup.class); + } catch (ValidateException e) { + return new Result().error(e.getMsg()); + } + msg.setAppId(mqConfig.getAppId()); + msg.setRequestUrl(mqConfig.getHost().concat(MqMethodPathEnum.SEND_MSG.getCode())); + msg.setToken(mqConfig.getToken()); + try { + Result result = HttpClientManager.getInstance().sendPostByHttps(msg.getRequestUrl(), JSON.toJSONString(msg)); + log.debug("sendMsg result:{}", JSON.toJSONString(result)); + if (result.success()) { + MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); + if (resultResult.getErrCode().equals(NumConstant.ZERO)) { + JSONObject jsonObject = JSON.parseObject(resultResult.getData()); + return new Result().ok(jsonObject.getString("msgId")); + } else { + log.error("sendMsg fail,resultData:{}", JSON.toJSONString(resultResult)); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), resultResult.getErrMsg()); + } + } + Result resultResult = new Result<>(); + resultResult.error(result.getCode(), result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.debug("sendMsg exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + + + /** + * desc:发送mq消息 + * + * @return + */ + public static Result> getEventClassList() { + if (mqConfig == null) { + mqConfig = SpringContextUtils.getBean(MqConfig.class); + } + Map param = new HashMap<>(); + param.put("appId", mqConfig.getAppId()); + param.put("token", mqConfig.getToken()); + String requestUrl = mqConfig.getHost().concat(MqMethodPathEnum.GET_EVENT_LIST.getCode()); + + try { + Result result = HttpClientManager.getInstance().sendPostByHttps(requestUrl, JSON.toJSONString(param)); + log.debug("getEventClassList result:{}", JSON.toJSONString(result)); + if (result.success()) { + MqReturnBaseResult resultResult = JSON.parseObject(result.getData(), MqReturnBaseResult.class); + if (resultResult.getErrCode().equals(NumConstant.ZERO)) { + List eventClassDto = JSON.parseArray(resultResult.getData(), EventClassDto.class); + return new Result>().ok(eventClassDto); + } else { + log.error("sendMsg fail,resultData:{}", JSON.toJSONString(resultResult)); + return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), resultResult.getErrMsg()); + } + } + Result> resultResult = new Result<>(); + resultResult.error(result.getCode(), result.getMsg()); + resultResult.setInternalMsg(result.getInternalMsg()); + return resultResult; + } catch (Exception e) { + log.debug("sendMsg exception", e); + return new Result>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + + +} diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index 702ce1f34e..b4dc44a7df 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.27 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.28 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index dadaab41ed..3944de1695 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.27 + 0.3.28 com.epmet epmet-cloud @@ -108,7 +108,7 @@ - + lb://epmet-auth-server lb://epmet-admin-server @@ -130,6 +130,7 @@ lb://oper-customize-server lb://oper-crm-server + lb://resi-guide-server @@ -189,6 +190,12 @@ lb://epmet-third-server + + lb://epmet-heart-server + + + lb://epmet-point-server + @@ -273,6 +280,10 @@ lb://epmet-openapi-scan lb://epmet-third-server + + lb://epmet-heart-server + + lb://epmet-point-server @@ -354,6 +365,10 @@ lb://epmet-openapi-scan lb://epmet-third-server + + lb://epmet-heart-server + + lb://epmet-point-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index eb0440abb7..851ac62764 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -292,6 +292,24 @@ spring: order: 31 predicates: - Path=${server.servlet.context-path}/third/** + filters: + - StripPrefix=1 + - CpAuth=true + # 爱心互助 + - id: epmet-heart-server + uri: @gateway.routes.epmet-heart-server.url@ + order: 32 + predicates: + - Path=${server.servlet.context-path}/heart/** + filters: + - StripPrefix=1 + - CpAuth=true + # 积分银行 + - id: epmet-point-server + uri: @gateway.routes.epmet-point-server.url@ + order: 33 + predicates: + - Path=${server.servlet.context-path}/point/** filters: - StripPrefix=1 - CpAuth=true @@ -335,6 +353,8 @@ renren: - /resi/group/** - /resi/partymember/** - /gov/grid/** + - /heart/** + - /point/** management: endpoints: web: @@ -388,7 +408,7 @@ ribbon: ConnectTimeout: 300000 epmet: - # 党群e事通(不放行) + # 党群e事通(校验是否登录) urls: - /oper/customize/** - /oper/crm/** diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.java new file mode 100644 index 0000000000..10aadcb475 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/EventFormDTO.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; +import java.util.Date; + + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Data +public class EventFormDTO implements Serializable { + + + private static final long serialVersionUID = -5890535035537229696L; + /** + * 主键 + */ + private String id; + + /** + * 消息网关事件类别ID 从消息网关获取事件类型Id + */ + private String classId; + + /** + * 消息网关APP_ID + */ + private String appId; + + /** + * 消息网关APP_NAME + */ + private String appName; + + /** + * 事件标识 与消息网关事件tag一致 + */ + @NotBlank(message = "事件标识不能为空",groups = {AddGroup.class, UpdateGroup.class}) + private String eventCode; + + /** + * 事件名称 + */ + @NotBlank(message = "事件名称不能为空",groups = {AddGroup.class}) + private String eventName; + + /** + * 事件说明 + */ + private String eventDesc; + + /** + * 事件功能分组ID 来自oper_customize.customer_function表 + */ + @NotBlank(message = "功能分组ID不能为空",groups = {AddGroup.class}) + private String functionId; + + /** + * 是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值 + */ + @NotBlank(message = "是否是通用事件不能为空",groups = {AddGroup.class}) + private String isCommon; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag; + + /** + * 乐观锁 查询时添加版本号,新加的事件需要更新版本号 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/EventDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/EventDTO.java new file mode 100644 index 0000000000..e95e09002a --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/EventDTO.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Data +public class EventDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 消息网关事件类别ID 从消息网关获取事件类型Id + */ + private String classId; + + /** + * 消息网关APP_ID + */ + private String appId; + + /** + * 消息网关APP_NAME + */ + private String appName; + + /** + * 事件标识 与消息网关事件tag一致 + */ + private String eventCode; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 事件说明 + */ + private String eventDesc; + + /** + * 事件功能分组ID 来自oper_customize.customer_function表 + */ + private String functionId; + + /** + * 是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值 + */ + private String isCommon; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag; + + /** + * 乐观锁 查询时添加版本号,新加的事件需要更新版本号 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index 2c694bbd67..69b16c5a01 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -116,6 +116,11 @@ false + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c @@ -177,6 +182,11 @@ true + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java new file mode 100644 index 0000000000..8aa3dc2fc1 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -0,0 +1,11 @@ +package com.epmet.constant; + +/** + * desc:项目常量 + */ +public interface ProjectConstant { + /** + * 时间已存在 + */ + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java new file mode 100644 index 0000000000..4c3212b878 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/EventController.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.config.MqConfig; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SendMqMsgUtils; +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.EventFormDTO; +import com.epmet.dto.result.EventDTO; +import com.epmet.service.EventService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Slf4j +@RestController +@RequestMapping("event") +public class EventController { + + @Autowired + private EventService eventService; + @Autowired + private MqConfig mqConfig; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = eventService.page(params); + return new Result>().ok(page); + } + @GetMapping("geteventclass") + public Result getEventClass(){ + return SendMqMsgUtils.getEventClassList(); + } + + /** + * desc:添加事件,如果已存在则不作任何改动,直接返回成功 + * + * @param formDTO + * @return + * json:{ + * "classId":"epmet_heart", + * "appId":"202007161443499985fa2d397436d10356542134c8f008c48", + * "appName":"党群e事通开发测试", + * "eventCode":"register_volunteer", + * "eventName":"认证志愿者", + * "eventDesc":"给注册志愿者的人发放积分", + * "functionId":"43addd0735230c01eedbb38d721076b0", + * "isCommon":"0" + * } + */ + @PostMapping("addEvent") + public Result addEvent(@RequestBody EventFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + eventService.addEvent(formDTO); + return new Result().ok(true); + } + + /** + * desc:修改事件,如果已存在则不作任何改动,直接返回成功 + * + * @param formDTO + * @return + */ + @GetMapping("updateEvent") + public Result updateEvent(@RequestBody EventFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + eventService.updateEvent(formDTO); + return new Result().ok(true); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/EventDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/EventDao.java new file mode 100644 index 0000000000..4db69553ec --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/EventDao.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.EventEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Mapper +public interface EventDao extends BaseDao { + + int getCountByEventCode(@Param("eventCode") String eventCode); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java new file mode 100644 index 0000000000..7db253d389 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/EventEntity.java @@ -0,0 +1,78 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("event") +public class EventEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 消息网关事件类别ID 从消息网关获取事件类型Id + */ + private String classId; + + /** + * 消息网关APP_ID + */ + private String appId; + + /** + * 消息网关APP_NAME + */ + private String appName; + + /** + * 事件标识 与消息网关事件tag一致 + */ + private String eventCode; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 事件说明 + */ + private String eventDesc; + + /** + * 事件功能分组ID 来自oper_customize.customer_function表 + */ + private String functionId; + + /** + * 是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值 + */ + private String isCommon; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java new file mode 100644 index 0000000000..373689f711 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/enu/SysResponseEnum.java @@ -0,0 +1,41 @@ +package com.epmet.enu; + +/** + * @author jianjun liu + * @date 2020-06-04 21:39 + **/ +public enum SysResponseEnum { + /** + * + * 业务代码枚举类 + * + * 编码样式:【CCCBBOOXX】 + * 编码示例说明: + * CCC 中心编码&业务系统 (103-内容扫描服务中心服务) + * BB 业务类型(00-默认 ) + * OO 操作类型(00-默认) + * + */ + /*通用枚举 */ + EXCEPTION(10301,"系统异常"), + + + /*事件 业务 01*/ + EVENT_HAS_ALREADY_EXIST(103010001,"事件已存在无需重复添加"), + ; + + 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; + } +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java new file mode 100644 index 0000000000..8e2c4cb635 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/EventService.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.EventFormDTO; +import com.epmet.dto.result.EventDTO; +import com.epmet.entity.EventEntity; + +import java.util.Map; + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +public interface EventService extends BaseService { + + void addEvent(EventFormDTO formDTO); + + void updateEvent(EventFormDTO formDTO); + + PageData page(Map params); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java new file mode 100644 index 0000000000..5fe736adb3 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/EventServiceImpl.java @@ -0,0 +1,72 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.EventDao; +import com.epmet.dto.form.EventFormDTO; +import com.epmet.dto.result.EventDTO; +import com.epmet.entity.EventEntity; +import com.epmet.service.EventService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * 事件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-16 + */ +@Slf4j +@Service +public class EventServiceImpl extends BaseServiceImpl implements EventService { + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, EventDTO.class); + } + @Override + public void addEvent(EventFormDTO formDTO) { + EventEntity eventEntity = ConvertUtils.sourceToTarget(formDTO, EventEntity.class); + baseDao.insert(eventEntity); + } + + @Override + public void updateEvent(EventFormDTO formDTO) { + //baseDao.update(eventEntity); + } + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml index 146d5758dd..ec2f2c7a2b 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml @@ -117,4 +117,12 @@ ribbon: #pageHelper分页插件 pagehelper: helper-dialect: mysql - reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +#亿联云消息网关 +elink: + mq: + appId: @elink.mq.appId@ #项目接入亿联云的应用Id + token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret + host: @elink.mq.host@ #亿联云消息网关服务地址 + sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql index 1e2005a491..2702dde08b 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/epmet_common_service.sql @@ -416,3 +416,24 @@ INSERT INTO `calender` VALUES ('ff7e08ece3008eeb1661a2b1d8b4e20e', 0, '20200711' INSERT INTO `calender` VALUES ('ffe45e7059c67874f88498cfcfd19b4c', 0, '20200424', '2020-04-24', 5, '', '', '', '1', '工作日', '无', 'Friday', '周五', 0, 0, 'APP_USER', '2020-05-12 01:32:25', 'APP_USER', '2020-05-12 10:05:11'); SET FOREIGN_KEY_CHECKS = 1; + +#add by liujianjun 2020-07-16 +CREATE TABLE `event` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CLASS_ID` varchar(32) DEFAULT NULL COMMENT '消息网关事件类别ID 从消息网关获取事件类型Id', + `APP_ID` varchar(128) DEFAULT NULL COMMENT '消息网关APP_ID', + `APP_NAME` varchar(32) DEFAULT NULL COMMENT '消息网关APP_NAME', + `EVENT_CODE` varchar(32) DEFAULT NULL COMMENT '事件标识 与消息网关事件tag一致', + `EVENT_NAME` varchar(32) DEFAULT NULL COMMENT '事件名称', + `EVENT_DESC` varchar(64) DEFAULT NULL COMMENT '事件说明', + `FUNCTION_ID` varchar(64) DEFAULT NULL COMMENT '功能ID 来自oper_customize.customer_function表', + `IS_COMMON` varchar(1) DEFAULT NULL COMMENT '是否是通用事件 0-否,1-是;消息体内需要体现该字段,通用则说明由业务系统自己计算分值', + `DEL_FLAG` varchar(1) DEFAULT NULL COMMENT '删除标识 0-否,1-是', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁 查询时添加版本号,新加的事件需要更新版本号', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`), + UNIQUE KEY `unx_event_code` (`EVENT_CODE`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='事件表'; diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml new file mode 100644 index 0000000000..e5418337ad --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/EventDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/pom.xml b/epmet-module/epmet-heart/epmet-heart-client/pom.xml new file mode 100644 index 0000000000..454488ddc2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + + com.epmet + epmet-heart + 2.0.0 + + + epmet-heart-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + com.epmet + epmet-user-client + 2.0.0 + compile + + + + + ${project.artifactId} + + + diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java new file mode 100644 index 0000000000..4ca6b53a0d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +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 ActContentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动id:act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActCustomizedDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActCustomizedDTO.java new file mode 100644 index 0000000000..ece26c588e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActCustomizedDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-19 + */ +@Data +public class ActCustomizedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(客户如果没配置,默认的值写在代码里) + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 标题:eg: 志愿者去哪儿 + */ + private String titleName; + + /** + * 咨询热线 + */ + private String hotline; + + /** + * 活动列表 + */ + private String actListName; + + /** + * 爱心榜 + */ + private String heartRankName; + + /** + * 活动回顾 + */ + private String actReviewName; + + /** + * 我的活动 + */ + private String myActName; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标记 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java new file mode 100644 index 0000000000..b747b77985 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java @@ -0,0 +1,257 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 报名开始时间 + */ + private Date signUpStartTime; + + /** + * 报名截止时间 + */ + private Date signUpEndTime; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 打卡开始时间 + */ + private Date signInStartTime; + + /** + * 打卡截止时间 + */ + private Date signInEndTime; + + /** + * 活动签到打卡地点 + */ + private String signInAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signInLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signInLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signInRadius; + + /** + * 活动名额类型(0-不限名额,1-固定名额) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 活动状态( +已发布/报名中:published; +已取消:canceled; +已结束:finished) + */ + private String actStatus; + + /** + * 活动取消的原因 + */ + private String cancelReason; + + /** + * 取消活动的时间 + */ + private Date cancelTime; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 发布名义:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 发布单位的上一级组织id,如果是以网格发布,此列存储的是网格所属机关的上一级机关 + */ + private String pid; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Boolean volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Boolean auditSwitch; + + /** + * 活动实际开始时间 + */ + private Date actualStartTime; + + /** + * 活动实际结束时间 + */ + private Date actualEndTime; + + /** + * 活动共计时长(服务时间)单位:分钟 + */ + private Integer serviceMin; + + /** + * 1已经总结0未总结 + */ + private Boolean summaryFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间(活动发布时间) + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + + // 虚字段 + + /** + * 用户id + */ + private String userId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLivePicDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLivePicDTO.java new file mode 100644 index 0000000000..3ce290e641 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLivePicDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-19 + */ +@Data +public class ActLivePicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 实况ID:act_live.id + */ + private String liveId; + + /** + * 图片地址 + */ + private String picUrl; + + /** + * 排序从1开始 + */ + private Integer sort; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标志 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLiveRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLiveRecDTO.java new file mode 100644 index 0000000000..46a30b97d6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActLiveRecDTO.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActLiveRecDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动id: act_info.id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 实况打卡位置经度 + */ + private BigDecimal longitude; + + /** + * 实况打卡位置纬度 + */ + private BigDecimal latitude; + + /** + * 实况打卡地址 + */ + private String address; + + /** + * 实况打卡描述 + */ + private String desc; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java new file mode 100644 index 0000000000..955997a340 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActOperationRecDTO.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +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 ActOperationRecDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动id + */ + private String actId; + + /** + * 发布:publish; +取消活动:cancel; +结束活动:finish +重新编辑:update + */ + private String type; + + /** + * 1通知用户0不通知,取消活动时默认true + */ + private Boolean noticeUser; + + /** + * 备注,取消活动时此列有值 + */ + private String remark; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 操作人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java new file mode 100644 index 0000000000..6b6daf74c2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActPointLogDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +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 ActPointLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(给分或者不给分,以及重新处理插入本表) + */ + private String id; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 积分值 + */ + private Integer points; + + /** + * 操作类型: +同意给分agree; 不给分:deny;重新处理: reset + */ + private String operateType; + + /** + * 备注:拒绝给分和重新处理时录入的理由 + */ + private String remark; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人(工作人员id) + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInPicDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInPicDTO.java new file mode 100644 index 0000000000..632b3f09ec --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInPicDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-19 + */ +@Data +public class ActSignInPicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 签到记录ID:act_sign_in_record.id + */ + private String signInId; + + /** + * 图片地址 + */ + private String picUrl; + + /** + * 排序从1开始 + */ + private Integer sort; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标志 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInRecDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInRecDTO.java new file mode 100644 index 0000000000..e8cb87fa83 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSignInRecDTO.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActSignInRecDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动id:act_info.id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 签到位置经度 + */ + private BigDecimal longitude; + + /** + * 签到位置纬度 + */ + private BigDecimal latitude; + + /** + * 签到地址 + */ + private String address; + + /** + * 签到描述 + */ + private String desc; + + /** + * 0不同步实况1同步到实况记录 + */ + private Integer syncLive; + + /** + * 实况id,党sync_live=1时此列有值 + */ + private String liveId; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.java new file mode 100644 index 0000000000..b1bc9f1898 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActStatisticalDTO.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +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 ActStatisticalDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(活动结束后插入本表) + */ + private String id; + + /** + * 活动id + */ + private String actId; + + /** + * 报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数) + */ + private Integer signupNum; + + /** + * 待审核 + */ + private Integer auditingNum; + + /** + * 审核通过 + */ + private Integer passedNum; + + /** + * 审核不通过总人数 + */ + private Integer refusedNum; + + /** + * 取消报名的人数 + */ + private Integer canceldNum; + + /** + * 活动已签到人数 + */ + private Integer signedInUserNum; + + /** + * 发放积分总人数 + */ + private Integer rewardUserNum; + + /** + * 拒绝发放积分总人数 + */ + private Integer denyRewardUserNum; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSummaryDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSummaryDTO.java new file mode 100644 index 0000000000..2de3fd0ce7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSummaryDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-19 + */ +@Data +public class ActSummaryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 活动ID:act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java new file mode 100644 index 0000000000..a7bff8713b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserLogDTO.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +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 ActUserLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 操作类型(已报名/待审核auditing, + * 审核通过passed, + * 审核不通过refused + * 取消报名canceled, + * ) + */ + private String operationType; + + /** + * 操作备注:(1)审核不通过的原因 +(2)取消报名的原因| +(3)拒绝发放积分的理由 +(4)重新处理的理由 + */ + private String reason; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间(操作的时间) + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java new file mode 100644 index 0000000000..2c7c7a2d8d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActUserRelationDTO.java @@ -0,0 +1,136 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +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 ActUserRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(用户-活动一对一,报名取消再报名也只有一条记录) + */ + private String id; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 当前状态(已报名/待审核auditing, +审核通过passed, +审核不通过refused +取消报名canceled, +) + */ + private String status; + + /** + * 审核通过类型:auto, manual + */ + private String passedType; + + /** + * 审核时间(同意、拒绝的时间) + */ + private Date auditTime; + + /** + * 未通过原因 + */ + private String failureReason; + + /** + * 取消报名的时间 + */ + private Date cancelTime; + + /** + * 用户取消报名的原因 + */ + private String cancelReason; + + /** + * 已处理: handled; 默认"",重新处理时reward_flag置为空字符串 + */ + private String processFlag; + + /** + * 已签到:signed_in; 默认"" + */ + private String signInFlag; + + /** + * 已给分:agree, 不给分:deny 默认"" + */ + private String rewardFlag; + + /** + * 拒绝发放积分备注 + */ + private String denyRewardReason; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间(报名时间) + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java new file mode 100644 index 0000000000..8ea2b28322 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/HeartUserInfoDTO.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +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 HeartUserInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(用户提交报名成功后,插入本表) + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 用户id + */ + private String userId; + + /** + * 1是志愿者,0不是志愿者(志愿者注册成功后需要来更新值) + */ + private Boolean volunteerFlag; + + /** + * 爱心时长(单位:分钟)(参与并签到了的活动,实际结束-实际开始)签到的。未签到但是有积分的 + + */ + private Integer kindnessTime; + + /** + * 实际参与活动个数(签到+1) + */ + private Integer participationNum; + + /** + * 参与活动并获得积分的次数(发放积分+1,重新处理如果原来是发放积分需要-1) + */ + private Integer obtainPointNum; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActContentDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActContentDTO.java new file mode 100644 index 0000000000..79d7f858d1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActContentDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-19 + */ +@Data +public class LatestActContentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 活动id:latest_act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java new file mode 100644 index 0000000000..68c34830cf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java @@ -0,0 +1,212 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class LatestActInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 报名开始时间 + */ + private Date signUpStartTime; + + /** + * 报名截止时间 + */ + private Date signUpEndTime; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 打卡开始时间 + */ + private Date signInStartTime; + + /** + * 打卡截止时间 + */ + private Date signInEndTime; + + /** + * 活动签到打卡地点 + */ + private String signInAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signInLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signInLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signInRadius; + + /** + * 活动名额类型(0-不限名额,1-固定名额) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 主办方类型:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 如果以网格名义发布,存储空字符串"" + */ + private String pid; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Boolean volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Boolean auditSwitch; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java new file mode 100644 index 0000000000..e0f352bc70 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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-19 + */ +@Data +public class VolunteerInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(志愿者注册后插入本表) + */ + private String id; + + /** + * 用户id + */ + private String userId; + + /** + * 客户id + */ + private String customerId; + + /** + * 志愿者自我介绍 + */ + private String volunteerIntroduce; + + /** + * 志愿者签名 + */ + private String volunteerSignature; + + /** + * 删除标记 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间(认证志愿者时间) + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/.gitkeep b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActBaseFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActBaseFormDTO.java new file mode 100644 index 0000000000..04a0b710aa --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActBaseFormDTO.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动列表(标准) 入参 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActBaseFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = { AddUserInternalGroup.class }) + private String customerId; + + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageNo; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageSize; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java new file mode 100644 index 0000000000..bd67a4a69b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActCaculateDistanceFormDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 重新定位 入参 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActCaculateDistanceFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 经度 + */ + @NotBlank(message = "经度不能为空", groups = { AddUserInternalGroup.class }) + private Double longitude; + + /** + * 纬度 + */ + @NotBlank(message = "纬度不能为空", groups = { AddUserInternalGroup.class }) + private Double latitude; + + /** + * 用户id + */ + @NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class }) + private String actId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActContentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActContentFormDTO.java new file mode 100644 index 0000000000..29ccd9fd98 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActContentFormDTO.java @@ -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 = { AddUserInternalGroup.class }) + private String actId; + + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageNo; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0", groups = { ResiActBaseFormDTO.AddUserInternalGroup.class }) + private Integer pageSize; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActDetailFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActDetailFormDTO.java new file mode 100644 index 0000000000..18c41b255e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActDetailFormDTO.java @@ -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 = { AddUserInternalGroup.class }) + private String actId; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java new file mode 100644 index 0000000000..54182f0da3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActInsertLiveFormDTO.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 images; + + /** + * 用户id + */ + private String userId; + + /** + * id + */ + private String id; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class }) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActRegistrationFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActRegistrationFormDTO.java new file mode 100644 index 0000000000..378b38e40c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActRegistrationFormDTO.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动报名参数 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActRegistrationFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 用户Id + */ + private String userId; + + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class }) + private String actId; + + /** + * 客户ID + */ + @NotBlank(message = "客户ID不能为空", groups = { AddUserInternalGroup.class }) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java new file mode 100644 index 0000000000..69c1486c7f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActSignInFormDTO.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 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 images; + + /** + * 0不同步实况1同步到实况记录 + */ + @NotBlank(message = "是否同步到实况记录不能为空", groups = { AddUserInternalGroup.class, AddUserShowGroup.class}) + private Integer syncLive; + + /** + * 用户id + */ + private String userId; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class }) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActUserCancelSignUpFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActUserCancelSignUpFormDTO.java new file mode 100644 index 0000000000..cbe419a7b3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiActUserCancelSignUpFormDTO.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form.resi; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 取消报名参数 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiActUserCancelSignUpFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 用户Id + */ + private String userId; + + /** + * 活动ID + */ + @NotBlank(message = "活动ID不能为空", groups = { AddUserInternalGroup.class }) + private String actId; + + /** + * 取消报名原因 + */ + @NotBlank(message = "请输入取消报名原因", groups = { AddUserInternalGroup.class, AddUserShowGroup.class }) + @Length(max = 150, message = "取消报名原因不能超过150字", groups = { AddUserInternalGroup.class, AddUserShowGroup.class }) + private String failureReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiLatestActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiLatestActFormDTO.java new file mode 100644 index 0000000000..0f9af626e5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiLatestActFormDTO.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 最新活动列表 入参 + * + * @author zhangyong + * @since v1.0.0 2020-07-21 + */ +@Data +public class ResiLatestActFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = { AddUserInternalGroup.class }) + private String customerId; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0", groups = { AddUserInternalGroup.class }) + private Integer num; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiMyActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiMyActFormDTO.java new file mode 100644 index 0000000000..5a8ad4e43f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiMyActFormDTO.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.form.resi; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 我的活动列表 入参 + * + * @author zhangyong + * @since v1.0.0 2020-07-20 + */ +@Data +public class ResiMyActFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>> + /** + * 添加用户操作的内部异常分组 + * 出现错误会提示给前端7000错误码,返回信息为:服务器开小差... + */ + public interface AddUserInternalGroup {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageNo; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0", groups = { AddUserInternalGroup.class }) + private Integer pageSize; + + /** + * 用户id + */ + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java new file mode 100644 index 0000000000..497f36f06e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java @@ -0,0 +1,117 @@ +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 {} + + // <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<< + + /** + * 用户id + */ + private String userId; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class }) + private String customerId; + + /** + * 姓 + */ + @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 avatarUrl; + + /** + * 志愿者签名 + */ + private String volunteerSignature; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java new file mode 100644 index 0000000000..3e653e76c1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AactUserDetailFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 报名审核-人员详情-入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 22:22 + */ +@Data +public class AactUserDetailFormDTO implements Serializable { + private static final long serialVersionUID = 5791290477143999176L; + + public interface AddUserInternalGroup { + } + + /** + * 列表页返回的主键 + */ + @NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class}) + private String actUserRelationId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java new file mode 100644 index 0000000000..5a4cfe3d5c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActCustomizedFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 获取自定义配置项-入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 15:17 + */ +@Data +public class ActCustomizedFormDTO implements Serializable { + private static final long serialVersionUID = 7089647420851532829L; + public interface AddUserInternalGroup {} + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = { AddUserInternalGroup.class }) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java new file mode 100644 index 0000000000..632b567c11 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActIdFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动id通用formdto + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 11:07 + */ +@Data +public class ActIdFormDTO implements Serializable { + private static final long serialVersionUID = 7151533863877527886L; + + public interface AddUserInternalGroup {} + /** + * 活动id + */ + @NotBlank(message = "活动id不能为空", groups = { ActIdFormDTO.AddUserInternalGroup.class }) + private String actId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActListCommonFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActListCommonFormDTO.java new file mode 100644 index 0000000000..bc89178a5c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActListCommonFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 21:21 + */ +@Data +public class ActListCommonFormDTO implements Serializable { + private static final long serialVersionUID = -8014343076037268806L; + public interface AddUserInternalGroup {} + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class }) + private String customerId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java new file mode 100644 index 0000000000..57166c22f1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPreviewFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动预览-查看活动详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 17:19 + */ +@Data +public class ActPreviewFormDTO implements Serializable { + private static final long serialVersionUID = -1603801389350245626L; + + public interface UserInternalGroup { + } + + /** + * 活动草稿id + */ + @NotBlank(message = "活动草稿id不能为空", groups = {UserInternalGroup.class}) + private String actDraftId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java new file mode 100644 index 0000000000..0df68ec7a8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 审核通过、拒绝入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 17:28 + */ +@Data +public class AuditUserFormDTO implements Serializable { + private static final long serialVersionUID = 243279409415285207L; + public interface AddUserInternalGroup { + } + public interface RefusedUserShowGroup extends CustomerClientShowGroup { + } + /** + * 列表页返回的主键 + */ + @NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class,RefusedUserShowGroup.class}) + private String actUserRelationId; + + @NotBlank(message = "拒绝理由不能为空", groups = {RefusedUserShowGroup.class}) + private String rejectReason; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/CancelActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/CancelActFormDTO.java new file mode 100644 index 0000000000..1ae524df14 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/CancelActFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 17:23 + */ +@Data +public class CancelActFormDTO implements Serializable { + private static final long serialVersionUID = -5297836691628421645L; + public interface AddUserInternalGroup {} + public interface UserShowGroup extends CustomerClientShowGroup { + } + /** + * 活动id + */ + @NotBlank(message = "活动id不能为空", groups = {AddUserInternalGroup.class }) + private String actId; + + /** + * 取消原因 + */ + @NotBlank(message = "取消原因不能为空", groups = {UserShowGroup.class}) + private String cancelReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActContentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActContentFormDTO.java new file mode 100644 index 0000000000..91bbae914b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActContentFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 活动内容 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 13:18 + */ +@Data +public class DraftActContentFormDTO implements Serializable { + private static final long serialVersionUID = 5236509944250440348L; + + public interface UserInternalGroup { + } + + public interface UserShowGroup extends CustomerClientShowGroup { + } + + /** + * 内容 + */ + @NotBlank(message = "内容不能为空", groups = {UserShowGroup.class}) + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + @NotBlank(message = "内容类型不能为空,图片:img;文字:text", groups = {UserInternalGroup.class}) + private String contentType; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java new file mode 100644 index 0000000000..1d128594ff --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/DraftActInfoFormDTO.java @@ -0,0 +1,164 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 预览-保存活动草稿入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 13:17 + */ +@Data +public class DraftActInfoFormDTO implements Serializable { + private static final long serialVersionUID = -4967079570884814526L; + + public interface AddUserInternalGroup { + } + + @Valid + private List actContent; + + /** + * 活动草稿id,如果是编辑之前的活动草稿,此列是有值的 + */ + private String actDraftId; + + + /** + * 如果是重新发布活动,此列是有值的 + */ + private String actId; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 封面图 + */ + private String coverPic; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动地点-经度 + */ + private BigDecimal actLongitude; + + /** + * 活动地点-纬度 + */ + private BigDecimal actLatitude; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + private String actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + private String actEndTime; + + /** + * 活动人数 + */ + private Integer actQuota; + + /** + * 活动积分 + */ + private Integer reward; + + /** + * 报名审核:true:只有志愿者才可以参加活动,false: 只要是居民就可以参加活动 + */ + private Boolean volunteerLimit; + + /** + * 报名审核: true: 需人工审核 false: 无需审核 + */ + private Boolean auditSwitch; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + private String signUpEndTime; + + /** + * 报名条件 + */ + private String requirement; + + /** + * 签到开始时间:yyyy-MM-dd HH:mm + */ + private String signInStartTime; + + /** + * 签到结束时间: yyyy-MM-dd HH:mm + */ + private String signInEndTime; + + /** + * 签到地址 + */ + private String signInAddress; + + /** + * 签到地址-纬度 + */ + private BigDecimal signInLatitude; + + /** + * 签到地址-经度 + */ + private BigDecimal signInLongitude; + + /** + * 签到有效范围(米) + */ + private Integer signInRadius; + + /** + * 主办方id + */ + private String sponsorId; + + /** + * 主办方类型:以网格名义:grid , 以机关名义: agency + */ + private String sponsorType; + + /** + * 主办方名称 + */ + private String sponsorName; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java new file mode 100644 index 0000000000..b3b79453b5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 积分发放给分,不给分,通用入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 13:10 + */ +@Data +public class GrantPointsFormDTO implements Serializable { + private static final long serialVersionUID = 4785107755585941804L; + public interface AddUserInternalGroup { + } + public interface DenyUserShowGroup extends CustomerClientShowGroup { + } + /** + * 积分发放待处理列表返参中的actUserRelationId + */ + @NotBlank(message = "主键不能为空", groups = {AddUserInternalGroup.class,DenyUserShowGroup.class}) + private String actUserRelationId; + + @NotBlank(message = "理由不能为空", groups = {DenyUserShowGroup.class}) + private String denyRewardReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActContentFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActContentFormDTO.java new file mode 100644 index 0000000000..efe2592e7a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActContentFormDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 发布活动入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 16:21 + */ +@Data +public class PublishActContentFormDTO implements Serializable { + private static final long serialVersionUID = 7541780156596764819L; + + public interface UserInternalGroup { + } + + public interface UserShowGroup extends CustomerClientShowGroup { + } + + /** + * 内容 + */ + @NotBlank(message = "内容不能为空", groups = {UserShowGroup.class}) + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + @NotBlank(message = "内容类型不能为空,图片:img;文字:text", groups = {UserInternalGroup.class}) + private String contentType; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java new file mode 100644 index 0000000000..e1005aa31a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java @@ -0,0 +1,193 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 发布活动-入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 16:15 + */ +@Data +public class PublishActInfoFormDTO implements Serializable { + private static final long serialVersionUID = -2066903357493362692L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @Valid + @Size(min=1,message = "活动详情不能为空",groups = {AddUserShowGroup.class}) + private List actContent; + + /** + * 活动草稿id,如果是编辑之前的活动草稿,此列是有值的 + */ + private String actDraftId; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 活动标题 + */ + @NotBlank(message = "活动标题不能为空", groups = {AddUserShowGroup.class}) + @Length(min=1, max=50,message = "活动标题限50字以内", groups = {AddUserShowGroup.class}) + private String title; + + /** + * 封面图 + */ + @NotBlank(message = "封面图不能为空", groups = {AddUserShowGroup.class}) + private String coverPic; + + /** + * 活动地点 + */ + @NotBlank(message = "活动地点不能为空", groups = {AddUserShowGroup.class}) + private String actAddress; + + /** + * 活动地点-经度 + */ + @NotNull(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal actLongitude; + + /** + * 活动地点-纬度 + */ + @NotNull(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal actLatitude; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "活动预计开始时间不能为空", groups = {AddUserShowGroup.class}) + private String actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "活动预计结束时间不能为空", groups = {AddUserShowGroup.class}) + private String actEndTime; + + /** + * 活动人数 + */ + @Min(0) + private Integer actQuota; + + /** + * 活动积分 + */ + @Min(0) + private Integer reward; + + /** + * 报名审核:true:只有志愿者才可以参加活动,false: 只要是居民就可以参加活动 + */ + @NotNull(message = "报名身份不能为空", groups = {AddUserInternalGroup.class}) + private Boolean volunteerLimit; + + /** + * 报名审核: true: 需人工审核 false: 无需审核 + */ + @NotNull(message = "报名审核方式不能为空", groups = {AddUserInternalGroup.class}) + private Boolean auditSwitch; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @NotBlank(message = "报名截止时间不能为空", groups = {AddUserShowGroup.class}) + private String signUpEndTime; + + /** + * 报名条件 + */ + @NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class}) + @Length(min=1, max=50,message = "报名条件限200字以内", groups = {AddUserShowGroup.class}) + private String requirement; + + /** + * 签到开始时间:yyyy-MM-dd HH:mm + */ + @NotBlank(message = "签到开始时间不能为空", groups = {AddUserShowGroup.class}) + private String signInStartTime; + + /** + * 签到结束时间: yyyy-MM-dd HH:mm + */ + @NotBlank(message = "签到结束时间不能为空", groups = {AddUserShowGroup.class}) + private String signInEndTime; + + /** + * 签到地址 + */ + @NotBlank(message = "签到地址不能为空", groups = {AddUserShowGroup.class}) + private String signInAddress; + + /** + * 签到地址-纬度 + */ + @NotNull(message = "签到地址-纬度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal signInLatitude; + + /** + * 签到地址-经度 + */ + @NotNull(message = "签到地址-经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal signInLongitude; + + /** + * 签到有效范围(米) + */ + @Min(0) + @NotNull(message = "签到有效范围不能为空", groups = {AddUserShowGroup.class}) + private Integer signInRadius; + + /** + * 主办方id + */ + @NotBlank(message = "主办方id不能为空", groups = {AddUserInternalGroup.class}) + private String sponsorId; + + /** + * 主办方类型:以网格名义:grid , 以机关名义: agency + */ + @NotBlank(message = "主办方类型不能为空", groups = {AddUserInternalGroup.class}) + private String sponsorType; + + /** + * 主办方名称 + */ + @NotBlank(message = "主办方名称不能为空", groups = {AddUserShowGroup.class}) + private String sponsorName; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空", groups = {AddUserShowGroup.class}) + private String sponsorContacts; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class}) + private String sponsorTel; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java new file mode 100644 index 0000000000..f3bce130df --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java @@ -0,0 +1,194 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.Valid; +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 重新发布活动-入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/27 13:49 + */ +@Data +public class RePublishFormDTO implements Serializable { + private static final long serialVersionUID = -959956652123514886L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @Valid + @Size(min=1,message = "活动详情不能为空",groups = {AddUserShowGroup.class}) + private List actContent; + + /** + * 活动id + */ + @NotBlank(message = "活动id不能为空", groups = {AddUserInternalGroup.class}) + private String actId; + + /** + * 是否通知已报名人员:true 通知 false 不通知 + */ + @NotNull(message = "是否通知已报名人员标志不能为空",groups ={AddUserInternalGroup.class} ) + private Boolean noticePassedPeople; + + + /** + * 活动标题 + */ + @NotBlank(message = "活动标题不能为空", groups = {AddUserShowGroup.class}) + @Length(min=1, max=50,message = "活动标题限50字以内", groups = {AddUserShowGroup.class}) + private String title; + + /** + * 封面图 + */ + @NotBlank(message = "封面图不能为空", groups = {AddUserShowGroup.class}) + private String coverPic; + + /** + * 活动地点 + */ + @NotBlank(message = "活动地点不能为空", groups = {AddUserShowGroup.class}) + private String actAddress; + + /** + * 活动地点-经度 + */ + @NotNull(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal actLongitude; + + /** + * 活动地点-纬度 + */ + @NotNull(message = "活动地点经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal actLatitude; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "活动预计开始时间不能为空", groups = {AddUserShowGroup.class}) + private String actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "活动预计结束时间不能为空", groups = {AddUserShowGroup.class}) + private String actEndTime; + + /** + * 活动人数 + */ + @Min(0) + private Integer actQuota; + + /** + * 活动积分 + */ + @Min(0) + private Integer reward; + + /** + * 报名审核:true:只有志愿者才可以参加活动,false: 只要是居民就可以参加活动 + */ + @NotNull(message = "报名身份不能为空", groups = {AddUserInternalGroup.class}) + private Boolean volunteerLimit; + + /** + * 报名审核: true: 需人工审核 false: 无需审核 + */ + @NotNull(message = "报名审核方式不能为空", groups = {AddUserInternalGroup.class}) + private Boolean auditSwitch; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @NotBlank(message = "报名截止时间不能为空", groups = {AddUserShowGroup.class}) + private String signUpEndTime; + + /** + * 报名条件 + */ + @NotBlank(message = "报名条件不能为空", groups = {AddUserShowGroup.class}) + @Length(min=1, max=50,message = "报名条件限200字以内", groups = {AddUserShowGroup.class}) + private String requirement; + + /** + * 签到开始时间:yyyy-MM-dd HH:mm + */ + @NotBlank(message = "签到开始时间不能为空", groups = {AddUserShowGroup.class}) + private String signInStartTime; + + /** + * 签到结束时间: yyyy-MM-dd HH:mm + */ + @NotBlank(message = "签到结束时间不能为空", groups = {AddUserShowGroup.class}) + private String signInEndTime; + + /** + * 签到地址 + */ + @NotBlank(message = "签到地址不能为空", groups = {AddUserShowGroup.class}) + private String signInAddress; + + /** + * 签到地址-纬度 + */ + @NotNull(message = "签到地址-纬度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal signInLatitude; + + /** + * 签到地址-经度 + */ + @NotNull(message = "签到地址-经度不能为空", groups = {AddUserInternalGroup.class}) + private BigDecimal signInLongitude; + + /** + * 签到有效范围(米) + */ + @Min(0) + @NotNull(message = "签到有效范围不能为空", groups = {AddUserShowGroup.class}) + private Integer signInRadius; + + /** + * 主办方id + */ + @NotBlank(message = "主办方id不能为空", groups = {AddUserInternalGroup.class}) + private String sponsorId; + + /** + * 主办方类型:以网格名义:grid , 以机关名义: agency + */ + @NotBlank(message = "主办方类型不能为空", groups = {AddUserInternalGroup.class}) + private String sponsorType; + + /** + * 主办方名称 + */ + @NotBlank(message = "主办方名称不能为空", groups = {AddUserShowGroup.class}) + private String sponsorName; + + /** + * 联系人 + */ + @NotBlank(message = "联系人不能为空", groups = {AddUserShowGroup.class}) + private String sponsorContacts; + + /** + * 联系电话 + */ + @NotBlank(message = "联系电话不能为空", groups = {AddUserShowGroup.class}) + private String sponsorTel; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java new file mode 100644 index 0000000000..e6af4266e4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActCustomizedFormDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 保存自定义配置-入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 17:22 + */ +@Data +public class SaveActCustomizedFormDTO implements Serializable { + + private static final long serialVersionUID = 5571356065160809543L; + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + /** + * act_customized主键 + */ + @NotBlank(message = "主键不能为空", groups = { AddUserInternalGroup.class }) + private String actCustomizedId; + + /** + * 标题:志愿者去哪儿 + */ + @NotBlank(message = "标题不能为空", groups = { AddUserShowGroup.class }) + private String titleName; + + /** + * 咨询热线 + */ + @NotBlank(message = "咨询热线不能为空", groups = { AddUserShowGroup.class }) + private String hotLine; + + /** + * 活动列表 + */ + @NotBlank(message = "活动列表名称不能为空", groups = { AddUserShowGroup.class }) + private String actListName; + + /** + * 爱心榜 + */ + @NotBlank(message = "爱心榜列表名称不能为空", groups = { AddUserShowGroup.class }) + private String heartRankName; + + /** + * 活动回顾 + */ + @NotBlank(message = "活动回顾列表名称不能为空", groups = { AddUserShowGroup.class }) + private String actReviewName; + + /** + * 我的活动 + */ + @NotBlank(message = "我的回顾列表名称不能为空", groups = { AddUserShowGroup.class }) + private String myActName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActualTimeFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActualTimeFormDTO.java new file mode 100644 index 0000000000..8380ece57c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SaveActualTimeFormDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 已结束-保存活动实际开始结束时间 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 19:43 + */ +@Data +public class SaveActualTimeFormDTO implements Serializable { + private static final long serialVersionUID = -3668309257254318868L; + + public interface AddUserInternalGroup { + } + + public interface UserShowGroup extends CustomerClientShowGroup { + } + + /** + * 活动id + */ + @NotBlank(message = "活动id不能为空", groups = {AddUserInternalGroup.class}) + private String actId; + /** + * 实际开始时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "实际开始时间不能为空", groups = {UserShowGroup.class}) + private String actualStartTime; + /** + * 实际结束时间yyyy-MM-dd HH:mm + */ + @NotBlank(message = "实际结束时间不能为空", groups = {UserShowGroup.class}) + private String actualEndTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SummaryActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SummaryActFormDTO.java new file mode 100644 index 0000000000..bd5f3a2655 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/SummaryActFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form.work; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; +import java.io.Serializable; +import java.util.List; + +/** + * 保存添加回顾入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/27 10:33 + */ +@Data +public class SummaryActFormDTO implements Serializable { + private static final long serialVersionUID = -3610355661618180808L; + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + /** + * 活动id + */ + @NotBlank(message = "活动id不能为空", groups = {AddUserInternalGroup.class }) + private String actId; + + @Valid + @Size(min=1,message = "活动详情不能为空",groups = {AddUserShowGroup.class}) + private List actContent; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java new file mode 100644 index 0000000000..26e2944e35 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/UserHistoricalActFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form.work; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 报名审核-人员历史活动情况入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 16:12 + */ +@Data +public class UserHistoricalActFormDTO implements Serializable { + public interface AddUserInternalGroup {} + /** + * 居民端用户id + */ + @NotBlank(message = "居民端用户id不能为空", groups = {AddUserInternalGroup.class}) + private String userId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/.gitkeep b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActContentResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActContentResultDTO.java new file mode 100644 index 0000000000..4d6e9bbf3f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActContentResultDTO.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java new file mode 100644 index 0000000000..18dba0c301 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java @@ -0,0 +1,140 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 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; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java new file mode 100644 index 0000000000..c842cef5e4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActInfoResultDTO.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 ResiActInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ + private String actId; + + /** + * 标题 + */ + private String title; + + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动开始时间 + */ + private String actStartTime; + + /** + * 活动结束时间 + */ + private String actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额类型(true:固定名额(1) false: 不限制名额(0)) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动状态:(报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress; 已结束:finished;取消报名canceld;) + */ + private String actCurrentState; + + /** + *用户报名状态(no_signed_up: 未报名,signed_up: 已报名) + */ + private String signupFlag; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActLiveRecResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActLiveRecResultDTO.java new file mode 100644 index 0000000000..8798dfb0ef --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActLiveRecResultDTO.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 活动详情-已结束-现场实况列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ResiActLiveRecResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 现场实况次数 + */ + private Integer actLiveNum; + + /** + * 打卡列表 + */ + private List actLives; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRefusedDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRefusedDetailResultDTO.java new file mode 100644 index 0000000000..34d18ae9d2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActRefusedDetailResultDTO.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActSummaryResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActSummaryResultDTO.java new file mode 100644 index 0000000000..f52006de80 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActSummaryResultDTO.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.java new file mode 100644 index 0000000000..b6905711fe --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiInProgressActResultDTO.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result.resi; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 即将进行/正在进行中的活动 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-07-21 + */ +@Data +public class ResiInProgressActResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actId; + + /** + * 标题 + */ + private String title; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java new file mode 100644 index 0000000000..1bf6b8124e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLatestActResultDTO.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 ResiLatestActResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actId; + + /** + * 标题 + */ + private String title; + + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动开始时间 + */ + private String actStartTime; + + /** + * 活动结束时间 + */ + private String actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额类型(true:固定名额(1) false: 不限制名额(0)) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动状态:(报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress;) + */ + private String actCurrentState; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLeaderboardResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLeaderboardResultDTO.java new file mode 100644 index 0000000000..d3d50da078 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLeaderboardResultDTO.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java new file mode 100644 index 0000000000..fc7d7d39e7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiLookBackActResultDTO.java @@ -0,0 +1,69 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 ResiLookBackActResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actId; + + /** + * 标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动开始时间 + */ + private String actStartTime; + + /** + * 活动结束时间 + */ + private String actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动状态:(已结束:finished;) + */ + private String actCurrentState; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java new file mode 100644 index 0000000000..b477f6d513 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiMyActResultDTO.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 ResiMyActResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String actId; + + /** + * 标题 + */ + private String title; + + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动开始时间 + */ + private String actStartTime; + + /** + * 活动结束时间 + */ + private String actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额类型(true:固定名额(1) false: 不限制名额(0)) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signupNum; + + /** + * 活动当前状态(审核中auditing,审核通过passed,审核不通过refused,已结束canceld) + */ + private String actCurrentState; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java new file mode 100644 index 0000000000..f06d4eaa89 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActCustomizedResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 获取自定义配置项-返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 15:03 + */ +@Data +public class ActCustomizedResultDTO implements Serializable { + private static final long serialVersionUID = 5784819474548493258L; + + /** + * act_customized主键 + */ + private String actCustomizedId; + + /** + * 标题:志愿者去哪儿 + */ + private String titleName; + + /** + * 咨询热线 + */ + private String hotLine; + + /** + * 活动列表 + */ + private String actListName; + + /** + * 爱心榜 + */ + private String heartRankName; + + /** + * 活动回顾 + */ + private String actReviewName; + + /** + * 我的活动 + */ + private String myActName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDraftContentDTOResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDraftContentDTOResultDTO.java new file mode 100644 index 0000000000..845efcb65c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDraftContentDTOResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 获取最近一次编辑的活动内容-返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 21:58 + */ +@Data +public class ActDraftContentDTOResultDTO implements Serializable { + private static final long serialVersionUID = 7937967625440168599L; + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java new file mode 100644 index 0000000000..73609e486f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 活动预览详情页-活动内容详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 17:39 + */ +@Data +public class ActPreviewContentResultDTO implements Serializable { + private static final long serialVersionUID = -3351984717336783565L; + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java new file mode 100644 index 0000000000..eb6f07693c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewResultDTO.java @@ -0,0 +1,92 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 活动预览-查看活动详情返参修改 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 17:23 + */ +@Data +public class ActPreviewResultDTO implements Serializable { + private static final long serialVersionUID = 8655407962470027973L; + + /** + * 活动草稿id + */ + private String actDraftId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动人数 + */ + private Integer actQuota; + + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + + /** + * 活动积分 + */ + private Integer reward; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + + /** + * 报名条件 + */ + private String requirement; + + /** + * 主办方名称 + */ + private String sponsorName; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 活动详情 + */ + private List actContent; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActSignUpStatResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActSignUpStatResultDTO.java new file mode 100644 index 0000000000..960af1c3b5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActSignUpStatResultDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 报名审核-概要统计 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 16:44 + */ +@Data +public class ActSignUpStatResultDTO implements Serializable { + private static final long serialVersionUID = 3218353394763939617L; + /** + * 活动id + */ + private String actId; + /** + * 活动标题 + */ + private String title; + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + /** + * 活动名额 + */ + private Integer actQuota; + + + + + /** + * 剩余报名名额 + */ + private Integer residueNum; + /** + * 待审核总人数 + */ + private Integer auditingNum; + /** + * 已通过总人数 + */ + private Integer passedNum; + /** + * 已拒绝总人数 + */ + private Integer refusedNum; + /** + * 已取消总人数 + */ + private Integer canceledNum; + + /** + * 已报名(待审核+已通过) + */ + private Integer totalSignUp; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditResult.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditResult.java new file mode 100644 index 0000000000..480cc75f71 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditResult.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 审核结果(已通过/已拒绝) + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 14:01 + */ +@Data +public class AuditResult implements Serializable { + private static final long serialVersionUID = -656845099071435835L; + /** + * 审核通过/拒绝的时间yyyy-MM-dd HH:mm:ss + */ + private Date auditTime; + + /** + * 拒绝原因,status=passed时返回空字符串 + */ + private String refusedReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java new file mode 100644 index 0000000000..1993b73dfa --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingActUserResultDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.result.work; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 报名审核-待审核列表返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 22:14 + */ +@Data +public class AuditingActUserResultDTO implements Serializable { + private static final long serialVersionUID = 5567556309702585031L; + /** + * act_user_relation主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 微信昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 报名时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + public AuditingActUserResultDTO(){ + //微信基本信息先默认为空字符串 + this.setRealName(NumConstant.EMPTY_STR); + this.setNickName(NumConstant.EMPTY_STR); + this.setHeadImgUrl(NumConstant.EMPTY_STR); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java new file mode 100644 index 0000000000..764c81b2fe --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/AuditingUserDetailResultDTO.java @@ -0,0 +1,104 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 报名审核-待审核人员详情-返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 22:24 + */ +@Data +public class AuditingUserDetailResultDTO implements Serializable { + private static final long serialVersionUID = 6259802533450991971L; + /** + * 活动id + */ + private String actId; + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 性别1男2女0未知 + */ + private String gender; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 联系方式 + */ + private String mobile; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 居住地址 + */ + private String address; + + /** + * 待审核auditing, 审核通过passed, 审核不通过refused 取消报名canceld, + */ + private String status; + + /** + * 报名时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * 返回文本:已拒绝5次 + */ + private String refusedCountDesc; + + /** + * 最近一次拒绝原因 + */ + private String latestRefusedReason; + + /** + * 最近一次拒绝的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date latestAuditTime; + + /** + * 历史活动情况 + */ + private HistoricalActInfo historicalActInfo; + + + /** + * 取消信息(已取消界面 用) + */ + private CancelResult cancelResult; + /** + * 审核结果(已通过/已拒绝) + */ + private AuditResult auditResult; + + /** + * 审核历史(待审核界面需要显示) + */ + private HistoricalAuditResult historicalAuditResult; + private String actUserRelationId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CancelResult.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CancelResult.java new file mode 100644 index 0000000000..bf128fc0b1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CancelResult.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 取消信息(已取消界面 用) + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 13:53 + */ +@Data +public class CancelResult implements Serializable { + private static final long serialVersionUID = -4638522326622908384L; + + /** + * 取消的原因:当status=canceld,才有值 + */ + private String cancelReason; + + /** + * 取消的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date cancelTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java new file mode 100644 index 0000000000..3239a78ced --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java @@ -0,0 +1,127 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 已取消-活动详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 18:02 + */ +@Data +public class CanceledActDetailResultDTO implements Serializable { + private static final long serialVersionUID = 4438884084461494174L; + + /** + *活动id + */ + private String actId; + + /** + * 活动标题 + */ + private String title; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + + /** + * 活动开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + /** + * 活动积分 + */ + private Integer reward; + /** + * 主办方名称 + */ + private String sponsorName; + /** + * 报名条件 + */ + private String requirement; + /** + * 取消时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date cancelTime; + /** + * 取消理由 + */ + private String cancelReason; + /** + * 活动详情 + */ + private List actContent; + /** + * true,我发布的,false,其他人发布的 + */ + private Boolean isMyPublish; + + @JsonIgnore + private String createdBy; + + @Override + public String toString() { + return "CanceledActDetailResultDTO{" + + "actId='" + actId + '\'' + + ", title='" + title + '\'' + + ", signUpEndTime=" + signUpEndTime + + ", actStartTime=" + actStartTime + + ", actEndTime=" + actEndTime + + ", actAddress='" + actAddress + '\'' + + ", actQuota=" + actQuota + + ", actQuotaCategory=" + actQuotaCategory + + ", sponsorContacts='" + sponsorContacts + '\'' + + ", sponsorTel='" + sponsorTel + '\'' + + ", reward=" + reward + + ", sponsorName='" + sponsorName + '\'' + + ", requirement='" + requirement + '\'' + + ", cancelTime=" + cancelTime + + ", cancelReason='" + cancelReason + '\'' + + ", actContent=" + actContent + + '}'; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java new file mode 100644 index 0000000000..887a457b4e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java @@ -0,0 +1,55 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 23:09 + */ +@Data +public class CanceledActResultDTO implements Serializable { + private static final long serialVersionUID = 7026227776577088524L; + /** + *活动id + */ + private String actId; + + /** + *活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 取消活动的时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date cancelTime; + + /** + * 活动取消的原因 + */ + private String cancelReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActUserResultDTO.java new file mode 100644 index 0000000000..c35ec60a4c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActUserResultDTO.java @@ -0,0 +1,78 @@ +package com.epmet.dto.result.work; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 报名审核-已取消报名列表 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 16:24 + */ +@Data +public class CanceledActUserResultDTO implements Serializable { + private static final long serialVersionUID = 2860252989602238156L; + + /** + * act_user_relation主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 微信昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 报名时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 取消报名的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date cancelTime; + + /** + * 用户取消报名的原因 + */ + private String cancelReason; + + public CanceledActUserResultDTO(){ + //微信基本信息先默认为空字符串 + this.setRealName(NumConstant.EMPTY_STR); + this.setNickName(NumConstant.EMPTY_STR); + this.setHeadImgUrl(NumConstant.EMPTY_STR); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledUserResultDTO.java new file mode 100644 index 0000000000..6a02a9796d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledUserResultDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 已结束-已取消报名人员列表 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 10:51 + */ +@Data +public class CanceledUserResultDTO implements Serializable { + private static final long serialVersionUID = 5261680369821817096L; + /** + * 主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 取消时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date cancelTime; + + /** + * 取消原因 + */ + private String cancelReason; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java new file mode 100644 index 0000000000..135a9d539e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CustomerHeartConfigsResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 居民端根据客户id获取爱心互助自定义配置-返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 12:45 + */ +@Data +public class CustomerHeartConfigsResultDTO implements Serializable { + /** + * act_customized主键 + */ + @JsonIgnore + private String actCustomizedId; + + /** + * 标题:志愿者去哪儿 + */ + private String titleName; + + /** + * 咨询热线 + */ + private String hotLine; + + /** + * 活动列表 + */ + private String actListName; + + /** + * 爱心榜 + */ + private String heartRankName; + + /** + * 活动回顾 + */ + private String actReviewName; + + /** + * 我的活动 + */ + private String myActName; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/DeniedUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/DeniedUserResultDTO.java new file mode 100644 index 0000000000..c7ca1833bb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/DeniedUserResultDTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 积分发放-已拒绝列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 19:01 + */ +@Data +public class DeniedUserResultDTO implements Serializable { + private static final long serialVersionUID = 110993452055116412L; + + /** + * 给分或者不给分,重新处理入参用 + */ + private String actUserRelationId; + + /** + * 用户id + */ + private String userId; + + /** + * 活动id + */ + private String actId; + + /** + * 姓名 + */ + private String realName; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * true:是志愿者 false:不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 拒绝原因 + */ + private String denyRewardReason; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java new file mode 100644 index 0000000000..5e9d4a991d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java @@ -0,0 +1,116 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 已结束-活动详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 20:52 + */ +@Data +public class FinishedActDetailResultDTO implements Serializable { + private static final long serialVersionUID = 6780614493878658227L; + /** + * 活动id + */ + private String actId; + + /** + * 活动标题 + */ + private String title; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 活动积分 + */ + private Integer reward; + + /** + * 主办方名称 + */ + private String sponsorName; + + /** + * 报名条件 + */ + private String requirement; + + /** + * 是否添加回顾:true已经总结 false:未总结 + */ + private Boolean summaryFlag; + + /** + * 活动详情 + */ + private List actContent; + + /** + * 实际开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actualStartTime; + + /** + * 实际结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actualEndTime; + /** + * true,我发布的,false,其他人发布的 + */ + private Boolean isMyPublish; + + @JsonIgnore + private String createdBy; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java new file mode 100644 index 0000000000..25f9d7e46b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 23:19 + */ +@Data +public class FinishedActResultDTO implements Serializable { + private static final long serialVersionUID = -8967999331248723146L; + + /** + *活动id + */ + private String actId; + + /** + *活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + /** + * 活动实际开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actualStartTime; + + /** + * 活动实际结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actualEndTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/Grid.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/Grid.java new file mode 100644 index 0000000000..581eac9d9a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/Grid.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 添加组织-接口返参 + * + * @author sun + */ +@Data +public class Grid implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格Id + */ + private String gridId = ""; + /** + * 机关-网格名称 + */ + private String agencyGridName = ""; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalActInfo.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalActInfo.java new file mode 100644 index 0000000000..6054511006 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalActInfo.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户历史活动情况 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 12:39 + */ +@Data +public class HistoricalActInfo implements Serializable { + private static final long serialVersionUID = -7554295919888726898L; + /** + * 实际参加活动个数 + */ + private Integer signInActNum; + /** + * 报名活动个数 + */ + private Integer signUpActNum; + /** + * 获得积分活动个数 + */ + private Integer obtainPointsActNum; + + public HistoricalActInfo(){ + this.signInActNum=0; + this.signUpActNum=0; + this.obtainPointsActNum=0; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalAuditResult.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalAuditResult.java new file mode 100644 index 0000000000..54f307c152 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/HistoricalAuditResult.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 审核历史(待审核界面需要显示) + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 14:03 + */ +@Data +public class HistoricalAuditResult implements Serializable { + /** + * 最近一次拒绝原因 + */ + private String latestRefusedReason; + /** + * 最近一次拒绝的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date latestAuditTime; + /** + * 返回文本:已拒绝5次 + */ + private String refusedCountDesc; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java new file mode 100644 index 0000000000..cc9e66a9bf --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java @@ -0,0 +1,101 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 进行中-活动详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 21:26 + */ +@Data +public class InProgressActDetailResultDTO implements Serializable { + private static final long serialVersionUID = -2159602705968655263L; + + /** + * 活动id + */ + private String actId; + + /** + * 活动标题 + */ + private String title; + + /** + * 报名截止时间:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 活动积分 + */ + private Integer reward; + + /** + * 主办方名称 + */ + private String sponsorName; + + /** + * 报名条件 + */ + private String requirement; + + /** + * 活动详情 + */ + private List actContent; + + /** + * true,我发布的,false,其他人发布的 + */ + private Boolean isMyPublish; + + @JsonIgnore + private String createdBy; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java new file mode 100644 index 0000000000..5e25e5fab0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java @@ -0,0 +1,80 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 21:23 + */ +@Data +public class InProgressActResultDTO implements Serializable { + private static final long serialVersionUID = -2631607663760353230L; + + /** + *活动id + */ + private String actId; + + /** + *活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 活动状态:报名中:signing_up;截止报名: end_sign_up; 已开始: in_progress; 已报满: enough + */ + private String status=""; + + /** + * 活动预计开始时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * true:固定名额 false: 不限制名额 + */ + private Boolean actQuotaCategory; + + /** + * 活动名额人数 + */ + private Integer actQuota; + + /** + * 已报名人数 + */ + private Integer signedUp; + + /** + * 报名截止时间 + */ + @JsonIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + + /** + * 报名开始时间 + */ + @JsonIgnore + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpStartTime; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/JoinedUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/JoinedUserResultDTO.java new file mode 100644 index 0000000000..821364850a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/JoinedUserResultDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 已结束-已参加人员列表 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 9:54 + */ +@Data +public class JoinedUserResultDTO implements Serializable { + private static final long serialVersionUID = 3120376299314043862L; + /** + * 主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * true已签到 false:未签到 + */ + private Boolean signInFlag; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 报名时间yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpTime; + + /** + * 积分说明,接口直接返回:积分+5 或者 积分+0 + */ + private String pointsDes; + + /** + * 活动奖励积分 + */ + @JsonIgnore + private Integer reward; + + /** + * 已给分:agree, 不给分:deny 默认"" + */ + @JsonIgnore + private String rewardFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java new file mode 100644 index 0000000000..89d5c1e4ec --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/LatestDraftActInfoResultDTO.java @@ -0,0 +1,169 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 获取最近一次编辑的活动-返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 21:54 + */ +@Data +public class LatestDraftActInfoResultDTO implements Serializable { + private static final long serialVersionUID = 4104775168048712734L; + /** + * 活动草稿id + */ + private String actDraftId; + /** + * 客户id + */ + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 报名开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpStartTime; + + /** + * 报名截止时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动预计开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 签到开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signInStartTime; + + /** + * 签到截止时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signInEndTime; + + /** + * 活动签到打卡地点 + */ + private String signInAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signInLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signInLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signInRadius; + + /** + * 活动名额类型(0-不限名额,1-固定名额) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 主办方类型:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Boolean volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Boolean auditSwitch; + + /** + * 活动内容- + */ + private List actContentList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ObtainedUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ObtainedUserResultDTO.java new file mode 100644 index 0000000000..05cf6e2674 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ObtainedUserResultDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 积分发放-已发放列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/26 18:43 + */ +@Data +public class ObtainedUserResultDTO implements Serializable { + private static final long serialVersionUID = 8187248601958392521L; + /** + * 给分或者不给分,重新处理入参用 + */ + private String actUserRelationId; + + /** + * 用户id + */ + private String userId; + + /** + * 活动id + */ + private String actId; + + /** + * 姓名 + */ + private String realName; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * true:是志愿者 false:不是志愿者 + */ + private Boolean volunteerFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PassedActUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PassedActUserResultDTO.java new file mode 100644 index 0000000000..52f8d2469b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PassedActUserResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.result.work; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 报名审核-已通过列表返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 15:12 + */ +@Data +public class PassedActUserResultDTO implements Serializable { + private static final long serialVersionUID = -3805973537303081543L; + /** + * act_user_relation主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 微信昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 报名时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 审核通过的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date auditTime; + + public PassedActUserResultDTO(){ + //微信基本信息先默认为空字符串 + this.setRealName(NumConstant.EMPTY_STR); + this.setNickName(NumConstant.EMPTY_STR); + this.setHeadImgUrl(NumConstant.EMPTY_STR); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PendingUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PendingUserResultDTO.java new file mode 100644 index 0000000000..d8f3837265 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PendingUserResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result.work; + +import com.epmet.commons.tools.constant.StrConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 积分发放-待处理列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 12:20 + */ +@Data +public class PendingUserResultDTO implements Serializable { + private static final long serialVersionUID = -5744298386442386198L; + /** + * 活动id + */ + private String actId; + + /** + * 活动标题 + */ + private String title; + + /** + * 积分奖励 + */ + private Integer reward; + + /** + * 已签到人员列表 + */ + private List signedInList; + + /** + * 未签到人员列表 + */ + private List noSignInList; + public PendingUserResultDTO(String actId){ + this.actId= actId; + this.title=StrConstant.EPMETY_STR; + this.reward=0; + this.signedInList=new ArrayList<>(); + this.noSignInList=new ArrayList<>(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java new file mode 100644 index 0000000000..08c3ff1d97 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActInitResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 17:49 + */ +@Data +public class PublishActInitResultDTO implements Serializable { + private static final long serialVersionUID = 6579531592586604405L; + /** + * true:存在正在编辑的活动 false 不存在 + */ + private Boolean existFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java new file mode 100644 index 0000000000..bc9c9549cd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/PublishActResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 发布活动-返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 18:29 + */ +@Data +public class PublishActResultDTO implements Serializable { + private static final long serialVersionUID = 4699176252192192495L; + /** + * 活动id + */ + private String actId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java new file mode 100644 index 0000000000..80f668afae --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java @@ -0,0 +1,151 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; +import java.util.List; + +/** + * 重新编辑-获取活动详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/27 11:14 + */ +@Data +public class ReEditActInfoResultDTO implements Serializable { + private static final long serialVersionUID = 512857031034752008L; + + /** + * 活动id + */ + private String actId; + + /** + * 活动标题 + */ + private String title; + + /** + * 封面图地址 + */ + private String coverPic; + + /** + * 活动地址 + */ + private String actAddress; + + /** + * 活动地址-经度 + */ + private BigDecimal actLongitude; + + /** + *活动地址-维度 + */ + private BigDecimal actLatitude; + /** + * 活动预计开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actStartTime; + + /** + * 活动预计结束时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date actEndTime; + + /** + * 活动人数 + */ + private Integer actQuota; + /** + * 活动积分 + */ + private Integer reward; + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Boolean volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Boolean auditSwitch; + + /** + * 报名截止时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signUpEndTime; + /** + * 报名条件 + */ + private String requirement; + + /** + * 打卡开始时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signInStartTime; + + /** + * 打卡签到截止时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signInEndTime; + + /** + * 活动签到打卡地点 + */ + private String signInAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signInLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signInLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signInRadius; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 发布名义:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 活动详情 + */ + private List actContent; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/RejectedActUserResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/RejectedActUserResultDTO.java new file mode 100644 index 0000000000..58d5f5c1cb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/RejectedActUserResultDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.result.work; + +import com.epmet.commons.tools.constant.NumConstant; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 报名审核-已拒绝列表 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 15:41 + */ +@Data +public class RejectedActUserResultDTO implements Serializable { + private static final long serialVersionUID = 2569855003833546409L; + /** + * act_user_relation主键 + */ + private String actUserRelationId; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 微信昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 报名时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date signUpTime; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; + + /** + * 审核不通过的时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date auditTime; + + /** + * 未通过原因 + */ + private String failureReason; + + public RejectedActUserResultDTO(){ + //微信基本信息先默认为空字符串 + this.setRealName(NumConstant.EMPTY_STR); + this.setNickName(NumConstant.EMPTY_STR); + this.setHeadImgUrl(NumConstant.EMPTY_STR); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java new file mode 100644 index 0000000000..248519fc28 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SaveActDraftResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 预览-保存活动草稿返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 12:53 + */ +@Data +public class SaveActDraftResultDTO implements Serializable { + private static final long serialVersionUID = -111427814347693729L; + + /** + * 活动草稿id + */ + private String actDraftId; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SponsorResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SponsorResultDTO.java new file mode 100644 index 0000000000..ee7006381f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/SponsorResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 20:23 + */ +@Data +public class SponsorResultDTO implements Serializable { + private static final long serialVersionUID = 2781093523201803701L; + /** + * 机关组织Id + */ + private String agencyId = ""; + /** + * 机关组织名称 + */ + private String agencyName = ""; + /** + * 机关下网格列表信息 + */ + private List agencyGridList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserBaseInfo.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserBaseInfo.java new file mode 100644 index 0000000000..b7ec382f5e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserBaseInfo.java @@ -0,0 +1,45 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 积分发放待处理界面,用户基本信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 12:22 + */ +@Data +public class UserBaseInfo implements Serializable { + private static final long serialVersionUID = 4316319460642833716L; + /** + * act_user_relation主键 + */ + private String actUserRelationId; + + /** + * 用户id + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 微信昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * true: 是志愿者 false : 不是志愿者 + */ + private Boolean volunteerFlag; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java new file mode 100644 index 0000000000..c4bbb1f100 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActInfoDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.result.work; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 历史活动列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 16:19 + */ +@Data +public class UserHistoricalActInfoDTO implements Serializable { + private static final long serialVersionUID = 3703921511083310251L; + /** + * 活动id + */ + private String actId; + /** + * 活动标题 + */ + private String title; + /** + * 活动地址 + */ + private String actAddress; + /** + * 签到时间yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private Date signInTime; + /** + * 服务时长单位120分钟 + */ + private Integer kindNessTime; + /** + * 可得积分 + */ + private Integer reward; + /** + * 正常发放:agree, 拒绝发放:deny + */ + private String rewardFlag; + /** + * 拒绝给分的理由 + */ + private String denyRewardReason; + + /** + * 已处理: handled; 默认"",重新处理时reward_flag置为空字符串 + */ + private String processFlag; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java new file mode 100644 index 0000000000..a6046ffd63 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/UserHistoricalActResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.result.work; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 16:15 + */ +@Data +public class UserHistoricalActResultDTO implements Serializable { + private static final long serialVersionUID = 7437428110692437615L; + /** + * 居民端用户id + */ + private String userId; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 昵称 + */ + private String nickName; + + /** + * 姓名 + */ + private String realName; + + /** + * 实际参加活动个数 + */ + private Integer signInActNum; + /** + * 报名活动个数 + */ + private Integer signUpActNum; + /** + * 获得积分活动个数 + */ + private Integer obtainPointsActNum; + + /** + *历史活动列表 + */ + private List actInfoList; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java new file mode 100644 index 0000000000..85a0f088e0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -0,0 +1,15 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:25 + */ +@FeignClient(name = ServiceConstant.EPMET_POINT_SERVER, fallback = EpmetHeartOpenFeignClientFallback.class) +public interface EpmetHeartOpenFeignClient { +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java new file mode 100644 index 0000000000..0dc4701b4b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.EpmetHeartOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/4 13:26 + */ +@Component +public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignClient { +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/Dockerfile b/epmet-module/epmet-heart/epmet-heart-server/Dockerfile new file mode 100644 index 0000000000..696964e45a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8090 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..f26cbd716e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-heart-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.1 + ports: + - "8111:8111" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml new file mode 100644 index 0000000000..8a981b9839 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-heart-server-prod + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-heart-server:0.0.1 + ports: + - "8111:8111" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/prod:/logs" + environment: + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 600M \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..7e11fabd04 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-heart-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-heart-server:0.0.1 + ports: + - "8111:8111" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml new file mode 100644 index 0000000000..52a56bea7c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -0,0 +1,235 @@ + + + 4.0.0 + 0.0.1 + + com.epmet + epmet-heart + 2.0.0 + + epmet-heart-server + jar + + + + com.epmet + epmet-heart-client + 2.0.0 + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + com.epmet + epmet-common-clienttoken + 2.0.0 + compile + + + com.epmet + gov-org-client + 2.0.0 + compile + + + com.epmet + epmet-user-client + 2.0.0 + compile + + + com.epmet + epmet-message-client + 2.0.0 + compile + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + dev + + true + + + 8111 + dev + + + + + + epmet_heart_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + false + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + test + + + 8111 + test + + + + + + epmet + elink@833066 + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + true + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + prod + + + 8111 + test + + + + + + epmet_heart_user + EpmEt-db-UsEr + + 0 + r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com + 6379 + EpmEtclOUdrEdIs!Q2w + + true + 192.168.11.180:8848 + bd205d23-e696-47be-b995-916313f86e99 + + + false + + + true + https://epmet-open.elinkservice.cn/api/epmetscan/api + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java new file mode 100644 index 0000000000..39fd7584e1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/EpmetHeartApplication.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * 模块 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class EpmetHeartApplication { + + public static void main(String[] args) { + SpringApplication.run(EpmetHeartApplication.class, args); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..1fcce2b65b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "heart"; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/SwaggerConfig.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/SwaggerConfig.java new file mode 100644 index 0000000000..262f1bc07b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/config/SwaggerConfig.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.config; + +import com.epmet.commons.tools.constant.Constant; +import io.swagger.annotations.ApiOperation; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.PathSelectors; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.ApiKey; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +import java.util.List; + +import static com.google.common.collect.Lists.newArrayList; + +/** + * Swagger配置 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Configuration +@EnableSwagger2 +public class SwaggerConfig implements WebMvcConfigurer { + + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .apiInfo(apiInfo()) + .select() + //加了ApiOperation注解的类,才生成接口文档 + .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) + .paths(PathSelectors.any()) + .build() + .directModelSubstitute(java.util.Date.class, String.class) + .securitySchemes(security()); + + } + + private ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("人人开源") + .description("模块接口文档") + .termsOfServiceUrl("https://www.renren.io") + .version("1.1.0") + .build(); + } + + private List security() { + return newArrayList( + new ApiKey(Constant.TOKEN_HEADER, Constant.TOKEN_HEADER, "header") + ); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java new file mode 100644 index 0000000000..c5387c8ce4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActConstant.java @@ -0,0 +1,164 @@ +package com.epmet.constant; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 20:21 + */ +public interface ActConstant { + /** + * 文本 + */ + String ACT_CONTENT_TYPE_TEXT = "text"; + + /** + * 图片 + */ + String ACT_CONTENT_TYPE_IMG="img"; + + /** + * (1)活动状态 + * act_info表中的status,已发布/报名中, + * 发布成功后自动赋值 + */ + String ACT_STATUS_PUBLISHED="published"; + + /** + * (2)活动状态 + * 活动已取消, + * 成功取消活动后,写入act_info表中的status, + */ + String ACT_STATUS_CANCELED="canceled"; + + /** + * (3)活动状态 + * 活动已结束 + * 活动后,写入act_info表中的status, + */ + String ACT_STATUS_FINISHED="finished"; + + /** + * 发布活动时,选择的主办方名义,已组织名义发布 + */ + String SPONSOR_AGENCY="agency"; + + /** + * 发布活动时,选择的主办方名义,已网格名义发布 + */ + String SPONSOR_GRID="grid"; + + /** + * act_operation_rec活动操作日志:取消活动 + */ + String ACT_OPER_TYPE_CANCEL="cancel"; + + /** + * act_operation_rec活动操作日志:发布活动 + */ + String ACT_OPER_TYPE_PUBLISH="publish"; + + /** + * act_operation_rec活动操作日志:结束活动 + */ + String ACT_OPER_TYPE_FINISH="finish"; + + /** + * act_operation_rec活动操作日志:重新发布活动 + */ + String ACT_OPER_TYPE_UPDATE="update"; + + /** + * (1)act_user_relation表的status:已报名/待审核auditing, + */ + String ACT_USER_STATUS_AUDITING="auditing"; + + /** + * (2)act_user_relation表的status:审核通过passed, + */ + String ACT_USER_STATUS_PASSED="passed"; + + /** + * (3)act_user_relation表的status:审核不通过refused + */ + String ACT_USER_STATUS_REFUSED="refused"; + + /** + * (4)act_user_relation表的status:取消报名canceled, + */ + String ACT_USER_STATUS_CANCELD="canceled"; + + /** + * (5)act_user_relation表的REWARD_FLAG:给积分agree + */ + String ACT_USER_STATUS_AGREE="agree"; + + /** + * (6)act_user_relation表的REWARD_FLAG:不给积分deny + */ + String ACT_USER_STATUS_DENY="deny"; + + /** + * (7)act_user_relation表的SIGN_IN_FLAG:已签到 + */ + String ACT_USER_STATUS_SIGNED_IN="signed_in"; + + /*act_user_log表:操作类型( + 已报名/待审核auditing, + 审核通过passed, + 审核不通过refused + 取消报名canceld, + )*/ + String ACT_USER_LOG_OPER_AUDITING="auditing"; + String ACT_USER_LOG_OPER_PASSED="passed"; + String ACT_USER_LOG_OPER_REFUSED="refused"; + String ACT_USER_LOG_OPER_CANCELD="canceled"; + + /** + * 审核通过类型:auto, manual + */ + String PASSEDTYPE_AUTO="auto"; + String PASSEDTYPE_MANUAL="manual"; + + /** + * (1)用户活动页面按钮控制:我要报名 + */ + String CURRENT_STATUS_USER_SIGN_UP = "sign_up"; + + /** + * (2)用户活动页面按钮控制:已报满 + */ + String CURRENT_STATUS_USER_ENOUGH = "enough"; + + /** + * (3)用户活动页面按钮控制:截止报名 + */ + String CURRENT_STATUS_USER_END_SIGN_UP = "end_sign_up"; + + /** + * (4)用户活动页面按钮控制:已开始 + */ + String CURRENT_STATUS_USER_IN_PROGRESS = "in_progress"; + + /** + * (5)用户活动页面按钮控制:已结束 + */ + String CURRENT_STATUS_USER_FINISHED = "finished"; + + /** + * (6)用户活动页面按钮控制:已取消 + */ + String CURRENT_STATUS_USER_CANCELED = "canceled"; + + /** + * (7)用户活动页面按钮控制:已确认积分 + */ + String CURRENT_STATUS_USER_POINTS_CONFIRM = "points_confirm"; + + /** + * act_user_rea + */ + String HANDLED="handled"; + + String RESET="reset"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java new file mode 100644 index 0000000000..e097fcd814 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActCustomizedConstant.java @@ -0,0 +1,40 @@ +package com.epmet.constant; + +/** + * 爱心互助自定义配置项 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 16:54 + */ +public interface ActCustomizedConstant { + + /** + * 标题:志愿者去哪儿 + */ + String TITLE_NAME = "志愿者去哪儿"; + + /** + * 咨询热线 + */ + String HOT_LINE = ""; + + /** + * 活动列表 + */ + String ACT_LIST_NAME = "活动列表"; + + /** + * 爱心榜 + */ + String HEART_RANK_NAME = "爱心榜"; + + /** + * 活动回顾 + */ + String ACT_REVIEW_NAME = "活动回顾"; + + /** + * 我的活动 + */ + String MY_ACT_NAME = "我的活动"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java new file mode 100644 index 0000000000..5fcbb51334 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java @@ -0,0 +1,43 @@ +package com.epmet.constant; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 17:55 + */ +public interface ActMessageConstant { + String TITLE="您有一条活动消息"; + /** + * 报名审核成功,给居民端用户发送消息 + */ + String AUDIT_PASSED="您报名的%s活动,已审核通过"; + /** + * 拒绝用户的报名,给居民端用户发送消息 + */ + String AUDIT_REFUSED="您报名的%s活动,审核未通过,原因:%s"; + /** + * 活动被取消,给已经通过审核的居民端用户,发送消息 + */ + String ACT_CANCELED="您报名的%s活动,已取消,原因:%s"; + + /** + * 发放积分(结束活动)时调用消息的备注 + */ + String ACT_POINTS_EVENT_REMARK="参与%s"; + + /** + * 居民端-用户认证志愿者,发送消息 + */ + String POINTS_EVENT_VOLUNTEER_AUTHENTICATE="用户%s,认证志愿者"; + + /** + * 居民端-添加实况,发送消息 + */ + String ACT_POINTS_EVENT_VOLUNTEER_LIVE="用户%s,添加活动实况,活动:%s"; + + /** + * 工作端-重新发布活动,通知待审核+已经审核通过的用户 + */ + String RE_PUBLISH_ACT="您好,您参与的%s活动,%s,请注意查看"; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java new file mode 100644 index 0000000000..a2ce0f1972 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ActCustomizedController.java @@ -0,0 +1,88 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.ActCustomizedFormDTO; +import com.epmet.dto.form.work.SaveActCustomizedFormDTO; +import com.epmet.dto.result.work.ActCustomizedResultDTO; +import com.epmet.dto.result.work.CustomerHeartConfigsResultDTO; +import com.epmet.service.ActCustomizedService; +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 generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@RestController +@RequestMapping("actcustomized") +public class ActCustomizedController { + + @Autowired + private ActCustomizedService actCustomizedService; + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 + * @Date 2020/7/20 15:42 + **/ + @PostMapping("getconfigs") + public Result getConfigs(@RequestBody ActCustomizedFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActCustomizedFormDTO.AddUserInternalGroup.class); + ActCustomizedResultDTO resultDTO=actCustomizedService.getConfigs(formDTO); + return new Result().ok(resultDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 保存自定义配置 + * @Date 2020/7/20 17:25 + **/ + @PostMapping("save") + public Result saveConfigs(@RequestBody SaveActCustomizedFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SaveActCustomizedFormDTO.AddUserShowGroup.class,SaveActCustomizedFormDTO.AddUserInternalGroup.class); + actCustomizedService.saveConfigs(formDTO); + return new Result(); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 居民端根据客户id获取爱心互助自定义配置 + * @Date 2020/7/21 12:47 + **/ + @PostMapping("/resi/getconfigs") + public Result getCustomerHeartConfigs(@RequestBody ActCustomizedFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ActCustomizedFormDTO.AddUserInternalGroup.class); + CustomerHeartConfigsResultDTO resultDTO = actCustomizedService.getCustomerHeartConfigs(formDTO); + return new Result().ok(resultDTO); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java new file mode 100644 index 0000000000..72f402337a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java @@ -0,0 +1,128 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.ActIdFormDTO; +import com.epmet.dto.form.work.GrantPointsFormDTO; +import com.epmet.dto.result.work.CanceledUserResultDTO; +import com.epmet.dto.result.work.DeniedUserResultDTO; +import com.epmet.dto.result.work.ObtainedUserResultDTO; +import com.epmet.dto.result.work.PendingUserResultDTO; +import com.epmet.service.GrantPointsService; +import com.epmet.service.WorkActUserService; +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; + +/** + * 工作端-积分发放api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/19 23:21 + */ +@RestController +@RequestMapping("grantpoints") +public class GrantPointsController { + @Autowired + private GrantPointsService grantPointsService; + @Autowired + private WorkActUserService workActUserService ; + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 积分发放-待处理列表 + * @Date 2020/7/24 12:28 + **/ + @PostMapping("pendinglist") + public Result queryPendingList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(grantPointsService.queryPendingList(formDTO.getActId())); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 积分发放-不给分 + * @Date 2020/7/24 13:14 + **/ + @PostMapping("deny") + public Result deny(@RequestBody GrantPointsFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.DenyUserShowGroup.class); + grantPointsService.deny(formDTO); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 积分发放-给分 + * @Date 2020/7/24 13:13 + **/ + @PostMapping("agree") + public Result agree(@RequestBody GrantPointsFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.AddUserInternalGroup.class); + grantPointsService.agree(formDTO); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 积分发放-重新处理 + * @Date 2020/7/24 15:16 + **/ + @PostMapping("reset") + public Result reset(@RequestBody GrantPointsFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.AddUserInternalGroup.class); + grantPointsService.reset(formDTO); + return new Result(); + } + + /** + * @param actIdFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 积分发放-已发放列表 + * @Date 2020/7/26 18:46 + **/ + @PostMapping("agreedlist") + public Result> agreedList(@RequestBody ActIdFormDTO actIdFormDTO) { + ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(grantPointsService.agreedList(actIdFormDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param actIdFormDTO + * @author yinzuomei + * @description 积分发放-已拒绝列表 + * @Date 2020/7/26 19:02 + **/ + @PostMapping("deniedlist") + public Result> deniedList(@RequestBody ActIdFormDTO actIdFormDTO){ + ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(grantPointsService.deniedList(actIdFormDTO)); + } + + /** + * @param actIdFormDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 积分发放-已取消报名列表 + * @Date 2020/7/26 19:19 + **/ + @PostMapping("canceleduserlist") + public Result> canceledUserList(@RequestBody ActIdFormDTO actIdFormDTO) { + ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActUserService.queryCanceledUserList(actIdFormDTO)); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java new file mode 100644 index 0000000000..29cde0e42b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java @@ -0,0 +1,312 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.resi.*; +import com.epmet.dto.result.resi.*; +import com.epmet.service.*; +import com.epmet.commons.tools.utils.Result; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * 居民端-活动相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/19 23:17 + */ +@RestController +@RequestMapping("/resi/act") +public class ResiActListController { + + @Autowired + private ActInfoService actInfoService; + + @Autowired + private ActUserRelationService actUserRelationService; + + @Autowired + private ActSummaryService actSummaryService; + + @Autowired + private ActLiveRecService actLiveRecService; + + @Autowired + private HeartUserInfoService heartUserInfoService; + + @Autowired + private ActSignInRecService actSignInRecService; + + /** + * 活动列表(包含状态:报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress; 已结束:finished;) + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("list") + public Result> listAct(@LoginUser TokenDto tokenDto, @RequestBody ResiActBaseFormDTO formDto) { + ValidatorUtils.validateEntity(formDto, ResiActBaseFormDTO.AddUserInternalGroup.class); + return actInfoService.listAct(tokenDto, formDto); + } + + + /** + * 我的活动-审核中 + * + * @param tokenDto + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + @PostMapping("list/auditing") + public Result> listAuditing(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { + ValidatorUtils.validateEntity(formDto, ResiMyActFormDTO.AddUserInternalGroup.class); + return actInfoService.myActListAuditing(tokenDto, formDto); + } + + /** + * 我的活动-未通过 + * + * @param tokenDto + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + @PostMapping("list/refused") + public Result> listRefused(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { + ValidatorUtils.validateEntity(formDto, ResiMyActFormDTO.AddUserInternalGroup.class); + return actInfoService.myActListRefused(tokenDto, formDto); + } + + /** + * 我的活动-已通过 + * + * @param tokenDto + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + @PostMapping("list/passed") + public Result> listPassed(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { + ValidatorUtils.validateEntity(formDto, ResiMyActFormDTO.AddUserInternalGroup.class); + return actInfoService.myActListPassed(tokenDto, formDto); + } + + /** + * 我的活动-已结束 + * + * @param tokenDto + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + @PostMapping("list/canceld") + public Result> listcanceld(@LoginUser TokenDto tokenDto, @RequestBody ResiMyActFormDTO formDto) { + ValidatorUtils.validateEntity(formDto, ResiMyActFormDTO.AddUserInternalGroup.class); + return actInfoService.myActListCanceld(tokenDto, formDto); + } + + /** + * 最新活动列表 + * + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + @PostMapping("list/latestact") + public Result> latestAct(@RequestBody ResiLatestActFormDTO formDto) { + ValidatorUtils.validateEntity(formDto, ResiLatestActFormDTO.AddUserInternalGroup.class); + return actInfoService.latestAct(formDto); + } + + /* + * 正在进行中的活动 + * 进入活动的快捷入口, 前端只取第一条 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:56 2020-07-21 + **/ + @PostMapping("inprogress") + public Result> inProgressAct(@LoginUser TokenDto tokenDto) { + return actInfoService.inProgressAct(tokenDto); + } + + /** + * 活动回顾列表(包含状态:已结束:finished;) + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("actlookback") + public Result> actLookBack(@RequestBody ResiActBaseFormDTO formDto) { + ValidatorUtils.validateEntity(formDto, ResiActBaseFormDTO.AddUserInternalGroup.class); + return actInfoService.actLookBack(formDto); + } + + // + + /** + * 活动详情 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("detail") + public Result detail(@LoginUser TokenDto tokenDto, @RequestBody ResiActDetailFormDTO formDto) { + ValidatorUtils.validateEntity(formDto, ResiActDetailFormDTO.AddUserInternalGroup.class); + return actInfoService.actDetail(tokenDto, formDto); + } + + /** + * 活动详情-未通过 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("rejectdetail") + public Result rejectDetail(@LoginUser TokenDto tokenDto, @RequestBody ResiActDetailFormDTO formDto) { + ValidatorUtils.validateEntity(formDto, ResiActDetailFormDTO.AddUserInternalGroup.class); + return actInfoService.rejectDetail(tokenDto, formDto); + } + + /** + * 活动详情-已结束-回顾稿 + * + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("summary/list") + public Result summaryList(@RequestBody ResiActContentFormDTO formDto) { + ValidatorUtils.validateEntity(formDto, ResiActContentFormDTO.AddUserInternalGroup.class); + return actSummaryService.summaryList(formDto); + } + + /** + * 活动详情-已结束-现场实况列表 + * + * @param map{actId:""} + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + @PostMapping("livereclist") + public Result liveRecList(@RequestBody Map map) { + return actLiveRecService.liveRecList(map); + } + + // + + /** + * 取消活动报名 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:29 2020-07-20 + **/ + @PostMapping("cancelsignup") + public Result cancelSignUp(@LoginUser TokenDto tokenDto, @RequestBody ResiActUserCancelSignUpFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ResiActUserCancelSignUpFormDTO.AddUserInternalGroup.class, ResiActUserCancelSignUpFormDTO.AddUserShowGroup.class); + return actUserRelationService.cancelSignUp(tokenDto, formDTO); + } + + /** + * 重新定位 + * 根据活动id、前端传的实时经纬度,与活动设置的经纬度相比较,判断用户是否已到达打卡地点 + * + * @param formDTO + * @return javax.xml.transform.Result + * @Author zhangyong + * @Date 16:48 2020-07-20 + **/ + @PostMapping("checksigninaddress") + public Result cancelSignUp(@RequestBody ResiActCaculateDistanceFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ResiActCaculateDistanceFormDTO.AddUserInternalGroup.class); + return actInfoService.checkSignInAddress(formDTO); + } + + /** + * 爱心榜 + * 显示报名参加过活动的用户/志愿者 + * 排序规则:按照爱心时长一致,按照参加次数排序 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 17:42 2020-07-22 + **/ + @PostMapping("leaderboard") + public Result> leaderboard(@RequestBody ResiActBaseFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ResiActBaseFormDTO.AddUserInternalGroup.class); + return heartUserInfoService.leaderboard(formDTO); + } + + /** + * 活动-添加实况 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:29 2020-07-23 + **/ + @PostMapping("insertlive") + public Result insertLive(@LoginUser TokenDto tokenDto, @RequestBody ResiActInsertLiveFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ResiActInsertLiveFormDTO.AddUserInternalGroup.class, ResiActInsertLiveFormDTO.AddUserShowGroup.class); + Result result = actLiveRecService.insertLive(tokenDto, formDTO); + return new Result(); + } + + /** + * 活动-签到 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:29 2020-07-23 + **/ + @PostMapping("signin") + public Result actSignIn(@LoginUser TokenDto tokenDto, @RequestBody ResiActSignInFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ResiActSignInFormDTO.AddUserInternalGroup.class, ResiActSignInFormDTO.AddUserShowGroup.class); + return actSignInRecService.actSignIn(tokenDto, formDTO); + } + + /** + * 活动报名 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 16:46 2020-07-23 + **/ + @PostMapping("registration") + public Result registration(@LoginUser TokenDto tokenDto, @RequestBody ResiActRegistrationFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ResiActRegistrationFormDTO.AddUserInternalGroup.class); + return actUserRelationService.registration(tokenDto, formDTO); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java new file mode 100644 index 0000000000..a2768b99bd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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, ResiVolunteerAuthenticateFormDTO.AddUserInternalGroup.class, ResiVolunteerAuthenticateFormDTO.AddUserShowGroup.class); + return volunteerInfoService.authenticate(tokenDto, formDTO); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java new file mode 100644 index 0000000000..a7ddd79e3b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/TestController.java @@ -0,0 +1,62 @@ +package com.epmet.controller; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SendMqMsgUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.Map; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/8 11:03 + */ +@RestController +@RequestMapping("demo") +public class TestController { + private Logger logger = LogManager.getLogger(TestController.class); + @Autowired + private LoginUserUtil loginUserUtil; + + @GetMapping("test") + public Result test(@LoginUser TokenDto tokenDto) { + Map map = new HashMap<>(); + String userId = loginUserUtil.getLoginUserId(); + map.put("TokenDto", tokenDto); + map.put("userId", userId); + return new Result().ok(map); + } + + @PostMapping("sendPointMsg") + public Result sendPointEvent(@RequestBody MqBaseMsgDTO mqBaseMsgDTO) { + Result result = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + logger.info("param:{},reult:{}", mqBaseMsgDTO, result); + return result; + } + + public static void main(String[] args) { + String url = "https://epmet-dev.elinkservice.cn/estos/producerService/producer/sendMsg"; + Map msgInfo = new HashMap(6); + msgInfo.put("appId", "202007161443499985fa2d397436d10356542134c8f008c48"); + //msgInfo.put("appName", "党群e事通开发测试"); + msgInfo.put("eventClass", "epmet_heart"); + msgInfo.put("eventTag", "active_send_point"); + msgInfo.put("msg", "我是消息体"); + //msgInfo.put("msgId", "123456"); + msgInfo.put("token", "52d9d9b0e7d0eb5b8b81c205b579e07c"); + String jsonStrParam = JSON.toJSONString(msgInfo); + Result result = HttpClientManager.getInstance().sendPostByHttps(url, jsonStrParam); + System.out.println("result:" + result + "param:" + jsonStrParam); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java new file mode 100644 index 0000000000..8501fb6ac8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java @@ -0,0 +1,243 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.*; +import com.epmet.dto.result.work.*; +import com.epmet.service.WorkActService; +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; + +/** + * 工作端-发布活动相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/19 23:17 + */ +@RestController +@RequestMapping("/work/act") +public class WorkActController { + @Autowired + private WorkActService workActService; + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 发布活动-删除历史活动草稿 + * @Date 2020/7/20 18:15 + **/ + @PostMapping("deletedraft") + public Result deleteDraft(){ + workActService.deleteDraft(); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 活动主办方 + * @Date 2020/7/23 20:37 + **/ + @PostMapping("sponsorlist") + public Result querySponsorList(){ + return new Result().ok(workActService.querySponsorList()); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 发布活动 + * @Date 2020/7/21 18:32 + **/ + @PostMapping("publish") + public Result publishAct(@RequestBody PublishActInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class); + for (PublishActContentFormDTO actContentFormDTO : formDTO.getActContent()) { + ValidatorUtils.validateEntity(actContentFormDTO, + PublishActContentFormDTO.UserShowGroup.class, + PublishActContentFormDTO.UserInternalGroup.class + ); + } + return new Result().ok(workActService.publishAct(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 进行中活动列表 + * @Date 2020/7/23 21:24 + **/ + @PostMapping("inprogresslist") + public Result> queryInProgressList(@RequestBody ActListCommonFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActService.queryInProgressList(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 已取消-活动列表 + * @Date 2020/7/23 23:11 + **/ + @PostMapping("canceledlist") + public Result> queryCanceledlist(@RequestBody ActListCommonFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActService.queryCanceledList(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 已结束-活动列表 + * @Date 2020/7/23 23:21 + **/ + @PostMapping("finishedlist") + public Result> queryFinishedList(@RequestBody ActListCommonFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ActListCommonFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActService.queryFinishedList(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 取消活动 + * @Date 2020/7/26 17:26 + **/ + @PostMapping("cancelact") + public Result cancelAct(@RequestBody CancelActFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,CancelActFormDTO.UserShowGroup.class,CancelActFormDTO.AddUserInternalGroup.class); + workActService.cancelAct(formDTO); + return new Result(); + } + + /** + * @param actIdFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 已取消-活动详情 + * @Date 2020/7/26 18:00 + **/ + @PostMapping("canceleddetail") + public Result canceledDetail(@RequestBody ActIdFormDTO actIdFormDTO) { + ValidatorUtils.validateEntity(actIdFormDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActService.canceledDetail(actIdFormDTO.getActId())); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 已结束-保存活动实际开始结束时间 + * @Date 2020/7/26 19:48 + **/ + @PostMapping("saveactualtime") + public Result saveActualTime(@RequestBody SaveActualTimeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SaveActualTimeFormDTO.UserShowGroup.class, + SaveActualTimeFormDTO.AddUserInternalGroup.class); + workActService.saveActualTime(formDTO); + return new Result(); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 已结束-活动详情 + * @Date 2020/7/26 21:01 + **/ + @PostMapping("finisheddeatil") + public Result finishedDeatil(@RequestBody ActIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActService.finishedDeatil(formDTO)); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 进行中-活动详情 + * @Date 2020/7/26 21:33 + **/ + @PostMapping("inprogressdetail") + public Result inProgressDetail(@RequestBody ActIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActService.inProgressDetail(formDTO.getActId())); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 已结束-确认结束活动 + * @Date 2020/7/26 21:48 + **/ + @PostMapping("finishact") + public Result finishAct(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + workActService.finishAct(formDTO.getActId()); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 保存添加回顾 + * @Date 2020/7/27 10:45 + **/ + @PostMapping("summaryact") + public Result summaryAct(@RequestBody SummaryActFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SummaryActFormDTO.AddUserInternalGroup.class); + if(null!=formDTO.getActContent()&&formDTO.getActContent().size()>0){ + ValidatorUtils.validateEntity(formDTO.getActContent(), SummaryActFormDTO.AddUserShowGroup.class); + } + workActService.summaryAct(formDTO); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 重新编辑-获取活动详情 + * @Date 2020/7/27 13:36 + **/ + @PostMapping("getactinfo") + public Result getActInfo(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActService.getActInfo(formDTO.getActId())); + } + + /** + * @param rePublishFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 重新发布活动 + * @Date 2020/7/27 13:55 + **/ + @PostMapping("republish") + public Result rePublish(@RequestBody RePublishFormDTO rePublishFormDTO) { + ValidatorUtils.validateEntity(rePublishFormDTO, RePublishFormDTO.AddUserShowGroup.class, RePublishFormDTO.AddUserInternalGroup.class); + for (PublishActContentFormDTO actContentFormDTO : rePublishFormDTO.getActContent()) { + ValidatorUtils.validateEntity(actContentFormDTO, + PublishActContentFormDTO.UserShowGroup.class, + PublishActContentFormDTO.UserInternalGroup.class + ); + } + return new Result().ok(workActService.rePublish(rePublishFormDTO)); + } + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java new file mode 100644 index 0000000000..e960a2f926 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActDraftController.java @@ -0,0 +1,91 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.*; +import com.epmet.dto.result.work.*; +import com.epmet.service.WorkActDraftService; +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 yinzuomei@elink-cn.com + * @date 2020/7/19 23:18 + */ +@RestController +@RequestMapping("/work/actdraft") +public class WorkActDraftController { + @Autowired + private WorkActDraftService workActDraftService; + + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 发布活动初始化 + * @Date 2020/7/20 17:51 + **/ + @PostMapping("publishactinit") + public Result publishActInit(){ + PublishActInitResultDTO initResultDTO=workActDraftService.publishActInit(); + return new Result().ok(initResultDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 获取最近一次编辑的活动,用户选择继续编辑上次的活动 + * @Date 2020/7/20 21:56 + **/ + @PostMapping("latestdraft") + public Result getLatestDraft(){ + LatestDraftActInfoResultDTO resultDTO=workActDraftService.getLatestDraft(); + return new Result().ok(resultDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 预览按下-调用此接口保存活动信息、活动内容 + * @Date 2020/7/21 14:00 + **/ + @PostMapping("saveact") + public Result saveAct(@RequestBody DraftActInfoFormDTO formDTO){ + //起码客户id不能为空 + ValidatorUtils.validateEntity(formDTO,DraftActInfoFormDTO.AddUserInternalGroup.class); + //如果录入了活动内容,需要校验 content、contentType + if (null != formDTO.getActContent() && formDTO.getActContent().size() > 0) { + for(DraftActContentFormDTO actContentFormDTO:formDTO.getActContent()){ + ValidatorUtils.validateEntity(actContentFormDTO, + DraftActContentFormDTO.UserShowGroup.class, + DraftActContentFormDTO.UserInternalGroup.class + ); + } + } + SaveActDraftResultDTO resultDTO=workActDraftService.saveAct(formDTO); + return new Result().ok(resultDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:24 + **/ + @PostMapping("preview") + public Result previewActDetail(@RequestBody ActPreviewFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,ActPreviewFormDTO.UserInternalGroup.class); + ActPreviewResultDTO resultDTO=workActDraftService.previewActDetail(formDTO); + return new Result().ok(resultDTO); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java new file mode 100644 index 0000000000..59769d69b9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java @@ -0,0 +1,174 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.work.*; +import com.epmet.dto.result.work.*; +import com.epmet.service.WorkActUserService; +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; + +/** + * 工作端:活动人员相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/19 23:16 + */ +@RestController +@RequestMapping("/work/actuser") +public class WorkActUserController { + + @Autowired + private WorkActUserService workActUserService; + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 报名审核-待审核列表 + * @Date 2020/7/21 22:24 + **/ + @PostMapping("auditinglist") + public Result> getAuditingList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActUserService.getAuditingList(formDTO)); + } + + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 报名审核-已通过列表 + * @Date 2020/7/22 15:16 + **/ + @PostMapping("passedlist") + public Result> getPassedList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActUserService.getPassedList(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 报名审核-已拒绝列表 + * @Date 2020/7/22 15:49 + **/ + @PostMapping("rejectedlist") + public Result> getRejectedlist(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActUserService.getRejectedlist(formDTO)); + } + + /** + * @return + * @param formDTO + * @author yinzuomei + * @description 报名审核-已取消报名列表 + * @Date 2020/7/22 16:23 + **/ + @PostMapping("canceledlist") + public Result> getCanceledList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActUserService.getCanceledList(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 报名审核-概要统计 + * @Date 2020/7/22 16:43 + **/ + @PostMapping("signupstat") + public Result getActSignUpStat(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActUserService.getActSignUpStat(formDTO.getActId())); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 报名审核-人员详情(待审核、已通过,已拒绝,已取消报名用的是一个api) + * @Date 2020/7/22 22:44 + **/ + @PostMapping("userdetail") + public Result queryAuditingUserDetail(@RequestBody AactUserDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AactUserDetailFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActUserService.queryAuditingUserDetail(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 报名审核-人员历史活动情况 + * @Date 2020/7/23 16:12 + **/ + @PostMapping("historicalact") + public Result queryUserHistoricalAct(@RequestBody UserHistoricalActFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, UserHistoricalActFormDTO.AddUserInternalGroup.class); + return new Result().ok(workActUserService.queryUserHistoricalAct(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 报名审核-审核通过 + * @Date 2020/7/23 17:31 + **/ + @PostMapping("auditpass") + public Result auditPass(@RequestBody AuditUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.AddUserInternalGroup.class); + workActUserService.auditPass(formDTO.getActUserRelationId()); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 报名审核-拒绝报名 + * @Date 2020/7/23 18:08 + **/ + @PostMapping("auditrefuse") + public Result auditrefuse(@RequestBody AuditUserFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.RefusedUserShowGroup.class); + workActUserService.auditRefuse(formDTO); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 已结束-已参加人员列表 + * @Date 2020/7/24 10:17 + **/ + @PostMapping("joinuserlist") + public Result> queryJoinUserList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActUserService.queryJoinUserList(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 已结束-已取消报名人员列表 + * @Date 2020/7/24 10:53 + **/ + @PostMapping("canceleduserlist") + public Result> queryCanceledUserList(@RequestBody ActIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class); + return new Result>().ok(workActUserService.queryCanceledUserList(formDTO)); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java new file mode 100644 index 0000000000..8ff05abcde --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActContentDao.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.work.ActPreviewContentResultDTO; +import com.epmet.entity.ActContentEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActContentDao extends BaseDao { + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 根据活动id查询活动详情 + * @Date 2020/7/26 18:26 + **/ + List selectByActId(String actId); + + /** + * @return int + * @param actId + * @author yinzuomei + * @description 根据活动id,将原来的活动详情删除,del_flag=1 + * @Date 2020/7/27 14:06 + **/ + int updateDelFlagByActId(String actId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java new file mode 100644 index 0000000000..440c2cb81f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActCustomizedDao.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.work.ActCustomizedResultDTO; +import com.epmet.dto.result.work.CustomerHeartConfigsResultDTO; +import com.epmet.entity.ActCustomizedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActCustomizedDao extends BaseDao { + + /** + * @param customerId + * @return com.epmet.dto.result.work.ActCustomizedResultDTO + * @author yinzuomei + * @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 + * @Date 2020/7/20 17:04 + **/ + ActCustomizedResultDTO selectConfigsByCustomerId(String customerId); + + /** + * @return com.epmet.dto.result.work.CustomerHeartConfigsResultDTO + * @param customerId + * @author yinzuomei + * @description 居民端根据客户id获取爱心互助自定义配置 + * @Date 2020/7/21 12:48 + **/ + CustomerHeartConfigsResultDTO selectCustomerHeartConfigs(String customerId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java new file mode 100644 index 0000000000..ce0d39cb16 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -0,0 +1,300 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.form.resi.ResiActBaseFormDTO; +import com.epmet.dto.form.resi.ResiActDetailFormDTO; +import com.epmet.dto.form.resi.ResiLatestActFormDTO; +import com.epmet.dto.form.resi.ResiMyActFormDTO; +import com.epmet.dto.result.resi.*; +import com.epmet.dto.result.work.*; +import com.epmet.entity.ActInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActInfoDao extends BaseDao { + + /** + * 活动列表 - 报名中(未报满) - signing_up + * 列表排序第一组 无分页 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListActSigningUp(ResiActBaseFormDTO formDTO); + + /** + * 活动列表 - (报名中),已报满 - enough + * 列表排序第二组 无分页 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListActQuotaIsEnough(ResiActBaseFormDTO formDTO); + + /** + * 活动列表 - 截止报名 - end_sign_up + * 列表排序第三组 无分页 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListActEndSignUp(ResiActBaseFormDTO formDTO); + + /** + * 活动列表 - 已开始 - in_progress + * 列表排序第四组 无分页 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListActInProgress(ResiActBaseFormDTO formDTO); + + /** + * 活动列表 - 已结束 - finished + * 列表排序第四无组 分页 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListActFinished(ResiActBaseFormDTO formDTO); + // 活动列表End + + /** + * 我的活动-审核中 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-20 + **/ + List selectListMyActAuditing(ResiMyActFormDTO formDTO); + + /** + * 我的活动-审核不通过 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-20 + **/ + List selectListActRefused(ResiMyActFormDTO formDTO); + + /** + * 我的活动-已通过 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-20 + **/ + List selectListMyActIHavePassed(ResiMyActFormDTO formDTO); + + /** + * 我的活动-已结束 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-20 + **/ + List selectListMyActCanceld(ResiMyActFormDTO formDTO); + // 我的活动End + + /** + * 最新活动列表(未结束的、未取消的活动) + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListLatestAct(ResiLatestActFormDTO formDTO); + + /** + * 即将进行/正在进行中的活动 + * 进入活动的快捷入口,滚动显示 当前用户正在(或将要)进行的一条活动 + * 活动开始前1小时,此处展示:您报名的“情暖夕阳,爱在锦水”的活动还有xx分钟开始。 + * 活动开始后显示:正在进行中的活动:“情暖夕阳。。。 + * + * @param userId + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListInProgress(@Param("userId") String userId); + + /** + * 活动回顾列表 + * 已结束的活动,并且有实况或有回顾 + * 按照时间顺序排序 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 11:00 2020-07-20 + **/ + List selectListLookBackAct(ResiActBaseFormDTO formDTO); + + /** + * 根据活动id、用户id 查询用户报名的活动信息 + * + * @param actId + * @param userId + * @return com.epmet.dto.ActInfoDTO + * @Author zhangyong + * @Date 17:39 2020-07-20 + **/ + ActInfoDTO queryActAccordingToActIdAndUserId(@Param("actId") String actId, @Param("userId") String userId); + + /** + * @return com.epmet.dto.result.work.ActSignUpStatResultDTO + * @param actId + * @author yinzuomei + * @description 报名审核-概要统计:活动基本信息 + * @Date 2020/7/22 17:08 + **/ + ActSignUpStatResultDTO getActSignUpStat(String actId); + + /** + * 活动详情 + * + * @param formDto + * @return com.epmet.dto.result.resi.ResiActDetailResultDTO + * @Author zhangyong + * @Date 09:20 2020-07-22 + **/ + ResiActDetailResultDTO selectActInfoDetail(ResiActDetailFormDTO formDto); + + /** + * 活动详情-未通过 + * + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + ResiActRefusedDetailResultDTO selectActRejectDetail(ResiActDetailFormDTO formDto); + + /** + * 从活动内容表,查询活动内容 + * + * @param actId + * @return java.util.List + * @Author zhangyong + * @Date 09:56 2020-07-22 + **/ + List selectListActContent(@Param("actId") String actId); + + /** + * 查询当前报名的活动开始时间-结束时间,是否与其他已报名,未结束的活动,存在交集情况 + * + * @param actInfoDTO + * @return java.lang.Integer + * @Author zhangyong + * @Date 17:17 2020-07-23 + **/ + Integer checkActTime(ActInfoDTO actInfoDTO); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 查询正在进行中的活动列表 + * @Date 2020/7/23 21:58 + **/ + List selectInprogress(String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 已取消-活动列表 + * @Date 2020/7/23 23:13 + **/ + List selectCanceledList(String customerId); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 已结束-活动列表 + * @Date 2020/7/23 23:21 + **/ + List selectFinishedList(String customerId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 已结束-已参加人员列表 + * @Date 2020/7/24 10:18 + **/ + List queryJoinUserList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 已结束-已取消报名人员列表 + * @Date 2020/7/24 10:55 + **/ + List queryCanceledUserList(String actId); + + /** + * @return com.epmet.dto.result.work.CanceledActDetailResultDTO + * @param actId + * @author yinzuomei + * @description 工作端-查询已取消活动详情 + * @Date 2020/7/26 18:29 + **/ + CanceledActDetailResultDTO selectCanceledActInfo(String actId); + + /** + * @return com.epmet.dto.result.work.FinishedActDetailResultDTO + * @param actId + * @author yinzuomei + * @description 已结束-活动详情 + * @Date 2020/7/26 21:04 + **/ + FinishedActDetailResultDTO selectFinishedDetail(String actId); + + /** + * @return com.epmet.dto.result.work.InProgressActDetailResultDTO + * @param actId + * @author yinzuomei + * @description 进行中-活动详情 + * @Date 2020/7/26 21:35 + **/ + InProgressActDetailResultDTO selectInProgressDetail(String actId); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLivePicDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLivePicDao.java new file mode 100644 index 0000000000..1976a5320d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLivePicDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActLivePicEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActLivePicDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java new file mode 100644 index 0000000000..ce9999af87 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActLiveRecDao.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ActLivePicDTO; +import com.epmet.dto.ActLiveRecDTO; +import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; +import com.epmet.entity.ActLiveRecEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActLiveRecDao extends BaseDao { + + /** + * 根据活动id,查询活动下的所有活动实况 + * + * @param actId + * @return java.util.List + * @Author zhangyong + * @Date 16:27 2020-07-22 + **/ + List selectListActLives(@Param("actId") String actId); + + /** + * 根据实况id,查询每条实况对应的多张图片 + * + * @param liveIds + * @return java.util.List + * @Author zhangyong + * @Date 17:04 2020-07-22 + **/ + List selectListActLiveImg(@Param("liveId") List liveIds); + + /** + * 插入活动实况表 + * + * @param formDTO + * @return void + * @Author zhangyong + * @Date 18:05 2020-07-24 + **/ + void insertActLiveRec(ResiActInsertLiveFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActOperationRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActOperationRecDao.java new file mode 100644 index 0000000000..6a6c4357af --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActOperationRecDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActOperationRecEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActOperationRecDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActPointLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActPointLogDao.java new file mode 100644 index 0000000000..9d6298581c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActPointLogDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActPointLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActPointLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInPicDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInPicDao.java new file mode 100644 index 0000000000..ddf3ca56ec --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInPicDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActSignInPicEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActSignInPicDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.java new file mode 100644 index 0000000000..ca383df81f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSignInRecDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ActSignInRecDTO; +import com.epmet.dto.form.resi.ResiActSignInFormDTO; +import com.epmet.entity.ActSignInRecEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActSignInRecDao extends BaseDao { + + /** + * 插入活动签到记录表 + * + * @param dto + * @return void + * @Author zhangyong + * @Date 18:05 2020-07-24 + **/ + void insertActSignInRec(ActSignInRecDTO dto); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActStatisticalDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActStatisticalDao.java new file mode 100644 index 0000000000..ac052c4eae --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActStatisticalDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ActStatisticalEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActStatisticalDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java new file mode 100644 index 0000000000..cb4993d0b0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActSummaryDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.resi.ResiActContentFormDTO; +import com.epmet.dto.result.resi.ResiActSummaryResultDTO; +import com.epmet.entity.ActSummaryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActSummaryDao extends BaseDao { + + /** + * 活动详情-已结束-回顾稿 + * + * @param formDto + * @return com.epmet.dto.result.resi.ResiActSummaryResultDTO + * @Author zhangyong + * @Date 15:11 2020-07-22 + **/ + ResiActSummaryResultDTO selectListSummary(ResiActContentFormDTO formDto); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java new file mode 100644 index 0000000000..348a259dde --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserLogDao.java @@ -0,0 +1,64 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ActUserLogDTO; +import com.epmet.entity.ActUserLogEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActUserLogDao extends BaseDao { + + /** + * @return java.lang.Integer + * @param actId + * @param userId + * @author yinzuomei + * @description 被拒绝的总次数 + * @Date 2020/7/23 14:13 + **/ + Integer selectRefusedCount(@Param("actId") String actId, @Param("userId") String userId); + + /** + * @return com.epmet.dto.ActUserLogDTO + * @param actId + * @param userId + * @author yinzuomei + * @description 最后被拒绝的记录 + * @Date 2020/7/23 14:13 + **/ + ActUserLogDTO selectLatestRefused(@Param("actId") String actId, @Param("userId") String userId); + + /** + * 查询我累计【报名过】的活动次数 + * + * @param userId + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:12 2020-07-23 + **/ + Integer countActTimesOfParticipation(@Param("userId") String userId); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java new file mode 100644 index 0000000000..46affbe03e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActUserRelationDao.java @@ -0,0 +1,209 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.result.work.DeniedUserResultDTO; +import com.epmet.dto.result.work.ObtainedUserResultDTO; +import com.epmet.dto.result.work.UserHistoricalActInfoDTO; +import com.epmet.entity.ActUserRelationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface ActUserRelationDao extends BaseDao { + + /** + * @param actId 活动id + * @return java.util.List + * @author yinzuomei + * @description 根据活动id,当前状态(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld,)查询待审核人员关系记录 + * @Date 2020/7/21 22:41 + **/ + List selecUserList(@Param("actId") String actId,@Param("status") String status); + + /** + * @param actId 活动id + * @return java.util.List + * @author yinzuomei + * @description 根据活动id,当前状态(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld,)返回用户id集合 + * @Date 2020/7/21 22:45 + **/ + List selectUserIdList(@Param("actId") String actId,@Param("status") String status); + + /** + * @return java.lang.Integer + * @param actId + * @param status + * @author yinzuomei + * @description 根据活动id, 用户状态,统计用户数eg:待审核总数,审核通过总数,已拒绝总数,已取消报名总数 + * @Date 2020/7/22 18:20 + **/ + Integer selectCountUser(@Param("actId") String actId, @Param("status")String status); + + /** + * 根据活动id,查询活动已报名的人数 + * + * @param actId + * @return Integer + * @Author zhangyong + * @Date 10:51 2020-07-22 + **/ + Integer selectActSignupNum(@Param("actId") String actId); + + /** + * 根据用户id和活动id,修改 用户活动关系表 + * + * @param userRelationDTO + * @return void + * @Author zhangyong + * @Date 14:39 2020-07-22 + **/ + void updateUserRelationByActIdAndUserId(ActUserRelationDTO userRelationDTO); + + /** + * @return java.lang.Integer + * @param userId + * @author yinzuomei + * @description 实际参加活动个数(已经签到的) + * @Date 2020/7/23 15:56 + **/ + Integer countSignInActNum(String userId); + + /** + * @return java.lang.Integer + * @param userId + * @author yinzuomei + * @description 报名活动个数(act_user_realation) + * @Date 2020/7/23 15:57 + **/ + Integer countSignUpActNum(String userId); + + /** + * @return java.lang.Integer + * @param userId + * @author yinzuomei + * @description 获得积分活动个数 + * @Date 2020/7/23 15:57 + **/ + Integer countObtainPointsActNum(String userId); + + /** + * @return java.util.List + * @param userId + * @author yinzuomei + * @description 根据userId,查询参与活动记录 + * @Date 2020/7/23 16:46 + **/ + List selectAllByUserId(String userId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 查询待处理的记录 + * @Date 2020/7/24 13:02 + **/ + List selectInProgress(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 查询待处理的人员id集合 + * @Date 2020/7/24 13:02 + **/ + List selectInProgressUserIds(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 积分发放-已发放列表 + * @Date 2020/7/26 18:48 + **/ + List selectAgreedList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 积分发放-已拒绝列表 + * @Date 2020/7/26 19:11 + **/ + List selectDeniedList(String actId); + + /** + * @return java.lang.Integer + * @param actId + * @author yinzuomei + * @description 活动已签到人数 + * @Date 2020/7/26 22:34 + **/ + Integer selectCountSinedIn(String actId); + + /** + * @return java.lang.Integer + * @param actId + * @param rewardFlag + * @author yinzuomei + * @description 查询发放积分的总人数、拒绝发放积分的总人数 + * @Date 2020/7/26 22:38 + **/ + Integer selectCountByReward(@Param("actId") String actId, @Param("rewardFlag")String rewardFlag); + + /** + * 取消报名 + * 根据用户id和活动id,删除 用户活动关系表中,用户的报名记录 + * + * @param entity + * @return void + * @Author zhangyong + * @Date 14:39 2020-07-22 + **/ + void delSignUpRecord(ActUserRelationEntity entity); + + /** + * 当前用户是否曾报名参加过该活动 + * + * @param actId + * @param userId + * @return java.lang.Integer + * @Author zhangyong + * @Date 14:35 2020-07-27 + **/ + Integer selectCountByActIdAndUserId(@Param("actId") String actId, @Param("userId")String userId); + + /** + * @return java.util.List + * @param actId 活动id + * @author yinzuomei + * @description 根据活动id,查询待审核+已经审核通过的人员 + * @Date 2020/7/27 14:59 + **/ + List selectAuditingAndPassedList(String actId); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java new file mode 100644 index 0000000000..5e0bfb3785 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/HeartUserInfoDao.java @@ -0,0 +1,79 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.HeartUserInfoDTO; +import com.epmet.dto.form.resi.ResiActBaseFormDTO; +import com.epmet.entity.HeartUserInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface HeartUserInfoDao extends BaseDao { + + /** + * @return com.epmet.dto.HeartUserInfoDTO + * @param userId + * @author yinzuomei + * @description 根据用户id查询爱心用户记录 + * @Date 2020/7/21 22:48 + **/ + HeartUserInfoDTO selectByUserId(String userId); + + + /** + * 查询用户是否是志愿者:1是志愿者,0不是志愿者 + * + * @param userId + * @return java.lang.Boolean + * @Author zhangyong + * @Date 13:53 2020-07-22 + **/ + Boolean selectUserVolunteerFlag(@Param("userId") String userId); + + /** + * 爱心榜 + * 显示报名参加过活动的用户/志愿者 + * 排序规则:按照爱心时长一致,按照参加次数排序 + * + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 18:06 2020-07-22 + **/ + List selectListLeaderboard(ResiActBaseFormDTO formDTO); + + /** + * 根据用户id,修改用户信息表 + * + * @param dto + * @return void + * @Author zhangyong + * @Date 16:27 2020-07-23 + **/ + void updateHeartUserInfoByUserId(HeartUserInfoDTO dto); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java new file mode 100644 index 0000000000..acf7fe8557 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActContentDao.java @@ -0,0 +1,72 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; +import com.epmet.dto.result.work.ActPreviewContentResultDTO; +import com.epmet.entity.LatestActContentEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface LatestActContentDao extends BaseDao { + + /** + * @return int + * @param actId + * @author yinzuomei + * @description 根据活动id, 删除活动内容 + * @Date 2020/7/20 18:35 + **/ + int updateToDelByActId(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 根据latest_act_info.id查询活动内容,已排序 + * @Date 2020/7/20 23:01 + **/ + List selectActContentList(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 18:07 + **/ + List previewActContent(String actId); + + /** + * @return int + * @param actId + * @author yinzuomei + * @description 根据活动id删除活动详情 物理删除 + * @Date 2020/7/24 16:08 + **/ + int deleteByActId(String actId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java new file mode 100644 index 0000000000..caf1adf16f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActInfoDao.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.work.ActPreviewResultDTO; +import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.entity.LatestActInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface LatestActInfoDao extends BaseDao { + + /** + * @param userId + * @return java.lang.Integer + * @author yinzuomei + * @description 查询当前用户保留的活动记录 + * @Date 2020/7/20 18:06 + **/ + Integer countByUserId(String userId); + + /** + * @param userId + * @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO + * @author yinzuomei + * @description 获取用户最近一次编辑的活动信息 + * @Date 2020/7/20 23:05 + **/ + LatestDraftActInfoResultDTO selectLatestActDraft(String userId); + + /** + * @return com.epmet.dto.result.work.ActPreviewResultDTO + * @param actDraftId + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:56 + **/ + ActPreviewResultDTO previewActInfo(String actDraftId); + + /** + * @return int + * @param id + * @author yinzuomei + * @description 逻辑删除表记录 + * @Date 2020/7/27 17:10 + **/ + int updateToDelById(String id); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java new file mode 100644 index 0000000000..5ceec37857 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/VolunteerInfoDao.java @@ -0,0 +1,55 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.VolunteerInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface VolunteerInfoDao extends BaseDao { + + /** + * 查询用户是否是志愿者身份 + * >0 是 + * 0 不是 + * + * @param userId + * @return java.lang.String + * @Author zhangyong + * @Date 14:33 2020-07-23l + **/ + Integer queryVolunteerFlagByUserId(@Param("userId") String userId); + + /** + * 根据用户ID,修改志愿者信息 + * + * @param entity + * @return void + * @Author zhangyong + * @Date 15:05 2020-07-23 + **/ + void updateVolunteerInfoByUserId(VolunteerInfoEntity entity); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActContentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActContentEntity.java new file mode 100644 index 0000000000..a39d4a48c5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActContentEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_content") +public class ActContentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id:act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActCustomizedEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActCustomizedEntity.java new file mode 100644 index 0000000000..df76098d87 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActCustomizedEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_customized") +public class ActCustomizedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 标题:eg: 志愿者去哪儿 + */ + private String titleName; + + /** + * 咨询热线 + */ + private String hotline; + + /** + * 活动列表 + */ + private String actListName; + + /** + * 爱心榜 + */ + private String heartRankName; + + /** + * 活动回顾 + */ + private String actReviewName; + + /** + * 我的活动 + */ + private String myActName; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java new file mode 100644 index 0000000000..e227b29ed5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java @@ -0,0 +1,220 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_info") +public class ActInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 报名开始时间 + */ + private Date signUpStartTime; + + /** + * 报名截止时间 + */ + private Date signUpEndTime; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 打卡开始时间 + */ + private Date signInStartTime; + + /** + * 打卡截止时间 + */ + private Date signInEndTime; + + /** + * 活动签到打卡地点 + */ + private String signInAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signInLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signInLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signInRadius; + + /** + * 活动名额类型(0(false)-不限名额,1(true)-固定名额) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 活动状态( +已发布/报名中:published; +已取消:canceled; +已结束:finished) + */ + private String actStatus; + + /** + * 活动取消的原因 + */ + private String cancelReason; + + /** + * 取消活动的时间 + */ + private Date cancelTime; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 发布名义:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 发布单位的上一级组织id,如果是以网格发布,此列存储的是网格所属机关的上一级机关 + */ + private String pid; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Boolean volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Boolean auditSwitch; + + /** + * 活动实际开始时间 + */ + private Date actualStartTime; + + /** + * 活动实际结束时间 + */ + private Date actualEndTime; + + /** + * 活动共计时长(服务时间)单位:分钟 + */ + private Integer serviceMin; + + /** + * 1已经总结0未总结 + */ + private Boolean summaryFlag; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLivePicEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLivePicEntity.java new file mode 100644 index 0000000000..07c47eff6f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLivePicEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_live_pic") +public class ActLivePicEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 实况ID:act_live.id + */ + private String liveId; + + /** + * 图片地址 + */ + private String picUrl; + + /** + * 排序从1开始 + */ + private Integer sort; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLiveRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLiveRecEntity.java new file mode 100644 index 0000000000..8d3373cd76 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActLiveRecEntity.java @@ -0,0 +1,72 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_live_rec") +public class ActLiveRecEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id: act_info.id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 实况打卡位置经度 + */ + private BigDecimal longitude; + + /** + * 实况打卡位置纬度 + */ + private BigDecimal latitude; + + /** + * 实况打卡地址 + */ + private String address; + + /** + * 实况打卡描述 + */ + private String desc; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java new file mode 100644 index 0000000000..5a54f8f5c5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActOperationRecEntity.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_operation_rec") +public class ActOperationRecEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id + */ + private String actId; + + /** + * 发布:publish; +取消活动:cancel; +结束活动:finish +重新编辑:update + */ + private String type; + + /** + * 1通知用户0不通知,取消活动时默认true + */ + private Boolean noticeUser; + + /** + * 备注,取消活动时此列有值 + */ + private String remark; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java new file mode 100644 index 0000000000..e18170b8a3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActPointLogEntity.java @@ -0,0 +1,64 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_point_log") +public class ActPointLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 积分值 + */ + private Integer points; + + /** + * 操作类型: +同意给分agree; 不给分:deny;重新处理: reset + */ + private String operateType; + + /** + * 备注:拒绝给分和重新处理时录入的理由 + */ + private String remark; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInPicEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInPicEntity.java new file mode 100644 index 0000000000..fd95c558cc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInPicEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_sign_in_pic") +public class ActSignInPicEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 签到记录ID:act_sign_in_record.id + */ + private String signInId; + + /** + * 图片地址 + */ + private String picUrl; + + /** + * 排序从1开始 + */ + private Integer sort; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInRecEntity.java new file mode 100644 index 0000000000..9ceb0bb53a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSignInRecEntity.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_sign_in_rec") +public class ActSignInRecEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id:act_info.id + */ + private String actId; + + /** + * 用户id + */ + private String userId; + + /** + * 签到位置经度 + */ + private BigDecimal longitude; + + /** + * 签到位置纬度 + */ + private BigDecimal latitude; + + /** + * 签到地址 + */ + private String address; + + /** + * 签到描述 + */ + private String desc; + + /** + * 0不同步实况1同步到实况记录 + */ + private Integer syncLive; + + /** + * 实况id,党sync_live=1时此列有值 + */ + private String liveId; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.java new file mode 100644 index 0000000000..cc1a41fa9a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActStatisticalEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_statistical") +public class ActStatisticalEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id + */ + private String actId; + + /** + * 报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数) + */ + private Integer signupNum; + + /** + * 待审核 + */ + private Integer auditingNum; + + /** + * 审核通过 + */ + private Integer passedNum; + + /** + * 审核不通过总人数 + */ + private Integer refusedNum; + + /** + * 取消报名的人数 + */ + private Integer canceldNum; + + /** + * 活动已签到人数 + */ + private Integer signedInUserNum; + + /** + * 发放积分总人数 + */ + private Integer rewardUserNum; + + /** + * 拒绝发放积分总人数 + */ + private Integer denyRewardUserNum; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSummaryEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSummaryEntity.java new file mode 100644 index 0000000000..6a50b01aae --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSummaryEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_summary") +public class ActSummaryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID:act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java new file mode 100644 index 0000000000..751f535f5f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserLogEntity.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_user_log") +public class ActUserLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 操作类型(已报名/待审核auditing, + * 审核通过passed, + * 审核不通过refused + * 取消报名canceled, + * ) + */ + private String operationType; + + /** + * 操作备注:(1)审核不通过的原因 +(2)取消报名的原因| +(3)拒绝发放积分的理由 +(4)重新处理的理由 + */ + private String reason; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java new file mode 100644 index 0000000000..f5af4a176d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActUserRelationEntity.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("act_user_relation") +public class ActUserRelationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动ID + */ + private String actId; + + /** + * 用户ID + */ + private String userId; + + /** + * 当前状态(已报名/待审核auditing, +审核通过passed, +审核不通过refused +取消报名canceled, +) + */ + private String status; + + /** + * 审核通过类型:auto, manual + */ + private String passedType; + + /** + * 审核时间(同意、拒绝的时间) + */ + private Date auditTime; + + /** + * 未通过原因 + */ + private String failureReason; + + /** + * 取消报名的时间 + */ + private Date cancelTime; + + /** + * 用户取消报名的原因 + */ + private String cancelReason; + + /** + * 已处理: handled; 默认"",重新处理时reward_flag置为空字符串 + */ + private String processFlag; + + /** + * 已签到:signed_in; 默认"" + */ + private String signInFlag; + + /** + * 已给分:agree, 不给分:deny 默认"" + */ + private String rewardFlag; + + /** + * 拒绝发放积分备注 + */ + private String denyRewardReason; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java new file mode 100644 index 0000000000..c7b90074b1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/HeartUserInfoEntity.java @@ -0,0 +1,69 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("heart_user_info") +public class HeartUserInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 用户id + */ + private String userId; + + /** + * 1是志愿者,0不是志愿者(志愿者注册成功后需要来更新值) + */ + private Boolean volunteerFlag; + + /** + * 爱心时长(单位:分钟)(参与并签到了的活动,实际结束-实际开始)签到的。未签到但是有积分的 + + */ + private Integer kindnessTime; + + /** + * 实际参与活动个数(签到+1) + */ + private Integer participationNum; + + /** + * 参与活动并获得积分的次数(发放积分+1,重新处理如果原来是发放积分需要-1) + */ + private Integer obtainPointNum; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActContentEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActContentEntity.java new file mode 100644 index 0000000000..0ccb343b75 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActContentEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("latest_act_content") +public class LatestActContentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 活动id:latest_act_info.id + */ + private String actId; + + /** + * 内容 + */ + private String content; + + /** + * 内容类型 图片:img;文字:text + */ + private String contentType; + + /** + * 内容顺序 从1开始 + */ + private Integer orderNum; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java new file mode 100644 index 0000000000..df12c12dc0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java @@ -0,0 +1,182 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("latest_act_info") +public class LatestActInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 活动标题 + */ + private String title; + + /** + * 活动封面 + */ + private String coverPic; + + /** + * 报名开始时间 + */ + private Date signUpStartTime; + + /** + * 报名截止时间 + */ + private Date signUpEndTime; + + /** + * 招募要求 + */ + private String requirement; + + /** + * 活动开始时间 + */ + private Date actStartTime; + + /** + * 活动结束时间 + */ + private Date actEndTime; + + /** + * 活动地点 + */ + private String actAddress; + + /** + * 活动位置经度 + */ + private BigDecimal actLongitude; + + /** + * 活动位置纬度 + */ + private BigDecimal actLatitude; + + /** + * 打卡开始时间 + */ + private Date signInStartTime; + + /** + * 打卡截止时间 + */ + private Date signInEndTime; + + /** + * 活动签到打卡地点 + */ + private String signInAddress; + + /** + * 活动签到打卡位置经度 + */ + private BigDecimal signInLongitude; + + /** + * 活动签到打卡位置纬度 + */ + private BigDecimal signInLatitude; + + /** + * 活动签到打卡半径(单位:米) + */ + private Integer signInRadius; + + /** + * 活动名额类型(0-不限名额,1-固定名额) + */ + private Boolean actQuotaCategory; + + /** + * 活动名额 + */ + private Integer actQuota; + + /** + * 联系人 + */ + private String sponsorContacts; + + /** + * 联系电话 + */ + private String sponsorTel; + + /** + * 主办方类型:网格主办:grid;组织主办:agency + */ + private String sponsorType; + + /** + * 主办方id(机关或网格的id) + */ + private String sponsorId; + + /** + * 活动主办方名称(机关或网格的名称) + */ + private String sponsorName; + + /** + * 如果以网格名义发布,存储空字符串"" + */ + private String pid; + + /** + * 活动奖励积分 + */ + private Integer reward; + + /** + * 身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + */ + private Boolean volunteerLimit; + + /** + * 审核开关:1报名人员需要人工审核0不需要 + */ + private Boolean auditSwitch; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java new file mode 100644 index 0000000000..484e911fe1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("volunteer_info") +public class VolunteerInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private String userId; + + /** + * 客户id + */ + private String customerId; + + /** + * 志愿者自我介绍 + */ + private String volunteerIntroduce; + + /** + * 志愿者签名 + */ + private String volunteerSignature; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActContentExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActContentExcel.java new file mode 100644 index 0000000000..c94706353e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActContentExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActContentExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动id:act_info.id") + private String actId; + + @Excel(name = "内容") + private String content; + + @Excel(name = "内容类型 图片:img;文字:text") + private String contentType; + + @Excel(name = "内容顺序 从1开始") + private Integer orderNum; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActCustomizedExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActCustomizedExcel.java new file mode 100644 index 0000000000..00b2a6d366 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActCustomizedExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActCustomizedExcel { + + @Excel(name = "主键(客户如果没配置,默认的值写在代码里)") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "标题:eg: 志愿者去哪儿") + private String titleName; + + @Excel(name = "咨询热线") + private String hotline; + + @Excel(name = "活动列表") + private String actListName; + + @Excel(name = "爱心榜") + private String heartRankName; + + @Excel(name = "活动回顾") + private String actReviewName; + + @Excel(name = "我的活动") + private String myActName; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标记") + private String delFlag; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActInfoExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActInfoExcel.java new file mode 100644 index 0000000000..9b8a737572 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActInfoExcel.java @@ -0,0 +1,162 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "活动标题") + private String title; + + @Excel(name = "活动封面") + private String coverPic; + + @Excel(name = "报名开始时间") + private Date signupStartTime; + + @Excel(name = "报名截止时间") + private Date signupEndTime; + + @Excel(name = "招募要求") + private String requirement; + + @Excel(name = "活动开始时间") + private Date actStartTime; + + @Excel(name = "活动结束时间") + private Date actEndTime; + + @Excel(name = "活动地点") + private String actAddress; + + @Excel(name = "活动位置经度") + private BigDecimal actLongitude; + + @Excel(name = "活动位置纬度") + private BigDecimal actLatitude; + + @Excel(name = "打卡开始时间") + private Date signinStartTime; + + @Excel(name = "打卡截止时间") + private Date signinEndTime; + + @Excel(name = "活动签到打卡地点") + private String signinAddress; + + @Excel(name = "活动签到打卡位置经度") + private BigDecimal signinLongitude; + + @Excel(name = "活动签到打卡位置纬度") + private BigDecimal signinLatitude; + + @Excel(name = "活动签到打卡半径(单位:米)") + private Integer signinRadius; + + @Excel(name = "活动名额类型(0-不限名额,1-固定名额)") + private Integer actQuotaCategory; + + @Excel(name = "活动名额") + private Integer actQuota; + + @Excel(name = "活动状态( 已发布/报名中:published; 已取消:canceled; 已结束:finished)") + private String actStatus; + + @Excel(name = "活动取消的原因") + private String cancelReason; + + @Excel(name = "取消活动的时间") + private Date cancelTime; + + @Excel(name = "联系人") + private String sponsorContacts; + + @Excel(name = "联系电话") + private String sponsorTel; + + @Excel(name = "发布名义:网格主办:grid;组织主办:agency") + private String sponsorType; + + @Excel(name = "主办方id(机关或网格的id)") + private String sponsorId; + + @Excel(name = "活动主办方名称(机关或网格的名称)") + private String sponsorName; + + @Excel(name = "发布单位的上一级组织id,如果是以网格发布,此列存储的是网格所属机关的上一级机关") + private String pid; + + @Excel(name = "活动奖励积分") + private Integer reward; + + @Excel(name = "身份限制:1只有志愿者才可以参加活动0不限制志愿者身份") + private Integer volunteerLimit; + + @Excel(name = "审核开关:1报名人员需要人工审核0不需要") + private Integer auditSwitch; + + @Excel(name = "活动实际开始时间") + private Date actualStartTime; + + @Excel(name = "活动实际结束时间") + private Date actualEndTime; + + @Excel(name = "活动共计时长(服务时间)单位:分钟") + private Integer serviceMin; + + @Excel(name = "1已经总结0未总结") + private Integer summaryFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间(活动发布时间)") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标识") + private String delFlag; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLivePicExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLivePicExcel.java new file mode 100644 index 0000000000..8fb21190df --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLivePicExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActLivePicExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "实况ID:act_live.id") + private String liveId; + + @Excel(name = "图片地址") + private String picUrl; + + @Excel(name = "排序从1开始") + private Integer sort; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标志") + private String delFlag; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLiveRecExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLiveRecExcel.java new file mode 100644 index 0000000000..f85f566f67 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActLiveRecExcel.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActLiveRecExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动id: act_info.id") + private String actId; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "实况打卡位置经度") + private BigDecimal longitude; + + @Excel(name = "实况打卡位置纬度") + private BigDecimal latitude; + + @Excel(name = "实况打卡地址") + private String address; + + @Excel(name = "实况打卡描述") + private String desc; + + @Excel(name = "删除标记") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActOperationRecExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActOperationRecExcel.java new file mode 100644 index 0000000000..b9d7974822 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActOperationRecExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActOperationRecExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动id") + private String actId; + + @Excel(name = "发布:publish; 取消活动:cancel; 结束活动:finish 重新编辑:update") + private String type; + + @Excel(name = "1通知用户0不通知") + private Integer noticeUser; + + @Excel(name = "删除标记") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "操作人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActPointLogExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActPointLogExcel.java new file mode 100644 index 0000000000..9017737a09 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActPointLogExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActPointLogExcel { + + @Excel(name = "主键(给分或者不给分,以及重新处理插入本表)") + private String id; + + @Excel(name = "活动id") + private String actId; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "加积分:add ; 减积分:subtract") + private String pointType; + + @Excel(name = "积分值") + private Integer points; + + @Excel(name = "操作类型: 同意给分agree; 不给分:deny;重新处理: reset") + private String operateType; + + @Excel(name = "备注:拒绝给分和重新处理时录入的理由") + private String remark; + + @Excel(name = "删除标识 0-否,1-是") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人(工作人员id)") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInPicExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInPicExcel.java new file mode 100644 index 0000000000..6e3e6168f1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInPicExcel.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActSignInPicExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "签到记录ID:act_sign_in_record.id") + private String signInId; + + @Excel(name = "图片地址") + private String picUrl; + + @Excel(name = "排序从1开始") + private Integer sort; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标志") + private String delFlag; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInRecExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInRecExcel.java new file mode 100644 index 0000000000..8862beb067 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSignInRecExcel.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActSignInRecExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动id:act_info.id") + private String actId; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "签到位置经度") + private BigDecimal longitude; + + @Excel(name = "签到位置纬度") + private BigDecimal latitude; + + @Excel(name = "签到地址") + private String address; + + @Excel(name = "签到描述") + private String desc; + + @Excel(name = "0不同步实况1同步到实况记录") + private Integer syncLive; + + @Excel(name = "实况id,党sync_live=1时此列有值") + private String liveId; + + @Excel(name = "删除标记") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActStatisticalExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActStatisticalExcel.java new file mode 100644 index 0000000000..8de1f083d9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActStatisticalExcel.java @@ -0,0 +1,89 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActStatisticalExcel { + + @Excel(name = "主键(活动结束后插入本表)") + private String id; + + @Excel(name = "活动id") + private String actId; + + @Excel(name = "已报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数)") + private Integer signupNum; + + @Excel(name = "待审核") + private Integer auditingNum; + + @Excel(name = "审核通过") + private Integer passedNum; + + @Excel(name = "审核不通过总人数") + private Integer refusedNum; + + @Excel(name = "取消报名的人数") + private Integer canceldNum; + + @Excel(name = "活动已签到人数") + private Integer signedInUserNum; + + @Excel(name = "添加实况总人数") + private Integer liveUserNum; + + @Excel(name = "实况总记录数") + private Integer liveCount; + + @Excel(name = "发放积分总人数") + private Integer rewardUserNum; + + @Excel(name = "拒绝发放积分总人数") + private Integer denyRewardUserNum; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSummaryExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSummaryExcel.java new file mode 100644 index 0000000000..6767630412 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActSummaryExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActSummaryExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "活动ID:act_info.id") + private String actId; + + @Excel(name = "内容") + private String content; + + @Excel(name = "内容类型 图片:img;文字:text") + private String contentType; + + @Excel(name = "内容顺序 从1开始") + private Integer orderNum; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserLogExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserLogExcel.java new file mode 100644 index 0000000000..5db57daab1 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserLogExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActUserLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动ID") + private String actId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "操作类型(已报名/待审核auditing, 审核通过passed, 审核不通过refused 取消报名canceld, 发放积分rewarded 拒绝发放积分refuse_reward 重新处理processing)") + private String operationType; + + @Excel(name = "操作备注:(1)审核不通过的原因(2)取消报名的原因|(3)拒绝发放积分的理由 (4)重新处理的理由") + private String reason; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间(操作的时间)") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserRelationExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserRelationExcel.java new file mode 100644 index 0000000000..f61580acdd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ActUserRelationExcel.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class ActUserRelationExcel { + + @Excel(name = "主键(用户-活动一对一,报名取消再报名也只有一条记录)") + private String id; + + @Excel(name = "活动ID") + private String actId; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "当前状态(已报名/待审核auditing, 审核通过passed, 审核不通过refused 取消报名canceld,)") + private String status; + + @Excel(name = "审核通过类型:auto, manual") + private String passedType; + + @Excel(name = "审核时间(同意、拒绝的时间)") + private Date auditTime; + + @Excel(name = "未通过原因") + private String failureReason; + + @Excel(name = "取消报名的时间") + private Date cancelTime; + + @Excel(name = "用户取消报名的原因") + private String cancelReason; + + @Excel(name = "已处理: handled; 默认空字符串,重新处理时reward_flag置为空字符串") + private String processFlag; + + @Excel(name = "已签到:signed_in; 默认空字符串") + private String signInFlag; + + @Excel(name = "已给分:agree, 不给分:deny 默认空字符串") + private String rewardFlag; + + @Excel(name = "拒绝发放积分备注") + private String denyRewardReason; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "删除标记") + private String delFlag; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间(报名时间)") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/HeartUserInfoExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/HeartUserInfoExcel.java new file mode 100644 index 0000000000..30f2f5c4a6 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/HeartUserInfoExcel.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class HeartUserInfoExcel { + + @Excel(name = "主键(用户提交报名成功后,插入本表)") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "1是志愿者,0不是志愿者(志愿者注册成功后需要来更新值)") + private Integer volunteerFlag; + + @Excel(name = "爱心时长(单位:分钟)(参与并签到了的活动,实际结束-实际开始)签到的。未签到但是有积分的 ") + private Integer kindnessTime; + + @Excel(name = "实际参与活动个数(签到+1)") + private Integer participationNum; + + @Excel(name = "参与活动并获得积分的次数(发放积分+1,重新处理如果原来是发放积分需要-1)") + private Integer obtainPointNum; + + @Excel(name = "删除标记") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActContentExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActContentExcel.java new file mode 100644 index 0000000000..9439c24ba0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActContentExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class LatestActContentExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "活动id:latest_act_info.id") + private String actId; + + @Excel(name = "内容") + private String content; + + @Excel(name = "内容类型 图片:img;文字:text") + private String contentType; + + @Excel(name = "内容顺序 从1开始") + private Integer orderNum; + + @Excel(name = "删除标识 0.未删除 1.已删除") + private Integer delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActInfoExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActInfoExcel.java new file mode 100644 index 0000000000..4ad7c2ab80 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/LatestActInfoExcel.java @@ -0,0 +1,141 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class LatestActInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "活动标题") + private String title; + + @Excel(name = "活动封面") + private String coverPic; + + @Excel(name = "报名开始时间") + private Date signupStartTime; + + @Excel(name = "报名截止时间") + private Date signupEndTime; + + @Excel(name = "招募要求") + private String requirement; + + @Excel(name = "活动开始时间") + private Date actStartTime; + + @Excel(name = "活动结束时间") + private Date actEndTime; + + @Excel(name = "活动地点") + private String actAddress; + + @Excel(name = "活动位置经度") + private BigDecimal actLongitude; + + @Excel(name = "活动位置纬度") + private BigDecimal actLatitude; + + @Excel(name = "打卡开始时间") + private Date signinStartTime; + + @Excel(name = "打卡截止时间") + private Date signinEndTime; + + @Excel(name = "活动签到打卡地点") + private String signinAddress; + + @Excel(name = "活动签到打卡位置经度") + private BigDecimal signinLongitude; + + @Excel(name = "活动签到打卡位置纬度") + private BigDecimal signinLatitude; + + @Excel(name = "活动签到打卡半径(单位:米)") + private Integer signinRadius; + + @Excel(name = "活动名额类型(0-不限名额,1-固定名额)") + private Integer actQuotaCategory; + + @Excel(name = "活动名额") + private Integer actQuota; + + @Excel(name = "联系人") + private String sponsorContacts; + + @Excel(name = "联系电话") + private String sponsorTel; + + @Excel(name = "主办方类型:网格主办:grid;组织主办:agency") + private String sponsorType; + + @Excel(name = "主办方id(机关或网格的id)") + private String sponsorId; + + @Excel(name = "活动主办方名称(机关或网格的名称)") + private String sponsorName; + + @Excel(name = "如果以网格名义发布,存储空字符串") + private String pid; + + @Excel(name = "活动奖励积分") + private Integer reward; + + @Excel(name = "身份限制:1只有志愿者才可以参加活动0不限制志愿者身份") + private Integer volunteerLimit; + + @Excel(name = "审核开关:1报名人员需要人工审核0不需要") + private Integer auditSwitch; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + @Excel(name = "删除标识") + private String delFlag; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/VolunteerInfoExcel.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/VolunteerInfoExcel.java new file mode 100644 index 0000000000..d10316d6c8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/VolunteerInfoExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class VolunteerInfoExcel { + + @Excel(name = "主键(志愿者注册后插入本表)") + private String id; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "志愿者自我介绍") + private String volunteerIntroduce; + + @Excel(name = "志愿者签名") + private String volunteerSignature; + + @Excel(name = "删除标记") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间(认证志愿者时间)") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/exception/ModuleErrorCode.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/exception/ModuleErrorCode.java new file mode 100644 index 0000000000..1206c71b9a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/exception/ModuleErrorCode.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.exception; + + +import com.epmet.commons.tools.exception.ErrorCode; + +/** + * 模块错误编码,由9位数字组成,前6位为模块编码,后3位为业务编码 + *

+ * 如:100001001(100001代表模块,001代表业务代码) + *

+ * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface ModuleErrorCode extends ErrorCode { + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActContentRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActContentRedis.java new file mode 100644 index 0000000000..4570a2701e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActContentRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActContentRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActCustomizedRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActCustomizedRedis.java new file mode 100644 index 0000000000..a5a070843f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActCustomizedRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActCustomizedRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActInfoRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActInfoRedis.java new file mode 100644 index 0000000000..22c59f9e70 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActInfoRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLivePicRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLivePicRedis.java new file mode 100644 index 0000000000..2f8a75528b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLivePicRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActLivePicRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLiveRecRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLiveRecRedis.java new file mode 100644 index 0000000000..2f24bab04e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActLiveRecRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActLiveRecRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActOperationRecRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActOperationRecRedis.java new file mode 100644 index 0000000000..ba55729812 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActOperationRecRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActOperationRecRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActPointLogRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActPointLogRedis.java new file mode 100644 index 0000000000..eaa25a47b7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActPointLogRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActPointLogRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInPicRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInPicRedis.java new file mode 100644 index 0000000000..1dd1c83295 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInPicRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActSignInPicRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInRecRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInRecRedis.java new file mode 100644 index 0000000000..a284611f48 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSignInRecRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActSignInRecRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActStatisticalRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActStatisticalRedis.java new file mode 100644 index 0000000000..373cd14a37 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActStatisticalRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActStatisticalRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSummaryRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSummaryRedis.java new file mode 100644 index 0000000000..847f27756b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActSummaryRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActSummaryRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserLogRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserLogRedis.java new file mode 100644 index 0000000000..631d2d4808 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserLogRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActUserLogRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserRelationRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserRelationRedis.java new file mode 100644 index 0000000000..1bd4bab980 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/ActUserRelationRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class ActUserRelationRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/HeartUserInfoRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/HeartUserInfoRedis.java new file mode 100644 index 0000000000..4f749e8d28 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/HeartUserInfoRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class HeartUserInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActContentRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActContentRedis.java new file mode 100644 index 0000000000..2413bfc9ee --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActContentRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class LatestActContentRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActInfoRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActInfoRedis.java new file mode 100644 index 0000000000..83864f7283 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/LatestActInfoRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class LatestActInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/VolunteerInfoRedis.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/VolunteerInfoRedis.java new file mode 100644 index 0000000000..03a2ee9ce0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/redis/VolunteerInfoRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class VolunteerInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActContentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActContentService.java new file mode 100644 index 0000000000..fde8428f41 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActContentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActContentDTO; +import com.epmet.entity.ActContentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActContentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActContentDTO + * @author generator + * @date 2020-07-19 + */ + ActContentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActContentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActContentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java new file mode 100644 index 0000000000..7c56084f81 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActCustomizedService.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActCustomizedDTO; +import com.epmet.dto.form.work.ActCustomizedFormDTO; +import com.epmet.dto.form.work.SaveActCustomizedFormDTO; +import com.epmet.dto.result.work.ActCustomizedResultDTO; +import com.epmet.dto.result.work.CustomerHeartConfigsResultDTO; +import com.epmet.entity.ActCustomizedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActCustomizedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActCustomizedDTO + * @author generator + * @date 2020-07-19 + */ + ActCustomizedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActCustomizedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActCustomizedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); + + /** + * @return com.epmet.dto.result.work.ActCustomizedResultDTO + * @param formDTO + * @author yinzuomei + * @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 + * @Date 2020/7/20 15:42 + **/ + ActCustomizedResultDTO getConfigs(ActCustomizedFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 保存自定义配置 + * @Date 2020/7/20 17:26 + **/ + void saveConfigs(SaveActCustomizedFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.CustomerHeartConfigsResultDTO + * @param formDTO + * @author yinzuomei + * @description 居民端根据客户id获取爱心互助自定义配置 + * @Date 2020/7/21 12:47 + **/ + CustomerHeartConfigsResultDTO getCustomerHeartConfigs(ActCustomizedFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java new file mode 100644 index 0000000000..4f67a60cd8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java @@ -0,0 +1,227 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.form.resi.*; +import com.epmet.dto.result.resi.*; +import com.epmet.entity.ActInfoEntity; + +import com.epmet.commons.tools.utils.Result; + +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActInfoDTO + * @author generator + * @date 2020-07-19 + */ + ActInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); + + /** + * 根据活动id、前端传的实时经纬度,与活动设置的经纬度相比较,判断用户是否已到达打卡地点 + * @param fromDTO + * @return javax.xml.transform.Result + * @Author zhangyong + * @Date 16:48 2020-07-20 + **/ + Result checkSignInAddress(ResiActCaculateDistanceFormDTO fromDTO); + + /** + * 活动列表(包含状态:报名中:signing_up;已报满:enough;截止报名: end_sign_up; 已开始: in_progress; 已结束:finished;) + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + Result> listAct(TokenDto tokenDto, ResiActBaseFormDTO formDto); + + /* + * 我的活动-审核中 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:15 2020-07-21 + **/ + Result> myActListAuditing(TokenDto tokenDto, ResiMyActFormDTO formDto); + + /* + * 我的活动-未通过 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:15 2020-07-21 + **/ + Result> myActListRefused(TokenDto tokenDto, ResiMyActFormDTO formDto); + + /* + * 我的活动-已通过 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:15 2020-07-21 + **/ + Result> myActListPassed(TokenDto tokenDto, ResiMyActFormDTO formDto); + + /* + * 我的活动-已结束 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:15 2020-07-21 + **/ + Result> myActListCanceld(TokenDto tokenDto, ResiMyActFormDTO formDto); + + /** + * 最新活动列表 + * + * @param formDto + * @return java.util.List + * @Author zhangyong + * @Date 13:53 2020-07-21 + **/ + Result> latestAct(ResiLatestActFormDTO formDto); + + /** + * 正在进行中的活动 + * 进入活动的快捷入口, 前端只取第一条 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 15:00 2020-07-21 + **/ + Result> inProgressAct(TokenDto tokenDto); + + /** + * 活动回顾列表(包含状态:已结束:finished;) + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + Result> actLookBack(ResiActBaseFormDTO formDTO); + + /** + * 活动详情 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + Result actDetail(TokenDto tokenDto, ResiActDetailFormDTO formDto); + + /** + * 活动详情-未通过 + * + * @param tokenDto + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + Result rejectDetail(TokenDto tokenDto, ResiActDetailFormDTO formDto); + + /** + * 查询当前报名的活动开始时间-结束时间,是否与其他已报名,未结束的活动,存在交集情况 + * + * @param actInfoDTO + * @return java.lang.Integer + * @Author zhangyong + * @Date 17:17 2020-07-23 + **/ + Integer checkActTime(ActInfoDTO actInfoDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLivePicService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLivePicService.java new file mode 100644 index 0000000000..9e082cf4f4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLivePicService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActLivePicDTO; +import com.epmet.entity.ActLivePicEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActLivePicService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActLivePicDTO + * @author generator + * @date 2020-07-19 + */ + ActLivePicDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActLivePicDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActLivePicDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java new file mode 100644 index 0000000000..9ebe84e2ff --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActLiveRecService.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; +import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; +import com.epmet.entity.ActLiveRecEntity; + +import java.util.Map; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActLiveRecService extends BaseService { + + /** + * 活动详情-已结束-现场实况列表 + * + * @param map + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + Result liveRecList(Map map); + + /** + * 活动-添加实况 + * 返回实况id,主要是因为,当签到并转发实况时,表中需要存储【实况ID】 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:40 2020-07-23 + **/ + Result insertLive(TokenDto tokenDto, ResiActInsertLiveFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActOperationRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActOperationRecService.java new file mode 100644 index 0000000000..301a02b7f3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActOperationRecService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActOperationRecDTO; +import com.epmet.entity.ActOperationRecEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActOperationRecService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActOperationRecDTO + * @author generator + * @date 2020-07-19 + */ + ActOperationRecDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActOperationRecDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActOperationRecDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActPointLogService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActPointLogService.java new file mode 100644 index 0000000000..93840c7129 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActPointLogService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActPointLogDTO; +import com.epmet.entity.ActPointLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActPointLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActPointLogDTO + * @author generator + * @date 2020-07-19 + */ + ActPointLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActPointLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActPointLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInPicService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInPicService.java new file mode 100644 index 0000000000..68d8960299 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInPicService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActSignInPicDTO; +import com.epmet.entity.ActSignInPicEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActSignInPicService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActSignInPicDTO + * @author generator + * @date 2020-07-19 + */ + ActSignInPicDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActSignInPicDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActSignInPicDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java new file mode 100644 index 0000000000..c2ba4124ce --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSignInRecService.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.resi.ResiActSignInFormDTO; +import com.epmet.entity.ActSignInRecEntity; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActSignInRecService extends BaseService { + /** + * 活动-签到 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:29 2020-07-23 + **/ + Result actSignIn(TokenDto tokenDto, ResiActSignInFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActStatisticalService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActStatisticalService.java new file mode 100644 index 0000000000..1d4a93eb48 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActStatisticalService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActStatisticalDTO; +import com.epmet.entity.ActStatisticalEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActStatisticalService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActStatisticalDTO + * @author generator + * @date 2020-07-19 + */ + ActStatisticalDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActStatisticalDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActStatisticalDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java new file mode 100644 index 0000000000..863626d44f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActSummaryService.java @@ -0,0 +1,108 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.ActSummaryDTO; +import com.epmet.dto.form.resi.ResiActContentFormDTO; +import com.epmet.dto.result.resi.ResiActSummaryResultDTO; +import com.epmet.entity.ActSummaryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActSummaryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActSummaryDTO + * @author generator + * @date 2020-07-19 + */ + ActSummaryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActSummaryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActSummaryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); + + /** + * 活动详情-已结束-回顾稿 + * + * @param formDto + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 13:39 2020-07-21 + **/ + Result summaryList(ResiActContentFormDTO formDto); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java new file mode 100644 index 0000000000..4eb8fbe83d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserLogService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ActUserLogDTO; +import com.epmet.entity.ActUserLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActUserLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserLogDTO + * @author generator + * @date 2020-07-19 + */ + ActUserLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActUserLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActUserLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); + + /** + * 查询我累计报名过的活动次数 + * + * @param userId + * @return java.lang.Integer + * @Author zhangyong + * @Date 16:12 2020-07-23 + **/ + Integer countActTimesOfParticipation(String userId); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java new file mode 100644 index 0000000000..f3a135ee6a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActUserRelationService.java @@ -0,0 +1,153 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.form.resi.ResiActRegistrationFormDTO; +import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; +import com.epmet.entity.ActUserRelationEntity; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface ActUserRelationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ActUserRelationDTO + * @author generator + * @date 2020-07-19 + */ + ActUserRelationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(ActUserRelationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(ActUserRelationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); + + /** + * @return java.util.List + * @param actId + * @param status 当前状态(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld,) + * @author yinzuomei + * @description 根据活动id,查询待审核人员关系记录 + * @Date 2020/7/21 22:40 + **/ + List getUserList(@Param("actId") String actId,@Param("status") String status); + + /** + * @return java.util.List + * @param actId + * @param status 当前状态(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld,) + * @author yinzuomei + * @description 根据活动id,查询待审核人员,返回用户id集合 + * @Date 2020/7/21 22:44 + **/ + List getUserIdList(@Param("actId") String actId,@Param("status")String status); + + /** + * @return java.lang.Integer + * @param actId + * @param status + * @author yinzuomei + * @description 根据活动id,用户状态,统计用户数 + * @Date 2020/7/22 18:17 + **/ + Integer selectCountUser(@Param("actId") String actId, @Param("status") String status); + + + /** + * 取消活动报名 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:29 2020-07-20 + **/ + Result cancelSignUp(TokenDto tokenDto, ResiActUserCancelSignUpFormDTO formDTO); + + /** + * 活动报名 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 16:46 2020-07-23 + **/ + Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java new file mode 100644 index 0000000000..e8d53e3b44 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/GrantPointsService.java @@ -0,0 +1,71 @@ +package com.epmet.service; + +import com.epmet.dto.form.work.ActIdFormDTO; +import com.epmet.dto.form.work.GrantPointsFormDTO; +import com.epmet.dto.result.work.DeniedUserResultDTO; +import com.epmet.dto.result.work.ObtainedUserResultDTO; +import com.epmet.dto.result.work.PendingUserResultDTO; + +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 12:26 + */ +public interface GrantPointsService { + /** + * @return com.epmet.dto.result.work.PendingUserResultDTO + * @param actId + * @author yinzuomei + * @description 积分发放-待处理列表 + * @Date 2020/7/24 12:28 + **/ + PendingUserResultDTO queryPendingList(String actId); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 积分发放-给分 + * @Date 2020/7/24 13:34 + **/ + void agree(GrantPointsFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 积分发放-不给分 + * @Date 2020/7/24 15:03 + **/ + void deny(GrantPointsFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 积分发放-重新处理 + * @Date 2020/7/24 15:16 + **/ + void reset(GrantPointsFormDTO formDTO); + + /** + * @return java.util.List + * @param actIdFormDTO + * @author yinzuomei + * @description 积分发放-已发放列表 + * @Date 2020/7/26 18:47 + **/ + List agreedList(ActIdFormDTO actIdFormDTO); + + /** + * @return java.util.List + * @param actIdFormDTO + * @author yinzuomei + * @description 积分发放-已拒绝列表 + * @Date 2020/7/26 19:02 + **/ + List deniedList(ActIdFormDTO actIdFormDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.java new file mode 100644 index 0000000000..f753bb67ae --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/HeartUserInfoService.java @@ -0,0 +1,130 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.HeartUserInfoDTO; +import com.epmet.dto.form.resi.ResiActBaseFormDTO; +import com.epmet.dto.result.resi.ResiLeaderboardResultDTO; +import com.epmet.entity.HeartUserInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface HeartUserInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return HeartUserInfoDTO + * @author generator + * @date 2020-07-19 + */ + HeartUserInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(HeartUserInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(HeartUserInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); + + /** + * @return com.epmet.dto.HeartUserInfoDTO + * @param userId + * @author yinzuomei + * @description 根据用户id查询爱心用户记录 + * @Date 2020/7/21 22:48 + **/ + HeartUserInfoDTO getByUserId(String userId); + + + /** + * 爱心榜 + * 显示报名参加过活动的用户/志愿者 + * 排序规则:按照爱心时长一致,按照参加次数排序 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 17:42 2020-07-22 + **/ + Result> leaderboard(ResiActBaseFormDTO formDTO); + + /** + * 根据用户id,修改用户信息表 + * + * @param dto + * @return void + * @Author zhangyong + * @Date 16:27 2020-07-23 + **/ + void updateHeartUserInfoByUserId(HeartUserInfoDTO dto); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java new file mode 100644 index 0000000000..39a067055f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActContentService.java @@ -0,0 +1,134 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.LatestActContentDTO; +import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; +import com.epmet.dto.result.work.ActPreviewContentResultDTO; +import com.epmet.entity.LatestActContentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface LatestActContentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return LatestActContentDTO + * @author generator + * @date 2020-07-19 + */ + LatestActContentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(LatestActContentDTO dto); + + /** + * 默认保存 + * + * @param dtoList + * @return void + * @author generator + * @date 2020-07-19 + */ + void saveLatestActContentDTOList(List dtoList); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(LatestActContentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); + + /** + * @return int + * @param actId + * @author yinzuomei + * @description 根据活动id,删除活动内容 + * @Date 2020/7/20 18:34 + **/ + int deleteByActId(String actId); + + /** + * @return java.util.List + * @param actId + * @author yinzuomei + * @description 根据latest_act_info.id查询活动内容,已排序 + * @Date 2020/7/20 22:59 + **/ + List selectActContentList(String actId); + + /** + * @return java.util.List + * @param actDraftId latest_act_info主键 + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:47 + **/ + List previewActContent(String actDraftId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java new file mode 100644 index 0000000000..0102ea76ee --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActInfoService.java @@ -0,0 +1,143 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.LatestActInfoDTO; +import com.epmet.dto.result.work.ActPreviewResultDTO; +import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.entity.LatestActInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface LatestActInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return LatestActInfoDTO + * @author generator + * @date 2020-07-19 + */ + LatestActInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(LatestActInfoDTO dto); + + /** + * 默认保存,返回主键 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + String saveOrUpdateLatestActInfoDTO(LatestActInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(LatestActInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); + + /** + * @return java.lang.Integer + * @param userId + * @author yinzuomei + * @description 查询当前用户保留的活动记录 + * @Date 2020/7/20 17:58 + **/ + Integer countByUserId(String userId); + + /** + * @return void + * @param userId + * @author yinzuomei + * @description 删除当前用户的活动草稿 + * @Date 2020/7/20 18:17 + **/ + void deleteAllDraft(String userId); + + /** + * @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO + * @param userId + * @author yinzuomei + * @description 获取用户最近一次编辑的活动信息 + * @Date 2020/7/20 22:59 + **/ + LatestDraftActInfoResultDTO getLatestActDraft(String userId); + + /** + * @return com.epmet.dto.result.work.ActPreviewResultDTO + * @param actDraftId latest_act_info主键 + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:45 + **/ + ActPreviewResultDTO previewActInfo(String actDraftId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java new file mode 100644 index 0000000000..6938871d5b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.VolunteerInfoDTO; +import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.entity.VolunteerInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface VolunteerInfoService extends BaseService { + + /** + * 志愿者认证 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:09 2020-07-23 + **/ + Result authenticate(TokenDto tokenDto, ResiVolunteerAuthenticateFormDTO formDTO); + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java new file mode 100644 index 0000000000..cc0683b91c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActDraftService.java @@ -0,0 +1,54 @@ +package com.epmet.service; + +import com.epmet.dto.form.work.ActPreviewFormDTO; +import com.epmet.dto.form.work.DraftActInfoFormDTO; +import com.epmet.dto.result.work.ActPreviewResultDTO; +import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.dto.result.work.PublishActInitResultDTO; +import com.epmet.dto.result.work.SaveActDraftResultDTO; + +/** + * 工作端活动草稿 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 17:51 + */ +public interface WorkActDraftService { + + /** + * @return com.epmet.dto.form.work.PublishActInitResultDTO + * @param + * @author yinzuomei + * @description 发布活动初始化 + * @Date 2020/7/20 17:54 + **/ + PublishActInitResultDTO publishActInit(); + + /** + * @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO + * @param + * @author yinzuomei + * @description 获取最近一次编辑的活动 + * @Date 2020/7/20 22:29 + **/ + LatestDraftActInfoResultDTO getLatestDraft(); + + /** + * @return com.epmet.dto.result.work.SaveActDraftResultDTO + * @param formDTO + * @author yinzuomei + * @description 预览按下-调用此接口保存活动信息、活动内容 + * @Date 2020/7/21 14:00 + **/ + SaveActDraftResultDTO saveAct(DraftActInfoFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.ActPreviewResultDTO + * @param formDTO + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:24 + **/ + ActPreviewResultDTO previewActDetail(ActPreviewFormDTO formDTO); + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java new file mode 100644 index 0000000000..8aca54049d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java @@ -0,0 +1,149 @@ +package com.epmet.service; + +import com.epmet.dto.form.work.*; +import com.epmet.dto.result.work.*; + +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 20:36 + */ +public interface WorkActService { + /** + * @return void + * @param + * @author yinzuomei + * @description 发布活动-删除历史活动草稿 + * @Date 2020/7/20 18:15 + **/ + void deleteDraft(); + + /** + * @return com.epmet.dto.result.work.SponsorResultDTO + * @param + * @author yinzuomei + * @description 活动主办方 + * @Date 2020/7/23 20:37 + **/ + SponsorResultDTO querySponsorList(); + + /** + * @return com.epmet.dto.result.work.PublishActResultDTO + * @param formDTO + * @author yinzuomei + * @description 发布活动 + * @Date 2020/7/21 18:33 + **/ + PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.InProgressActResultDTO + * @param formDTO + * @author yinzuomei + * @description 进行中活动列表 + * @Date 2020/7/23 21:24 + **/ + List queryInProgressList(ActListCommonFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 已取消-活动列表 + * @Date 2020/7/23 23:11 + **/ + List queryCanceledList(ActListCommonFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 已结束-活动列表 + * @Date 2020/7/23 23:21 + **/ + List queryFinishedList(ActListCommonFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 取消活动 + * @Date 2020/7/26 17:26 + **/ + void cancelAct(CancelActFormDTO formDTO); + + /** + * @return void + * @param actId + * @author yinzuomei + * @description 已取消-活动详情 + * @Date 2020/7/26 18:00 + **/ + CanceledActDetailResultDTO canceledDetail(String actId); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 已结束-保存活动实际开始结束时间 + * @Date 2020/7/26 19:49 + **/ + void saveActualTime(SaveActualTimeFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.dto.result.work.FinishedActDetailResultDTO + * @author yinzuomei + * @description 已结束-活动详情 + * @Date 2020/7/26 21:02 + **/ + FinishedActDetailResultDTO finishedDeatil(ActIdFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.InProgressActDetailResultDTO + * @param actId + * @author yinzuomei + * @description 进行中-活动详情 + * @Date 2020/7/26 21:34 + **/ + InProgressActDetailResultDTO inProgressDetail(String actId); + + /** + * @return void + * @param actId + * @author yinzuomei + * @description 已结束-确认结束活动 + * @Date 2020/7/26 21:48 + **/ + void finishAct(String actId); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 保存添加回顾 + * @Date 2020/7/27 10:45 + **/ + void summaryAct(SummaryActFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.ReEditActInfoResultDTO + * @param actId + * @author yinzuomei + * @description 重新编辑-获取活动详情 + * @Date 2020/7/27 13:36 + **/ + ReEditActInfoResultDTO getActInfo(String actId); + + /** + * @return com.epmet.dto.result.work.PublishActResultDTO + * @param rePublishFormDTO + * @author yinzuomei + * @description 重新发布活动 + * @Date 2020/7/27 13:55 + **/ + PublishActResultDTO rePublish(RePublishFormDTO rePublishFormDTO); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java new file mode 100644 index 0000000000..281d8e7556 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java @@ -0,0 +1,144 @@ +package com.epmet.service; + +import com.epmet.dto.form.work.AactUserDetailFormDTO; +import com.epmet.dto.form.work.ActIdFormDTO; +import com.epmet.dto.form.work.AuditUserFormDTO; +import com.epmet.dto.form.work.UserHistoricalActFormDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.work.*; + +import java.util.List; + +/** + * 工作端:活动人员相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 22:23 + */ +public interface WorkActUserService { + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 报名审核-待审核列表 + * @Date 2020/7/21 22:25 + **/ + List getAuditingList(ActIdFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 报名审核-已通过列表 + * @Date 2020/7/22 15:16 + **/ + List getPassedList(ActIdFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 报名审核-已拒绝列表 + * @Date 2020/7/22 15:50 + **/ + List getRejectedlist(ActIdFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 报名审核-已取消报名列表 + * @Date 2020/7/22 16:35 + **/ + List getCanceledList(ActIdFormDTO formDTO); + + /** + * @return com.epmet.dto.result.work.ActSignUpStatResultDTO + * @param actId + * @author yinzuomei + * @description 报名审核-概要统计 + * @Date 2020/7/22 17:02 + **/ + ActSignUpStatResultDTO getActSignUpStat(String actId); + + /** + * @return com.epmet.dto.result.work.AuditingUserDetailResultDTO + * @param formDTO + * @author yinzuomei + * @description 报名审核-待审核人员详情 + * @Date 2020/7/22 22:44 + **/ + AuditingUserDetailResultDTO queryAuditingUserDetail(AactUserDetailFormDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 报名审核-人员历史活动情况 + * @Date 2020/7/23 16:16 + **/ + UserHistoricalActResultDTO queryUserHistoricalAct(UserHistoricalActFormDTO formDTO); + + /** + * @return void + * @param actUserRelationId + * @author yinzuomei + * @description 报名审核-审核通过 + * @Date 2020/7/23 17:30 + **/ + void auditPass(String actUserRelationId); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 报名审核-拒绝报名 + * @Date 2020/7/23 18:14 + **/ + void auditRefuse(AuditUserFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 已结束-已参加人员列表 + * @Date 2020/7/24 10:17 + **/ + List queryJoinUserList(ActIdFormDTO formDTO); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 已结束-已取消报名人员列表 + * @Date 2020/7/24 10:54 + **/ + List queryCanceledUserList(ActIdFormDTO formDTO); + + /** + * @return com.epmet.dto.result.UserBaseInfoResultDTO + * @param userId + * @author yinzuomei + * @description 根据用户id获取用户基本信息 + * @Date 2020/7/24 12:47 + **/ + UserBaseInfoResultDTO queryUserBaseInfo(String userId); + + /** + * @return java.util.List + * @param userIdList + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/24 12:47 + **/ + List queryUserBaseInfoList(List userIdList); + + /** + * @return java.lang.Boolean + * @param userId + * @author yinzuomei + * @description 根据用户id判断是否志愿者 + * @Date 2020/7/24 12:52 + **/ + Boolean getVolunteerFlag(String userId); +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActContentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActContentServiceImpl.java new file mode 100644 index 0000000000..88e241dda9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActContentServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActContentDao; +import com.epmet.dto.ActContentDTO; +import com.epmet.entity.ActContentEntity; +import com.epmet.redis.ActContentRedis; +import com.epmet.service.ActContentService; +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.List; +import java.util.Map; + +/** + * 活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActContentServiceImpl extends BaseServiceImpl implements ActContentService { + + @Autowired + private ActContentRedis actContentRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActContentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActContentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActContentDTO get(String id) { + ActContentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActContentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActContentDTO dto) { + ActContentEntity entity = ConvertUtils.sourceToTarget(dto, ActContentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActContentDTO dto) { + ActContentEntity entity = ConvertUtils.sourceToTarget(dto, ActContentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java new file mode 100644 index 0000000000..1ecc24fc9b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActCustomizedServiceImpl.java @@ -0,0 +1,176 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.ActCustomizedConstant; +import com.epmet.dao.ActCustomizedDao; +import com.epmet.dto.ActCustomizedDTO; +import com.epmet.dto.form.work.ActCustomizedFormDTO; +import com.epmet.dto.form.work.SaveActCustomizedFormDTO; +import com.epmet.dto.result.work.ActCustomizedResultDTO; +import com.epmet.dto.result.work.CustomerHeartConfigsResultDTO; +import com.epmet.entity.ActCustomizedEntity; +import com.epmet.redis.ActCustomizedRedis; +import com.epmet.service.ActCustomizedService; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +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.List; +import java.util.Map; + +/** + * 爱心互助首页自定义配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActCustomizedServiceImpl extends BaseServiceImpl implements ActCustomizedService { + private Logger logger = LogManager.getLogger(ActCustomizedServiceImpl.class); + @Autowired + private ActCustomizedRedis actCustomizedRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActCustomizedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActCustomizedDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActCustomizedDTO get(String id) { + ActCustomizedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActCustomizedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActCustomizedDTO dto) { + ActCustomizedEntity entity = ConvertUtils.sourceToTarget(dto, ActCustomizedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActCustomizedDTO dto) { + ActCustomizedEntity entity = ConvertUtils.sourceToTarget(dto, ActCustomizedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @return com.epmet.dto.result.work.ActCustomizedResultDTO + * @param formDTO + * @author yinzuomei + * @description 获取当前客户下,爱心互助模块自定义配置项,如果没有配置,返回系统默认 + * @Date 2020/7/20 17:27 + **/ + @Override + public ActCustomizedResultDTO getConfigs(ActCustomizedFormDTO formDTO) { + ActCustomizedResultDTO actCustomizedResultDTO = baseDao.selectConfigsByCustomerId(formDTO.getCustomerId()); + if (null == actCustomizedResultDTO) { + logger.info(String.format("客户id%s没有自定义爱心互助相关图标名称,初始化默认值插入数据库", formDTO.getCustomerId())); + ActCustomizedEntity actCustomizedEntity = new ActCustomizedEntity(); + actCustomizedEntity.setCustomerId(formDTO.getCustomerId()); + actCustomizedEntity.setTitleName(ActCustomizedConstant.TITLE_NAME); + actCustomizedEntity.setHotline(ActCustomizedConstant.HOT_LINE); + actCustomizedEntity.setActListName(ActCustomizedConstant.ACT_LIST_NAME); + actCustomizedEntity.setHeartRankName(ActCustomizedConstant.HEART_RANK_NAME); + actCustomizedEntity.setActReviewName(ActCustomizedConstant.ACT_REVIEW_NAME); + actCustomizedEntity.setMyActName(ActCustomizedConstant.MY_ACT_NAME); + insert(actCustomizedEntity); + actCustomizedResultDTO = ConvertUtils.sourceToTarget(actCustomizedEntity, ActCustomizedResultDTO.class); + actCustomizedResultDTO.setActCustomizedId(actCustomizedEntity.getId()); + actCustomizedResultDTO.setHotLine(ActCustomizedConstant.HOT_LINE); + } + return actCustomizedResultDTO; + } + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 保存自定义配置 + * @Date 2020/7/20 17:27 + **/ + @Override + public void saveConfigs(SaveActCustomizedFormDTO formDTO) { + ActCustomizedDTO actCustomizedDTO=this.get(formDTO.getActCustomizedId()); + if(null!=actCustomizedDTO){ + actCustomizedDTO.setTitleName(formDTO.getTitleName()); + actCustomizedDTO.setHotline(formDTO.getHotLine()); + actCustomizedDTO.setActListName(formDTO.getActListName()); + actCustomizedDTO.setHeartRankName(formDTO.getHeartRankName()); + actCustomizedDTO.setActReviewName(formDTO.getActReviewName()); + actCustomizedDTO.setMyActName(formDTO.getMyActName()); + this.update(actCustomizedDTO); + return; + }else{ + logger.error("根据主键",formDTO.getActCustomizedId(),"查询act_customized表为空,保存自定义配置失败"); + } + } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.CustomerHeartConfigsResultDTO + * @author yinzuomei + * @description 居民端根据客户id获取爱心互助自定义配置 + * @Date 2020/7/21 12:47 + **/ + @Override + public CustomerHeartConfigsResultDTO getCustomerHeartConfigs(ActCustomizedFormDTO formDTO) { + CustomerHeartConfigsResultDTO resultDTO = baseDao.selectCustomerHeartConfigs(formDTO.getCustomerId()); + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java new file mode 100644 index 0000000000..3644df4f10 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -0,0 +1,373 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +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.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ActConstant; +import com.epmet.dao.ActInfoDao; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dao.HeartUserInfoDao; +import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.form.resi.*; +import com.epmet.dto.result.resi.*; +import com.epmet.entity.ActInfoEntity; +import com.epmet.entity.ActUserRelationEntity; +import com.epmet.redis.ActInfoRedis; +import com.epmet.service.ActInfoService; +import com.epmet.service.ActUserRelationService; +import com.epmet.utils.CaculateDistance; +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.*; + +/** + * 活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActInfoServiceImpl extends BaseServiceImpl implements ActInfoService { + + @Autowired + private ActInfoRedis actInfoRedis; + + @Autowired + private ActUserRelationService relationService; + + @Autowired + private ActUserRelationDao actUserRelationDao; + + @Autowired + private HeartUserInfoDao heartUserInfoDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActInfoDTO get(String id) { + ActInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActInfoDTO dto) { + ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActInfoDTO dto) { + ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result> listAct(TokenDto tokenDto, ResiActBaseFormDTO formDto) { + List list = new ArrayList<>(); + formDto.setUserId(tokenDto.getUserId()); + // 查询活动状态是:报名中 signing_up + List signingUp = baseDao.selectListActSigningUp(formDto); + list.addAll(signingUp); + + // 查询活动状态是:已报满 enough + List enough = baseDao.selectListActQuotaIsEnough(formDto); + list.addAll(enough); + + // 查询活动状态是:截止报名 end_sign_up + List endSignUp = baseDao.selectListActEndSignUp(formDto); + list.addAll(endSignUp); + + // 查询活动状态是:已开始 in_progress + List inProgress = baseDao.selectListActInProgress(formDto); + list.addAll(inProgress); + + // 查询活动状态是:已结束 finished + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); + List finished = baseDao.selectListActFinished(formDto); + list.addAll(finished); + return new Result>().ok(list); + } + + @Override + public Result> myActListAuditing(TokenDto tokenDto, ResiMyActFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); + List myAct = baseDao.selectListMyActAuditing(formDto); + return new Result>().ok(myAct); + } + + @Override + public Result> myActListRefused(TokenDto tokenDto, ResiMyActFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); + List myAct = baseDao.selectListActRefused(formDto); + return new Result>().ok(myAct); + } + + @Override + public Result> myActListPassed(TokenDto tokenDto, ResiMyActFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); + List myAct = baseDao.selectListMyActIHavePassed(formDto); + return new Result>().ok(myAct); + } + + @Override + public Result> myActListCanceld(TokenDto tokenDto, ResiMyActFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); + List myAct = baseDao.selectListMyActCanceld(formDto); + return new Result>().ok(myAct); + } + + @Override + public Result> latestAct(ResiLatestActFormDTO formDto) { + List latest = baseDao.selectListLatestAct(formDto); + return new Result>().ok(latest); + } + + @Override + public Result> inProgressAct(TokenDto tokenDto) { + List inProgress = baseDao.selectListInProgress(tokenDto.getUserId()); + return new Result>().ok(inProgress); + } + + @Override + public Result> actLookBack(ResiActBaseFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + List lookBackAct = baseDao.selectListLookBackAct(formDTO); + return new Result>().ok(lookBackAct); + } + + @Override + public Result actDetail(TokenDto tokenDto, ResiActDetailFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + // 从活动表查询活动信息 + ResiActDetailResultDTO detailResultDTO = baseDao.selectActInfoDetail(formDto); + // 获取活动内容 + detailResultDTO.setActContent(baseDao.selectListActContent(formDto.getActId())); + // 查询用户是否是志愿者 + Boolean volunteerFlag = heartUserInfoDao.selectUserVolunteerFlag(formDto.getUserId()); + detailResultDTO.setUserVolunteerFlag(volunteerFlag); + + // 获取用户报名状态 + String currentUserStatus = getCurrentUserStatus(formDto.getActId(), formDto.getUserId()); + detailResultDTO.setCurrentUserStatus(currentUserStatus); + return new Result().ok(detailResultDTO); + } + + /** + * 返回当前活动下,用户状态: + * (sign_up-我要报名,canceld-取消报名,enough-已报满,end_sign_up-截止报名,in_progress-已开始; finished-已结束,canceled-已取消) + * + * @param actId 活动id + * @param userId 用户id + * @return java.lang.String + * @Author zhangyong + * @Date 2020/7/22 10:54 + **/ + private String getCurrentUserStatus(String actId, String userId) { + Date currentTime = new Date(); + ActInfoEntity actInfoEntity =baseDao.selectById(actId); + // 活动已取消 + if (ActConstant.CURRENT_STATUS_USER_CANCELED.equals(actInfoEntity.getActStatus())) { + return ActConstant.CURRENT_STATUS_USER_CANCELED; + } + // 活动已经结束 + if (ActConstant.CURRENT_STATUS_USER_FINISHED.equals(actInfoEntity.getActStatus())) { + return ActConstant.CURRENT_STATUS_USER_FINISHED; + } + + // 查询用户是否报名该活动 + QueryWrapper actUserRelationWrapper = new QueryWrapper<>(); + actUserRelationWrapper.eq("ACT_ID", actId) + .eq("USER_ID", userId) + .orderByDesc("CREATED_TIME").last("limit 1"); + ActUserRelationEntity actUserRelationEntity = actUserRelationDao.selectOne(actUserRelationWrapper); + // 查询活动已报名的人数 + Integer signUpNum = actUserRelationDao.selectActSignupNum(actId); + + if (null == actUserRelationEntity) { + return getCurrentUserStatusNotSignUp(actInfoEntity, signUpNum, currentTime); + } else { + return getCurrentUserStatusHasSignUp(actInfoEntity, actUserRelationEntity, signUpNum, currentTime); + } + } + + /** + * 用户未报名活动时,判断用户活动状态 + * + * @param actInfoEntity 当前活动 + * @param signUpNum 活动报名人数 + * @param currentTime 当前时间 + * @return java.lang.String + * @author zhangyong + * @date 2020/7/22 10:54 + */ + private String getCurrentUserStatusNotSignUp(ActInfoEntity actInfoEntity, Integer signUpNum, Date currentTime) { + if (currentTime.before(actInfoEntity.getSignUpEndTime())) { + /*报名结束前*/ + if (Boolean.FALSE.equals(actInfoEntity.getActQuotaCategory()) || actInfoEntity.getActQuota() > signUpNum) { + // 我要报名(不限名额或者未报满的) + return ActConstant.CURRENT_STATUS_USER_SIGN_UP; + } else { + // 已报满(限制名额且已经报满的) + return ActConstant.CURRENT_STATUS_USER_ENOUGH; + } + } else if (currentTime.after(actInfoEntity.getSignUpEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) { + /*报名结束,活动未开始:显示:截止报名*/ + return ActConstant.CURRENT_STATUS_USER_END_SIGN_UP; + } else if (currentTime.after(actInfoEntity.getActStartTime()) && currentTime.before(actInfoEntity.getActEndTime())) { + // 活动开始-结束的时间段内: 显示:已开始 + return ActConstant.CURRENT_STATUS_USER_IN_PROGRESS; + } else { + // 最后,显示:已结束 + return ActConstant.CURRENT_STATUS_USER_FINISHED; + } + } + + /** + * 用户已报名活动时,判断用户活动状态 + * + * @param actInfoEntity 当前活动 + * @param actUserRelationEntity 用户活动关系 + * @param signUpNum 活动报名人数 + * @param currentTime 当前时间 + * @return java.lang.String + * @author zhangyong + * @date 2020/7/22 17:11 + */ + private String getCurrentUserStatusHasSignUp(ActInfoEntity actInfoEntity, ActUserRelationEntity actUserRelationEntity, Integer signUpNum, Date currentTime) { + String actUserStatus = actUserRelationEntity.getStatus(); + + // 已确认过积分,直接返回 + if (ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelationEntity.getRewardFlag()) + || ActConstant.ACT_USER_STATUS_DENY.equals(actUserRelationEntity.getRewardFlag())) { + return ActConstant.CURRENT_STATUS_USER_POINTS_CONFIRM; + } + + if (currentTime.after(actInfoEntity.getActStartTime()) && currentTime.before(actInfoEntity.getActEndTime())) { + /* 活动开始-结束的时间段内 */ + return ActConstant.CURRENT_STATUS_USER_IN_PROGRESS; + } else if (currentTime.before(actInfoEntity.getSignUpEndTime())) { + /* 报名截至时间前 */ + //(未审核、审核通过的)底部显示按钮 取消报名 + if (ActConstant.ACT_USER_STATUS_AUDITING.equals(actUserStatus) || ActConstant.ACT_USER_STATUS_PASSED.equals(actUserStatus)) { + return ActConstant.ACT_USER_STATUS_CANCELD; + } + // 活动限制名额,且报名人数已满 已报满 + if (Boolean.FALSE.equals(actInfoEntity.getActQuotaCategory()) && signUpNum >= actInfoEntity.getActQuota()) { + return ActConstant.CURRENT_STATUS_USER_ENOUGH; + } + // (报名审核未通过或者已经取消报名的)可再次报名-我要报名 + if (ActConstant.ACT_USER_STATUS_REFUSED.equals(actUserStatus) || ActConstant.ACT_USER_STATUS_CANCELD.equals(actUserStatus)) { + return ActConstant.CURRENT_STATUS_USER_SIGN_UP; + } + } else if (currentTime.after(actInfoEntity.getSignUpEndTime()) && currentTime.before(actInfoEntity.getActStartTime())) { + /* 报名截止但 活动未开始 */ + // 已经取消报名的-报名截止 + if (ActConstant.ACT_USER_STATUS_CANCELD.equals(actUserStatus)) { + return ActConstant.CURRENT_STATUS_USER_END_SIGN_UP; + } + // 已报名审核不通过 -报名截止 + if (ActConstant.ACT_USER_STATUS_REFUSED.equals(actUserStatus)) { + return ActConstant.CURRENT_STATUS_USER_END_SIGN_UP; + } + // 已报名且审核通过、未审核 -取消报名 + if (ActConstant.ACT_USER_STATUS_PASSED.equals(actUserStatus) || ActConstant.ACT_USER_STATUS_AUDITING.equals(actUserStatus)) { + return ActConstant.ACT_USER_STATUS_CANCELD; + } + } + return ActConstant.CURRENT_STATUS_USER_FINISHED; + } + + @Override + public Result rejectDetail(TokenDto tokenDto, ResiActDetailFormDTO formDto) { + formDto.setUserId(tokenDto.getUserId()); + ResiActRefusedDetailResultDTO detail = baseDao.selectActRejectDetail(formDto); + return new Result().ok(detail); + } + + @Override + public Result checkSignInAddress(ResiActCaculateDistanceFormDTO formDTO) { + // 根据活动id,查询活动基本信息 + ActInfoEntity entity = baseDao.selectById(formDTO.getActId()); + Double distance = CaculateDistance.getDistance(formDTO.getLongitude(),formDTO.getLatitude(),entity.getActLongitude().doubleValue(),entity.getActLatitude().doubleValue()); + if (distance <= entity.getSignInRadius()){ + return new Result(); + } else { + throw new RenException(EpmetErrorCode.NOT_IN_THE_SIGN_IN_RANGE.getCode()); + } + } + + @Override + public Integer checkActTime(ActInfoDTO actInfoDTO) { + return baseDao.checkActTime(actInfoDTO); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLivePicServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLivePicServiceImpl.java new file mode 100644 index 0000000000..5f2bf70f66 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLivePicServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActLivePicDao; +import com.epmet.dto.ActLivePicDTO; +import com.epmet.entity.ActLivePicEntity; +import com.epmet.redis.ActLivePicRedis; +import com.epmet.service.ActLivePicService; +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.List; +import java.util.Map; + +/** + * 活动实况图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActLivePicServiceImpl extends BaseServiceImpl implements ActLivePicService { + + @Autowired + private ActLivePicRedis actLivePicRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActLivePicDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActLivePicDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActLivePicDTO get(String id) { + ActLivePicEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActLivePicDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActLivePicDTO dto) { + ActLivePicEntity entity = ConvertUtils.sourceToTarget(dto, ActLivePicEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActLivePicDTO dto) { + ActLivePicEntity entity = ConvertUtils.sourceToTarget(dto, ActLivePicEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java new file mode 100644 index 0000000000..ed5cd03409 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActLiveRecServiceImpl.java @@ -0,0 +1,179 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.MqConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; +import com.epmet.commons.tools.exception.ErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SendMqMsgUtils; +import com.epmet.constant.ActMessageConstant; +import com.epmet.dao.ActLivePicDao; +import com.epmet.dao.ActLiveRecDao; +import com.epmet.dto.ActLivePicDTO; +import com.epmet.dto.ActLiveRecDTO; +import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.resi.ResiActLiveRecResultDTO; +import com.epmet.entity.ActLivePicEntity; +import com.epmet.entity.ActLiveRecEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.redis.ActLiveRecRedis; +import com.epmet.service.ActLiveRecService; +import com.epmet.utils.ValidityVerification; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 活动实况记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActLiveRecServiceImpl extends BaseServiceImpl implements ActLiveRecService { + private Logger logger = LogManager.getLogger(VolunteerInfoServiceImpl.class); + + @Autowired + private ActLiveRecRedis actLiveRecRedis; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + private ActLivePicDao actLivePicDao; + + @Override + public Result liveRecList(Map map) { + if (map.get("actId") == null){ + logger.error("传参中没有活动ID"); + throw new RenException("传参中没有活动ID"); + } + // 数据汇总 + ResiActLiveRecResultDTO resultDto = new ResiActLiveRecResultDTO(); + // 查询实况记录 + List actLives = baseDao.selectListActLives(map.get("actId")); + List userIds = new ArrayList<>(); + List liveIds = new ArrayList<>(); + for (ActLiveRecDTO actLive : actLives){ + userIds.add(actLive.getUserId()); + liveIds.add(actLive.getId()); + } + if (actLives.size() > NumConstant.ZERO){ + // 查询用户微信基础信息 + Result> userWxInfos = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + if (userWxInfos.getData().size() > NumConstant.ZERO){ + // 根据活动实况id,查询对应实况的图片集合 + List actLiveImg = baseDao.selectListActLiveImg(liveIds); + + List dataContainer = new ArrayList<>(); + for (int k = 0; k < actLives.size(); k++) { + Map base = new HashMap<>(); + base.put("nickname", userWxInfos.getData().get(k).getNickname()); + base.put("headImg", userWxInfos.getData().get(k).getHeadImgUrl()); + base.put("desc", actLives.get(k).getDesc()); + base.put("createdTime", actLives.get(k).getCreatedTime()); + // 查询打卡对应图片 + List imgUrlList = new ArrayList<>(); + for (ActLivePicDTO urlDto : actLiveImg) { + if (actLives.get(k).getId().equals(urlDto.getLiveId())) { + imgUrlList.add(urlDto.getPicUrl()); + } + } + base.put("images", imgUrlList); + dataContainer.add(base); + } + resultDto.setActLives(dataContainer); + resultDto.setActLiveNum(dataContainer.size()); + } else { + logger.error("未查到用户基础信息"); + throw new RenException("未查到用户基础信息"); + } + } + return new Result().ok(resultDto); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result insertLive(TokenDto tokenDto, ResiActInsertLiveFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + // 文本校验 + ValidityVerification verification = new ValidityVerification(); + verification.textScanVerification(formDTO.getDesc(),"添加实况-文本内容审核失败"); + // 图片校验 + verification.imgScanVerification(formDTO.getImages(),"添加实况-图片审核失败"); + + // 存储活动实况记录表 + String uuid = UUID.randomUUID().toString().replaceAll("-",""); + formDTO.setId(uuid); + baseDao.insertActLiveRec(formDTO); + + //存储活动实况图片 + List imgList = formDTO.getImages(); + if (null != imgList){ + for (int i = 0; i < imgList.size(); i++) { + String imgUrl = imgList.get(i); + ActLivePicEntity actLivePicEntity = new ActLivePicEntity(); + actLivePicEntity.setLiveId(uuid); + actLivePicEntity.setPicUrl(imgUrl); + actLivePicEntity.setSort(i + NumConstant.ONE); + actLivePicDao.insert(actLivePicEntity); + } + } + // 发送消息 由积分系统消费消息(需要使用规则) + this.grantActPoints(formDTO); + return new Result().ok(uuid); + } + + private void grantActPoints(ResiActInsertLiveFormDTO formDTO){ + //备注 + String remark=String.format(ActMessageConstant.ACT_POINTS_EVENT_VOLUNTEER_LIVE,formDTO.getUserId(),formDTO.getActId()); + MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); + //mq的事件类型 + mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_INSERT_LIVE.getEventClass()); + //事件code + mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_INSERT_LIVE.getEventTag()); + List actPointEventMsgList=new ArrayList<>(); + ActPointEventMsg actPointEventMsg=new ActPointEventMsg(); + actPointEventMsg.setCustomerId(formDTO.getCustomerId()); + actPointEventMsg.setUserId(formDTO.getUserId()); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setIsCommon(false); + actPointEventMsg.setRemark(remark); + actPointEventMsgList.add(actPointEventMsg); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); + Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!result.success()){ + logger.error("添加活动实况,事件发送失败"); + } + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActOperationRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActOperationRecServiceImpl.java new file mode 100644 index 0000000000..aa83d22102 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActOperationRecServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActOperationRecDao; +import com.epmet.dto.ActOperationRecDTO; +import com.epmet.entity.ActOperationRecEntity; +import com.epmet.redis.ActOperationRecRedis; +import com.epmet.service.ActOperationRecService; +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.List; +import java.util.Map; + +/** + * 活动操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActOperationRecServiceImpl extends BaseServiceImpl implements ActOperationRecService { + + @Autowired + private ActOperationRecRedis actOperationRecRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActOperationRecDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActOperationRecDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActOperationRecDTO get(String id) { + ActOperationRecEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActOperationRecDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActOperationRecDTO dto) { + ActOperationRecEntity entity = ConvertUtils.sourceToTarget(dto, ActOperationRecEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActOperationRecDTO dto) { + ActOperationRecEntity entity = ConvertUtils.sourceToTarget(dto, ActOperationRecEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActPointLogServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActPointLogServiceImpl.java new file mode 100644 index 0000000000..0f09783403 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActPointLogServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActPointLogDao; +import com.epmet.dto.ActPointLogDTO; +import com.epmet.entity.ActPointLogEntity; +import com.epmet.redis.ActPointLogRedis; +import com.epmet.service.ActPointLogService; +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.List; +import java.util.Map; + +/** + * 活动发放积分日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActPointLogServiceImpl extends BaseServiceImpl implements ActPointLogService { + + @Autowired + private ActPointLogRedis actPointLogRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActPointLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActPointLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActPointLogDTO get(String id) { + ActPointLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActPointLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActPointLogDTO dto) { + ActPointLogEntity entity = ConvertUtils.sourceToTarget(dto, ActPointLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActPointLogDTO dto) { + ActPointLogEntity entity = ConvertUtils.sourceToTarget(dto, ActPointLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInPicServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInPicServiceImpl.java new file mode 100644 index 0000000000..b9c54782e3 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInPicServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActSignInPicDao; +import com.epmet.dto.ActSignInPicDTO; +import com.epmet.entity.ActSignInPicEntity; +import com.epmet.redis.ActSignInPicRedis; +import com.epmet.service.ActSignInPicService; +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.List; +import java.util.Map; + +/** + * 活动签到图片表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActSignInPicServiceImpl extends BaseServiceImpl implements ActSignInPicService { + + @Autowired + private ActSignInPicRedis actSignInPicRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActSignInPicDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActSignInPicDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActSignInPicDTO get(String id) { + ActSignInPicEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActSignInPicDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActSignInPicDTO dto) { + ActSignInPicEntity entity = ConvertUtils.sourceToTarget(dto, ActSignInPicEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActSignInPicDTO dto) { + ActSignInPicEntity entity = ConvertUtils.sourceToTarget(dto, ActSignInPicEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java new file mode 100644 index 0000000000..c874a61640 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSignInRecServiceImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ActConstant; +import com.epmet.dao.ActSignInPicDao; +import com.epmet.dao.ActSignInRecDao; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dto.ActSignInRecDTO; +import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.form.resi.ResiActInsertLiveFormDTO; +import com.epmet.dto.form.resi.ResiActSignInFormDTO; +import com.epmet.entity.ActSignInPicEntity; +import com.epmet.entity.ActSignInRecEntity; +import com.epmet.redis.ActSignInRecRedis; +import com.epmet.service.ActLiveRecService; +import com.epmet.service.ActSignInRecService; +import com.epmet.utils.ValidityVerification; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; +import java.util.UUID; + +/** + * 活动签到记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActSignInRecServiceImpl extends BaseServiceImpl implements ActSignInRecService { + + @Autowired + private ActSignInRecRedis actSignInRecRedis; + + @Autowired + private ActUserRelationDao actUserRelationDao; + + @Autowired + private ActSignInPicDao actSignInPicDao; + + @Autowired + private ActLiveRecService actLiveRecService; + + @Override + @Transactional(rollbackFor = Exception.class) + public Result actSignIn(TokenDto tokenDto, ResiActSignInFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + // 文本校验 + ValidityVerification verification = new ValidityVerification(); + verification.textScanVerification(formDTO.getDesc(),"添加签到-文本内容审核失败"); + // 图片校验 + verification.imgScanVerification(formDTO.getImages(),"添加签到-图片审核失败"); + + // 更新用户活动关系表 SIGN_IN_FLAG字段更新为已签到 + ActUserRelationDTO actUserRelationDTO = new ActUserRelationDTO(); + actUserRelationDTO.setActId(formDTO.getActId()); + actUserRelationDTO.setUserId(formDTO.getUserId()); + actUserRelationDTO.setSignInFlag(ActConstant.ACT_USER_STATUS_SIGNED_IN); + actUserRelationDao.updateUserRelationByActIdAndUserId(actUserRelationDTO); + + ActSignInRecDTO dto = ConvertUtils.sourceToTarget(formDTO, ActSignInRecDTO.class); + + if (formDTO.getSyncLive() == NumConstant.ONE){ + // 签到内容同步到实况 + ResiActInsertLiveFormDTO liveFormDTO = ConvertUtils.sourceToTarget(formDTO, ResiActInsertLiveFormDTO.class); + Result inSertlive = actLiveRecService.insertLive(tokenDto, liveFormDTO); + //实况id, 当sync_live=1时此列有值 + dto.setLiveId(inSertlive.getData()); + } + // 存储活动签到记录表 + String uuid = UUID.randomUUID().toString().replaceAll("-",""); + dto.setId(uuid); + baseDao.insertActSignInRec(dto); + + //存储活动签到图片 + List imgList = formDTO.getImages(); + if (null != imgList){ + for (int i = 0; i < imgList.size(); i++) { + String imgUrl = imgList.get(i); + ActSignInPicEntity actLivePicEntity = new ActSignInPicEntity(); + actLivePicEntity.setSignInId(uuid); + actLivePicEntity.setPicUrl(imgUrl); + actLivePicEntity.setSort(i + NumConstant.ONE); + actSignInPicDao.insert(actLivePicEntity); + } + } + return new Result(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActStatisticalServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActStatisticalServiceImpl.java new file mode 100644 index 0000000000..9dc1d82ede --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActStatisticalServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActStatisticalDao; +import com.epmet.dto.ActStatisticalDTO; +import com.epmet.entity.ActStatisticalEntity; +import com.epmet.redis.ActStatisticalRedis; +import com.epmet.service.ActStatisticalService; +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.List; +import java.util.Map; + +/** + * 活动统计信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActStatisticalServiceImpl extends BaseServiceImpl implements ActStatisticalService { + + @Autowired + private ActStatisticalRedis actStatisticalRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActStatisticalDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActStatisticalDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActStatisticalDTO get(String id) { + ActStatisticalEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActStatisticalDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActStatisticalDTO dto) { + ActStatisticalEntity entity = ConvertUtils.sourceToTarget(dto, ActStatisticalEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActStatisticalDTO dto) { + ActStatisticalEntity entity = ConvertUtils.sourceToTarget(dto, ActStatisticalEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java new file mode 100644 index 0000000000..d3f9087afc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActSummaryServiceImpl.java @@ -0,0 +1,115 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.ActSummaryDao; +import com.epmet.dto.ActSummaryDTO; +import com.epmet.dto.form.resi.ResiActContentFormDTO; +import com.epmet.dto.result.resi.ResiActSummaryResultDTO; +import com.epmet.entity.ActSummaryEntity; +import com.epmet.redis.ActSummaryRedis; +import com.epmet.service.ActSummaryService; +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.List; +import java.util.Map; + +/** + * 活动回顾表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActSummaryServiceImpl extends BaseServiceImpl implements ActSummaryService { + + @Autowired + private ActSummaryRedis actSummaryRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActSummaryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActSummaryDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActSummaryDTO get(String id) { + ActSummaryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActSummaryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActSummaryDTO dto) { + ActSummaryEntity entity = ConvertUtils.sourceToTarget(dto, ActSummaryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActSummaryDTO dto) { + ActSummaryEntity entity = ConvertUtils.sourceToTarget(dto, ActSummaryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Result summaryList(ResiActContentFormDTO formDto) { + int pageIndex = (formDto.getPageNo() - NumConstant.ONE) * formDto.getPageSize(); + formDto.setPageNo(pageIndex); + return new Result().ok(baseDao.selectListSummary(formDto)); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserLogServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserLogServiceImpl.java new file mode 100644 index 0000000000..72cc2395c9 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserLogServiceImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ActUserLogDao; +import com.epmet.dto.ActUserLogDTO; +import com.epmet.entity.ActUserLogEntity; +import com.epmet.redis.ActUserLogRedis; +import com.epmet.service.ActUserLogService; +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.List; +import java.util.Map; + +/** + * 用户活动关系日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActUserLogServiceImpl extends BaseServiceImpl implements ActUserLogService { + + @Autowired + private ActUserLogRedis actUserLogRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActUserLogDTO get(String id) { + ActUserLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActUserLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActUserLogDTO dto) { + ActUserLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActUserLogDTO dto) { + ActUserLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public Integer countActTimesOfParticipation(String userId) { + return baseDao.countActTimesOfParticipation(userId); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java new file mode 100644 index 0000000000..134ac475e2 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActUserRelationServiceImpl.java @@ -0,0 +1,325 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; +import com.epmet.commons.tools.constant.FieldConstant; +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.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ActConstant; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dao.HeartUserInfoDao; +import com.epmet.dao.VolunteerInfoDao; +import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.ActUserLogDTO; +import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.form.resi.ResiActRegistrationFormDTO; +import com.epmet.dto.form.resi.ResiActUserCancelSignUpFormDTO; +import com.epmet.dto.result.UserRoleResultDTO; +import com.epmet.entity.ActUserLogEntity; +import com.epmet.entity.ActUserRelationEntity; +import com.epmet.entity.HeartUserInfoEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.redis.ActUserRelationRedis; +import com.epmet.service.ActInfoService; +import com.epmet.service.ActUserLogService; +import com.epmet.service.ActUserRelationService; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +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; + +/** + * 用户活动关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class ActUserRelationServiceImpl extends BaseServiceImpl implements ActUserRelationService { + + @Autowired + private ActUserRelationRedis actUserRelationRedis; + @Autowired + private ActUserLogService actUserLogService; + @Autowired + private ActInfoService actInfoService; + @Autowired + private VolunteerInfoDao volunteerInfoDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private HeartUserInfoDao heartUserInfoDao; + + private Logger logger = LogManager.getLogger(WorkActDraftServiceImpl.class); + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ActUserRelationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ActUserRelationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ActUserRelationDTO get(String id) { + ActUserRelationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ActUserRelationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ActUserRelationDTO dto) { + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(dto, ActUserRelationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ActUserRelationDTO dto) { + ActUserRelationEntity entity = ConvertUtils.sourceToTarget(dto, ActUserRelationEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param actId + * @param status 当前状态(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld,) + * @return java.util.List + * @author yinzuomei + * @description 查询已通过的人员列表 + * @Date 2020/7/22 15:31 + **/ + @Override + public List getUserList(String actId, String status) { + return baseDao.selecUserList(actId, status); + } + + /** + * @param actId + * @param status 当前状态(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld,) + * @return java.util.List + * @author yinzuomei + * @description 查询已通过的人员列表 userId集合 + * @Date 2020/7/22 15:37 + **/ + @Override + public List getUserIdList(String actId, String status) { + return baseDao.selectUserIdList(actId, status); + } + + /** + * @param actId + * @param status + * @return java.lang.Integer + * @author yinzuomei + * @description 根据活动id, 用户状态,统计用户数eg:待审核总数,审核通过总数,已拒绝总数,已取消报名总数 + * @Date 2020/7/22 18:17 + **/ + @Override + public Integer selectCountUser(String actId, String status) { + return baseDao.selectCountUser(actId, status); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result cancelSignUp(TokenDto tokenDto, ResiActUserCancelSignUpFormDTO formDTO) { + //1、更新用户活动关系表 的用户状态 + ActUserRelationDTO userRelationDTO = new ActUserRelationDTO(); + userRelationDTO.setActId(formDTO.getActId()); + userRelationDTO.setUserId(tokenDto.getUserId()); + userRelationDTO.setCancelReason(formDTO.getFailureReason()); + userRelationDTO.setStatus(ActConstant.ACT_USER_STATUS_CANCELD); + baseDao.updateUserRelationByActIdAndUserId(userRelationDTO); + + //2、插入用户活动关系日志表 + ActUserLogDTO userLogDTO = new ActUserLogDTO(); + userLogDTO.setActId(formDTO.getActId()); + userLogDTO.setUserId(tokenDto.getUserId()); + userLogDTO.setOperationType(ActConstant.ACT_USER_LOG_OPER_CANCELD); + userLogDTO.setReason(formDTO.getFailureReason()); + actUserLogService.save(userLogDTO); + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result registration(TokenDto tokenDto, ResiActRegistrationFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + boolean satisfy = false; + // 查询活动信息 + ActInfoDTO actInfoDTO = actInfoService.get(formDTO.getActId()); + // >0 当前用户是志愿者 + Integer volunteerFlag = volunteerInfoDao.queryVolunteerFlagByUserId(formDTO.getUserId()); + if (actInfoDTO.getVolunteerLimit()){ + // 活动只能志愿者参加, 当前用户是否满足条件 + satisfy = this.volunteerParticipationAct(volunteerFlag); + } else { + // 活动不限制志愿者身份,但要求是 居民身份, 当前用户是否满足条件 + satisfy = this.resiParticipationAct(formDTO.getUserId()); + } + if (satisfy){ + // 开始报名 + this.actStartSignUp(actInfoDTO, formDTO, volunteerFlag); + } + return new Result(); + } + + /** + * 开始报名活动 + * + * @param actInfoDTO 活动详情 + * @param formDTO 接口请求入参 + * @param volunteerFlag >0 当前用户是志愿者 + * @return void + * @Author zhangyong + * @Date 15:31 2020-07-24 + **/ + private void actStartSignUp(ActInfoDTO actInfoDTO, ResiActRegistrationFormDTO formDTO, Integer volunteerFlag){ + boolean signUp = true; + Integer auditingNum = actUserLogService.countActTimesOfParticipation(formDTO.getUserId()); + if (auditingNum > NumConstant.ZERO){ + // 2.判断本次报名的活动与之前未结束的活动报名时间 是否产生交集,产生则 报名失败 + actInfoDTO.setUserId(formDTO.getUserId()); + Integer actTimeFlag = actInfoService.checkActTime(actInfoDTO); + if (actTimeFlag > NumConstant.ZERO){ + signUp = false; + logger.info("活动报名失败,活动时间冲突"); + throw new RenException(EpmetErrorCode.ACT_TIME_CONFLICT.getCode()); + } + } else { + // 3.第一次报名 + HeartUserInfoEntity entity = new HeartUserInfoEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setUserId(formDTO.getUserId()); + entity.setVolunteerFlag(volunteerFlag > NumConstant.ZERO); + entity.setKindnessTime(NumConstant.ZERO); + entity.setParticipationNum(NumConstant.ZERO); + entity.setObtainPointNum(NumConstant.ZERO); + heartUserInfoDao.insert(entity); + } + if (signUp){ + // 4.插入活动日志表 + ActUserLogEntity userLogEntity = new ActUserLogEntity(); + userLogEntity.setActId(formDTO.getActId()); + userLogEntity.setUserId(formDTO.getUserId()); + userLogEntity.setOperationType(ActConstant.ACT_USER_LOG_OPER_AUDITING); + actUserLogService.insert(userLogEntity); + } + ActUserRelationEntity entity = new ActUserRelationEntity(); + entity.setActId(formDTO.getActId()); + entity.setUserId(formDTO.getUserId()); + entity.setStatus(ActConstant.ACT_USER_STATUS_AUDITING); + // 审核开关:1报名人员需要人工审核(true) 0不需要(false) + if (actInfoDTO.getAuditSwitch()){ + entity.setPassedType(ActConstant.PASSEDTYPE_MANUAL); + } else { + entity.setPassedType(ActConstant.PASSEDTYPE_AUTO); + entity.setAuditTime(new Date()); + } + Integer operationCount = baseDao.selectCountByActIdAndUserId(formDTO.getActId(), formDTO.getUserId()); + if (operationCount > NumConstant.ZERO){ + // 用户如果不是第一次参加 这次的活动,先删除关系表中的数据,在插入 + baseDao.delSignUpRecord(entity); + } + baseDao.insert(entity); + } + + /** + * 活动报名,限制必须是志愿者身份。当前用户是否符合 + * @param volunteerFlag + * @return boolean + * @Author zhangyong + * @Date 15:04 2020-07-24 + **/ + private boolean volunteerParticipationAct(Integer volunteerFlag){ + boolean satisfy = false; + // 活动只能志愿者参加 + if (volunteerFlag > NumConstant.ZERO){ + satisfy = true; + return satisfy; + } else { + logger.info("活动报名失败,请先认证志愿者"); + throw new RenException(EpmetErrorCode.NON_CERTIFIED_VOLUNTEER.getCode()); + } + } + + /** + * 活动报名,不限制志愿者身份,但要求是 居民身份。当前用户是否符合 + * @param userId + * @return boolean + * @Author zhangyong + * @Date 15:04 2020-07-24 + **/ + private boolean resiParticipationAct(String userId){ + boolean satisfy = false; + // 活动不限制志愿者身份,但要求是 居民身份 + Result> userRoleInfo = epmetUserOpenFeignClient.getUserRoleInfoByUserId(userId); + if (userRoleInfo.success()){ + for (UserRoleResultDTO roleResultDTO :userRoleInfo.getData()){ + if (EpmetRoleKeyConstant.REGISTERED_RESI.equals(roleResultDTO.getRoleKey())){ + satisfy = true; + } + } + } + if (!satisfy){ + logger.info("活动报名失败,请完善居民信息"); + throw new RenException(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); + } else { + return satisfy; + } + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java new file mode 100644 index 0000000000..ccdab4e19e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java @@ -0,0 +1,288 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.constant.ActConstant; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dto.ActInfoDTO; +import com.epmet.dto.ActPointLogDTO; +import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.form.work.ActIdFormDTO; +import com.epmet.dto.form.work.GrantPointsFormDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.work.DeniedUserResultDTO; +import com.epmet.dto.result.work.ObtainedUserResultDTO; +import com.epmet.dto.result.work.PendingUserResultDTO; +import com.epmet.dto.result.work.UserBaseInfo; +import com.epmet.service.*; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 积分发放 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/24 12:27 + */ +@Service +public class GrantPointsServiceImpl implements GrantPointsService { + private Logger logger = LogManager.getLogger(GrantPointsServiceImpl.class); + @Autowired + private ActInfoService actInfoService; + @Autowired + private ActUserRelationDao actUserRelationDao; + @Autowired + private WorkActUserService workActUserService; + @Autowired + private ActUserRelationService actUserRelationService; + @Autowired + private ActPointLogService actPointLogService; + @Autowired + private LoginUserUtil loginUserUtil; + /** + * @param actId + * @return com.epmet.dto.result.work.PendingUserResultDTO + * @author yinzuomei + * @description 积分发放-待处理列表 + * @Date 2020/7/24 12:28 + **/ + @Override + public PendingUserResultDTO queryPendingList(String actId) { + PendingUserResultDTO pendingUserResultDTO = new PendingUserResultDTO(actId); + ActInfoDTO actInfoDTO = actInfoService.get(actId); + if (null == actInfoDTO) { + return pendingUserResultDTO; + } + pendingUserResultDTO.setActId(actId); + pendingUserResultDTO.setReward(actInfoDTO.getReward()); + pendingUserResultDTO.setTitle(actInfoDTO.getTitle()); + //已签到人员列表 + List signedInList = new ArrayList<>(); + //未签到人员列表 + List noSignInList = new ArrayList<>(); + List signedActUserList = actUserRelationDao.selectInProgress(actId); + List userIdList = actUserRelationDao.selectInProgressUserIds(actId); + List userInfoList = workActUserService.queryUserBaseInfoList(userIdList); + for (ActUserRelationDTO actUserRelation : signedActUserList) { + UserBaseInfo userBaseInfo = new UserBaseInfo(); + userBaseInfo.setActUserRelationId(actUserRelation.getId()); + userBaseInfo.setUserId(actUserRelation.getUserId()); + userBaseInfo.setVolunteerFlag(workActUserService.getVolunteerFlag(actUserRelation.getUserId())); + for (UserBaseInfoResultDTO userBaseInfoResultDTO : userInfoList) { + if (actUserRelation.getUserId().equals(userBaseInfoResultDTO.getUserId())) { + userBaseInfo.setRealName(userBaseInfoResultDTO.getRealName()); + userBaseInfo.setNickName(userBaseInfoResultDTO.getNickname()); + userBaseInfo.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + if (ActConstant.ACT_USER_STATUS_SIGNED_IN.equals(actUserRelation.getSignInFlag())) { + //已签到 + signedInList.add(userBaseInfo); + } else { + //未签到 + noSignInList.add(userBaseInfo); + } + } + pendingUserResultDTO.setNoSignInList(noSignInList); + pendingUserResultDTO.setSignedInList(signedInList); + return pendingUserResultDTO; + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 积分发放-给分 + * @Date 2020/7/24 13:34 + **/ + @Override + public void agree(GrantPointsFormDTO formDTO) { + //是否是待处理 + ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId()); + if(null==actUserRelationDTO){ + logger.warn("积分发放-给分act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId()); + return; + } + //如果是已处理直接返回 + if(ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())){ + logger.info("积分发放-给分act_user_relation already handled,actUserRelationId="+formDTO.getActUserRelationId()); + return; + } + //查取分值 + ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId()); + if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) { + logger.warn("积分发放-给分act_info is null or act_info is finished"); + return; + } + if(!loginUserUtil.getLoginUserId().equals(actInfoDTO.getCreatedBy())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //更新act_user_relation改为已处理,给分 + actUserRelationDTO.setProcessFlag(ActConstant.HANDLED); + actUserRelationDTO.setRewardFlag(ActConstant.ACT_USER_STATUS_AGREE); + actUserRelationDTO.setDenyRewardReason(StrConstant.EPMETY_STR); + actUserRelationService.update(actUserRelationDTO); + //增加一条act_point_log + ActPointLogDTO actPointLogDTO=new ActPointLogDTO(); + actPointLogDTO.setActId(actUserRelationDTO.getActId()); + actPointLogDTO.setUserId(actUserRelationDTO.getUserId()); + actPointLogDTO.setPoints(actInfoDTO.getReward()); + actPointLogDTO.setOperateType(ActConstant.ACT_USER_STATUS_AGREE); + actPointLogDTO.setRemark(StrConstant.EPMETY_STR); + actPointLogService.save(actPointLogDTO); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 积分发放-不给分 + * @Date 2020/7/24 15:03 + **/ + @Override + public void deny(GrantPointsFormDTO formDTO) { + //是否是待处理 + ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId()); + if(null==actUserRelationDTO){ + logger.warn("积分发放-不给分act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId()); + return; + } + //如果是已处理直接返回 + if(ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())){ + logger.info("积分发放-不给分act_user_relation already handled,actUserRelationId="+formDTO.getActUserRelationId()); + return; + } + //查取分值 + ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId()); + if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) { + logger.warn("积分发放-不给分act_info is null or act_info is finished"); + return; + } + if(!loginUserUtil.getLoginUserId().equals(actInfoDTO.getCreatedBy())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //更新act_user_relation改为已处理,给分 + actUserRelationDTO.setProcessFlag(ActConstant.HANDLED); + actUserRelationDTO.setRewardFlag(ActConstant.ACT_USER_STATUS_DENY); + actUserRelationDTO.setDenyRewardReason(formDTO.getDenyRewardReason()); + actUserRelationService.update(actUserRelationDTO); + //增加一条act_point_log + ActPointLogDTO actPointLogDTO=new ActPointLogDTO(); + actPointLogDTO.setActId(actUserRelationDTO.getActId()); + actPointLogDTO.setUserId(actUserRelationDTO.getUserId()); + actPointLogDTO.setPoints(actInfoDTO.getReward()); + actPointLogDTO.setOperateType(ActConstant.ACT_USER_STATUS_DENY); + actPointLogDTO.setRemark(formDTO.getDenyRewardReason()); + actPointLogService.save(actPointLogDTO); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 积分发放-重新处理 + * @Date 2020/7/24 15:16 + **/ + @Override + public void reset(GrantPointsFormDTO formDTO) { + ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId()); + if(null==actUserRelationDTO){ + logger.warn("积分发放-重新处理act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId()); + return; + } + //查取分值 + ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId()); + if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) { + logger.warn("积分发放-重新处理act_info is null or act_info is finished"); + return; + } + if(!loginUserUtil.getLoginUserId().equals(actInfoDTO.getCreatedBy())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //更新act_user_relation改为未处理 初始状态 + actUserRelationDTO.setProcessFlag(StrConstant.EPMETY_STR); + actUserRelationDTO.setRewardFlag(StrConstant.EPMETY_STR); + actUserRelationDTO.setDenyRewardReason(StrConstant.EPMETY_STR); + actUserRelationService.update(actUserRelationDTO); + //增加一条act_point_log + ActPointLogDTO actPointLogDTO=new ActPointLogDTO(); + actPointLogDTO.setActId(actUserRelationDTO.getActId()); + actPointLogDTO.setUserId(actUserRelationDTO.getUserId()); + actPointLogDTO.setPoints(actInfoDTO.getReward()); + actPointLogDTO.setOperateType(ActConstant.RESET); + actPointLogDTO.setRemark(StrConstant.EPMETY_STR); + actPointLogService.save(actPointLogDTO); + } + + /** + * @param actIdFormDTO + * @return java.util.List + * @author yinzuomei + * @description 积分发放-已发放列表 + * @Date 2020/7/26 18:47 + **/ + @Override + public List agreedList(ActIdFormDTO actIdFormDTO) { + List list = actUserRelationDao.selectAgreedList(actIdFormDTO.getActId()); + if (null == list || list.size() < 0) { + return new ArrayList<>(); + } + List userIdList = new ArrayList<>(); + for (ObtainedUserResultDTO obtainedUserResultDTO : list) { + obtainedUserResultDTO.setVolunteerFlag(workActUserService.getVolunteerFlag(obtainedUserResultDTO.getUserId())); + userIdList.add(obtainedUserResultDTO.getUserId()); + } + List userBaseInfoResultDTOList = workActUserService.queryUserBaseInfoList(userIdList); + for (ObtainedUserResultDTO obtainedUser : list) { + for (UserBaseInfoResultDTO userBaseInfoResultDTO : userBaseInfoResultDTOList) { + if (obtainedUser.getUserId().equals(userBaseInfoResultDTO.getUserId())) { + obtainedUser.setRealName(userBaseInfoResultDTO.getRealName()); + obtainedUser.setNickName(userBaseInfoResultDTO.getNickname()); + obtainedUser.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + } + return list; + } + + /** + * @param actIdFormDTO + * @return java.util.List + * @author yinzuomei + * @description 积分发放-已拒绝列表 + * @Date 2020/7/26 19:02 + **/ + @Override + public List deniedList(ActIdFormDTO actIdFormDTO) { + List list = actUserRelationDao.selectDeniedList(actIdFormDTO.getActId()); + if (null == list || list.size() < 0) { + return new ArrayList<>(); + } + List userIdList = new ArrayList<>(); + for (DeniedUserResultDTO deniedUserResultDTO : list) { + deniedUserResultDTO.setVolunteerFlag(workActUserService.getVolunteerFlag(deniedUserResultDTO.getUserId())); + userIdList.add(deniedUserResultDTO.getUserId()); + } + List userBaseInfoResultDTOList = workActUserService.queryUserBaseInfoList(userIdList); + for (DeniedUserResultDTO deniedUser : list) { + for (UserBaseInfoResultDTO userBaseInfoResultDTO : userBaseInfoResultDTOList) { + if (deniedUser.getUserId().equals(userBaseInfoResultDTO.getUserId())) { + deniedUser.setRealName(userBaseInfoResultDTO.getRealName()); + deniedUser.setNickName(userBaseInfoResultDTO.getNickname()); + deniedUser.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + } + return list; + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java new file mode 100644 index 0000000000..a8d0dfacfe --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/HeartUserInfoServiceImpl.java @@ -0,0 +1,168 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.HeartUserInfoDao; +import com.epmet.dto.HeartUserInfoDTO; +import com.epmet.dto.form.resi.ResiActBaseFormDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.resi.ResiLeaderboardResultDTO; +import com.epmet.entity.HeartUserInfoEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.redis.HeartUserInfoRedis; +import com.epmet.service.HeartUserInfoService; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class HeartUserInfoServiceImpl extends BaseServiceImpl implements HeartUserInfoService { + private Logger logger = LogManager.getLogger(HeartUserInfoServiceImpl.class); + @Autowired + private HeartUserInfoRedis heartUserInfoRedis; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, HeartUserInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, HeartUserInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public HeartUserInfoDTO get(String id) { + HeartUserInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, HeartUserInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(HeartUserInfoDTO dto) { + HeartUserInfoEntity entity = ConvertUtils.sourceToTarget(dto, HeartUserInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(HeartUserInfoDTO dto) { + HeartUserInfoEntity entity = ConvertUtils.sourceToTarget(dto, HeartUserInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param userId + * @return com.epmet.dto.HeartUserInfoDTO + * @author yinzuomei + * @description 根据用户id查询爱心用户记录 + * @Date 2020/7/21 22:48 + **/ + @Override + public HeartUserInfoDTO getByUserId(String userId) { + return baseDao.selectByUserId(userId); + } + + @Override + public Result> leaderboard(ResiActBaseFormDTO formDTO) { + List resultDTOS = new ArrayList<>(); + // 获取排好序的 排行榜 + List leaderboardList = baseDao.selectListLeaderboard(formDTO); + if (leaderboardList.size() > NumConstant.ZERO){ + // 根据用户ID获取微信昵称、头像 + List userIds = new ArrayList<>(); + for (HeartUserInfoDTO list : leaderboardList){ + userIds.add(list.getUserId()); + } + // 查询用户微信基础信息 + Result> userWxInfos = epmetUserOpenFeignClient.queryUserBaseInfo(userIds); + if (userWxInfos.success() && userWxInfos.getData().size() > NumConstant.ZERO){ + for (HeartUserInfoDTO list : leaderboardList){ + ResiLeaderboardResultDTO dto = new ResiLeaderboardResultDTO(); + dto.setKindnessTime(list.getKindnessTime()); + dto.setVolunteerFlag(list.getVolunteerFlag()); + dto.setParticipationNum(list.getParticipationNum()); + List wxInfo = userWxInfos.getData(); + for (UserBaseInfoResultDTO wx : wxInfo){ + if (list.getUserId().equals(wx.getUserId())){ + dto.setHeadImg(wx.getHeadImgUrl()); + dto.setNickname(wx.getNickname()); + } + } + resultDTOS.add(dto); + } + } else { + logger.info("查询用户基本信息接口返回失败"); + throw new RenException("查询用户基本信息失败"); + } + } + return new Result>().ok(resultDTOS); + } + + @Override + public void updateHeartUserInfoByUserId(HeartUserInfoDTO dto) { + baseDao.updateHeartUserInfoByUserId(dto); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java new file mode 100644 index 0000000000..9d73f7866a --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActContentServiceImpl.java @@ -0,0 +1,157 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.LatestActContentDao; +import com.epmet.dto.LatestActContentDTO; +import com.epmet.dto.result.work.ActDraftContentDTOResultDTO; +import com.epmet.dto.result.work.ActPreviewContentResultDTO; +import com.epmet.entity.LatestActContentEntity; +import com.epmet.redis.LatestActContentRedis; +import com.epmet.service.LatestActContentService; +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.List; +import java.util.Map; + +/** + * 最近一次编辑的活动内容 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class LatestActContentServiceImpl extends BaseServiceImpl implements LatestActContentService { + + @Autowired + private LatestActContentRedis latestActContentRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, LatestActContentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, LatestActContentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public LatestActContentDTO get(String id) { + LatestActContentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, LatestActContentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(LatestActContentDTO dto) { + LatestActContentEntity entity = ConvertUtils.sourceToTarget(dto, LatestActContentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveLatestActContentDTOList(List dtoList) { + //先删除之前的 + baseDao.deleteByActId(dtoList.get(0).getActId()); + //再插入新的 + for(LatestActContentDTO dto:dtoList){ + LatestActContentEntity entity = ConvertUtils.sourceToTarget(dto, LatestActContentEntity.class); + insert(entity); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(LatestActContentDTO dto) { + LatestActContentEntity entity = ConvertUtils.sourceToTarget(dto, LatestActContentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param actId + * @return int + * @author yinzuomei + * @description 根据活动id, 删除活动内容 + * @Date 2020/7/20 18:34 + **/ + @Override + public int deleteByActId(String actId) { + //逻辑删除 + int updateNum=baseDao.updateToDelByActId(actId); + //后面直接全部删除 + return updateNum; + } + + /** + * @param actId + * @return java.util.List + * @author yinzuomei + * @description 根据latest_act_info.id查询活动内容,已排序 + * @Date 2020/7/20 22:59 + **/ + @Override + public List selectActContentList(String actId) { + return baseDao.selectActContentList(actId); + } + + /** + * @param actId latest_act_info主键 + * @return java.util.List + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:47 + **/ + @Override + public List previewActContent(String actId) { + return baseDao.previewActContent(actId); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java new file mode 100644 index 0000000000..069c4f91c7 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActInfoServiceImpl.java @@ -0,0 +1,184 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.LatestActInfoDao; +import com.epmet.dto.LatestActInfoDTO; +import com.epmet.dto.result.work.ActPreviewResultDTO; +import com.epmet.dto.result.work.LatestDraftActInfoResultDTO; +import com.epmet.entity.LatestActInfoEntity; +import com.epmet.redis.LatestActInfoRedis; +import com.epmet.service.LatestActContentService; +import com.epmet.service.LatestActInfoService; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +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.List; +import java.util.Map; + +/** + * 最近一次编辑的活动信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class LatestActInfoServiceImpl extends BaseServiceImpl implements LatestActInfoService { + private Logger logger = LogManager.getLogger(LatestActInfoServiceImpl.class); + @Autowired + private LatestActInfoRedis latestActInfoRedis; + @Autowired + private LatestActContentService latestActContentService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, LatestActInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, LatestActInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public LatestActInfoDTO get(String id) { + LatestActInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, LatestActInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(LatestActInfoDTO dto) { + LatestActInfoEntity entity = ConvertUtils.sourceToTarget(dto, LatestActInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String saveOrUpdateLatestActInfoDTO(LatestActInfoDTO dto) { + if(StringUtils.isNotBlank(dto.getId())&&null!=baseDao.selectById(dto.getId())){ + logger.info("草稿id不为空,且根据id查询latest_act_info is not null 时更新记录"); + LatestActInfoEntity entity = ConvertUtils.sourceToTarget(dto, LatestActInfoEntity.class); + updateById(entity); + return dto.getId(); + } + dto.setId(null); + LatestActInfoEntity entity = ConvertUtils.sourceToTarget(dto, LatestActInfoEntity.class); + insert(entity); + logger.info("insert latest_act_info success"); + return entity.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(LatestActInfoDTO dto) { + LatestActInfoEntity entity = ConvertUtils.sourceToTarget(dto, LatestActInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @return java.lang.Integer + * @param userId + * @author yinzuomei + * @description 查询当前用户保留的活动记录 + * @Date 2020/7/20 18:04 + **/ + @Override + public Integer countByUserId(String userId) { + return baseDao.countByUserId(userId); + } + + /** + * @param userId + * @return void + * @author yinzuomei + * @description 删除当前用户的活动草稿 + * @Date 2020/7/20 18:17 + **/ + @Override + public void deleteAllDraft(String userId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(userId), FieldConstant.CREATED_BY, userId); + List entityList = baseDao.selectList(wrapper); + for(LatestActInfoEntity entity:entityList){ + //删除活动内容 + int num=latestActContentService.deleteByActId(entity.getId()); + //删除活动属性: del_flag="1" + baseDao.updateToDelById(entity.getId()); + } + } + + /** + * @param userId + * @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO + * @author yinzuomei + * @description 获取用户最近一次编辑的活动信息 + * @Date 2020/7/20 22:59 + **/ + @Override + public LatestDraftActInfoResultDTO getLatestActDraft(String userId) { + return baseDao.selectLatestActDraft(userId); + } + + /** + * @param actDraftId latest_act_info主键 + * @return com.epmet.dto.result.work.ActPreviewResultDTO + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:45 + **/ + @Override + public ActPreviewResultDTO previewActInfo(String actDraftId) { + return baseDao.previewActInfo(actDraftId); + } + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java new file mode 100644 index 0000000000..182da8e261 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.MqConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SendMqMsgUtils; +import com.epmet.constant.ActMessageConstant; +import com.epmet.dao.VolunteerInfoDao; +import com.epmet.dto.HeartUserInfoDTO; +import com.epmet.dto.form.WxUserInfoFormDTO; +import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO; +import com.epmet.entity.ActUserRelationEntity; +import com.epmet.entity.VolunteerInfoEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.redis.VolunteerInfoRedis; +import com.epmet.service.HeartUserInfoService; +import com.epmet.service.VolunteerInfoService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.List; + +/** + * 志愿者信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class VolunteerInfoServiceImpl extends BaseServiceImpl implements VolunteerInfoService { + private Logger logger = LogManager.getLogger(VolunteerInfoServiceImpl.class); + + @Autowired + private VolunteerInfoRedis volunteerInfoRedis; + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + @Autowired + private HeartUserInfoService heartUserInfoService; + + @Override + @Transactional(rollbackFor = Exception.class) + public Result authenticate(TokenDto tokenDto, ResiVolunteerAuthenticateFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + // 检查是否是志愿者 + Integer volunteerFlag = baseDao.queryVolunteerFlagByUserId(tokenDto.getUserId()); + VolunteerInfoEntity volunteerInfoEntity = ConvertUtils.sourceToTarget(formDTO, VolunteerInfoEntity.class); + if (volunteerFlag > NumConstant.ZERO){ + // 是志愿者:更新志愿者信息表 + baseDao.updateVolunteerInfoByUserId(volunteerInfoEntity); + } else { + // 不是志愿者:插入志愿者信息表 + baseDao.insert(volunteerInfoEntity); + + // 更新用户信息表的 是否是志愿者标识 + HeartUserInfoDTO userInfoDTO = new HeartUserInfoDTO(); + userInfoDTO.setUserId(tokenDto.getUserId()); + userInfoDTO.setVolunteerFlag(true); + heartUserInfoService.updateHeartUserInfoByUserId(userInfoDTO); + + // 发送消息 由积分系统消费消息(需要使用规则) + this.grantActPoints(formDTO); + } + // 更新用户基础信息表 并 更新用户微信表 + WxUserInfoFormDTO wxUserInfoFormDTO = ConvertUtils.sourceToTarget(formDTO, WxUserInfoFormDTO.class); + return epmetUserOpenFeignClient.updateUserBaseAndWxUserInfo(wxUserInfoFormDTO); + } + + private void grantActPoints(ResiVolunteerAuthenticateFormDTO formDTO){ + //备注 + String remark=String.format(ActMessageConstant.POINTS_EVENT_VOLUNTEER_AUTHENTICATE,formDTO.getUserId()); + MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); + //mq的事件类型 + mqBaseMsgDTO.setEventClass(EventEnum.REGISTER_VOLUNTEER.getEventClass()); + //事件code + mqBaseMsgDTO.setEventTag(EventEnum.REGISTER_VOLUNTEER.getEventTag()); + List actPointEventMsgList=new ArrayList<>(); + ActPointEventMsg actPointEventMsg=new ActPointEventMsg(); + actPointEventMsg.setCustomerId(formDTO.getCustomerId()); + actPointEventMsg.setUserId(formDTO.getUserId()); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setIsCommon(false); + actPointEventMsg.setRemark(remark); + actPointEventMsgList.add(actPointEventMsg); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); + Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!result.success()){ + logger.error("志愿者认证事件发送失败"); + } + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java new file mode 100644 index 0000000000..a1b008430e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActDraftServiceImpl.java @@ -0,0 +1,253 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.LatestActContentDTO; +import com.epmet.dto.LatestActInfoDTO; +import com.epmet.dto.form.work.ActPreviewFormDTO; +import com.epmet.dto.form.work.DraftActContentFormDTO; +import com.epmet.dto.form.work.DraftActInfoFormDTO; +import com.epmet.dto.result.work.*; +import com.epmet.service.LatestActContentService; +import com.epmet.service.LatestActInfoService; +import com.epmet.service.WorkActDraftService; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 工作端活动草稿 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/20 17:52 + */ +@Service +public class WorkActDraftServiceImpl implements WorkActDraftService { + private Logger logger = LogManager.getLogger(WorkActDraftServiceImpl.class); + @Autowired + private LoginUserUtil loginUserUtil; + @Autowired + private LatestActInfoService latestActInfoService; + @Autowired + private LatestActContentService latestActContentService; + + /** + * @return com.epmet.dto.form.work.PublishActInitResultDTO + * @param + * @author yinzuomei + * @description 发布活动初始化 + * @Date 2020/7/20 17:55 + **/ + @Override + public PublishActInitResultDTO publishActInit() { + PublishActInitResultDTO resultDTO=new PublishActInitResultDTO(); + resultDTO.setExistFlag(false); + String currentUserId=loginUserUtil.getLoginUserId(); + if(StringUtils.isNotBlank(currentUserId)){ + Integer count=latestActInfoService.countByUserId(currentUserId); + if(count>=1){ + logger.info(String.format("userId=%s存在%s条正在编辑的活动",currentUserId,count)); + resultDTO.setExistFlag(true); + } + }else{ + logger.warn("loginUserUtil.getLoginUserId()获取当前用户id为空"); + } + return resultDTO; + } + + + /** + * @return com.epmet.dto.result.work.LatestDraftActInfoResultDTO + * @author yinzuomei + * @description 获取最近一次编辑的活动 + * @Date 2020/7/20 22:29 + **/ + @Override + public LatestDraftActInfoResultDTO getLatestDraft() { + String userId=loginUserUtil.getLoginUserId(); + if(StringUtils.isNotBlank(userId)){ + LatestDraftActInfoResultDTO latestAct=latestActInfoService.getLatestActDraft(userId); + if(null!=latestAct){ + List actContentList=latestActContentService.selectActContentList(latestAct.getActDraftId()); + latestAct.setActContentList(actContentList); + } + return latestAct; + }else{ + logger.warn("loginUserUtil.getLoginUserId()获取当前用户id为空"); + } + return null; + } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.SaveActDraftResultDTO + * @author yinzuomei + * @description 预览按下-调用此接口保存活动信息、活动内容 + * @Date 2020/7/21 14:00 + **/ + @Override + public SaveActDraftResultDTO saveAct(DraftActInfoFormDTO formDTO) { + //保存活动属性 + LatestActInfoDTO latestActInfoDTO=this.constructLatestActInfoDTO(formDTO); + //如果存在草稿id,则更新 + String actDraftId=latestActInfoService.saveOrUpdateLatestActInfoDTO(latestActInfoDTO); + if(null!=formDTO.getActContent()&&formDTO.getActContent().size()>0){ + //保存活动内容 + List actContentList=this.constructLatestActContent(formDTO.getActContent(),actDraftId); + //删除之前的内容,保存本次的修改 物理删除 + latestActContentService.saveLatestActContentDTOList(actContentList); + } + SaveActDraftResultDTO resultDTO=new SaveActDraftResultDTO(); + resultDTO.setActDraftId(actDraftId); + return resultDTO; + } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.ActPreviewResultDTO + * @author yinzuomei + * @description 预览-查看活动详情 + * @Date 2020/7/21 17:24 + **/ + @Override + public ActPreviewResultDTO previewActDetail(ActPreviewFormDTO formDTO) { + ActPreviewResultDTO actPreviewResultDTO = latestActInfoService.previewActInfo(formDTO.getActDraftId()); + if (null != actPreviewResultDTO) { + List actContent = latestActContentService.previewActContent(formDTO.getActDraftId()); + if (null != actContent && actContent.size() > 0) { + actPreviewResultDTO.setActContent(actContent); + } + } + return actPreviewResultDTO; + } + + /** + * @return java.util.List + * @param actContent + * @param actDraftId + * @author yinzuomei + * @description 保存草稿- 构造latest_act_content + * @Date 2020/7/21 19:22 + **/ + private List constructLatestActContent(List actContent,String actDraftId) { + List list=new ArrayList<>(); + int orderNum=1; + for(DraftActContentFormDTO actContentFormDTO:actContent){ + LatestActContentDTO latestAct=new LatestActContentDTO(); + latestAct.setActId(actDraftId); + latestAct.setContent(actContentFormDTO.getContent()); + latestAct.setContentType(actContentFormDTO.getContentType()); + latestAct.setOrderNum(orderNum); + list.add(latestAct); + orderNum++; + } + return list; + } + + /** + * @return com.epmet.dto.LatestActInfoDTO + * @param formDTO + * @author yinzuomei + * @description 保存草稿- 构造latest_act_info + * @Date 2020/7/21 19:22 + **/ + private LatestActInfoDTO constructLatestActInfoDTO(DraftActInfoFormDTO formDTO) { + LatestActInfoDTO latestActInfoDTO=new LatestActInfoDTO(); + if(StringUtils.isNotBlank(formDTO.getActDraftId())){ + logger.info("修改活动草稿actDraftId",formDTO.getActDraftId()); + latestActInfoDTO.setId(formDTO.getActDraftId()); + } + latestActInfoDTO.setCustomerId(formDTO.getCustomerId()); + //活动标题 + latestActInfoDTO.setTitle(formDTO.getTitle()); + //活动封面 + latestActInfoDTO.setCoverPic(formDTO.getCoverPic()); + //报名开始时间latestActInfoDTO.setSignUpStartTime(new Date()); + //报名截止时间 + if(StringUtils.isNotBlank(formDTO.getSignUpEndTime())){ + Date signUpEndTime= DateUtils.minStrToSecondDate(formDTO.getSignUpEndTime()); + latestActInfoDTO.setSignUpEndTime(signUpEndTime); + } + //招募要求 + latestActInfoDTO.setRequirement(formDTO.getRequirement()); + //活动预计开始时间 + if(StringUtils.isNotBlank(formDTO.getActStartTime())){ + Date actStartTime= DateUtils.minStrToSecondDate(formDTO.getActStartTime()); + latestActInfoDTO.setActStartTime(actStartTime); + } + //活动预计结束时间 + if(StringUtils.isNotBlank(formDTO.getActEndTime())){ + Date actEndTime=DateUtils.minStrToSecondDate(formDTO.getActEndTime()); + latestActInfoDTO.setActEndTime(actEndTime); + } + //活动地点 + latestActInfoDTO.setActAddress(formDTO.getActAddress()); + //活动地点-经度 + if(null!=formDTO.getActLongitude()){ + latestActInfoDTO.setActLongitude(formDTO.getActLongitude()); + } + //活动地点-纬度 + if(null!=formDTO.getActLatitude()){ + latestActInfoDTO.setActLatitude(formDTO.getActLatitude()); + } + //打开开始时间 + if(StringUtils.isNotBlank(formDTO.getSignInStartTime())){ + Date signInStartTime=DateUtils.minStrToSecondDate(formDTO.getSignInStartTime()); + latestActInfoDTO.setSignInStartTime(signInStartTime); + } + //打开截止时间 + if(StringUtils.isNotBlank(formDTO.getSignInEndTime())){ + Date signInEndTime=DateUtils.minStrToSecondDate(formDTO.getSignInEndTime()); + latestActInfoDTO.setSignInEndTime(signInEndTime); + } + //活动签到打卡地点 + latestActInfoDTO.setSignInAddress(formDTO.getSignInAddress()); + //活动签到打卡位置经度 + if(null!=formDTO.getSignInLongitude()){ + latestActInfoDTO.setSignInLongitude(formDTO.getSignInLongitude()); + } + //活动签到打卡位置纬度 + if(null!=formDTO.getSignInLatitude()){ + latestActInfoDTO.setSignInLatitude(formDTO.getSignInLatitude()); + } + //活动签到打卡半径(单位:米) + if(null!=formDTO.getSignInRadius()){ + latestActInfoDTO.setSignInRadius(formDTO.getSignInRadius()); + } + //活动名额类型(0-不限名额,1-固定名额) + if(null!=formDTO.getActQuota()&&formDTO.getActQuota()==0){ + latestActInfoDTO.setActQuotaCategory(false); + }else{ + latestActInfoDTO.setActQuotaCategory(true); + } + //活动名额 + latestActInfoDTO.setActQuota(formDTO.getActQuota()); + //联系人 + latestActInfoDTO.setSponsorContacts(formDTO.getSponsorContacts()); + //联系电话 + latestActInfoDTO.setSponsorTel(formDTO.getSponsorTel()); + //主办方类型:网格主办:grid;组织主办:agency + latestActInfoDTO.setSponsorType(formDTO.getSponsorType()); + //主办方id(机关或网格的id) + latestActInfoDTO.setSponsorId(formDTO.getSponsorId()); + //活动主办方名称(机关或网格的名称) + latestActInfoDTO.setSponsorName(formDTO.getSponsorName()); + //如果以网格名义发布,存储空字符串"" + latestActInfoDTO.setSponsorType(formDTO.getSponsorType()); + //活动奖励积分 + latestActInfoDTO.setReward(formDTO.getReward()); + //身份限制:1只有志愿者才可以参加活动0不限制志愿者身份 + latestActInfoDTO.setVolunteerLimit(formDTO.getVolunteerLimit()); + //审核开关:1报名人员需要人工审核0不需要 + latestActInfoDTO.setAuditSwitch(formDTO.getAuditSwitch()); + return latestActInfoDTO; + } + + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java new file mode 100644 index 0000000000..0a78b35470 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java @@ -0,0 +1,1019 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.MqConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.eventmsg.ActPointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; +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.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.*; +import com.epmet.constant.ActConstant; +import com.epmet.constant.ActMessageConstant; +import com.epmet.constant.ReadFlagConstant; +import com.epmet.dao.*; +import com.epmet.dto.*; +import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.dto.form.work.*; +import com.epmet.dto.result.ActSponsorResultDTO; +import com.epmet.dto.result.work.*; +import com.epmet.entity.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.*; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.UUID; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 20:37 + */ +@Service +public class WorkActServiceImpl implements WorkActService { + private Logger logger = LogManager.getLogger(WorkActServiceImpl.class); + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private LoginUserUtil loginUserUtil; + @Autowired + private ActInfoDao actInfoDao; + @Autowired + private LatestActInfoService latestActInfoService; + @Autowired + private ActContentDao actContentDao; + @Autowired + private ActOperationRecDao actOperationRecDao; + @Autowired + private ActInfoService actInfoService; + @Autowired + private ActUserRelationDao actUserRelationDao; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private ActStatisticalService actStatisticalService; + @Autowired + private ActUserRelationService actUserRelationService; + @Autowired + private HeartUserInfoDao heartUserInfoDao; + @Autowired + private HeartUserInfoService heartUserInfoService; + @Autowired + private ActSummaryDao actSummaryDao; + + /** + * @return void + * @author yinzuomei + * @description 发布活动-删除历史活动草稿 + * @Date 2020/7/20 18:15 + **/ + @Override + public void deleteDraft() { + String currentUserId=loginUserUtil.getLoginUserId(); + if(StringUtils.isNotBlank(currentUserId)){ + latestActInfoService.deleteAllDraft(currentUserId); + } + } + + /** + * @return com.epmet.dto.result.work.SponsorResultDTO + * @author yinzuomei + * @description 活动主办方 + * @Date 2020/7/23 20:37 + **/ + @Override + public SponsorResultDTO querySponsorList() { + String staffId=loginUserUtil.getLoginUserId(); + if(StringUtils.isNotBlank(staffId)){ + Result result=govOrgOpenFeignClient.querySponsorList(staffId); + if(result.success()&&null!=result.getData()){ + SponsorResultDTO sponsorResultDTO=new SponsorResultDTO(); + sponsorResultDTO.setAgencyId(result.getData().getAgencyId()); + sponsorResultDTO.setAgencyName(result.getData().getAgencyName()); + sponsorResultDTO.setAgencyGridList(ConvertUtils.sourceToTarget(result.getData().getAgencyGridList(), Grid.class)); + return sponsorResultDTO; + } + } + logger.error("当前用户id获取为空"); + return null; + } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.PublishActResultDTO + * @author yinzuomei + * @description 发布活动 + * @Date 2020/7/21 18:33 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public PublishActResultDTO publishAct(PublishActInfoFormDTO formDTO) { + //构造属性保存活动属性,活动内容 + ActInfoEntity actInfoEntity=this.constructActInfo(formDTO); + //校验参数 + this.checkPublishFormDTO(actInfoEntity); + PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); + //内容审核(活动标题、招募要求、活动内容图文) + this.auditAct(formDTO); + logger.info("发布活动,审核成功"); + + actInfoDao.insert(actInfoEntity); + + List actContentEntityList=this.constructActContent(formDTO.getActContent(),actInfoEntity.getId()); + for(ActContentEntity actContentEntity:actContentEntityList){ + actContentDao.insert(actContentEntity); + } + //插入一条操作日志 + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(actInfoEntity.getId()); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_PUBLISH); + actOperationRecEntity.setNoticeUser(false); + actOperationRecEntity.setRemark(StrConstant.EPMETY_STR); + actOperationRecDao.insert(actOperationRecEntity); + + //删除所有的草稿 + this.deleteDraft(); + publishActResultDTO.setActId(actInfoEntity.getId()); + + return publishActResultDTO; + } + + /** + * @return void + * @param actInfoEntity + * @author yinzuomei + * @description 第一次发布 + * @Date 2020/7/24 16:45 + **/ + private void checkPublishFormDTO(ActInfoEntity actInfoEntity) { + //1、活动预计开始时间、活动预计结束时间 + if(actInfoEntity.getActStartTime().compareTo(actInfoEntity.getActEndTime())!=-1){ + throw new RenException(EpmetErrorCode.ACT_START_TIME_ERROR.getCode()); + } + //2、签到开始时间、签到结束时间 + if(actInfoEntity.getSignInStartTime().compareTo(actInfoEntity.getSignInEndTime())!=-1){ + throw new RenException(EpmetErrorCode.ACT_SIGN_IN_START_TIME_ERROR.getCode()); + } + int n=actInfoEntity.getSignUpEndTime().compareTo(actInfoEntity.getActStartTime()); + //3、报名截止时间(应该在活动预计开始时间之前) + if(n!=-1){ + throw new RenException((EpmetErrorCode.ACT_SIGN_UP_END_TIME_ERROR.getCode())); + } + } + + public static void main(String[] args) { + SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + Date yesterDate=format.parse("2020-07-26 13:00:00"); + Date today=format.parse("2020-07-27 13:00:00"); + Date tommorrow=format.parse("2020-07-28 13:00:00"); + Date today1=format.parse("2020-07-27 13:00:00"); + System.out.println(yesterDate.compareTo(today)); + System.out.println(tommorrow.compareTo(today)); + System.out.println(today.compareTo(today1)); + } catch (ParseException e) { + e.printStackTrace(); + } + + } + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 活动相关内容审核(活动标题、招募要求、活动内容图文) + * @Date 2020/7/21 19:20 + **/ + private void auditAct(PublishActInfoFormDTO formDTO) { + //1、活动标题 + if (StringUtils.isNotBlank(formDTO.getTitle())) { + this.auditActTitle(formDTO.getTitle()); + } + //2、活动封面 + if(StringUtils.isNotBlank(formDTO.getCoverPic())){ + this.auditActCoverPic(formDTO.getCoverPic()); + } + + //3、招募要求 + if (StringUtils.isNotBlank(formDTO.getRequirement())) { + this.auditActRequirement(formDTO.getRequirement()); + } + //4、活动内容 + if(null==formDTO.getActContent()||formDTO.getActContent().size()<1){ + return; + } + List textList=new ArrayList<>(); + List imgList=new ArrayList<>(); + for(PublishActContentFormDTO actContent:formDTO.getActContent()){ + if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){ + textList.add(actContent.getContent()); + }else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){ + imgList.add(actContent.getContent()); + } + } + this.auditActContent(textList,imgList); + } + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 重新发布活动,内容审核 + * @Date 2020/7/27 14:01 + **/ + private void auditRePublishAct(RePublishFormDTO formDTO) { + //1、活动标题 + if (StringUtils.isNotBlank(formDTO.getTitle())) { + this.auditActTitle(formDTO.getTitle()); + } + //2、活动封面 + if(StringUtils.isNotBlank(formDTO.getCoverPic())){ + this.auditActCoverPic(formDTO.getCoverPic()); + } + + //3、招募要求 + if (StringUtils.isNotBlank(formDTO.getRequirement())) { + this.auditActRequirement(formDTO.getRequirement()); + } + //4、活动内容 + if(null==formDTO.getActContent()||formDTO.getActContent().size()<1){ + return; + } + List textList=new ArrayList<>(); + List imgList=new ArrayList<>(); + for(PublishActContentFormDTO actContent:formDTO.getActContent()){ + if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){ + textList.add(actContent.getContent()); + }else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){ + imgList.add(actContent.getContent()); + } + } + this.auditActContent(textList,imgList); + } + + /** + * @return com.epmet.entity.ActInfoEntity + * @param formDTO + * @author yinzuomei + * @description 发布活动-构造act_info + * @Date 2020/7/21 20:00 + **/ + private ActInfoEntity constructActInfo(PublishActInfoFormDTO formDTO) { + ActInfoEntity actInfoEntity = ConvertUtils.sourceToTarget(formDTO, ActInfoEntity.class); + //报名开始、报名截止、活动预计开始、活动预计截止、签到开始、签到截止 + actInfoEntity.setSignUpEndTime(DateUtils.minStrToSecondDate(formDTO.getSignUpEndTime())); + actInfoEntity.setSignInStartTime(DateUtils.minStrToSecondDate(formDTO.getSignInStartTime())); + actInfoEntity.setSignInEndTime(DateUtils.minStrToSecondDate(formDTO.getSignInEndTime())); + actInfoEntity.setActStartTime(DateUtils.minStrToSecondDate(formDTO.getActStartTime())); + actInfoEntity.setActEndTime(DateUtils.minStrToSecondDate(formDTO.getActEndTime())); + //活动名额类型(0-不限名额,1-固定名额) + if(actInfoEntity.getActQuota()==0){ + actInfoEntity.setActQuotaCategory(false); + }else{ + actInfoEntity.setActQuotaCategory(true); + } + Date nowDate=new Date(); + actInfoEntity.setSignUpStartTime(nowDate); + actInfoEntity.setCreatedTime(nowDate); + actInfoEntity.setUpdatedTime(nowDate); + actInfoEntity.setActStatus(ActConstant.ACT_STATUS_PUBLISHED); + + //1已经总结0未总结 + actInfoEntity.setSummaryFlag(false); + if(ActConstant.SPONSOR_AGENCY.equals(actInfoEntity.getSponsorType())){ + //调用gov_org服务获取当前组织的上一级机关id + Result result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId()); + if(result.success()&&null!=result.getData()){ + actInfoEntity.setPid(result.getData().getPid()); + }else{ + logger.warn("根据agencyId查询组织信息失败,agencyId=",formDTO.getSponsorId()); + } + }else{ + actInfoEntity.setPid(StrConstant.EPMETY_STR); + } + return actInfoEntity; + } + + /** + * @return com.epmet.entity.ActInfoEntity + * @param formDTO + * @author yinzuomei + * @description 重新发布=构造act_info + * @Date 2020/7/27 14:02 + **/ + private ActInfoEntity constructRePublishActInfo(RePublishFormDTO formDTO) { + ActInfoEntity actInfoEntity = ConvertUtils.sourceToTarget(formDTO, ActInfoEntity.class); + //报名开始、报名截止、活动预计开始、活动预计截止、签到开始、签到截止 + actInfoEntity.setSignUpEndTime(DateUtils.minStrToSecondDate(formDTO.getSignUpEndTime())); + actInfoEntity.setSignInStartTime(DateUtils.minStrToSecondDate(formDTO.getSignInStartTime())); + actInfoEntity.setSignInEndTime(DateUtils.minStrToSecondDate(formDTO.getSignInEndTime())); + actInfoEntity.setActStartTime(DateUtils.minStrToSecondDate(formDTO.getActStartTime())); + actInfoEntity.setActEndTime(DateUtils.minStrToSecondDate(formDTO.getActEndTime())); + //活动名额类型(0-不限名额,1-固定名额) + if(actInfoEntity.getActQuota()==0){ + actInfoEntity.setActQuotaCategory(false); + }else{ + actInfoEntity.setActQuotaCategory(true); + } + Date nowDate=new Date(); + actInfoEntity.setSignUpStartTime(nowDate); + actInfoEntity.setCreatedTime(nowDate); + actInfoEntity.setUpdatedTime(nowDate); + actInfoEntity.setActStatus(ActConstant.ACT_STATUS_PUBLISHED); + + //1已经总结0未总结 + actInfoEntity.setSummaryFlag(false); + if(ActConstant.SPONSOR_AGENCY.equals(actInfoEntity.getSponsorType())){ + //调用gov_org服务获取当前组织的上一级机关id + Result result=govOrgOpenFeignClient.getAgencyById(formDTO.getSponsorId()); + if(result.success()&&null!=result.getData()){ + actInfoEntity.setPid(result.getData().getPid()); + }else{ + logger.warn("重新发布活动,根据agencyId查询组织信息失败,agencyId=",formDTO.getSponsorId()); + } + }else{ + actInfoEntity.setPid(StrConstant.EPMETY_STR); + } + return actInfoEntity; + } + + /** + * @return java.util.List + * @param actContent + * @param actId + * @author yinzuomei + * @description 发布活动-构造活动详情act_content + * @Date 2020/7/21 19:59 + **/ + private List constructActContent(List actContent, String actId) { + List list=new ArrayList<>(); + int orderNum=1; + for(PublishActContentFormDTO actContentFormDTO:actContent){ + ActContentEntity actContentEntity=new ActContentEntity(); + actContentEntity.setActId(actId); + actContentEntity.setContent(actContentFormDTO.getContent()); + actContentEntity.setContentType(actContentFormDTO.getContentType()); + actContentEntity.setOrderNum(orderNum); + list.add(actContentEntity); + orderNum++; + } + return list; + } + + /** + * @return void + * @param textList + * @param imgList + * @author yinzuomei + * @description 活动详情审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActContent(List textList, List imgList) { + //审核活动详情中的内容 + if(null!=textList&&textList.size()>0){ + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + textList.forEach(content -> { + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(content); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + }); + Result contentSyncScanRes = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!contentSyncScanRes.success()) { + logger.error("活动详情内容审核接口失败,返参:", JSON.toJSONString(contentSyncScanRes)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!contentSyncScanRes.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode()); + } + } + logger.info("活动详情内容审核成功"); + } + if(null!=imgList&&imgList.size()>0){ + //审核活动详情中的图片 + 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 imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + logger.error("活动详情图片审核接口失败,返参:", JSON.toJSONString(imgScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.ACT_CONTENT_IMG_SCAN_FAILED.getCode()); + } + } + logger.info("活动详情图片审核成功"); + } + } + + /** + * @return void + * @param requirement + * @author yinzuomei + * @description 活动招募条件审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActRequirement(String requirement) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(requirement); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("活动报名条件审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.error("活动报名条件审核失败,报名条件:",requirement); + throw new RenException(EpmetErrorCode.ACT_REQ_SCAN_FAILED.getCode()); + } + } + logger.info("活动报名条件审核成功"); + } + + /** + * @return void + * @param coverPic + * @author yinzuomei + * @description 活动封面图片审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActCoverPic(String coverPic) { + ImgScanParamDTO coverPicScanParamDTO = new ImgScanParamDTO(); + ImgTaskDTO coverImgtask = new ImgTaskDTO(); + coverImgtask.setDataId(UUID.randomUUID().toString().replace("-", "")); + coverImgtask.setUrl(coverPic); + coverPicScanParamDTO.getTasks().add(coverImgtask); + Result coverPicScanRes = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), coverPicScanParamDTO); + if (!coverPicScanRes.success()){ + logger.error("活动封面审核失败接口返回失败,返参:", JSON.toJSONString(coverPicScanRes)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!coverPicScanRes.getData().isAllPass()) { + logger.error("活动封面审核失败,封面图片地址:",coverPic); + throw new RenException(EpmetErrorCode.ACT_COVER_PIC_SCAN_FAILED.getCode()); + } + } + logger.info("活动封面审核成功"); + } + + /** + * @return void + * @param title + * @author yinzuomei + * @description 活动标题审核 + * @Date 2020/7/21 19:21 + **/ + private void auditActTitle(String title) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(title); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + logger.error("活动标题审核接口返回失败,返参:", JSON.toJSONString(textSyncScanResult)); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + logger.error("活动标题审核失败,标题内容:",title); + throw new RenException(EpmetErrorCode.ACT_TITLE_SCAN_FAILED.getCode()); + } + } + logger.info("活动标题审核通过"); + } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.InProgressActResultDTO + * @author yinzuomei + * @description 进行中活动列表 + * @Date 2020/7/23 21:24 + **/ + @Override + public List queryInProgressList(ActListCommonFormDTO formDTO) { + List list = actInfoDao.selectInprogress(formDTO.getCustomerId()); + Date nowDate = new Date(); + for (InProgressActResultDTO inProgressActResultDTO : list) { +// 活动状态:报名中:signing_up;截止报名: end_sign_up; 已开始: in_progress; 已报满: enough + if (nowDate.compareTo(inProgressActResultDTO.getSignUpEndTime()) == -1 + || nowDate.compareTo(inProgressActResultDTO.getSignUpEndTime()) == 0) { + //截止报名时间之前(包含报名时间截止时间点) + if (!inProgressActResultDTO.getActQuotaCategory()) { + //如果是不限制名额,则显示报名中 + inProgressActResultDTO.setStatus("signing_up"); + continue; + } else { + //固定名额,且已报名人数<活动需要人数显示报名中 + if (inProgressActResultDTO.getActQuota() > inProgressActResultDTO.getSignedUp()) { + inProgressActResultDTO.setStatus("signing_up"); + continue; + } else if (inProgressActResultDTO.getActQuota().equals(inProgressActResultDTO.getSignedUp())) { + inProgressActResultDTO.setStatus("enough"); + continue; + } + } + } else if (nowDate.compareTo(inProgressActResultDTO.getSignUpEndTime()) == 1 + || nowDate.compareTo(inProgressActResultDTO.getActStartTime()) == -1) { + //活动报名截止-活动预计开始之间显示截止报名 + inProgressActResultDTO.setStatus("end_sign_up"); + continue; + } else if (nowDate.compareTo(inProgressActResultDTO.getActStartTime()) == 1 + || nowDate.compareTo(inProgressActResultDTO.getActStartTime()) == 0) { + //活动预计开始时间点之后,包含活动预计开始时间点,显示 已开始 + inProgressActResultDTO.setStatus("in_progress"); + continue; + } + } + return list; + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 已取消-活动列表 + * @Date 2020/7/23 23:11 + **/ + @Override + public List queryCanceledList(ActListCommonFormDTO formDTO) { + return actInfoDao.selectCanceledList(formDTO.getCustomerId()); + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 已结束-活动列表 + * @Date 2020/7/23 23:21 + **/ + @Override + public List queryFinishedList(ActListCommonFormDTO formDTO) { + return actInfoDao.selectFinishedList(formDTO.getCustomerId()); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 取消活动 + * @Date 2020/7/26 17:26 + **/ + @Override + public void cancelAct(CancelActFormDTO formDTO) { + ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId()); + if(null==actInfoDTO){ + logger.error("act_info is null"); + return ; + } + if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //插入取消活动操作日志 + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(formDTO.getActId()); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_CANCEL); + actOperationRecEntity.setNoticeUser(true); + actOperationRecEntity.setRemark(formDTO.getCancelReason()); + actOperationRecDao.insert(actOperationRecEntity); + //更新活动标识,改为已取消 + actInfoDTO.setCancelReason(formDTO.getCancelReason()); + actInfoDTO.setCancelTime(actOperationRecEntity.getCreatedTime()); + actInfoDTO.setActStatus(ActConstant.ACT_STATUS_CANCELED); + actInfoService.update(actInfoDTO); + //查询已经通过审核的用户,发送消息 + List userIdList=actUserRelationDao.selectUserIdList(formDTO.getActId(),ActConstant.ACT_USER_STATUS_PASSED); + if(null!=userIdList&&userIdList.size()>0){ + List userMessageFormDTOS=new ArrayList<>(); + for(String userId:userIdList){ + UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); + userMessageFormDTO.setCustomerId(actInfoDTO.getCustomerId()); + userMessageFormDTO.setUserId(userId); + userMessageFormDTO.setGridId(StrConstant.STAR); + userMessageFormDTO.setApp(AppClientConstant.APP_RESI); + userMessageFormDTO.setTitle(ActMessageConstant.TITLE); + userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); + userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.ACT_CANCELED, + actInfoDTO.getTitle(), + formDTO.getCancelReason())); + userMessageFormDTOS.add(userMessageFormDTO); + } + Result sendMessageRes= epmetMessageOpenFeignClient.saveUserMessageList(userMessageFormDTOS); + if(sendMessageRes.success()){ + logger.info("给审核通过的用户发送消息成功"); + } + } + + } + + /** + * @param actId + * @return void + * @author yinzuomei + * @description 已取消-活动详情 + * @Date 2020/7/26 18:00 + **/ + @Override + public CanceledActDetailResultDTO canceledDetail(String actId) { + CanceledActDetailResultDTO canceledActDetailResultDTO=actInfoDao.selectCanceledActInfo(actId); + if(null!=canceledActDetailResultDTO){ + canceledActDetailResultDTO.setActContent(actContentDao.selectByActId(actId)); + if(canceledActDetailResultDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + canceledActDetailResultDTO.setIsMyPublish(true); + }else{ + canceledActDetailResultDTO.setIsMyPublish(false); + } + } + return canceledActDetailResultDTO; + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 已结束-保存活动实际开始结束时间 + * @Date 2020/7/26 19:49 + **/ + @Override + public void saveActualTime(SaveActualTimeFormDTO formDTO) { + if(formDTO.getActualStartTime().compareTo(formDTO.getActualEndTime())!=-1){ + throw new RenException(EpmetErrorCode.ACT_ACTUAL_START_TIME_ERROR.getCode()); + } + ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId()); + Date actualStartTime= DateUtils.minStrToSecondDate(formDTO.getActualStartTime()); + actInfoDTO.setActualStartTime(actualStartTime); + Date actualEndTime= DateUtils.minStrToSecondDate(formDTO.getActualEndTime()); + actInfoDTO.setActualEndTime(actualEndTime); + actInfoDTO.setServiceMin(DateUtils.calculateMin(actualStartTime,actualEndTime)); + actInfoService.update(actInfoDTO); + } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.FinishedActDetailResultDTO + * @author yinzuomei + * @description 已结束-活动详情 + * @Date 2020/7/26 21:02 + **/ + @Override + public FinishedActDetailResultDTO finishedDeatil(ActIdFormDTO formDTO) { + FinishedActDetailResultDTO resultDTO = actInfoDao.selectFinishedDetail(formDTO.getActId()); + if (null != resultDTO) { + List list = actContentDao.selectByActId(formDTO.getActId()); + resultDTO.setActContent(list); + if(resultDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + resultDTO.setIsMyPublish(true); + }else{ + resultDTO.setIsMyPublish(false); + } + } + return resultDTO; + } + + /** + * @param actId + * @return com.epmet.dto.result.work.InProgressActDetailResultDTO + * @author yinzuomei + * @description 进行中-活动详情 + * @Date 2020/7/26 21:34 + **/ + @Override + public InProgressActDetailResultDTO inProgressDetail(String actId) { + InProgressActDetailResultDTO resultDTO = actInfoDao.selectInProgressDetail(actId); + if (null != resultDTO) { + List list = actContentDao.selectByActId(actId); + resultDTO.setActContent(list); + if(resultDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + resultDTO.setIsMyPublish(true); + }else{ + resultDTO.setIsMyPublish(false); + } + } + return resultDTO; + } + + /** + * @param actId + * @return void + * @author yinzuomei + * @description 已结束-确认结束活动 + * @Date 2020/7/26 21:48 + **/ + @Override + public void finishAct(String actId) { + ActInfoDTO actInfoDTO=actInfoService.get(actId); + if(null==actInfoDTO){ + logger.error("act_info is null"); + return; + } + //校验是否可以结束 + this.checkActInfoDTO(actInfoDTO); + //act_info表改为已完成 + actInfoDTO.setActStatus(ActConstant.ACT_STATUS_FINISHED); + actInfoService.update(actInfoDTO); + //发放爱心时长、参与活动并获得积分的次数 + updateHeartUserInfo(actInfoDTO); + //保存结束活动日志 + this.saveActOperationRec(actId); + //生成统计表 + this.saveActStatistical(actId); + //发放积分调用事件 + if(actInfoDTO.getReward()>0){ + this.grantActPoints(actInfoDTO); + } + } + + private void grantActPoints(ActInfoDTO actInfoDTO) { + //查询已经给分的用户 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(actInfoDTO.getId()), FieldConstant.ID, actInfoDTO.getId()) + .eq("PROCESS_FLAG",ActConstant.HANDLED) + .eq("REWARD_FLAG",ActConstant.ACT_USER_STATUS_AGREE); + List actUserRelationEntityList=actUserRelationDao.selectList(wrapper); + if(null==actUserRelationEntityList||actUserRelationEntityList.size()<1){ + logger.info("不存在给分的记录,无需发送消息时间"); + return; + } + //查询当前用户所属组织信息 + Result userResult=govOrgOpenFeignClient.getAgencyByStaff(loginUserUtil.getLoginUserId()); + if(!userResult.success()||null==userResult.getData()){ + logger.error(String.format("根据staffId查询所属的组织机构失败,staffId=%s",loginUserUtil.getLoginUserId())); + } + String opAgencyId=userResult.getData().getId(); + //备注 + String remark=String.format(ActMessageConstant.ACT_POINTS_EVENT_REMARK,actInfoDTO.getTitle()); + MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); + //mq的事件类型 + mqBaseMsgDTO.setEventClass(EventEnum.ACTIVE_SEND_POINT.getEventClass()); + //事件code + mqBaseMsgDTO.setEventTag(EventEnum.ACTIVE_SEND_POINT.getEventTag()); + List actPointEventMsgList=new ArrayList<>(); + for(ActUserRelationEntity actUserRelationEntity:actUserRelationEntityList){ + ActPointEventMsg actPointEventMsg=new ActPointEventMsg(); + actPointEventMsg.setOpAgencyId(opAgencyId); + actPointEventMsg.setCustomerId(actInfoDTO.getCustomerId()); + actPointEventMsg.setUserId(actUserRelationEntity.getUserId()); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setPoint(actInfoDTO.getReward()); + actPointEventMsg.setIsCommon(true); + actPointEventMsg.setRemark(remark); + actPointEventMsgList.add(actPointEventMsg); + } + mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); + Result result=SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!result.success()){ + logger.error("活动积分发放失败"); + } + } + + private void updateHeartUserInfo(ActInfoDTO actInfoDTO) { + List actUserRelationDTOList=actUserRelationService.getUserList(actInfoDTO.getId(),StrConstant.EPMETY_STR); + for(ActUserRelationDTO actUserRelation:actUserRelationDTOList){ + HeartUserInfoDTO heartUserInfoDTO=heartUserInfoDao.selectByUserId(actUserRelation.getUserId()); + if(null==heartUserInfoDTO){ + continue; + } + if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){ + heartUserInfoDTO.setObtainPointNum(heartUserInfoDTO.getObtainPointNum()+1); + } + //爱心时长发放(签到的。未签到但是有积分的) + if(ActConstant.ACT_USER_STATUS_SIGNED_IN.equals(actUserRelation.getSignInFlag())){ + //已签到的 + heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin()); + }else{ + //未签到,但是有积分的 + if(ActConstant.ACT_USER_STATUS_AGREE.equals(actUserRelation.getRewardFlag())){ + heartUserInfoDTO.setKindnessTime(heartUserInfoDTO.getKindnessTime()+actInfoDTO.getServiceMin()); + } + } + heartUserInfoService.update(heartUserInfoDTO); + } + } + + private void saveActStatistical(String actId) { + ActStatisticalDTO actStatisticalDTO=new ActStatisticalDTO(); + actStatisticalDTO.setActId(actId); + //报名总人数(已报名/待审核auditing,审核通过passed,审核不通过refused取消报名canceld总人数) + actStatisticalDTO.setSignupNum(actUserRelationDao.selectCountUser(actId,StrConstant.EPMETY_STR)); + // 待审核总数 + actStatisticalDTO.setAuditingNum(actUserRelationDao.selectCountUser(actId,ActConstant.ACT_USER_STATUS_AUDITING)); + //审核不通过总人数 + actStatisticalDTO.setPassedNum(actUserRelationDao.selectCountUser(actId,ActConstant.ACT_USER_STATUS_PASSED)); + //审核不通过总人数 + actStatisticalDTO.setRefusedNum(actUserRelationDao.selectCountUser(actId,ActConstant.ACT_USER_STATUS_REFUSED)); + //取消报名的人数 + actStatisticalDTO.setCanceldNum(actUserRelationDao.selectCountUser(actId,ActConstant.ACT_USER_STATUS_CANCELD)); + //活动已签到人数 + actStatisticalDTO.setSignedInUserNum(actUserRelationDao.selectCountSinedIn(actId)); + //发放积分总人数 + actStatisticalDTO.setRewardUserNum(actUserRelationDao.selectCountByReward(actId,ActConstant.ACT_USER_STATUS_AGREE)); + //拒绝发放积分总人数 + actStatisticalDTO.setDenyRewardUserNum(actUserRelationDao.selectCountByReward(actId,ActConstant.ACT_USER_STATUS_DENY)); + actStatisticalService.save(actStatisticalDTO); + } + + private void saveActOperationRec(String actId) { + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(actId); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_FINISH); + actOperationRecEntity.setNoticeUser(false); + actOperationRecEntity.setRemark(StrConstant.EPMETY_STR); + actOperationRecDao.insert(actOperationRecEntity); + } + + private ActInfoDTO checkActInfoDTO(ActInfoDTO actInfoDTO) { + //只有我发布的活动,我可以就结束 + if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //待处理事项为空时才可以结束活动 + List list=actUserRelationDao.selectInProgress(actInfoDTO.getId()); + if(null!=list&&list.size()>0){ + throw new RenException(EpmetErrorCode.HAVE_HANDLE.getCode()); + } + //先填写实际开始时间、实际结束时间 + if(null==actInfoDTO.getActualStartTime()||null==actInfoDTO.getActualEndTime()){ + throw new RenException(EpmetErrorCode.ACTUAL_TIME.getCode()); + } + return actInfoDTO; + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 保存添加回顾 + * @Date 2020/7/27 10:45 + **/ + @Override + public void summaryAct(SummaryActFormDTO formDTO) { + ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId()); + if(null==actInfoDTO){ + logger.info("act_info is null"); + return; + } + if(!actInfoDTO.getActStatus().equals(ActConstant.ACT_STATUS_FINISHED)){ + //先结束活动,才能添加回顾 + throw new RenException(EpmetErrorCode.ACTUAL_NOT_FINISHED.getCode()); + } + if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + //只有我发布的活动,才可以添加回顾 + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + //审核 + List textList=new ArrayList<>(); + List imgList=new ArrayList<>(); + for(PublishActContentFormDTO actContent:formDTO.getActContent()){ + if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){ + textList.add(actContent.getContent()); + }else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){ + imgList.add(actContent.getContent()); + } + } + this.auditActContent(textList,imgList); + //插入act_summary记录 + int orderNum=1; + for(PublishActContentFormDTO actContentFormDTO:formDTO.getActContent()){ + ActSummaryEntity actSummaryEntity=new ActSummaryEntity(); + actSummaryEntity.setActId(formDTO.getActId()); + actSummaryEntity.setContent(actContentFormDTO.getContent()); + actSummaryEntity.setContentType(actContentFormDTO.getContentType()); + actSummaryEntity.setOrderNum(orderNum); + actSummaryDao.insert(actSummaryEntity); + orderNum++; + } + //更新act_info表的SUMMARY_FLAG=true + actInfoDTO.setSummaryFlag(true); + actInfoService.update(actInfoDTO); + } + + /** + * @param actId + * @return com.epmet.dto.result.work.ReEditActInfoResultDTO + * @author yinzuomei + * @description 重新编辑-获取活动详情 + * @Date 2020/7/27 13:36 + **/ + @Override + public ReEditActInfoResultDTO getActInfo(String actId) { + ActInfoDTO actInfoDTO=actInfoService.get(actId); + if(null==actInfoDTO){ + logger.error("act_info is null"); + return null; + } + if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + if(!ActConstant.ACT_STATUS_PUBLISHED.equals(actInfoDTO.getActStatus())){ + throw new RenException("只有进行中的活动才可以编辑"); + } + ReEditActInfoResultDTO resultDTO= ConvertUtils.sourceToTarget(actInfoDTO, ReEditActInfoResultDTO.class); + resultDTO.setActId(actId); + List actContent=actContentDao.selectByActId(actId); + resultDTO.setActContent(actContent); + return resultDTO; + } + + /** + * @param rePublishFormDTO + * @return com.epmet.dto.result.work.PublishActResultDTO + * @author yinzuomei + * @description 重新发布活动 + * @Date 2020/7/27 13:55 + **/ + @Override + public PublishActResultDTO rePublish(RePublishFormDTO rePublishFormDTO) { + ActInfoDTO originalActInfo=actInfoService.get(rePublishFormDTO.getActId()); + if(null==originalActInfo){ + logger.error("act_info is null"); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + if(!originalActInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + if(!ActConstant.ACT_STATUS_PUBLISHED.equals(originalActInfo.getActStatus())){ + throw new RenException("只有进行中的活动才可以编辑"); + } + //构造属性保存活动属性,活动内容 + ActInfoEntity newActInfoEntity=this.constructRePublishActInfo(rePublishFormDTO); + //校验参数 + this.checkPublishFormDTO(newActInfoEntity); + PublishActResultDTO publishActResultDTO=new PublishActResultDTO(); + //内容审核(活动标题、招募要求、活动内容图文) + this.auditRePublishAct(rePublishFormDTO); + logger.info("重新发布活动,审核成功"); + + newActInfoEntity.setId(rePublishFormDTO.getActId()); + actInfoDao.updateById(newActInfoEntity); + //删除原来的 + actContentDao.updateDelFlagByActId(rePublishFormDTO.getActId()); + //插入编辑后的活动详情 + List actContentEntityList=this.constructActContent(rePublishFormDTO.getActContent(),rePublishFormDTO.getActId()); + for(ActContentEntity actContentEntity:actContentEntityList){ + actContentDao.insert(actContentEntity); + } + //插入一条操作日志 + ActOperationRecEntity actOperationRecEntity=new ActOperationRecEntity(); + actOperationRecEntity.setActId(rePublishFormDTO.getActId()); + actOperationRecEntity.setType(ActConstant.ACT_OPER_TYPE_UPDATE); + actOperationRecEntity.setNoticeUser(rePublishFormDTO.getNoticePassedPeople()); + actOperationRecEntity.setRemark(StrConstant.EPMETY_STR); + actOperationRecDao.insert(actOperationRecEntity); + + //删除所有的草稿 + this.deleteDraft(); + publishActResultDTO.setActId(rePublishFormDTO.getActId()); + //发送消息通知-暂时不做了 + /*if(rePublishFormDTO.getNoticePassedPeople()){ + this.noticePassedPeople(originalActInfo,newActInfoEntity); + }*/ + return publishActResultDTO; + } + + private void noticePassedPeople(ActInfoDTO originalActInfo, ActInfoEntity newActInfoEntity) { + /* List actUserRelationDTOList=actUserRelationDao.selectAuditingAndPassedList(originalActInfo.getId()); + if(null==actUserRelationDTOList||actUserRelationDTOList.size()<1){ + logger.info("不存在待审核人员、已经审核用户,无需发送站内信"); + return; + } + String originalTitle=originalActInfo.getTitle(); + + //活动地点、活动预计开始时间、活动预计结束时间、活动积分、签到时间开始、签到结束时间、签到地点*/ + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java new file mode 100644 index 0000000000..c2f121e972 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java @@ -0,0 +1,635 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ActConstant; +import com.epmet.constant.ActMessageConstant; +import com.epmet.constant.ReadFlagConstant; +import com.epmet.dao.ActInfoDao; +import com.epmet.dao.ActUserLogDao; +import com.epmet.dao.ActUserRelationDao; +import com.epmet.dto.ActUserLogDTO; +import com.epmet.dto.ActUserRelationDTO; +import com.epmet.dto.HeartUserInfoDTO; +import com.epmet.dto.form.UserMessageFormDTO; +import com.epmet.dto.form.work.*; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.work.*; +import com.epmet.entity.ActInfoEntity; +import com.epmet.entity.ActUserLogEntity; +import com.epmet.entity.ActUserRelationEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.service.ActUserRelationService; +import com.epmet.service.HeartUserInfoService; +import com.epmet.service.WorkActUserService; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * 工作端:活动人员相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/21 22:23 + */ +@Service +public class WorkActUserServiceImpl implements WorkActUserService { + private Logger logger = LogManager.getLogger(WorkActUserServiceImpl.class); + @Autowired + private ActUserRelationService actUserRelationService; + @Autowired + private HeartUserInfoService heartUserInfoService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private ActInfoDao actInfoDao; + @Autowired + private ActUserLogDao actUserLogDao; + @Autowired + private ActUserRelationDao actUserRelationDao; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private LoginUserUtil loginUserUtil; + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 报名审核-待审核列表 + * @Date 2020/7/21 22:25 + **/ + @Override + public List getAuditingList(ActIdFormDTO formDTO) { + List list=new ArrayList<>(); + //查询出待审核的人员列表 + List actUserRelationDTOList=actUserRelationService.getUserList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_AUDITING); + if(null==actUserRelationDTOList||actUserRelationDTOList.size()==0){ + logger.info(String.format("当前活动,actId=%s待审核列表为空",formDTO.getActId())); + return list; + } + //查询出待审核的人员id集合 + List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_AUDITING); + //根据待审核的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfoList(userIdList); + for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ + AuditingActUserResultDTO auditingDTO=new AuditingActUserResultDTO(); + auditingDTO.setActUserRelationId(actUserRelationDTO.getId()); + auditingDTO.setActId(formDTO.getActId()); + auditingDTO.setUserId(actUserRelationDTO.getUserId()); + auditingDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + //true: 是志愿者 false : 不是志愿者 + auditingDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId())); + //赋值基本信息 + for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ + if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ + auditingDTO.setRealName(userBaseInfoResultDTO.getRealName()); + auditingDTO.setNickName(userBaseInfoResultDTO.getNickname()); + auditingDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + list.add(auditingDTO); + } + return list; + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 报名审核-已通过列表 + * @Date 2020/7/22 15:16 + **/ + @Override + public List getPassedList(ActIdFormDTO formDTO) { + List resultList=new ArrayList<>(); + //查询已通过的人员列表 + List actUserRelationDTOList=actUserRelationService.getUserList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_PASSED); + if(null==actUserRelationDTOList||actUserRelationDTOList.size()==0){ + logger.info(String.format("当前活动,actId=%s已通过列表为空",formDTO.getActId())); + return resultList; + } + //查询已通过审核的人员id集合 + List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_PASSED); + //根据已通过的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfoList(userIdList); + for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ + PassedActUserResultDTO passedDTO=new PassedActUserResultDTO(); + passedDTO.setActUserRelationId(actUserRelationDTO.getId()); + passedDTO.setActId(formDTO.getActId()); + passedDTO.setUserId(actUserRelationDTO.getUserId()); + passedDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + passedDTO.setAuditTime(actUserRelationDTO.getAuditTime()); + //true: 是志愿者 false : 不是志愿者 + passedDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId())); + //赋值基本信息 + for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ + if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ + passedDTO.setRealName(userBaseInfoResultDTO.getRealName()); + passedDTO.setNickName(userBaseInfoResultDTO.getNickname()); + passedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + resultList.add(passedDTO); + } + return resultList; + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 报名审核-已拒绝列表 + * @Date 2020/7/22 15:50 + **/ + @Override + public List getRejectedlist(ActIdFormDTO formDTO) { + List resultList=new ArrayList<>(); + //查询已拒绝的人员列表 + List actUserRelationDTOList=actUserRelationService.getUserList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_REFUSED); + if(null==actUserRelationDTOList||actUserRelationDTOList.size()==0){ + logger.info(String.format("当前活动,actId=%s已拒绝列表为空",formDTO.getActId())); + return resultList; + } + //查询已拒绝审核的人员id集合 + List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_REFUSED); + //根据已拒绝的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfoList(userIdList); + for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ + RejectedActUserResultDTO rejectedDTO=new RejectedActUserResultDTO(); + rejectedDTO.setActUserRelationId(actUserRelationDTO.getId()); + rejectedDTO.setActId(formDTO.getActId()); + rejectedDTO.setUserId(actUserRelationDTO.getUserId()); + rejectedDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + rejectedDTO.setAuditTime(actUserRelationDTO.getAuditTime()); + rejectedDTO.setFailureReason(actUserRelationDTO.getFailureReason()); + //true: 是志愿者 false : 不是志愿者 + rejectedDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId())); + //赋值基本信息 + for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ + if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ + rejectedDTO.setRealName(userBaseInfoResultDTO.getRealName()); + rejectedDTO.setNickName(userBaseInfoResultDTO.getNickname()); + rejectedDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + resultList.add(rejectedDTO); + } + return resultList; + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 报名审核-已取消报名列表 + * @Date 2020/7/22 16:35 + **/ + @Override + public List getCanceledList(ActIdFormDTO formDTO) { + List resultList=new ArrayList<>(); + //查询已取消的人员列表 + List actUserRelationDTOList=actUserRelationService.getUserList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_CANCELD); + if(null==actUserRelationDTOList||actUserRelationDTOList.size()==0){ + logger.info(String.format("当前活动,actId=%s已取消报名列表为空",formDTO.getActId())); + return resultList; + } + //查询已取消审核的人员id集合 + List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_CANCELD); + //根据已取消的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfoList(userIdList); + for(ActUserRelationDTO actUserRelationDTO:actUserRelationDTOList){ + CanceledActUserResultDTO cancelDTO=new CanceledActUserResultDTO(); + cancelDTO.setActUserRelationId(actUserRelationDTO.getId()); + cancelDTO.setActId(formDTO.getActId()); + cancelDTO.setUserId(actUserRelationDTO.getUserId()); + cancelDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + cancelDTO.setCancelReason(actUserRelationDTO.getCancelReason()); + cancelDTO.setCancelTime(actUserRelationDTO.getCancelTime()); + //true: 是志愿者 false : 不是志愿者 + cancelDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId())); + //赋值基本信息 + for(UserBaseInfoResultDTO userBaseInfoResultDTO:userInfoList){ + if(actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())){ + cancelDTO.setRealName(userBaseInfoResultDTO.getRealName()); + cancelDTO.setNickName(userBaseInfoResultDTO.getNickname()); + cancelDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + break; + } + } + resultList.add(cancelDTO); + } + return resultList; + } + + /** + * @param actId + * @return com.epmet.dto.result.work.ActSignUpStatResultDTO + * @author yinzuomei + * @description 报名审核-概要统计 + * @Date 2020/7/22 17:02 + **/ + @Override + public ActSignUpStatResultDTO getActSignUpStat(String actId) { + ActSignUpStatResultDTO actInfo=actInfoDao.getActSignUpStat(actId); + if(null!=actInfo){ + //待审核总人数 + actInfo.setAuditingNum(actUserRelationService.selectCountUser(actId,ActConstant.ACT_USER_STATUS_AUDITING)); + //已通过总人数 + actInfo.setPassedNum(actUserRelationService.selectCountUser(actId,ActConstant.ACT_USER_STATUS_PASSED)); + //已拒绝总人数 + actInfo.setRefusedNum(actUserRelationService.selectCountUser(actId,ActConstant.ACT_USER_STATUS_REFUSED)); + //已取消总人数 + actInfo.setCanceledNum(actUserRelationService.selectCountUser(actId,ActConstant.ACT_USER_STATUS_CANCELD)); + //true:固定名额 false: 不限制名额 + if(actInfo.getActQuotaCategory()){ + Integer totalSignUp=actInfo.getAuditingNum()+actInfo.getPassedNum(); + actInfo.setTotalSignUp(totalSignUp); + //剩余报名名额 + Integer residueNum=actInfo.getActQuota()-totalSignUp; + actInfo.setResidueNum(residueNum); + } + } + return actInfo; + } + + /** + * @param formDTO + * @return com.epmet.dto.result.work.AuditingUserDetailResultDTO + * @author yinzuomei + * @description 报名审核-待审核人员详情 + * @Date 2020/7/22 22:44 + **/ + @Override + public AuditingUserDetailResultDTO queryAuditingUserDetail(AactUserDetailFormDTO formDTO) { + ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId()); + UserBaseInfoResultDTO userBaseInfo=queryUserBaseInfo(actUserRelationDTO.getUserId()); + AuditingUserDetailResultDTO resultDTO=new AuditingUserDetailResultDTO(); + //基本信息赋值 + resultDTO.setActUserRelationId(actUserRelationDTO.getId()); + resultDTO.setActId(actUserRelationDTO.getActId()); + resultDTO.setUserId(actUserRelationDTO.getUserId()); + resultDTO.setRealName(userBaseInfo.getRealName()); + resultDTO.setGender(userBaseInfo.getGender()); + resultDTO.setMobile(userBaseInfo.getMobile()); + resultDTO.setIdNum(userBaseInfo.getIdNum()); + resultDTO.setAddress(userBaseInfo.getStreet()+userBaseInfo.getDistrict()+userBaseInfo.getBuildingAddress()); + resultDTO.setSignUpTime(actUserRelationDTO.getCreatedTime()); + /** + * 当前状态(已报名/待审核auditing, + 审核通过passed, + 审核不通过refused + 取消报名canceld, + ) + */ + resultDTO.setStatus(actUserRelationDTO.getStatus()); + HistoricalActInfo historicalActInfo=this.getHistoricalActInfo(actUserRelationDTO.getUserId()); + resultDTO.setHistoricalActInfo(historicalActInfo); + if(ActConstant.ACT_USER_STATUS_AUDITING.equals(resultDTO.getStatus())){ + //被拒绝过,才赋值 + Integer refusedCount=actUserLogDao.selectRefusedCount(actUserRelationDTO.getActId(),actUserRelationDTO.getUserId()); + if(null!=refusedCount&&refusedCount>0){ + ActUserLogDTO latestRefused=actUserLogDao.selectLatestRefused(actUserRelationDTO.getActId(),actUserRelationDTO.getUserId()); + HistoricalAuditResult historicalAuditResult=new HistoricalAuditResult(); + historicalAuditResult.setLatestAuditTime(latestRefused.getCreatedTime()); + historicalAuditResult.setLatestRefusedReason(latestRefused.getReason()); + historicalAuditResult.setRefusedCountDesc(String.format("已拒绝%s次",refusedCount)); + resultDTO.setHistoricalAuditResult(historicalAuditResult); + } + }else if(ActConstant.ACT_USER_STATUS_PASSED.equals(resultDTO.getStatus())||ActConstant.ACT_USER_STATUS_REFUSED.equals(resultDTO.getStatus())){ + AuditResult auditResult=new AuditResult(); + auditResult.setAuditTime(actUserRelationDTO.getAuditTime()); + auditResult.setRefusedReason(actUserRelationDTO.getFailureReason()); + resultDTO.setAuditResult(auditResult); + }else if(ActConstant.ACT_USER_STATUS_CANCELD.equals(resultDTO.getStatus())){ + CancelResult cancelResult=new CancelResult(); + cancelResult.setCancelReason(actUserRelationDTO.getCancelReason()); + cancelResult.setCancelTime(actUserRelationDTO.getCancelTime()); + resultDTO.setCancelResult(cancelResult); + } + resultDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId())); + return resultDTO; + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 报名审核-人员历史活动情况 + * @Date 2020/7/23 16:16 + **/ + @Override + public UserHistoricalActResultDTO queryUserHistoricalAct(UserHistoricalActFormDTO formDTO) { + UserHistoricalActResultDTO resultDTO=new UserHistoricalActResultDTO(); + UserBaseInfoResultDTO userBaseInfoResultDTO=this.queryUserBaseInfo(formDTO.getUserId()); + //基本信息 + resultDTO.setUserId(formDTO.getUserId()); + resultDTO.setHeadImgUrl(userBaseInfoResultDTO.getHeadImgUrl()); + resultDTO.setNickName(userBaseInfoResultDTO.getNickname()); + resultDTO.setRealName(userBaseInfoResultDTO.getRealName()); + //参与活动统计值 + HistoricalActInfo historicalActInfo=getHistoricalActInfo(formDTO.getUserId()); + resultDTO.setSignInActNum(historicalActInfo.getSignInActNum()); + resultDTO.setSignUpActNum(historicalActInfo.getSignUpActNum()); + resultDTO.setObtainPointsActNum(historicalActInfo.getObtainPointsActNum()); + //历史活动列表 + resultDTO.setActInfoList(actUserRelationDao.selectAllByUserId(formDTO.getUserId())); + return resultDTO; + } + + /** + * @param actUserRelationId + * @return void + * @author yinzuomei + * @description 报名审核-审核通过 + * @Date 2020/7/23 17:30 + **/ + @Override + public void auditPass(String actUserRelationId) { + ActUserRelationEntity actUserRelationEntity=actUserRelationDao.selectById(actUserRelationId); + if(null==actUserRelationEntity||!ActConstant.ACT_USER_STATUS_AUDITING.equals(actUserRelationEntity.getStatus())){ + logger.info("当前用户不处理待审核状态"); + return ; + } + ActInfoEntity actInfo = actInfoDao.selectById(actUserRelationEntity.getActId()); + if(null==actInfo){ + logger.error("查询活动为空actId="+actUserRelationEntity.getActId()); + return; + } + if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + if(actInfo.getActStatus().equals(ActConstant.ACT_STATUS_CANCELED)){ + logger.info("活动已经取消,无需处理"); + return; + } + Date auditTime=new Date(); + actUserRelationEntity.setStatus(ActConstant.ACT_USER_STATUS_PASSED); + actUserRelationEntity.setPassedType(ActConstant.PASSEDTYPE_MANUAL); + actUserRelationEntity.setAuditTime(auditTime); + actUserRelationEntity.setFailureReason(StrConstant.EPMETY_STR); + //更新关系记录表改为已通过 + actUserRelationDao.updateById(actUserRelationEntity); + + ActUserLogEntity actUserLogEntity=new ActUserLogEntity(); + actUserLogEntity.setActId(actUserRelationEntity.getActId()); + actUserLogEntity.setUserId(actUserRelationEntity.getUserId()); + actUserLogEntity.setOperationType(ActConstant.ACT_USER_LOG_OPER_PASSED); + actUserLogEntity.setReason(StrConstant.EPMETY_STR); + actUserLogEntity.setCreatedTime(auditTime); + //插入一条日志 + actUserLogDao.insert(actUserLogEntity); + //给居民发消息 + this.saveUserMessage(actUserRelationEntity,ActConstant.ACT_USER_STATUS_PASSED,actInfo); + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 报名审核-拒绝报名 + * @Date 2020/7/23 18:14 + **/ + @Override + public void auditRefuse(AuditUserFormDTO formDTO) { + ActUserRelationEntity actUserRelationEntity=actUserRelationDao.selectById(formDTO.getActUserRelationId()); + if(null==actUserRelationEntity||!ActConstant.ACT_USER_STATUS_AUDITING.equals(actUserRelationEntity.getStatus())){ + logger.info("当前用户不处理待审核状态"); + return ; + } + ActInfoEntity actInfo = actInfoDao.selectById(actUserRelationEntity.getActId()); + if(null==actInfo){ + logger.error("查询活动为空actId="+actUserRelationEntity.getActId()); + return; + } + if(actInfo.getActStatus().equals(ActConstant.ACT_STATUS_CANCELED)){ + logger.info("活动已经取消,无需处理"); + return; + } + if(!actInfo.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ + throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); + } + Date auditTime=new Date(); + actUserRelationEntity.setStatus(ActConstant.ACT_USER_STATUS_REFUSED); + actUserRelationEntity.setPassedType(ActConstant.PASSEDTYPE_MANUAL); + actUserRelationEntity.setAuditTime(auditTime); + //拒绝理由必填 + actUserRelationEntity.setFailureReason(formDTO.getRejectReason()); + //更新关系记录表改为已拒绝 + actUserRelationDao.updateById(actUserRelationEntity); + ActUserLogEntity actUserLogEntity=new ActUserLogEntity(); + actUserLogEntity.setActId(actUserRelationEntity.getActId()); + actUserLogEntity.setUserId(actUserRelationEntity.getUserId()); + actUserLogEntity.setOperationType(ActConstant.ACT_USER_LOG_OPER_REFUSED); + actUserLogEntity.setReason(StrConstant.EPMETY_STR); + actUserLogEntity.setCreatedTime(auditTime); + //插入一条日志 + actUserLogDao.insert(actUserLogEntity); + //给居民发消息 + this.saveUserMessage(actUserRelationEntity,ActConstant.ACT_USER_STATUS_REFUSED,actInfo); + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 已结束-已参加人员列表 + * @Date 2020/7/24 10:17 + **/ + @Override + public List queryJoinUserList(ActIdFormDTO formDTO) { + List list=actInfoDao.queryJoinUserList(formDTO.getActId()); + if(null!=list&&list.size()>0){ + //查询已通过审核的人员id集合 + List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_PASSED); + //根据已通过的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfoList(userIdList); + for(JoinedUserResultDTO joinedUserResultDTO:list){ + //积分描述赋值 + if(ActConstant.ACT_USER_STATUS_AGREE.equals(joinedUserResultDTO.getRewardFlag())){ + joinedUserResultDTO.setPointsDes(String.format("积分+%s",joinedUserResultDTO.getReward())); + }else if(ActConstant.ACT_USER_STATUS_DENY.equals(joinedUserResultDTO.getRewardFlag())){ + joinedUserResultDTO.setPointsDes("积分+0"); + } + //志愿者标识赋值 + joinedUserResultDTO.setVolunteerFlag(this.getVolunteerFlag(joinedUserResultDTO.getUserId())); + //基础信息赋值 + for(UserBaseInfoResultDTO userBaseInfo:userInfoList){ + if(joinedUserResultDTO.getUserId().equals(userBaseInfo.getUserId())){ + joinedUserResultDTO.setRealName(userBaseInfo.getRealName()); + joinedUserResultDTO.setNickName(userBaseInfo.getNickname()); + joinedUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl()); + break; + } + + } + } + } + return list; + } + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 已结束-已取消报名人员列表 + * @Date 2020/7/24 10:54 + **/ + @Override + public List queryCanceledUserList(ActIdFormDTO formDTO) { + List list=actInfoDao.queryCanceledUserList(formDTO.getActId()); + if(null!=list&&list.size()>0){ + //查询已取消报名的人员id集合 + List userIdList=actUserRelationService.getUserIdList(formDTO.getActId(), ActConstant.ACT_USER_STATUS_CANCELD); + //根据已取消报名的人员集合,查询出用户基本信息 + List userInfoList=this.queryUserBaseInfoList(userIdList); + for(CanceledUserResultDTO canceledUserResultDTO:list){ + //志愿者标识赋值 + canceledUserResultDTO.setVolunteerFlag(this.getVolunteerFlag(canceledUserResultDTO.getUserId())); + //基础信息赋值 + for(UserBaseInfoResultDTO userBaseInfo:userInfoList){ + if(canceledUserResultDTO.getUserId().equals(userBaseInfo.getUserId())){ + canceledUserResultDTO.setRealName(userBaseInfo.getRealName()); + canceledUserResultDTO.setNickName(userBaseInfo.getNickname()); + canceledUserResultDTO.setHeadImgUrl(userBaseInfo.getHeadImgUrl()); + break; + } + + } + } + } + return list; + } + + /** + * @param actUserRelationEntity + * @param type + * @return void + * @author yinzuomei + * @description 报名审核通过,拒绝通知居民 + * @Date 2020/7/23 18:01 + **/ + private void saveUserMessage(ActUserRelationEntity actUserRelationEntity, String type,ActInfoEntity actInfo) { + try { + UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); + userMessageFormDTO.setCustomerId(actInfo.getCustomerId()); + userMessageFormDTO.setUserId(actUserRelationEntity.getUserId()); + userMessageFormDTO.setGridId(StrConstant.STAR); + userMessageFormDTO.setApp(AppClientConstant.APP_RESI); + userMessageFormDTO.setTitle(ActMessageConstant.TITLE); + userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); + if (ActConstant.ACT_USER_STATUS_PASSED.equals(type)) { + userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.AUDIT_PASSED, actInfo.getTitle())); + } else if (ActConstant.ACT_USER_STATUS_REFUSED.equals(type)) { + userMessageFormDTO.setMessageContent(String.format(ActMessageConstant.AUDIT_REFUSED, actInfo.getTitle(), actUserRelationEntity.getFailureReason())); + } + Result result = epmetMessageOpenFeignClient.saveUserMessage(userMessageFormDTO); + if (result.success()) { + logger.info("审核成功,已成功发送站内信"); + }else{ + logger.error("审核成功,发送站内信失败"+ JSON.toJSONString(result)); + } + } catch (Exception e) { + logger.error("审核结果,发送站内信异常", e.getMessage()); + } + } + + /** + * @return com.epmet.dto.result.work.HistoricalActInfo + * @param userId + * @author yinzuomei + * @description 用户历史活动情况 + * @Date 2020/7/23 15:56 + **/ + private HistoricalActInfo getHistoricalActInfo(String userId) { + HistoricalActInfo historicalActInfo=new HistoricalActInfo(); + /** + * 实际参加活动个数(已经签到的) + */ + Integer signInActNum=actUserRelationDao.countSignInActNum(userId); + historicalActInfo.setSignInActNum(signInActNum); + /** + * 报名活动个数(act_user_realation) + */ + Integer signUpActNum=actUserRelationDao.countSignUpActNum(userId); + historicalActInfo.setSignUpActNum(signUpActNum); + /** + * 获得积分活动个数 + */ + Integer obtainPointsActNum=actUserRelationDao.countObtainPointsActNum(userId); + historicalActInfo.setObtainPointsActNum(obtainPointsActNum); + return historicalActInfo; + } + + /** + * @return java.lang.Boolean + * @param userId + * @author yinzuomei + * @description 根据用户id判断是否志愿者 + * @Date 2020/7/24 12:51 + **/ + @Override + public Boolean getVolunteerFlag(String userId) { + HeartUserInfoDTO heartUserInfoDTO=heartUserInfoService.getByUserId(userId); + //true: 是志愿者 false : 不是志愿者 + if(null!=heartUserInfoDTO){ + return heartUserInfoDTO.getVolunteerFlag(); + } + return false; + } + + /** + * @return java.util.List + * @param userIdList + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 10:38 + **/ + @Override + public List queryUserBaseInfoList(List userIdList) { + List userInfoList=new ArrayList<>(); + if(null==userIdList||userIdList.size()==0){ + return userInfoList; + } + //调用epemet_user服务获取用户的基本信息 + Result> resultUserList =epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if(resultUserList.success()&&resultUserList.getData().size()>0){ + return resultUserList.getData(); + }else{ + logger.warn("查询用户基本信息接口返回失败"); + } + return userInfoList; + } + + /** + * @return com.epmet.dto.result.UserBaseInfoResultDTO + * @param userId + * @author yinzuomei + * @description 根据用户id获取用户基本信息 + * @Date 2020/7/23 12:52 + **/ + @Override + public UserBaseInfoResultDTO queryUserBaseInfo(String userId) { + List userIdList = new ArrayList<>(); + userIdList.add(userId); + //调用epemet_user服务获取用户的基本信息 + Result> resultUserList = epmetUserOpenFeignClient.queryUserBaseInfo(userIdList); + if (!resultUserList.success() || resultUserList.getData().size() < 1 || null == resultUserList.getData().get(0)) { + throw new RenException("查询用户基本信息失败"); + } + return resultUserList.getData().get(0); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/CaculateDistance.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/CaculateDistance.java new file mode 100644 index 0000000000..5a772706da --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/CaculateDistance.java @@ -0,0 +1,40 @@ +package com.epmet.utils; + + +/** + * 计算两个经纬度之间相差的距离(米) + * + * @Auther: zhangyong + * @Date: 2020-07-17 14:54 + */ +public class CaculateDistance { + + private static final double EARTH_RADIUS = 6378137; + private static double rad(double d) { + return d * Math.PI / 180.0; + } + + /** + * 根据两点间经纬度坐标(double值),计算两点间距离,单位为米 + * + * @param lng1 经度1 + * @param lat1 纬度1 + * @param lng2 经度2 + * @param lat2 纬度2 + * @return double + * @Author zhangyong + * @Date 14:56 2020-07-17 + **/ + public static double getDistance(double lng1, double lat1, double lng2, double lat2) { + double radLat1 = rad(lat1); + double radLat2 = rad(lat2); + double a = radLat1 - radLat2; + double b = rad(lng1) - rad(lng2); + double s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a/2),2) + + Math.cos(radLat1)*Math.cos(radLat2)*Math.pow(Math.sin(b/2),2))); + s = s * EARTH_RADIUS; + s = Math.round(s * 10000) / 10000; + return s; + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ModuleConstant.java new file mode 100644 index 0000000000..d9f96aa25d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.utils; + +import com.epmet.commons.tools.constant.Constant; + +/** + * 模块常量 + * + * @author Mark sunlightcs@gmail.com + * @since 1.1.0 + */ +public interface ModuleConstant extends Constant { + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java new file mode 100644 index 0000000000..4bb60ab49f --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/utils/ValidityVerification.java @@ -0,0 +1,94 @@ +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 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 被校验的图片列表 + * @param businessEnum 业务枚举,定义校验失败后,输出的日志信息 + * + * @return void + * @auther zhangyong + * @Date 14:42 2020-07-15 + **/ + public void imgScanVerification(List imgList, String businessEnum){ + if (null != imgList && 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 imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + // 业务枚举:例如:评论话题失败,评论内容为:%s" + log.error(String.format(businessEnum)); + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); + } + } + } + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..72477fb20d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -0,0 +1,136 @@ +server: + port: @server.port@ + servlet: + context-path: /heart + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epmet-heart-server + #环境 dev|test|prod + profiles: + active: dev + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.url@ + username: @datasource.druid.username@ + password: @datasource.druid.password@ + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml + #指定共享配置,且支持动态刷新 + # ext-config: + # - data-id: datasource.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + # - data-id: common.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + + # 数据迁移工具flyway + flyway: + enabled: false + locations: classpath:db/migration + url: @datasource.druid.url@ + user: @datasource.druid.username@ + password: @datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: INPUT + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + + +openapi: + scan: + server: + url: @openapi.scan.server.url@ + method: + imgSyncScan: /imgSyncScan + textSyncScan: /textSyncScan + +#亿联云消息网关 +elink: + mq: + appId: @elink.mq.appId@ #项目接入亿联云的应用Id + token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret + host: @elink.mq.host@ #亿联云消息网关服务地址 + sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..aacc15fdab --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/logback-spring.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + ERROR + ACCEPT + DENY + ${webHook} + ${secret} + ${appname} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/.gitkeep b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml new file mode 100644 index 0000000000..6a0027bd5e --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActContentDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE act_content ac + SET ac.DEL_FLAG = '1' + WHERE + ac.ACT_ID = #{actId} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActCustomizedDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActCustomizedDao.xml new file mode 100644 index 0000000000..7661ed10dd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActCustomizedDao.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml new file mode 100644 index 0000000000..370150c73d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -0,0 +1,666 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLivePicDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLivePicDao.xml new file mode 100644 index 0000000000..0df8cdc28c --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLivePicDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml new file mode 100644 index 0000000000..6b3c8d92ea --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActLiveRecDao.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO act_live_rec ( + ID, + ACT_ID, + USER_ID, + LONGITUDE, + LATITUDE, + ADDRESS, + `DESC`, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) + VALUES + ( #{id}, + #{actId}, + #{userId}, + #{longitude}, + #{latitude}, + #{address}, + #{desc}, + 0, + 0, + #{userId}, + now(), + #{userId}, + now()) + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActOperationRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActOperationRecDao.xml new file mode 100644 index 0000000000..555b3b18e5 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActOperationRecDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml new file mode 100644 index 0000000000..322fda60fb --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActPointLogDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInPicDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInPicDao.xml new file mode 100644 index 0000000000..af761e3fe4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInPicDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml new file mode 100644 index 0000000000..c1e6956935 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSignInRecDao.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO act_sign_in_rec ( + ID, + ACT_ID, + USER_ID, + LONGITUDE, + LATITUDE, + ADDRESS, + `DESC`, + SYNC_LIVE, + LIVE_ID, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) + VALUES + ( #{id}, + #{actId}, + #{userId}, + #{longitude}, + #{latitude}, + #{address}, + #{desc}, + #{syncLive}, + #{liveId}, + 0, + 0, + #{userId}, + now(), + #{userId}, + now()) + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml new file mode 100644 index 0000000000..4381ff3e2d --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActStatisticalDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml new file mode 100644 index 0000000000..6ff1b956d0 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActSummaryDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml new file mode 100644 index 0000000000..ed56feda4b --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserLogDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml new file mode 100644 index 0000000000..0b98a68f39 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActUserRelationDao.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE act_user_relation + SET + + STATUS = #{status}, + + + CANCEL_TIME = NOW(), + CANCEL_REASON = #{cancelReason}, + + + SIGN_IN_FLAG = #{signInFlag}, + + + UPDATED_BY = #{userId}, + + UPDATED_TIME = NOW() + WHERE + DEL_FLAG = '0' + AND ACT_ID = #{actId} + AND USER_ID = #{userId} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE act_user_relation + SET + DEL_FLAG = '1', + + UPDATED_BY = #{userId}, + + UPDATED_TIME = NOW() + WHERE + DEL_FLAG = '0' + AND ACT_ID = #{actId} + AND USER_ID = #{userId} + + + + + + + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml new file mode 100644 index 0000000000..9908c46e37 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/HeartUserInfoDao.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE heart_user_info + SET + + VOLUNTEER_FLAG = 1, + + + KINDNESS_TIME = #{kindnessTime}, + + + PARTICIPATION_NUM = #{participationNum}, + + + OBTAIN_POINT_NUM = #{obtainPointNum}, + + + UPDATED_BY = #{userId}, + + UPDATED_TIME = now() + WHERE DEL_FLAG = '0' + AND USER_ID = #{userId} + + diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml new file mode 100644 index 0000000000..c11277cc32 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActContentDao.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + UPDATE latest_act_content + SET DEL_FLAG = '1' + WHERE DEL_FLAG = '0' + AND ACT_ID = #{actId} + + + + + + + + + + + delete from latest_act_content where ACT_ID=#{actId} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml new file mode 100644 index 0000000000..a2e33b2245 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActInfoDao.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + update latest_act_info set DEL_FLAG='1' where id=#{id} + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml new file mode 100644 index 0000000000..3555334a07 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + UPDATE volunteer_info + SET + + CUSTOMER_ID = #{customerId}, + + + VOLUNTEER_INTRODUCE = #{volunteerIntroduce}, + + + VOLUNTEER_SIGNATURE = #{volunteerSignature}, + + + UPDATED_BY = #{userId}, + + UPDATED_TIME = now() + WHERE DEL_FLAG = '0' + AND USER_ID = #{userId} + + diff --git a/epmet-module/epmet-heart/pom.xml b/epmet-module/epmet-heart/pom.xml new file mode 100644 index 0000000000..34f68f6e5b --- /dev/null +++ b/epmet-module/epmet-heart/pom.xml @@ -0,0 +1,21 @@ + + + 4.0.0 + + + com.epmet + epmet-module + 2.0.0 + + + com.epmet + epmet-heart + pom + + + epmet-heart-client + epmet-heart-server + + + diff --git a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml index 9fc81b43c5..2749306424 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-job-server: container_name: epmet-job-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-job-server:0.3.22 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-job-server:0.3.23 ports: - "8084:8084" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index 76ac6ca878..b8f1def9d3 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -22,6 +22,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:47 */ +//@FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class,url = "http://127.0.0.1:8085") @FeignClient(name = ServiceConstant.EPMET_MESSAGE_SERVER, fallback = EpmetMessageOpenFeignClientFallback.class) public interface EpmetMessageOpenFeignClient { /** diff --git a/epmet-module/epmet-point/epmet-point-client/pom.xml b/epmet-module/epmet-point/epmet-point-client/pom.xml new file mode 100644 index 0000000000..c43496fa40 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/pom.xml @@ -0,0 +1,37 @@ + + + 4.0.0 + + + epmet-point + com.epmet + 2.0.0 + + + epmet-point-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + io.springfox + springfox-swagger2 + + + io.springfox + springfox-swagger-ui + + + + + ${project.artifactId} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationLogDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationLogDTO.java new file mode 100644 index 0000000000..8c8c1a6db1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationLogDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 PointVerificationLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 积分行为记录表ID 关联用户积分行为记录表 + */ + private String actionId; + + /** + * 核销对象 + */ + private String userId; + + /** + * 核销对象首次注册网格 + */ + private String userRegistedGridId; + + /** + * 核销对象首次注册网格所在机关 + */ + private String userRegistedAgnecyId; + + /** + * 核销人员ID + */ + private String operatorId; + + /** + * 核销人员名称 工作人员的昵称,在和核销记录里显示,兑换人、核销人都要显示,核销人昵称格式【xx机关-xxx】(ORG必须是机关级别?),若工作人员日后修改昵称,此项不变 + */ + private String operatorName; + + /** + * 核销人员所属机关ID + */ + private String operatorAgencyId; + + /** + * 核销物品 目前没有做商城,所以商品的信息统一记录并展示核销人员手动输入的信息,必填项,为商品描述,以后如果开发商城体系,此项关联商品的ID + */ + private String exchangedItem; + + /** + * 使用积分 需要多少积分 + */ + private Integer point; + + /** + * 核销人所在位置经度 + */ + private String longitude; + + /** + * 核销人所在位置维度 + */ + private String dimension; + + /** + * 核销人所在位置详细地址 + */ + private String address; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationStatisticalDailyDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationStatisticalDailyDTO.java new file mode 100644 index 0000000000..94ccf1963a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/PointVerificationStatisticalDailyDTO.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 PointVerificationStatisticalDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 日 + */ + private String dateId; + + /** + * 周 + */ + private String weekId; + + /** + * 月 + */ + private String monthId; + + /** + * 季 + */ + private String quarterId; + + /** + * 年 + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 核销分数 这一天内核销了多少积分,一次insert,多次update + */ + private Integer verificatedPoint; + + /** + * 工作人员机关ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 父级机关ID集合 + */ + private String pids; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 核销工作人员ID + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/SysOperateLogDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/SysOperateLogDTO.java new file mode 100644 index 0000000000..9d0344e07d --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/SysOperateLogDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 SysOperateLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 操作对象ID + */ + private String objectId; + + /** + * 对象类型 规则:rule + */ + private String objectType; + + /** + * 操作类型 新建:add,编辑:edit,删除:del; + */ + private String opType; + + /** + * 操作用户 操作人 + */ + private String opUser; + + /** + * 变更前数据 JSON串 + */ + private String befordData; + + /** + * 变更后数据 JSON串 + */ + private String afterData; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointActionLogDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointActionLogDTO.java new file mode 100644 index 0000000000..254e53bbd6 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointActionLogDTO.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 UserPointActionLogDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户ID + */ + private String userId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 加减分标识 plus/minus + */ + private String actionFlag; + + /** + * 来源ID 当来源为积分调整时 通过事件Id查找规则ID计算出分数 通过EVENT_ID能查出RUIE_ID + */ + private String eventId; + + /** + * 活动描述 获取积分的原因,相关内容,用来拼接【用户参加了xxx活动获取?积分】的文案,取活动的名称;【积分调整文案】;其他…… +如果是管理员手动调整扣减积分,ACTION_FLAG为"minus",但是不会生成核销记录,核销记录只保存用户使用积分兑换商品的核销详情 + */ + private String eventStatement; + + /** + * 事件名称 在积分记录里,对应的每一个明细都有一个标题和备注,该项为【标题】 value:活动、阅读文章、首次注册、评论、积分调整(手动)…… + */ + private String eventName; + + /** + * 分值 获取/核销的积分分值 + */ + private Integer point; + + /** + * 操作人所属机关ID 用户获取/核销积分的途径,1.工作人员手动审核积分发放、2.系统事件自动响应,所以CREATED_BY会可能是SYSTEM和工作人员的ID,当CREATED_BY是工作人员ID时,AGENCY_ID为这个工作人员所属的机关ID + */ + private String operatorAgencyId; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 SYSTEM或工作人员ID + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java new file mode 100644 index 0000000000..3cc6a6008f --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointStatisticalDailyDTO.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 UserPointStatisticalDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户Id + * */ + private String userId; + + /** + * 日 yyyy-MM-dd + */ + private String dateId; + + /** + * 周 yyyyWcc + */ + private String weekId; + + /** + * 月 yyyy-MM + */ + private String monthId; + + /** + * 季 yyyyQc + */ + private String quarterId; + + /** + * 年 yyyy + */ + private String yearId; + + /** + * 加减积分 plus/minus + */ + private String actionFlag; + + /** + * 客户ID + */ + private String customerId; + + /** + * 积分变动 当获取/核销标识为【plus】时,为这一日的积分增量,为 【miuns】时,为这一日的总的兑换积分数 + */ + private Integer pointChange; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointTotalDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointTotalDTO.java new file mode 100644 index 0000000000..bb92d7f476 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/UserPointTotalDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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 UserPointTotalDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户ID + */ + private String userId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 已兑积分 + */ + private Integer usedPoint; + + /** + * 可用积分 + */ + private Integer usablePoint; + + /** + * 总积分 总积分=已兑积分+剩余积分 + */ + private Integer totalPoint; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/.gitkeep b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointDetailFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointDetailFormDTO.java new file mode 100644 index 0000000000..d8a7fee9cb --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointDetailFormDTO.java @@ -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; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java new file mode 100644 index 0000000000..5d3c6dabfa --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java @@ -0,0 +1,89 @@ +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 javax.validation.constraints.NotNull; +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 = {AddGroup.class, UpdateGroup.class}) + private String customerId; + + /** + * 积分规则Id + */ + @NotBlank(message = "积分规则Id不能为空", groups = UpdateGroup.class) + private String ruleId; + + /** + * 功能Id + */ + @NotBlank(message = "功能Id不能为空", groups = {AddGroup.class}) + private String functionId; + + /** + * 积分规则名称 + */ + @NotBlank(message = "积分规则名称不能为空", groups = AddGroup.class) + private String ruleName; + /** + * 积分 + */ + @NotNull(message = "积分不能为空", groups = {UpdateGroup.class}) + private Integer point; + + /** + * 是否开启 + */ + @NotBlank(message = "是否开启不能为空", groups = {UpdateGroup.class}) + private String enabledFlag; + /** + * 是否启用 + */ + @NotNull(message = "积分上限不能为空", groups = {UpdateGroup.class}) + private Integer upLimit; + + /** + * 积分上限描述 + */ + private String upLimitDesc; + + //=======系统添加时的属性====== + /** + * 规则说明 事件说明 + */ + @NotBlank(message = "规则描述不能为空", groups = AddGroup.class) + private String ruleDesc; + + /** + * 事件CODE 来自事件表 + */ + @NotBlank(message = "事件code不能为空", groups = AddGroup.class) + private String eventCode; + + /** + * 操作类型 加积分:plus;减积分:minus + */ + private String operateType; + /** + * 获得积分单位 次:time;分钟:minute;小时:hour + */ + @NotBlank(message = "积分单位不能为空", groups = AddGroup.class) + private String pointUnit; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleListFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleListFormDTO.java new file mode 100644 index 0000000000..93566a19b3 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleListFormDTO.java @@ -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; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiCommonUserIdFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiCommonUserIdFormDTO.java new file mode 100644 index 0000000000..af247b84f0 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiCommonUserIdFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @ClassName ResiCommonUserIdFormDTO + * @Auth wangc + * @Date 2020-07-22 14:07 + */ +@Data +public class ResiCommonUserIdFormDTO implements Serializable { + private static final long serialVersionUID = -1961545266124776452L; + + public interface UserId extends CustomerClientShowGroup{} + + @NotBlank(message = "获取不到用户Id",groups = UserId.class) + private String userId; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiPointRankFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiPointRankFormDTO.java new file mode 100644 index 0000000000..e78baf6178 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiPointRankFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * @Description 查询用户积分总排行、周排行、月排行参数 + * @ClassName ResiPointRankParam + * @Auth wangc + * @Date 2020-07-21 16:22 + */ +@Data +public class ResiPointRankFormDTO implements Serializable { + private static final long serialVersionUID = 1534061512200591149L; + + /** + * 页码 + * */ + @Min(1) + private Integer pageNo; + + /** + * 每页数据条数 + * */ + private Integer pageSize; + + /** + * 时间维度 week month + * */ + private String timeDimension; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/.gitkeep b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/CustomerFunctionResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/CustomerFunctionResultDTO.java new file mode 100644 index 0000000000..817b94d7c1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/CustomerFunctionResultDTO.java @@ -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; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointDetailResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointDetailResultDTO.java new file mode 100644 index 0000000000..8ed856dc91 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointDetailResultDTO.java @@ -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; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRuleResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRuleResultDTO.java new file mode 100644 index 0000000000..bf8e546806 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/PointRuleResultDTO.java @@ -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; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointDetailResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointDetailResultDTO.java new file mode 100644 index 0000000000..556b8471e1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointDetailResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 居民端用户查询累计积分、可用积分 + * @ClassName ResiPointDetailResultDTO + * @Auth wangc + * @Date 2020-07-21 11:06 + */ +@Data +public class ResiPointDetailResultDTO implements Serializable { + private static final long serialVersionUID = -4909273528724428776L; + + /** + * 累计积分 + * */ + private Integer accumulatedPoint; + + /** + * 可用积分 + * */ + private Integer usablePoint; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogListResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogListResultDTO.java new file mode 100644 index 0000000000..46deb286e9 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogListResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 用户积分记录列表返参DTO + * @ClassName ResiPointLogListResultDTO + * @Auth wangc + * @Date 2020-07-22 14:03 + */ +@Data +public class ResiPointLogListResultDTO implements Serializable { + private static final long serialVersionUID = 5316430104874305245L; + /** + * 日期 yyyy-MM-dd 字符串 + * */ + private String date; + + /** + * 当日积分记录列表 + * */ + private List dailyList; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogPeriodResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogPeriodResultDTO.java new file mode 100644 index 0000000000..a701328659 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointLogPeriodResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 用户积分记录时段DTO + * @ClassName ResiPointLogPeriodResultDTO + * @Auth wangc + * @Date 2020-07-22 10:54 + */ +@Data +public class ResiPointLogPeriodResultDTO implements Serializable { + private static final long serialVersionUID = -7686828993714392843L; + + /** + * 日期 yyyy-MM-dd + * */ + private String date; + + /** + * 时段 HH:mm + * */ + private String time; + + /** + * +100 -25 + * */ + private String point; + + /** + * 标题 + * */ + private String title; + + /** + * 备注内容 + * */ + private String remark; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java new file mode 100644 index 0000000000..0bcf0a4758 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 居民端积分总排行、周排行、月排行接口返参DTO + * @ClassName ResiPointRankListResultDTO + * @Auth wangc + * @Date 2020-07-21 16:48 + */ +@Data +public class ResiPointRankListResultDTO implements Serializable { + private static final long serialVersionUID = 685408245193506541L; + + /** + * 当前用户昵称 + * */ + private String myNickname; + + /** + * 当前用户积分 + * */ + private Integer myPoint; + + /** + * 当前用户排名 + * */ + private Integer myRanking; + + /** + * 积分排名列表 + * */ + private List rankList; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankResultDTO.java new file mode 100644 index 0000000000..54f72cd275 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + + +/** + * @Description 用户积分排名DTO + * @ClassName ResiPointRankResultDTO + * @Auth wangc + * @Date 2020-07-21 14:52 + */ +@Data +public class ResiPointRankResultDTO implements Serializable { + private static final long serialVersionUID = 2095785598460202838L; + + private Integer rank; + + private String userId; + + private String customerId; + + private Integer totalPoint; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java new file mode 100644 index 0000000000..ee551db6e0 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ResiPointRankingResultDTO + * @Auth wangc + * @Date 2020-07-21 16:38 + */ +@Data +public class ResiPointRankingResultDTO implements Serializable { + private static final long serialVersionUID = -5073341813089351068L; + + private String nickname; + + private Integer ranking; + + private Integer point; + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java new file mode 100644 index 0000000000..643542bddc --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java @@ -0,0 +1,15 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback; +import org.springframework.cloud.openfeign.FeignClient; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @author wangc + * @date 2020/7/9 13:25 + */ +@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallback = EpmetPointOpenFeignClientFallback.class) +public interface EpmetPointOpenFeignClient { +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java new file mode 100644 index 0000000000..7dfd5ee983 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java @@ -0,0 +1,14 @@ +package com.epmet.feign.fallback; + +import com.epmet.feign.EpmetPointOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * @Description + * @ClassName EpmetPointOpenFeignClient + * @Auth wangc + * @Date 2020-07-10 09:14 + */ +@Component +public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignClient { +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java new file mode 100644 index 0000000000..ae4c7aeeba --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/dto/form/SendPointFormDTO.java @@ -0,0 +1,18 @@ +package dto.form;/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-07-17 17:16 + **/ + +import lombok.Data; + +/** + * desc:发送积分dto + * @author lyn + * @date 2020/7/17 17:16 + */ +@Data +public class SendPointFormDTO { + private String pointDesc; + private Integer point; +} diff --git a/epmet-module/epmet-point/epmet-point-server/Dockerfile b/epmet-module/epmet-point/epmet-point-server/Dockerfile new file mode 100644 index 0000000000..696964e45a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./app.jar + +EXPOSE 8090 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..60480da477 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-point-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.1 + ports: + - "8112:8112" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml new file mode 100644 index 0000000000..a53ebe7fe4 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-prod.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-point-server-prod + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-point-server:0.0.1 + ports: + - "8112:8112" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/prod:/logs" + environment: + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 600M \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..42c92bd168 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + oper-crm-server: + container_name: epmet-point-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-point-server:0.0.1 + ports: + - "8112:8112" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml new file mode 100644 index 0000000000..bb85bc3395 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -0,0 +1,217 @@ + + + 4.0.0 + 0.0.1 + + epmet-point + com.epmet + 2.0.0 + + + + epmet-point-server + jar + + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + com.epmet + epmet-common-clienttoken + 2.0.0 + compile + + + com.epmet + epmet-point-client + 2.0.0 + compile + + + com.epmet + oper-customize-client + 2.0.0 + compile + + + com.epmet + epmet-user-client + 2.0.0 + compile + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + dev + + true + + + 8112 + dev + + + + + + epmet_point_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + false + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + false + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + test + + + 8112 + test + + + + + + epmet + elink@833066 + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + true + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + prod + + + 8112 + test + + + + + + epmet_point_user + EpmEt-db-UsEr + + 0 + r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com + 6379 + EpmEtclOUdrEdIs!Q2w + + true + 192.168.11.180:8848 + bd205d23-e696-47be-b995-916313f86e99 + + + false + + + true + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + + + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java new file mode 100644 index 0000000000..4b8eeb035d --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/EpmetPointApplication.java @@ -0,0 +1,22 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +/** + * 模块 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class EpmetPointApplication { + public static void main(String[] args) { + SpringApplication.run(EpmetPointApplication.class, args); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java new file mode 100644 index 0000000000..eefb1d8b4d --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/PointUnitEnum.java @@ -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 desc; + + + PointUnitEnum(String code, String name) { + this.code = code; + this.desc = 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 getDesc() { + return desc; + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java new file mode 100644 index 0000000000..5ae3c00775 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/SysResponseEnum.java @@ -0,0 +1,44 @@ +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,"积分规则不存在"), + POINT_ENABLE_FLAG_PARAM_ERROR(112010003,"积分规则开启状态参数错误"), + ; + + 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; + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..0b59fee9ab --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ +package com.epmet.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "point"; + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java new file mode 100644 index 0000000000..d8e6ceac75 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/MqSubcribeConfig.java @@ -0,0 +1,45 @@ +package com.epmet.config; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.dto.form.mq.MqSubscribeFormDTO; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * desc:订阅积分事件 + */ +@Component +public class MqSubcribeConfig { + private Logger logger = LogManager.getLogger(MqSubcribeConfig.class); + + private String mqServer = "https://epmet-dev.elinkservice.cn/estos/mq-subscriber/subscribe"; + private String token = "1cfcbb5ade1e3202855ee5819983d773"; + + @PostConstruct + private void subscribe() { + MqSubscribeFormDTO event = new MqSubscribeFormDTO(); + event.setBelongAppId("202007161443499985fa2d397436d10356542134c8f008c48"); + event.setEventClass("epmet_heart"); + event.setEventTag("active_send_point"); + String callbackUrl = "http://192.168.1.119/point/callback/sendPoint"; + //callbackUrl = ""; + event.setCallbackUrl(callbackUrl); + List subscribeFormDTOList = new ArrayList<>(); + subscribeFormDTOList.add(event); + Map param = new HashMap<>(); + param.put("token", token); + param.put("mqSubscribeList", subscribeFormDTOList); + String jsonStrParam = JSON.toJSONString(param); + Result result = HttpClientManager.getInstance().sendPostByHttps(mqServer, JSON.toJSONString(param)); + logger.error("subscriber==jsonStrParam:{}=====result:{}" ,jsonStrParam, JSON.toJSONString(result)); + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java new file mode 100644 index 0000000000..04d9f2c4b4 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java @@ -0,0 +1,14 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: 工作人员积分调整Controller + * @date: Created in 2020-07-20 16:38 + * @author: wangc + */ +@RestController +@RequestMapping("work/adjustment") +public class AdjustmentController { +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java new file mode 100644 index 0000000000..5c9dc10f67 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java @@ -0,0 +1,51 @@ +package com.epmet.controller; + +import com.alibaba.fastjson.JSON; +import com.epmet.common.enu.PointUnitEnum; +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 = "addpointrule") + public Result add(@RequestBody PointRuleFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + pointRuleService.add(null, formDTO); + return new Result().ok(true); + } + + public static void main(String[] args) { + PointRuleFormDTO formDTO = new PointRuleFormDTO(); + formDTO.setPoint(0); + formDTO.setUpLimit(0); + //微笑山东 + formDTO.setCustomerId("57a648d230bf459b18ea23fc278c3de7"); + formDTO.setRuleDesc("认证志愿者会获得积分"); + formDTO.setEventCode("register_volunteer"); + formDTO.setPointUnit(PointUnitEnum.TIME.getCode()); + System.out.println(JSON.toJSONString(formDTO)); + + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java new file mode 100644 index 0000000000..c3bf13d4ba --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java @@ -0,0 +1,14 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: 工作人员积分核销Controller + * @date: Created in 2020-07-20 16:37 + * @author: wangc + */ +@RestController +@RequestMapping("work/exchange") +public class ExchangeController { +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java new file mode 100644 index 0000000000..51146befb0 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java @@ -0,0 +1,106 @@ +package com.epmet.controller; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.dto.form.mq.ReceiveMqMsg; +import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.service.UserPointActionLogService; +import dto.form.SendPointFormDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * desc: 积分相关消息回调controller + * + * @date: 2020/7/21 9:04 + * @author: jianjun liu + */ +@Slf4j +@RestController +@RequestMapping("mqCallback") +public class MqPointCallbackController { + private Logger logger = LogManager.getLogger(MqPointCallbackController.class); + + @Autowired + private UserPointActionLogService userPointActionLogService; + + /** + * desc:爱心活动积分发放 + * + * @param mqMsg + * @return + */ + @RequestMapping("activeSendPoint") + public String activeSendPoint(ReceiveMqMsg mqMsg) { + log.debug("activeSendPoint receive mqMsg:{}", JSON.toJSONString(mqMsg)); + if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) { + log.warn("activeSendPoint mqMsg is empty"); + return "success"; + } + SendPointFormDTO formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), SendPointFormDTO.class); + try { + //TODO 调用调整积分方法去给用户加减积分 userPointActionLogService. + } catch (Exception e) { + logger.error("activeSendPoint consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); + } + log.info("activeSendPoint consumer success,formDTO:{}", JSON.toJSONString(formDTO)); + return "success"; + } + + /** + * desc:爱心互助-志愿者注册消息 + * + * @param mqMsg + * @return + */ + @RequestMapping("registervolunteer") + public String registerVolunteer(ReceiveMqMsg mqMsg) { + log.debug("registerVolunteer receive mqMsg:{}", JSON.toJSONString(mqMsg)); + if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) { + log.warn("registerVolunteer mqMsg is empty"); + return "success"; + } + BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class); + try { + //TODO 调用调整积分方法去给用户加减积分 userPointActionLogService. + } catch (Exception e) { + logger.error("registerVolunteer consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); + } + log.info("registerVolunteer consumer success,formDTO:{}", JSON.toJSONString(formDTO)); + return "success"; + } + + /** + * desc:爱心互助-发布实况消息 + * + * @param mqMsg + * @return + */ + @RequestMapping("pubactivelive") + public String pubActiveLive(ReceiveMqMsg mqMsg) { + log.debug("pubActiveLive receive mqMsg:{}", JSON.toJSONString(mqMsg)); + if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) { + log.warn("pubActiveLive mqMsg is empty"); + return "success"; + } + BasePointEventMsg formDTO = ConvertUtils.sourceToTarget(mqMsg.getMsg(), BasePointEventMsg.class); + try { + //TODO 调用调整积分方法去给用户加减积分 userPointActionLogService. + } catch (Exception e) { + logger.error("pubActiveLive consume fail,msg:{}",JSON.toJSONString(mqMsg.getMsg())); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); + } + log.info("pubActiveLive consumer success,formDTO:{}", JSON.toJSONString(formDTO)); + return "success"; + } +} + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java new file mode 100644 index 0000000000..a0c7f479dd --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/PointRuleController.java @@ -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> getFunctionList(@LoginUser TokenDto tokenDTO) { + return new Result>().ok(pointRuleService.getFunctionList(tokenDTO.getCustomerId())); + } + + /** + * desc:根据功能id获取积分规则 + * + * @param tokenDTO + * @param formDTO + * @return + */ + @PostMapping(value = "list") + public Result> list(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleListFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(pointRuleService.list(formDTO)); + } + + /** + * desc:根据规则id获取积分规则 + * + * @param formDTO + * @return + */ + @PostMapping(value = "detail") + public Result detail(@RequestBody PointDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(pointRuleService.detail(formDTO)); + } + + /** + * desc:根据功能id获取积分规则 + * + * @param formDTO + * @return + */ + @PostMapping(value = "update") + public Result update(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, UpdateGroup.class); + pointRuleService.update(tokenDTO,formDTO); + return new Result().ok(true); + } + + /** + * desc:添加规则 + * + * @param formDTO + * @return + */ + @PostMapping(value = "add") + public Result add(@LoginUser TokenDto tokenDTO, @RequestBody PointRuleFormDTO formDTO) { + formDTO.setCustomerId(tokenDTO.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, AddGroup.class); + pointRuleService.add(tokenDTO,formDTO); + return new Result().ok(true); + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java new file mode 100644 index 0000000000..9a935771cb --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -0,0 +1,14 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @description: 居民端积分信息controller + * @date: Created in 2020-07-20 16:39 + * @author: wangc + */ +@RestController +@RequestMapping("resi/point") +public class ResiPointController { +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java new file mode 100644 index 0000000000..3418b3a5f3 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java @@ -0,0 +1,46 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.HashMap; +import java.util.Map; + +/** + * @Description + * @ClassName TestController + * @Auth wangc + * @Date 2020-07-10 09:27 + */ + +@RestController +@RequestMapping("demo") +public class TestController { + private Logger logger = LogManager.getLogger(TestController.class); + @Autowired + private LoginUserUtil loginUserUtil; + @GetMapping("test") + public Result test(@LoginUser TokenDto tokenDto){ + Map map=new HashMap<>(); + String userId=loginUserUtil.getLoginUserId(); + map.put("TokenDto", tokenDto); + map.put("userId",userId); + return new Result().ok(map); + } + @GetMapping("testlocalhost") + public Result testLocalhost(){ + logger.info("========================================="); + Result result = new Result(); + result.setData("success"); + return result; + } +} + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java new file mode 100644 index 0000000000..2c8f5a214a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.PointRuleListFormDTO; +import com.epmet.entity.PointRuleEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface PointRuleDao extends BaseDao { + + /** + * desc:获取该客户下有规则的功能Id + * + * @param customerId + * @return + */ + List selectFunctionIds(@Param("customerId") String customerId); + + /** + * desc:获取该客户下有规则的功能Id + * + * @param formDTO + * @return + */ + List selectListByFunctionId(PointRuleListFormDTO formDTO); + + int updateByCustomerId(PointRuleEntity entity); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java new file mode 100644 index 0000000000..4791eb6c00 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ResiPointLogPeriodResultDTO; +import com.epmet.entity.PointVerificationLogEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface PointVerificationLogDao extends BaseDao { + + /** + * @Description 查询指定用户兑换记录 + * @param userId + * @return + * @author wangc + * @date 2020.07.22 15:38 + **/ + List selectVerificationLog(@Param("userId") String userId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java new file mode 100644 index 0000000000..d123b66210 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.PointVerificationStatisticalDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface PointVerificationStatisticalDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/RuleOperateLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/RuleOperateLogDao.java new file mode 100644 index 0000000000..a959af0219 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/RuleOperateLogDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.RuleOperateLogEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface RuleOperateLogDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java new file mode 100644 index 0000000000..6f9ac3fb4c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ResiPointLogPeriodResultDTO; +import com.epmet.entity.UserPointActionLogEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface UserPointActionLogDao extends BaseDao { + + /** + * @Description 查询用户积分明细,按照时间倒叙 + * @param userId + * @return + * @author wangc + * @date 2020.07.22 13:56 + **/ + List selectPointActionLogList(@Param("userId") String userId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java new file mode 100644 index 0000000000..142817ae9f --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ResiPointRankResultDTO; +import com.epmet.entity.UserPointStatisticalDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface UserPointStatisticalDailyDao extends BaseDao { + + /** + * @Description 查询客户下周/月度用户积分排行榜 + * @param customerId + * @param dimension + * @param dimensionId + * @return + * @author wangc + * @date 2020.07.22 10:47 + **/ + List selectPointRankWithinTimeZone(@Param("customerId") String customerId,@Param("dimension") String dimension,@Param("dimensionId") String dimensionId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java new file mode 100644 index 0000000000..b50249c020 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ResiPointDetailResultDTO; +import com.epmet.dto.result.ResiPointRankResultDTO; +import com.epmet.entity.UserPointTotalEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Mapper +public interface UserPointTotalDao extends BaseDao { + + /** + * @Description 根据用户Id查询他的累计积分以及可用积分 + * @param userId + * @return + * @author wangc + * @date 2020.07.21 13:38 + **/ + ResiPointDetailResultDTO selectPointByUserId(@Param("userId")String userId); + + /** + * @Description 查询客户下的用户累计积分排名榜 + * @param customerId + * @return + * @author wangc + * @date 2020.07.21 15:16 + **/ + List selectUserPointRank(@Param("customerId") String customerId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java new file mode 100644 index 0000000000..dff7131269 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleEntity.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Objects; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_rule") +public class PointRuleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 规则名称 与事件名称保持一致即可 + */ + private String ruleName; + + /** + * 规则说明 事件说明 + */ + private String ruleDesc; + + /** + * 事件CODE 来自事件表 + */ + private String eventCode; + + /** + * 功能分组Id + */ + private String functionId; + + /** + * 操作类型 加积分:add;减积分:subtract + */ + private String operateType; + + /** + * 积分上限 + */ + private Integer upLimit; + + /** + * 积分上限描述 + */ + private String upLimitDesc; + + /** + * 获得积分值 + */ + private Integer point; + + /** + * 获得积分单位 次:time;分钟:minute;小时:hour + */ + private String pointUnit; + + /** + * 是否启用 0-否,1-是 + */ + private String enabledFlag; + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + PointRuleEntity entity = (PointRuleEntity) o; + return Objects.equals(customerId, entity.customerId) && + Objects.equals(ruleName, entity.ruleName) && + Objects.equals(ruleDesc, entity.ruleDesc) && + Objects.equals(eventCode, entity.eventCode) && + Objects.equals(functionId, entity.functionId) && + Objects.equals(operateType, entity.operateType) && + Objects.equals(upLimit, entity.upLimit) && + Objects.equals(upLimitDesc, entity.upLimitDesc) && + Objects.equals(point, entity.point) && + Objects.equals(pointUnit, entity.pointUnit) && + Objects.equals(enabledFlag, entity.enabledFlag); + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), customerId, ruleName, ruleDesc, eventCode, functionId, operateType, upLimit, upLimitDesc, point, pointUnit, enabledFlag); + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationLogEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationLogEntity.java new file mode 100644 index 0000000000..5e9de373e1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationLogEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_verification_log") +public class PointVerificationLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 积分行为记录表ID 关联用户积分行为记录表 + */ + private String actionId; + + /** + * 核销对象 + */ + private String userId; + + /** + * 核销对象首次注册网格 + */ + private String userRegistedGridId; + + /** + * 核销对象首次注册网格所在机关 + */ + private String userRegistedAgnecyId; + + /** + * 核销人员ID + */ + private String operatorId; + + /** + * 核销人员名称 工作人员的昵称,在和核销记录里显示,兑换人、核销人都要显示,核销人昵称格式【xx机关-xxx】(ORG必须是机关级别?),若工作人员日后修改昵称,此项不变 + */ + private String operatorName; + + /** + * 核销人员所属机关ID + */ + private String operatorAgencyId; + + /** + * 核销物品 目前没有做商城,所以商品的信息统一记录并展示核销人员手动输入的信息,必填项,为商品描述,以后如果开发商城体系,此项关联商品的ID + */ + private String exchangedItem; + + /** + * 使用积分 需要多少积分 + */ + private Integer point; + + /** + * 核销人所在位置经度 + */ + private String longitude; + + /** + * 核销人所在位置维度 + */ + private String dimension; + + /** + * 核销人所在位置详细地址 + */ + private String address; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationStatisticalDailyEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationStatisticalDailyEntity.java new file mode 100644 index 0000000000..b2b752d052 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointVerificationStatisticalDailyEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("point_verification_statistical_daily") +public class PointVerificationStatisticalDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 日 + */ + private String dateId; + + /** + * 周 + */ + private String weekId; + + /** + * 月 + */ + private String monthId; + + /** + * 季 + */ + private String quarterId; + + /** + * 年 + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 核销分数 这一天内核销了多少积分,一次insert,多次update + */ + private Integer verificatedPoint; + + /** + * 工作人员机关ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 父级机关ID集合 + */ + private String pids; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/RuleOperateLogEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/RuleOperateLogEntity.java new file mode 100644 index 0000000000..b1bfa7c61a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/RuleOperateLogEntity.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("rule_operate_log") +public class RuleOperateLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 规则ID + */ + private String ruleId; + + /** + * 操作类型 新建:add,编辑:edit,删除:del; + */ + private String opType; + + /** + * 操作用户 操作人 + */ + private String opUser; + + /** + * 变更前数据 JSON串 + */ + private String beforeData; + + /** + * 变更后数据 JSON串 + */ + private String afterData; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointActionLogEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointActionLogEntity.java new file mode 100644 index 0000000000..4c72c5659a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointActionLogEntity.java @@ -0,0 +1,82 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_point_action_log") +public class UserPointActionLogEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 加减分标识 plus/minus + */ + private String actionFlag; + + /** + * 来源ID 当来源为积分调整时 通过事件Id查找规则ID计算出分数 通过EVENT_ID能查出RUIE_ID + */ + private String eventId; + + /** + * 活动描述 获取积分的原因,相关内容,用来拼接【用户参加了xxx活动获取?积分】的文案,取活动的名称;【积分调整文案】;其他…… +如果是管理员手动调整扣减积分,ACTION_FLAG为"minus",但是不会生成核销记录,核销记录只保存用户使用积分兑换商品的核销详情 + */ + private String eventStatement; + + /** + * 事件名称 在积分记录里,对应的每一个明细都有一个标题和备注,该项为【标题】 value:活动、阅读文章、首次注册、评论、积分调整(手动)…… + */ + private String eventName; + + /** + * 分值 获取/核销的积分分值 + */ + private Integer point; + + /** + * 操作人所属机关ID 用户获取/核销积分的途径,1.工作人员手动审核积分发放、2.系统事件自动响应,所以CREATED_BY会可能是SYSTEM和工作人员的ID,当CREATED_BY是工作人员ID时,AGENCY_ID为这个工作人员所属的机关ID + */ + private String operatorAgencyId; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java new file mode 100644 index 0000000000..907d284425 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointStatisticalDailyEntity.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_point_statistical_daily") +public class UserPointStatisticalDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户Id + * */ + private String userId; + + /** + * 日 yyyy-MM-dd + */ + private String dateId; + + /** + * 周 yyyyWcc + */ + private String weekId; + + /** + * 月 yyyy-MM + */ + private String monthId; + + /** + * 季 yyyyQc + */ + private String quarterId; + + /** + * 年 yyyy + */ + private String yearId; + + /** + * 加减积分 plus/minus + */ + private String actionFlag; + + /** + * 客户ID + */ + private String customerId; + + /** + * 积分变动 当获取/核销标识为【plus】时,为这一日的积分增量,为 【miuns】时,为这一日的总的兑换积分数 + */ + private Integer pointChange; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointTotalEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointTotalEntity.java new file mode 100644 index 0000000000..6d8a3c6174 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/UserPointTotalEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_point_total") +public class UserPointTotalEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String userId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 已兑积分 + */ + private Integer usedPoint; + + /** + * 可用积分 + */ + private Integer usablePoint; + + /** + * 总积分 总积分=已兑积分+剩余积分 + */ + private Integer totalPoint; + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRuleExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRuleExcel.java new file mode 100644 index 0000000000..c5c26801e5 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointRuleExcel.java @@ -0,0 +1,89 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class PointRuleExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "规则名称 与事件名称保持一致即可") + private String ruleName; + + @Excel(name = "规则说明 事件说明") + private String ruleDesc; + + @Excel(name = "事件CODE 来自事件表") + private String eventCode; + + @Excel(name = "事件名称 来自事件表") + private String eventName; + + @Excel(name = "操作类型 加积分:add;减积分:subtract") + private String operateType; + + @Excel(name = "积分上限") + private Integer upLimit; + + @Excel(name = "积分上限描述") + private String upLimitDesc; + + @Excel(name = "获得积分值") + private Integer pointNum; + + @Excel(name = "获得积分单位 次:time;分钟:minute;小时:hour") + private String pointUnit; + + @Excel(name = "是否启用 0-否,1-是") + private String enabledFlag; + + @Excel(name = "删除标识 0-否,1-是") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationLogExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationLogExcel.java new file mode 100644 index 0000000000..f5cf3f8f79 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationLogExcel.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class PointVerificationLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "积分行为记录表ID 关联用户积分行为记录表") + private String actionId; + + @Excel(name = "核销对象") + private String userId; + + @Excel(name = "核销对象首次注册网格") + private String userRegistedGridId; + + @Excel(name = "核销对象首次注册网格所在机关") + private String userRegistedAgnecyId; + + @Excel(name = "核销人员ID") + private String operatorId; + + @Excel(name = "核销人员名称 工作人员的昵称,在和核销记录里显示,兑换人、核销人都要显示,核销人昵称格式【xx机关-xxx】(ORG必须是机关级别?),若工作人员日后修改昵称,此项不变") + private String operatorName; + + @Excel(name = "核销人员所属机关ID") + private String operatorAgencyId; + + @Excel(name = "核销物品 目前没有做商城,所以商品的信息统一记录并展示核销人员手动输入的信息,必填项,为商品描述,以后如果开发商城体系,此项关联商品的ID") + private String exchangedItem; + + @Excel(name = "使用积分 需要多少积分") + private Integer point; + + @Excel(name = "核销人所在位置经度") + private String longitude; + + @Excel(name = "核销人所在位置维度") + private String dimension; + + @Excel(name = "核销人所在位置详细地址") + private String address; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationStatisticalDailyExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationStatisticalDailyExcel.java new file mode 100644 index 0000000000..10a719da98 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/PointVerificationStatisticalDailyExcel.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class PointVerificationStatisticalDailyExcel { + + @Excel(name = "主键ID") + private String id; + + @Excel(name = "日") + private String dateId; + + @Excel(name = "周") + private String weekId; + + @Excel(name = "月") + private String monthId; + + @Excel(name = "季") + private String quarterId; + + @Excel(name = "年") + private String yearId; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "核销分数 这一天内核销了多少积分,一次insert,多次update") + private Integer verificatedPoint; + + @Excel(name = "工作人员机关ID") + private String agencyId; + + @Excel(name = "父级机关ID") + private String pid; + + @Excel(name = "父级机关ID集合") + private String pids; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人 核销工作人员ID") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/SysOperateLogExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/SysOperateLogExcel.java new file mode 100644 index 0000000000..a61756012f --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/SysOperateLogExcel.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class SysOperateLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "操作对象ID") + private String objectId; + + @Excel(name = "对象类型 规则:rule") + private String objectType; + + @Excel(name = "操作类型 新建:add,编辑:edit,删除:del;") + private String opType; + + @Excel(name = "操作用户 操作人") + private String opUser; + + @Excel(name = "变更前数据 JSON串") + private String befordData; + + @Excel(name = "变更后数据 JSON串") + private String afterData; + + @Excel(name = "删除标识 0-否,1-是") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointActionLogExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointActionLogExcel.java new file mode 100644 index 0000000000..6baf9de332 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointActionLogExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class UserPointActionLogExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "加减分标识 plus/minus") + private String actionFlag; + + @Excel(name = "来源ID 当来源为积分调整时 通过事件Id查找规则ID计算出分数 通过EVENT_ID能查出RUIE_ID") + private String eventId; + + @Excel(name = "活动描述 获取积分的原因,相关内容,用来拼接【用户参加了xxx活动获取?积分】的文案,取活动的名称;【积分调整文案】;其他…… 如果是管理员手动调整扣减积分,ACTION_FLAG为\"minus\",但是不会生成核销记录,核销记录只保存用户使用积分兑换商品的核销详情") + private String eventStatement; + + @Excel(name = "事件名称 在积分记录里,对应的每一个明细都有一个标题和备注,该项为【标题】 value:活动、阅读文章、首次注册、评论、积分调整(手动)……") + private String eventName; + + @Excel(name = "分值 获取/核销的积分分值") + private Integer point; + + @Excel(name = "操作人所属机关ID 用户获取/核销积分的途径,1.工作人员手动审核积分发放、2.系统事件自动响应,所以CREATED_BY会可能是SYSTEM和工作人员的ID,当CREATED_BY是工作人员ID时,AGENCY_ID为这个工作人员所属的机关ID") + private String operatorAgencyId; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人 SYSTEM或工作人员ID") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointStatisticalDailyExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointStatisticalDailyExcel.java new file mode 100644 index 0000000000..372a990500 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointStatisticalDailyExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class UserPointStatisticalDailyExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "日 yyyy-MM-dd") + private String dateId; + + @Excel(name = "周 yyyyWcc") + private String weekId; + + @Excel(name = "月 yyyy-MM") + private String monthId; + + @Excel(name = "季 yyyyQc") + private String quarterId; + + @Excel(name = "年 yyyy") + private String yearId; + + @Excel(name = "加减积分 plus/minus") + private String actionFlag; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "积分变动 当获取/核销标识为【plus】时,为这一日的积分增量,为 【miuns】时,为这一日的总的兑换积分数") + private Integer pointChange; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointTotalExcel.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointTotalExcel.java new file mode 100644 index 0000000000..2266e332b1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/excel/UserPointTotalExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Data +public class UserPointTotalExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户ID") + private String userId; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "已兑积分") + private Integer usedPoint; + + @Excel(name = "可用积分") + private Integer usablePoint; + + @Excel(name = "总积分 总积分=已兑积分+剩余积分") + private Integer totalPoint; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/exception/ModuleErrorCode.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/exception/ModuleErrorCode.java new file mode 100644 index 0000000000..1206c71b9a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/exception/ModuleErrorCode.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.exception; + + +import com.epmet.commons.tools.exception.ErrorCode; + +/** + * 模块错误编码,由9位数字组成,前6位为模块编码,后3位为业务编码 + *

+ * 如:100001001(100001代表模块,001代表业务代码) + *

+ * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public interface ModuleErrorCode extends ErrorCode { + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/redis/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java new file mode 100644 index 0000000000..fa53b5be05 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointRuleService.java @@ -0,0 +1,59 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.security.dto.TokenDto; +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.entity.PointRuleEntity; + +import java.util.List; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface PointRuleService extends BaseService { + + /** + * desc:根据用户id获取积分规则-功能列表 + * @param customerId + * @return + */ + List getFunctionList(String customerId); + + /** + * desc:根据客户Id 及功能Id获取规则列表 + * @param formDTO + * @return + */ + List list(PointRuleListFormDTO formDTO); + + PointDetailResultDTO detail(PointDetailFormDTO formDTO); + + void update(TokenDto tokenDTO, PointRuleFormDTO formDTO); + + void add(TokenDto tokenDTO, PointRuleFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java new file mode 100644 index 0000000000..54700cbf63 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationLogService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.PointVerificationLogDTO; +import com.epmet.dto.form.ResiCommonUserIdFormDTO; +import com.epmet.dto.result.ResiPointLogListResultDTO; +import com.epmet.entity.PointVerificationLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface PointVerificationLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointVerificationLogDTO + * @author generator + * @date 2020-07-20 + */ + PointVerificationLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(PointVerificationLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(PointVerificationLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); + + /** + * @Description 查找指定用户的积分兑换记录 + * @param userId + * @return + * @author wangc + * @date 2020.07.22 14:05 + **/ + List getMyExchangeRecord(ResiCommonUserIdFormDTO userId); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java new file mode 100644 index 0000000000..5c7b8903b3 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.PointVerificationStatisticalDailyDTO; +import com.epmet.entity.PointVerificationStatisticalDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface PointVerificationStatisticalDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PointVerificationStatisticalDailyDTO + * @author generator + * @date 2020-07-20 + */ + PointVerificationStatisticalDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(PointVerificationStatisticalDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(PointVerificationStatisticalDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.java new file mode 100644 index 0000000000..46e78037ec --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/SysOperateLogService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.SysOperateLogDTO; +import com.epmet.entity.RuleOperateLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface SysOperateLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return SysOperateLogDTO + * @author generator + * @date 2020-07-20 + */ + SysOperateLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(SysOperateLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(SysOperateLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java new file mode 100644 index 0000000000..e385a923c1 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointActionLogService.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserPointActionLogDTO; +import com.epmet.dto.form.ResiCommonUserIdFormDTO; +import com.epmet.dto.result.ResiPointLogListResultDTO; +import com.epmet.entity.UserPointActionLogEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface UserPointActionLogService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserPointActionLogDTO + * @author generator + * @date 2020-07-20 + */ + UserPointActionLogDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(UserPointActionLogDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(UserPointActionLogDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); + + /** + * @Description 查找指定用户的积分记录 + * @param userId + * @return + * @author wangc + * @date 2020.07.22 14:05 + **/ + List getMyPointRecord(ResiCommonUserIdFormDTO userId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java new file mode 100644 index 0000000000..b3cdc6443f --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.ResiPointRankFormDTO; +import com.epmet.dto.result.ResiPointRankListResultDTO; +import com.epmet.entity.UserPointStatisticalDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface UserPointStatisticalDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserPointStatisticalDailyDTO + * @author generator + * @date 2020-07-20 + */ + UserPointStatisticalDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(UserPointStatisticalDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(UserPointStatisticalDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); + + /** + * @Description 获取居民端周/月积分排行榜 还有当前用的信息 + * @param pointRankFormDTO + * @return + * @author wangc + * @date 2020.07.21 16:57 + **/ + ResiPointRankListResultDTO getPointRankWithinTimeZone(ResiPointRankFormDTO pointRankFormDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java new file mode 100644 index 0000000000..04a49fbf11 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointTotalService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserPointTotalDTO; +import com.epmet.entity.UserPointTotalEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +public interface UserPointTotalService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserPointTotalDTO + * @author generator + * @date 2020-07-20 + */ + UserPointTotalDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void save(UserPointTotalDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-20 + */ + void update(UserPointTotalDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-20 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java new file mode 100644 index 0000000000..a0ef4fed91 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -0,0 +1,194 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.common.enu.PointUnitEnum; +import com.epmet.common.enu.SysResponseEnum; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.enums.CommonOperateTypeEnum; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.PointRuleDao; +import com.epmet.dao.RuleOperateLogDao; +import com.epmet.dto.CustomerStaffDTO; +import com.epmet.dto.form.CustomerFunctionListFormDTO; +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.DefaultFunctionListResultDTO; +import com.epmet.dto.result.PointDetailResultDTO; +import com.epmet.dto.result.PointRuleResultDTO; +import com.epmet.entity.PointRuleEntity; +import com.epmet.entity.RuleOperateLogEntity; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.OperCustomizeOpenFeignClient; +import com.epmet.service.PointRuleService; +import lombok.extern.slf4j.Slf4j; +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 org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 积分规则表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Slf4j +@Service +public class PointRuleServiceImpl extends BaseServiceImpl implements PointRuleService { + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private RuleOperateLogDao ruleOperateLogDao; + + @Override + public List getFunctionList(String customerId) { + List result = new ArrayList<>(); + CustomerFunctionListFormDTO formDTO = new CustomerFunctionListFormDTO(); + formDTO.setCustomerId(customerId); + Result> openedFunctionResult = operCustomizeOpenFeignClient.getOpenedFunctionList(formDTO); + if (!openedFunctionResult.success()) { + log.warn("getFunctionList getOpenedFunctionList fail,result:{}", JSON.toJSONString(openedFunctionResult)); + throw new RenException(SysResponseEnum.THIRD_SERVICE_ERROR.getCode(), SysResponseEnum.THIRD_SERVICE_ERROR.getMsg()); + } + List resultData = openedFunctionResult.getData(); + if (CollectionUtils.isEmpty(resultData)) { + log.warn("getFunctionList customerId:{} have opened any function", customerId); + return result; + } + List functionIds = baseDao.selectFunctionIds(customerId); + if (CollectionUtils.isEmpty(functionIds)) { + log.warn("getFunctionList customerId:{} have any pointRules", customerId); + return result; + } + return resultData.stream().filter(function -> functionIds.contains(function.getFunctionId())) + .map(fun -> ConvertUtils.sourceToTarget(fun, CustomerFunctionResultDTO.class)) + .collect(Collectors.toList()); + } + + @Override + public List list(PointRuleListFormDTO formDTO) { + List result = new ArrayList<>(); + List list = baseDao.selectListByFunctionId(formDTO); + if (CollectionUtils.isEmpty(list)) { + log.warn("list functionId:{} return empty", formDTO.getFunctionId()); + return result; + } + result = list.stream().map(pointRuleEntity -> { + PointRuleResultDTO resultDTO = new PointRuleResultDTO(); + resultDTO.setRuleId(pointRuleEntity.getId()); + resultDTO.setRuleName(pointRuleEntity.getRuleName()); + resultDTO.setRuleDesc(pointRuleEntity.getRuleDesc()); + PointUnitEnum pointUnitEnum = PointUnitEnum.getEnum(pointRuleEntity.getPointUnit()); + if (pointRuleEntity == null || pointRuleEntity.getPoint() == null) { + log.error("list ruleId:{} have not pointUnit or pointNum,pointRule:{}", JSON.toJSONString(pointRuleEntity)); + return null; + } + resultDTO.setPointValue(pointRuleEntity.getPoint().toString().concat("分").concat(StrConstant.SEPARATOR).concat(pointUnitEnum.getDesc())); + return resultDTO; + }).filter(fun -> fun != null).collect(Collectors.toList()); + return result; + } + + @Override + public PointDetailResultDTO detail(PointDetailFormDTO formDTO) { + PointRuleEntity pointRuleEntity = baseDao.selectById(formDTO.getRuleId()); + if (pointRuleEntity == null) { + throw new RenException(SysResponseEnum.POINT_RULE_IS_NOT_EXIST.getCode(), SysResponseEnum.POINT_RULE_IS_NOT_EXIST.getMsg()); + } + PointDetailResultDTO resultDTO = ConvertUtils.sourceToTarget(pointRuleEntity, PointDetailResultDTO.class); + resultDTO.setRuleId(pointRuleEntity.getId()); + resultDTO.setEnabledFlag(NumConstant.ONE_STR.equals(pointRuleEntity.getEnabledFlag()) ? "true" : "false"); + return resultDTO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TokenDto tokenDTO, PointRuleFormDTO formDTO) { + validateEnableFlag(formDTO); + PointRuleEntity entityDB = baseDao.selectById(formDTO.getRuleId()); + //数据库不存在或者客户Id不相等 则抛出异常 + if (entityDB == null || !entityDB.getCustomerId().equals(formDTO.getCustomerId())) { + throw new RenException(SysResponseEnum.POINT_RULE_IS_NOT_EXIST.getCode(), SysResponseEnum.POINT_RULE_IS_NOT_EXIST.getMsg()); + } + PointRuleEntity entityNew = ConvertUtils.sourceToTarget(formDTO, PointRuleEntity.class); + entityNew.setId(formDTO.getRuleId()); + entityNew.setEnabledFlag(StrConstant.TRUE.equals(formDTO.getEnabledFlag()) ? "1" : "0"); + if (entityDB.equals(entityNew)) { + log.warn("update ignore tow entity is same"); + return; + } + baseDao.updateByCustomerId(entityNew); + insertOperateRecord(tokenDTO, entityNew, entityDB, CommonOperateTypeEnum.EDIT.getCode()); + } + + private void validateEnableFlag(PointRuleFormDTO formDTO) { + if (StringUtils.isNotBlank(formDTO.getEnabledFlag()) && !StrConstant.TRUE.equals(formDTO.getEnabledFlag()) && !StrConstant.FALSE.equals(formDTO.getEnabledFlag())) { + throw new RenException(SysResponseEnum.POINT_ENABLE_FLAG_PARAM_ERROR.getCode(), SysResponseEnum.POINT_ENABLE_FLAG_PARAM_ERROR.getMsg()); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void add(TokenDto tokenDTO, PointRuleFormDTO formDTO) { + validateEnableFlag(formDTO); + PointRuleEntity entity = ConvertUtils.sourceToTarget(formDTO, PointRuleEntity.class); + baseDao.insert(entity); + insertOperateRecord(tokenDTO, entity, null, CommonOperateTypeEnum.ADD.getCode()); + } + + private void insertOperateRecord(TokenDto tokenDTO, PointRuleEntity entityNew, PointRuleEntity entityDB, String opType) { + RuleOperateLogEntity record = new RuleOperateLogEntity(); + if (tokenDTO != null) { + CustomerStaffDTO userInfo = getCustomerStaff(tokenDTO.getUserId()); + record.setOpUser(userInfo.getRealName()); + } else { + record.setOpUser(Constant.APP_USER_FLAG); + } + record.setCustomerId(entityNew.getCustomerId()); + record.setRuleId(entityNew.getId()); + record.setOpType(opType); + record.setBeforeData(entityDB == null ? null : JSON.toJSONString(entityDB)); + record.setAfterData(JSON.toJSONString(entityNew)); + ruleOperateLogDao.insert(record); + } + + private CustomerStaffDTO getCustomerStaff(String userId) { + Result resultStaff = epmetUserOpenFeignClient.getCustomerStaff(userId); + if (!resultStaff.success() || null == resultStaff.getData()) { + throw new RenException(SysResponseEnum.THIRD_SERVICE_ERROR.getMsg()); + } + return resultStaff.getData(); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java new file mode 100644 index 0000000000..6b48127276 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java @@ -0,0 +1,133 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.PointVerificationLogDao; +import com.epmet.dto.PointVerificationLogDTO; +import com.epmet.dto.form.ResiCommonUserIdFormDTO; +import com.epmet.dto.result.ResiPointLogListResultDTO; +import com.epmet.dto.result.ResiPointLogPeriodResultDTO; +import com.epmet.entity.PointVerificationLogEntity; +import com.epmet.service.PointVerificationLogService; +import com.google.common.collect.Maps; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 核销记录/确认表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class PointVerificationLogServiceImpl extends BaseServiceImpl implements PointVerificationLogService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointVerificationLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointVerificationLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public PointVerificationLogDTO get(String id) { + PointVerificationLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointVerificationLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointVerificationLogDTO dto) { + PointVerificationLogEntity entity = ConvertUtils.sourceToTarget(dto, PointVerificationLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointVerificationLogDTO dto) { + PointVerificationLogEntity entity = ConvertUtils.sourceToTarget(dto, PointVerificationLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 查找指定用户的积分兑换记录 + * @param userId + * @return + * @author wangc + * @date 2020.07.22 14:05 + **/ + @Override + public List getMyExchangeRecord(ResiCommonUserIdFormDTO userId) { + List logList = baseDao.selectVerificationLog(userId.getUserId()); + List result = new LinkedList<>(); + if(null != logList && !logList.isEmpty()){ + Map> map = + logList.stream().collect(Collectors.groupingBy(ResiPointLogPeriodResultDTO::getDate)); + + Map> sortedMap = Maps.newLinkedHashMap(); + map.entrySet().stream().sorted(Map.Entry.>comparingByKey().reversed()) + .forEachOrdered(e -> sortedMap.put(e.getKey(), e.getValue())); + map.entrySet().forEach(e -> { + ResiPointLogListResultDTO o = new ResiPointLogListResultDTO(); + o.setDate(e.getKey()); + o.setDailyList(e.getValue()); + result.add(o); + }); + } + return result; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationStatisticalDailyServiceImpl.java new file mode 100644 index 0000000000..b1802b95cd --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationStatisticalDailyServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.PointVerificationStatisticalDailyDao; +import com.epmet.dto.PointVerificationStatisticalDailyDTO; +import com.epmet.entity.PointVerificationStatisticalDailyEntity; +import com.epmet.service.PointVerificationStatisticalDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 工作人员核销数据统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class PointVerificationStatisticalDailyServiceImpl extends BaseServiceImpl implements PointVerificationStatisticalDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PointVerificationStatisticalDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PointVerificationStatisticalDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public PointVerificationStatisticalDailyDTO get(String id) { + PointVerificationStatisticalDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PointVerificationStatisticalDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PointVerificationStatisticalDailyDTO dto) { + PointVerificationStatisticalDailyEntity entity = ConvertUtils.sourceToTarget(dto, PointVerificationStatisticalDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PointVerificationStatisticalDailyDTO dto) { + PointVerificationStatisticalDailyEntity entity = ConvertUtils.sourceToTarget(dto, PointVerificationStatisticalDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java new file mode 100644 index 0000000000..b309d3f7a0 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/SysOperateLogServiceImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.RuleOperateLogDao; +import com.epmet.dto.SysOperateLogDTO; +import com.epmet.entity.RuleOperateLogEntity; +import com.epmet.service.SysOperateLogService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 积分系统操作记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class SysOperateLogServiceImpl extends BaseServiceImpl implements SysOperateLogService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, SysOperateLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, SysOperateLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public SysOperateLogDTO get(String id) { + RuleOperateLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, SysOperateLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(SysOperateLogDTO dto) { + RuleOperateLogEntity entity = ConvertUtils.sourceToTarget(dto, RuleOperateLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(SysOperateLogDTO dto) { + RuleOperateLogEntity entity = ConvertUtils.sourceToTarget(dto, RuleOperateLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java new file mode 100644 index 0000000000..bb57179d6c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.UserPointActionLogDao; +import com.epmet.dto.UserPointActionLogDTO; +import com.epmet.dto.form.ResiCommonUserIdFormDTO; +import com.epmet.dto.result.ResiPointLogListResultDTO; +import com.epmet.dto.result.ResiPointLogPeriodResultDTO; +import com.epmet.entity.UserPointActionLogEntity; +import com.epmet.service.UserPointActionLogService; +import com.google.common.collect.Maps; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 用户积分行为记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class UserPointActionLogServiceImpl extends BaseServiceImpl implements UserPointActionLogService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserPointActionLogDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserPointActionLogDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public UserPointActionLogDTO get(String id) { + UserPointActionLogEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserPointActionLogDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserPointActionLogDTO dto) { + UserPointActionLogEntity entity = ConvertUtils.sourceToTarget(dto, UserPointActionLogEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserPointActionLogDTO dto) { + UserPointActionLogEntity entity = ConvertUtils.sourceToTarget(dto, UserPointActionLogEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 查找指定用户的积分记录 + * @param userId + * @return + * @author wangc + * @date 2020.07.22 14:05 + **/ + @Override + public List getMyPointRecord(ResiCommonUserIdFormDTO userId) { + List logList = baseDao.selectPointActionLogList(userId.getUserId()); + List result = new LinkedList<>(); + if(null != logList && !logList.isEmpty()){ + Map> map = + logList.stream().collect(Collectors.groupingBy(ResiPointLogPeriodResultDTO::getDate)); + + Map> sortedMap = Maps.newLinkedHashMap(); + map.entrySet().stream().sorted(Map.Entry.>comparingByKey().reversed()) + .forEachOrdered(e -> sortedMap.put(e.getKey(), e.getValue())); + map.entrySet().forEach(e -> { + ResiPointLogListResultDTO o = new ResiPointLogListResultDTO(); + o.setDate(e.getKey()); + o.setDailyList(e.getValue()); + result.add(o); + }); + + } + return result; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java new file mode 100644 index 0000000000..6f68297877 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.UserPointStatisticalDailyDao; +import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.ResiPointRankFormDTO; +import com.epmet.dto.result.ResiPointRankListResultDTO; +import com.epmet.entity.UserPointStatisticalDailyEntity; +import com.epmet.service.UserPointStatisticalDailyService; +import com.epmet.utils.ModuleConstant; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户积分统计情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl implements UserPointStatisticalDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserPointStatisticalDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserPointStatisticalDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public UserPointStatisticalDailyDTO get(String id) { + UserPointStatisticalDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserPointStatisticalDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserPointStatisticalDailyDTO dto) { + UserPointStatisticalDailyEntity entity = ConvertUtils.sourceToTarget(dto, UserPointStatisticalDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserPointStatisticalDailyDTO dto) { + UserPointStatisticalDailyEntity entity = ConvertUtils.sourceToTarget(dto, UserPointStatisticalDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 获取居民端周/月积分排行榜 还有当前用的信息 + * @param pointRankFormDTO + * @return + * @author wangc + * @date 2020.07.21 16:57 + **/ + @Override + public ResiPointRankListResultDTO getPointRankWithinTimeZone(ResiPointRankFormDTO pointRankFormDTO) { + //默认查周数据 + if(StringUtils.isBlank(pointRankFormDTO.getTimeDimension())) { + pointRankFormDTO.setTimeDimension(ModuleConstant.TIME_ZONE_WEEK); + } + + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java new file mode 100644 index 0000000000..22f3cf2e94 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointTotalServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.UserPointTotalDao; +import com.epmet.dto.UserPointTotalDTO; +import com.epmet.entity.UserPointTotalEntity; +import com.epmet.service.UserPointTotalService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户积分总计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-20 + */ +@Service +public class UserPointTotalServiceImpl extends BaseServiceImpl implements UserPointTotalService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserPointTotalDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserPointTotalDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public UserPointTotalDTO get(String id) { + UserPointTotalEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserPointTotalDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserPointTotalDTO dto) { + UserPointTotalEntity entity = ConvertUtils.sourceToTarget(dto, UserPointTotalEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserPointTotalDTO dto) { + UserPointTotalEntity entity = ConvertUtils.sourceToTarget(dto, UserPointTotalEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java new file mode 100644 index 0000000000..b21041f82c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -0,0 +1,50 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.utils; + +import com.epmet.commons.tools.constant.Constant; + +/** + * 模块常量 + * + * @author Mark sunlightcs@gmail.com + * @since 1.1.0 + */ +public interface ModuleConstant extends Constant { + + /** + * 正则表达式 日期 严格按照【yyyy-MM-dd】格式匹配 + * */ + String DATE_REG = "^([1-9]\\d{3}-)([0-1][1-9]-)(([0-3]{0,1}[0-9]))$"; + + /** + * 正则表达式 周 严格按照【yyyyWcc】格式匹配 + * */ + String WEEK_REG = "^([1-9]\\d{3}W)(([0-4][1-9])|50|51|52)"; + + /** + * 正则表达式 月份 严格按照【yyyy-MM】格式匹配 + * */ + String MONTH_REG = "^([1-9]\\d{3}-)(([0][1-9])|10|11|12)"; + + /** + * 兑换记录标题 + * */ + String TITLE_EXCHANGE_POINT = "积分兑换"; + + /** + * 按周排行 + * */ + String TIME_ZONE_WEEK = "week"; + + /** + * 按月排行 + * */ + String TIME_ZONE_MONTH = "month"; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/resources/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..06e24d34cc --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml @@ -0,0 +1,119 @@ +server: + port: @server.port@ + servlet: + context-path: /point + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epmet-point-server + #环境 dev|test|prod + profiles: + active: dev + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.url@ + username: @datasource.druid.username@ + password: @datasource.druid.password@ + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml + #指定共享配置,且支持动态刷新 + # ext-config: + # - data-id: datasource.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + # - data-id: common.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + + # 数据迁移工具flyway + flyway: + enabled: false + locations: classpath:db/migration + url: @datasource.druid.url@ + user: @datasource.druid.username@ + password: @datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: INPUT + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql new file mode 100644 index 0000000000..0b16e938af --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/epmet_point.sql @@ -0,0 +1,39 @@ +CREATE TABLE `point_rule` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID', + `RULE_NAME` varchar(32) DEFAULT NULL COMMENT '规则名称 与事件名称保持一致即可', + `RULE_DESC` varchar(32) DEFAULT NULL COMMENT '规则说明 事件说明', + `EVENT_CODE` varchar(32) DEFAULT NULL COMMENT '事件CODE 来自事件表', + `FUNCTION_ID` varchar(32) DEFAULT NULL COMMENT '功能分组Id 来自customize.function', + `OPERATE_TYPE` varchar(32) DEFAULT 'plus' COMMENT '操作类型 加积分:plus;减积分:minus', + `UP_LIMIT` int(11) DEFAULT '-1' COMMENT '积分上限 -1不限制;', + `UP_LIMIT_DESC` varchar(64) DEFAULT NULL COMMENT '积分上限描述', + `POINT` int(11) DEFAULT '0' COMMENT '单位积分值', + `POINT_UNIT` varchar(32) DEFAULT NULL COMMENT '获得积分单位 次:time;分钟:minute;小时:hour', + `ENABLED_FLAG` varchar(1) DEFAULT '0' COMMENT '是否启用 0-否,1-是', + `DEL_FLAG` varchar(1) DEFAULT NULL COMMENT '删除标识 0-否,1-是', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`), + UNIQUE KEY `unx_cus_event` (`CUSTOMER_ID`,`EVENT_CODE`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='积分规则表'; + +CREATE TABLE rule_operate_log( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) COMMENT '客户ID' , + RULE_ID VARCHAR(64) COMMENT '规则ID' , + OP_TYPE VARCHAR(32) COMMENT '操作类型 新建:add,编辑:edit,删除:del;' , + OP_USER VARCHAR(64) COMMENT '操作用户 操作人' , + BEFORE_DATA VARCHAR(1024) COMMENT '变更前数据 JSON串' , + AFTER_DATA VARCHAR(1024) COMMENT '变更后数据 JSON串' , + DEL_FLAG VARCHAR(1) COMMENT '删除标识 0-否,1-是' , + REVISION INT COMMENT '乐观锁' , + CREATED_BY VARCHAR(32) COMMENT '创建人' , + CREATED_TIME DATETIME COMMENT '创建时间' , + UPDATED_BY VARCHAR(32) COMMENT '更新人' , + UPDATED_TIME DATETIME COMMENT '更新时间' , + PRIMARY KEY (ID) +) COMMENT = '积分规则操作记录表'; diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..916c58edbb --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/logback-spring.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + ERROR + ACCEPT + DENY + ${webHook} + ${secret} + ${appname} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/.gitkeep b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml new file mode 100644 index 0000000000..481ab2dc18 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointRuleDao.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE point_rule + SET + POINT = #{point,jdbcType=INTEGER}, + ENABLED_FLAG = #{enabledFlag,jdbcType=VARCHAR}, + UP_LIMIT = #{upLimit,jdbcType=INTEGER} + WHERE id = #{id,jdbcType=VARCHAR} and CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationLogDao.xml new file mode 100644 index 0000000000..da8ca4135c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationLogDao.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationStatisticalDailyDao.xml new file mode 100644 index 0000000000..1a69fb4c49 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/PointVerificationStatisticalDailyDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/RuleOperateLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/RuleOperateLogDao.xml new file mode 100644 index 0000000000..0569aa74b5 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/RuleOperateLogDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml new file mode 100644 index 0000000000..57c6c0b81f --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml new file mode 100644 index 0000000000..e37642cd78 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointStatisticalDailyDao.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml new file mode 100644 index 0000000000..9c372dc78b --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-point/pom.xml b/epmet-module/epmet-point/pom.xml new file mode 100644 index 0000000000..460ce0de13 --- /dev/null +++ b/epmet-module/epmet-point/pom.xml @@ -0,0 +1,22 @@ + + + 4.0.0 + + + epmet-module + com.epmet + 2.0.0 + + + com.epmet + epmet-point + pom + + + epmet-point-server + epmet-point-client + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml index 60cf655960..c396270821 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.14 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.58 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorGridInfo.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorGridInfo.java new file mode 100644 index 0000000000..d0d0fa1d86 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorGridInfo.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 20:58 + */ +@Data +public class ActSponsorGridInfo implements Serializable { + private static final long serialVersionUID = -2797565581047800011L; + /** + * 网格Id + */ + private String gridId = ""; + /** + * 机关-网格名称 + */ + private String agencyGridName = ""; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorResultDTO.java new file mode 100644 index 0000000000..f7f7c955a1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ActSponsorResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/23 20:46 + */ +@Data +public class ActSponsorResultDTO implements Serializable { + /** + * 机关组织Id + */ + private String agencyId = ""; + /** + * 机关组织名称 + */ + private String agencyName = ""; + /** + * 机关下网格列表信息 + */ + private List agencyGridList; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 4fbf1e6f59..c5c421b5a3 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -156,4 +156,14 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/grid/gridsbystaffid/{staffId}") Result> listGridsbystaffid(@PathVariable("staffId") String staffId); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param staffId + * @author yinzuomei + * @description 发布活动-主办方列表 + * @Date 2020/7/23 20:47 + **/ + @PostMapping("/gov/org/customeragency/querysponsorlist/{staffId}") + Result querySponsorList(@PathVariable("staffId") String staffId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 48fa9c84dc..dcc848725f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -90,4 +90,16 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> listGridsbystaffid(String staffId) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "listGridsbystaffid", staffId); } + + /** + * @param staffId + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 发布活动-主办方列表 + * @Date 2020/7/23 20:47 + **/ + @Override + public Result querySponsorList(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "querySponsorList", staffId); + } } diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml index a6e6dd4760..a912b71cc2 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.74 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.76 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 6177a24ce6..83250c4c17 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -181,4 +181,16 @@ public class CustomerAgencyController { public Result getPublishAgencyList(@PathVariable("staffId") String staffId) { return new Result().ok(customerAgencyService.getPublishAgencyList(staffId)); } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param staffId + * @author yinzuomei + * @description 发布活动-主办方列表 + * @Date 2020/7/23 20:50 + **/ + @PostMapping("querysponsorlist/{staffId}") + Result querySponsorList(@PathVariable("staffId") String staffId){ + return new Result().ok(customerAgencyService.querySponsorList(staffId)); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 7f980cb8c8..8cfef54079 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -18,7 +18,9 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerStaffAgencyDTO; +import com.epmet.dto.result.ActSponsorGridInfo; import com.epmet.dto.result.StaffListResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; import org.apache.ibatis.annotations.Mapper; @@ -80,4 +82,22 @@ public interface CustomerStaffAgencyDao extends BaseDao selectActSponsorGrid(String staffId); + + /** + * @return com.epmet.dto.CustomerAgencyDTO + * @param staffId + * @author yinzuomei + * @description 根据staffId,查询我所属的组织信息 + * @Date 2020/7/23 21:10 + **/ + CustomerAgencyDTO selectMyAgency(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 66586aeec4..cacba8512e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -169,4 +169,13 @@ public interface CustomerAgencyService extends BaseService * @Description 党建声音-政府端-可选发布单位接口调用-根据人员角色查询对应的不同发布单位 **/ PublishAgencyListResultDTO getPublishAgencyList(String staffId); + + /** + * @return com.epmet.dto.result.ActSponsorResultDTO + * @param staffId + * @author yinzuomei + * @description 发布活动-主办方列表 + * @Date 2020/7/23 20:50 + **/ + ActSponsorResultDTO querySponsorList(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index 23b07f5b93..69a1d4ec87 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -810,5 +810,25 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl list=customerStaffAgencyDao.selectActSponsorGrid(staffId); + resultDTO.setAgencyGridList(list); + return resultDTO; + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index 21d9cf139c..222d4cc6d3 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -117,4 +117,28 @@ + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java index 2fed15dcf8..f2672f2b30 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftDetailFormDTO.java @@ -22,4 +22,9 @@ public class DraftDetailFormDTO implements Serializable { */ @NotBlank(message = "草稿id不能为空", groups = {DraftDetailFormDTO.AddUserInternalGroup.class}) private String draftId; + + /** + * 是否展示封面 + */ + private boolean showCover; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java index ccd0e9918e..6298a5cfca 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftDetailResultDTO.java @@ -59,4 +59,9 @@ public class DraftDetailResultDTO implements Serializable { * 标签名称数组 */ private String[] tagNameList; + + /** + * 封面信息 + */ + private CoverImgDTO coverInfo; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java index 4f41ee517c..e3f62d12d5 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftListResultDTO.java @@ -31,4 +31,9 @@ public class DraftListResultDTO implements Serializable { * 创建时间 */ private Long createdTime; + + /** + * 审核状态 + */ + private String auditStatus; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java index 1b0530e3e4..4b4ae98c07 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GovDraftContentDTO.java @@ -24,4 +24,9 @@ public class GovDraftContentDTO implements Serializable { */ private String content; + /** + * 审核状态 + */ + private String auditStatus; + } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java index f90304f477..65a7f54855 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java @@ -56,4 +56,14 @@ public interface ArticleConstant { * 操作权限异常-自己发表的文章只有自己才能下线 */ String SHIRO_EXCEPTION = "当前人员不是文章发布者,不能下线文章"; + + /** + * 发布方式 人工强制发布 不审核 + */ + String PUBLISH_WAY_MANUAL = "manualNoAudit"; + + /** + * 发布方式 api审核后自动发布 + */ + String PUBLISH_WAY_AUTO_AUDIT = "autoAudit"; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index b22716bc16..bf3de1429d 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -52,308 +52,330 @@ import java.util.List; @RestController @RequestMapping("article") public class ArticleController { - - @Autowired - private ArticleService articleService; - @Autowired - private ArticleOperateRecordService articleOperateRecordService; - @Autowired - private DraftService draftService; - - /** - * @param tokenDTO - * @return - * @Author sun - * @Description 党建声音-政府端-可选发布范围 - **/ - @PostMapping("agencygridlist") - public Result agencyGridList(@LoginUser TokenDto tokenDTO) { - ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); - agencyGridList.setAgencyGridList(articleService.agencyGridList(tokenDTO)); - return new Result().ok(agencyGridList); - } - - /** - * desc:政府端-点击返回按钮时,点击保存草稿 无需校验参数 - * @param fromDTO - * @throws Exception - */ - @PostMapping("savedraft") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) - public Result savedraft(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { - DraftContentSaveResultDTO draftDTO = articleService.saveDraft(tokenDto, fromDTO); - return new Result().ok(draftDTO); - } - - /** - * desc:保存或修改草稿内容 - * @param fromDTO - * @throws Exception - */ - @PostMapping("savecontent") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) - public Result saveOrUpdateContent(@LoginUser TokenDto tokenDto,@RequestBody DraftContentFromDTO fromDTO) throws Exception { - DraftContentSaveResultDTO resultDTO = articleService.saveOrUpdateContent(tokenDto, fromDTO, true); - return new Result().ok(resultDTO); - } - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result> - * @author yinzuomei@elink-cn.com - * @description 政府端:查询文章操作记录 - * @date 2020/6/2 16:50 - **/ - @PostMapping("oprationlist") - public Result> operationList(@RequestBody ArticleOperationFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, ArticleOperationFormDTO.AddUserInternalGroup.class); - List list = - articleOperateRecordService.listOfArticleOperation(formDTO.getArticleId()); - return new Result>().ok(list); - } - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @author yinzuomei@elink-cn.com - * @description 政府端:(已发布、已下线)文章详情 - * @date 2020/6/3 9:44 - **/ - @PostMapping("articledetail") - public Result articleDetail(@RequestBody GovArticleDetailFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - GovArticleDetailResultDTO articleDetail = articleService.queryGovArticleDetail(formDTO.getArticleId()); - return new Result().ok(articleDetail); - } - - /** - * @param formDTO 草稿id - * @return com.epmet.commons.tools.utils.Result - * @author yinzuomei@elink-cn.com - * @description 政府端:选中草稿编辑,获取草稿内容 - * @date 2020/6/3 13:18 - **/ - @PostMapping("getcontent") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) - public Result getContent(@RequestBody DraftDetailFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - DraftContentResultDTO draftContent=draftService.queryDraftContent(formDTO); - return new Result().ok(draftContent); - } - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @author yinzuomei@elink-cn.com - * @description 政府端:选中草稿编辑,获取草稿属性 - * @date 2020/6/3 13:51 - **/ - @PostMapping("getattr") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) - public Result getAttr(@RequestBody DraftDetailFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - DraftAttrResultDTO draftAttrResultDTO=draftService.getDraftAttr(formDTO); - return new Result().ok(draftAttrResultDTO); - } - /** - * @param tokenDTO - * @return - * @Author sun - * @Description 党建声音-政府端-可选发布单位 - **/ - @PostMapping("publishagencylist") - public Result publishAgencyList(@LoginUser TokenDto tokenDTO) { - return new Result().ok(articleService.publishAgencyList(tokenDTO)); - } - - /** - * @param tokenDTO formDTO - * @return - * @Author sun - * @Description 党建声音-政府端-下线文章 - **/ - @PostMapping("offlinearticle") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE) - public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) { - formDTO.setStaffId(tokenDTO.getUserId()); - ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class); - articleService.offLineArticle(formDTO); - return new Result(); - } - - /** - * desc:保存草稿属性 - * @param fromDTO - * @throws Exception - */ - @PostMapping("saveattr") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) - public Result saveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { - ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); - Boolean isSuccess = articleService.saveDraftAttr(tokenDto, fromDTO); - return new Result().ok(isSuccess); - } - - /** - * desc:预览保存草稿属性 - * @param fromDTO - * @throws Exception - */ - @PostMapping("previewsaveattr") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) - public Result previewSaveDraftAttr(@LoginUser TokenDto tokenDto,@RequestBody DraftAttrFromDTO fromDTO) throws Exception { - ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); - Boolean isSuccess = articleService.previewSaveDraftAttr(tokenDto, fromDTO); - return new Result().ok(isSuccess); - } - - /** - * desc:发布文章 - * @param formDTO - * @throws Exception - */ - @PostMapping("publish") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) - public Result publishArticle(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception { - Boolean isSuccess = articleService.publish(tokenDto, formDTO.getDraftId()); - if (isSuccess) { - scanContent(tokenDto, formDTO.getDraftId()); - } - return new Result().ok(isSuccess); - } - - @Async - public void scanContent(TokenDto tokenDto,String draftId){ - try { - SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId); - if (syncScanResult == null) { - log.error("scanContent draftId:{} return result null", draftId); - } - - if (syncScanResult.isAllPass()) { - articleService.scanAllPassPublishArticle(tokenDto, draftId, syncScanResult); - } else { - articleService.updateAuditStatusFailById(draftId, syncScanResult); - } - } catch (Exception e) { - articleService.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); - log.error("scanContent exception draftId:{} return result null", e); - } - } - - - /** - * 已发布文章列表 - * @author zhaoqifeng - * @date 2020/6/3 16:19 - * @param tokenDto - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - */ - @PostMapping("publishedarticlelist") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) - public Result> publishedArticleList(@LoginUser TokenDto tokenDto, @RequestBody PublishedListFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); - List list = articleService.publishedArticleList(tokenDto, formDTO).getList(); - return new Result>().ok(list); - } - - - /** - * 已下线文章列表 - * @author zhaoqifeng - * @date 2020/6/3 16:19 - * @param tokenDto - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - */ - @PostMapping("offlinearticlelist") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE_LIST) - public Result > offLineList(@LoginUser TokenDto tokenDto, @RequestBody OfflineListFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO); - List list = articleService.offlineList(tokenDto, formDTO).getList(); - return new Result >().ok(list); - } - /** - * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 - * @param commonArticleListFormDTO :: getGridId :: getNum - * @return List - * @author wangc - * @date 2020.06.02 16:13 - **/ - @PostMapping("resitoparticlelist") - public Result> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ - ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); - return new Result>().ok(articleService.getTopArticleList(commonArticleListFormDTO)); - } - - /** - * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 - * @param commonArticleListFormDTO :: getGridId :: getNum - * @return List - * @author wangc - * @date 2020.06.03 09:53 - **/ - @PostMapping("resilatestarticlelist") - public Result> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO){ - ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); - return new Result>().ok(articleService.getLatestArticleList(commonArticleListFormDTO)); - } - - /** - * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 - * @param articlePageFormDTO - * @return List - * @author wangc - * @date 2020.06.03 14:19 - **/ - @PostMapping("resiarticlelist") - public Result> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO){ - ValidatorUtils.validateEntity(articlePageFormDTO,ArticlePageFormDTO.ArticlePageInternalGroup.class); - return new Result>().ok(articleService.getArticleList(articlePageFormDTO)); - } - - /** - * @param tokenDTO formDTO - * @return - * @Author sun - * @Description 党建声音-政府端-可下线网格列表 - **/ - @PostMapping("publishgridlist") - public Result publishGridList(@LoginUser TokenDto tokenDTO, @RequestBody PublishGridListFormDTO formDTO) { - formDTO.setStaffId(tokenDTO.getUserId()); - ValidatorUtils.validateEntity(formDTO, PublishGridListFormDTO.AddUserInternalGroup.class); - ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); - agencyGridList.setAgencyGridList(articleService.publishGridList(formDTO)); - return new Result().ok(agencyGridList); - } - - - /** - * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL - * @param articleDetailFormDTO - * @return ArticleDetailResultDTO - * @author wangc - * @date 2020.06.03 18:28 - **/ - @PostMapping("resiarticledetail") - public Result resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO){ - ValidatorUtils.validateEntity(articleDetailFormDTO,ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); - return new Result().ok(articleService.getArticleDetail(articleDetailFormDTO)); - } - - /** - * @param formDTO - * @return com.epmet.commons.tools.utils.Result - * @author yinzuomei@elink-cn.com - * @description 政府端:文章预览 - * @date 2020/6/5 10:56 - **/ - @PostMapping("draftdetail") - public Result queryDraftDetail(@RequestBody DraftDetailFormDTO formDTO) { - ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); - DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO); - return new Result().ok(draftDetailResultDTO); - } + + @Autowired + private ArticleService articleService; + @Autowired + private ArticleOperateRecordService articleOperateRecordService; + @Autowired + private DraftService draftService; + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布范围 + **/ + @PostMapping("agencygridlist") + public Result agencyGridList(@LoginUser TokenDto tokenDTO) { + ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); + agencyGridList.setAgencyGridList(articleService.agencyGridList(tokenDTO)); + return new Result().ok(agencyGridList); + } + + /** + * desc:政府端-点击返回按钮时,点击保存草稿 无需校验参数 + * + * @param fromDTO + * @throws Exception + */ + @PostMapping("savedraft") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result savedraft(@LoginUser TokenDto tokenDto, @RequestBody DraftContentFromDTO fromDTO) throws Exception { + DraftContentSaveResultDTO draftDTO = articleService.saveDraft(tokenDto, fromDTO); + return new Result().ok(draftDTO); + } + + /** + * desc:保存或修改草稿内容 + * + * @param fromDTO + * @throws Exception + */ + @PostMapping("savecontent") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result saveOrUpdateContent(@LoginUser TokenDto tokenDto, @RequestBody DraftContentFromDTO fromDTO) throws Exception { + DraftContentSaveResultDTO resultDTO = articleService.saveOrUpdateContent(tokenDto, fromDTO, true); + return new Result().ok(resultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei@elink-cn.com + * @description 政府端:查询文章操作记录 + * @date 2020/6/2 16:50 + **/ + @PostMapping("oprationlist") + public Result> operationList(@RequestBody ArticleOperationFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ArticleOperationFormDTO.AddUserInternalGroup.class); + List list = + articleOperateRecordService.listOfArticleOperation(formDTO.getArticleId()); + return new Result>().ok(list); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:(已发布、已下线)文章详情 + * @date 2020/6/3 9:44 + **/ + @PostMapping("articledetail") + public Result articleDetail(@RequestBody GovArticleDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + GovArticleDetailResultDTO articleDetail = articleService.queryGovArticleDetail(formDTO.getArticleId()); + return new Result().ok(articleDetail); + } + + /** + * @param formDTO 草稿id + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:选中草稿编辑,获取草稿内容 + * @date 2020/6/3 13:18 + **/ + @PostMapping("getcontent") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) + public Result getContent(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftContentResultDTO draftContent = draftService.queryDraftContent(formDTO); + return new Result().ok(draftContent); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:选中草稿编辑,获取草稿属性 + * @date 2020/6/3 13:51 + **/ + @PostMapping("getattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DRAFT_EDIT) + public Result getAttr(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftAttrResultDTO draftAttrResultDTO = draftService.getDraftAttr(formDTO); + return new Result().ok(draftAttrResultDTO); + } + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可选发布单位 + **/ + @PostMapping("publishagencylist") + public Result publishAgencyList(@LoginUser TokenDto tokenDTO) { + return new Result().ok(articleService.publishAgencyList(tokenDTO)); + } + + /** + * @param tokenDTO formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-下线文章 + **/ + @PostMapping("offlinearticle") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE) + public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class); + articleService.offLineArticle(formDTO); + return new Result(); + } + + /** + * desc:保存草稿属性 + * + * @param fromDTO + * @throws Exception + */ + @PostMapping("saveattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result saveDraftAttr(@LoginUser TokenDto tokenDto, @RequestBody DraftAttrFromDTO fromDTO) throws Exception { + ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); + Boolean isSuccess = articleService.saveDraftAttr(tokenDto, fromDTO); + return new Result().ok(isSuccess); + } + + /** + * desc:预览保存草稿属性 + * + * @param fromDTO + * @throws Exception + */ + @PostMapping("previewsaveattr") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result previewSaveDraftAttr(@LoginUser TokenDto tokenDto, @RequestBody DraftAttrFromDTO fromDTO) throws Exception { + ValidatorUtils.validateEntity(fromDTO, DefaultGroup.class); + Boolean isSuccess = articleService.previewSaveDraftAttr(tokenDto, fromDTO); + return new Result().ok(isSuccess); + } + + /** + * desc:发布文章 + * + * @param formDTO + * @throws Exception + */ + @PostMapping("publish") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result publishArticle(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception { + Boolean isSuccess = articleService.publish(tokenDto, formDTO.getDraftId()); + if (isSuccess) { + scanContent(tokenDto, formDTO.getDraftId()); + } + return new Result().ok(isSuccess); + } + + /** + * desc:人工确认无误后发布文章,不走审核接口 + * + * @param formDTO + * @throws Exception + */ + @PostMapping("manualpublish") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISH) + public Result manualPublish(@LoginUser TokenDto tokenDto, @RequestBody PublishArticleFormDTO formDTO) throws Exception { + articleService.manualPublish(tokenDto, formDTO.getDraftId()); + return new Result().ok(true); + } + + @Async + public void scanContent(TokenDto tokenDto, String draftId) { + try { + SyncScanResult syncScanResult = articleService.scanContent(tokenDto, draftId); + if (syncScanResult == null) { + log.error("scanContent draftId:{} return result null", draftId); + } + + if (syncScanResult.isAllPass()) { + articleService.scanAllPassPublishArticle(tokenDto, draftId, syncScanResult); + } else { + articleService.updateAuditStatusFailById(draftId, syncScanResult); + } + } catch (Exception e) { + articleService.updateDraftPublishStatus(draftId, DraftConstant.AUDITFAIL); + log.error("scanContent exception draftId:{} return result null", e); + } + } + + + /** + * 已发布文章列表 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/6/3 16:19 + */ + @PostMapping("publishedarticlelist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_PUBLISHED_LIST) + public Result> publishedArticleList(@LoginUser TokenDto tokenDto, @RequestBody PublishedListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + List list = articleService.publishedArticleList(tokenDto, formDTO).getList(); + return new Result>().ok(list); + } + + + /** + * 已下线文章列表 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/6/3 16:19 + */ + @PostMapping("offlinearticlelist") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE_LIST) + public Result> offLineList(@LoginUser TokenDto tokenDto, @RequestBody OfflineListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + List list = articleService.offlineList(tokenDto, formDTO).getList(); + return new Result>().ok(list); + } + + /** + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @Description 根据网格Id查找置顶文章的相关信息列表 用处:居民端首页轮播 + * @author wangc + * @date 2020.06.02 16:13 + **/ + @PostMapping("resitoparticlelist") + public Result> resiTopArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO) { + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return new Result>().ok(articleService.getTopArticleList(commonArticleListFormDTO)); + } + + /** + * @param commonArticleListFormDTO :: getGridId :: getNum + * @return List + * @Description 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 + * @author wangc + * @date 2020.06.03 09:53 + **/ + @PostMapping("resilatestarticlelist") + public Result> resiLatestArticleList(@RequestBody CommonArticleListFormDTO commonArticleListFormDTO) { + ValidatorUtils.validateEntity(commonArticleListFormDTO, CommonArticleListFormDTO.ArticleBannerInternalGroup.class); + return new Result>().ok(articleService.getLatestArticleList(commonArticleListFormDTO)); + } + + /** + * @param articlePageFormDTO + * @return List + * @Description 根据网格Id和标签列表查找文章的相关信息列表 用处:居民端党建声音列表 + * @author wangc + * @date 2020.06.03 14:19 + **/ + @PostMapping("resiarticlelist") + public Result> resiArticleList(@RequestBody ArticlePageFormDTO articlePageFormDTO) { + ValidatorUtils.validateEntity(articlePageFormDTO, ArticlePageFormDTO.ArticlePageInternalGroup.class); + return new Result>().ok(articleService.getArticleList(articlePageFormDTO)); + } + + /** + * @param tokenDTO formDTO + * @return + * @Author sun + * @Description 党建声音-政府端-可下线网格列表 + **/ + @PostMapping("publishgridlist") + public Result publishGridList(@LoginUser TokenDto tokenDTO, @RequestBody PublishGridListFormDTO formDTO) { + formDTO.setStaffId(tokenDTO.getUserId()); + ValidatorUtils.validateEntity(formDTO, PublishGridListFormDTO.AddUserInternalGroup.class); + ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO(); + agencyGridList.setAgencyGridList(articleService.publishGridList(formDTO)); + return new Result().ok(agencyGridList); + } + + + /** + * @param articleDetailFormDTO + * @return ArticleDetailResultDTO + * @Description 根绝文章Id查询出文章的内容、封面等相关信息,如果居民端传入的网格Id不在该文章的发布范围内,则返回NULL + * @author wangc + * @date 2020.06.03 18:28 + **/ + @PostMapping("resiarticledetail") + public Result resiArticleDetail(@RequestBody ResiArticleDetailFormDTO articleDetailFormDTO) { + ValidatorUtils.validateEntity(articleDetailFormDTO, ResiArticleDetailFormDTO.ResiArticleDetailInternalGroup.class); + return new Result().ok(articleService.getArticleDetail(articleDetailFormDTO)); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei@elink-cn.com + * @description 政府端:文章预览 + * @date 2020/6/5 10:56 + **/ + @PostMapping("draftdetail") + public Result queryDraftDetail(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO); + return new Result().ok(draftDetailResultDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java index 2a9837723f..b7ffc4a382 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java @@ -24,7 +24,10 @@ 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.DeleteDraftFormDTO; +import com.epmet.dto.form.DraftDetailFormDTO; import com.epmet.dto.form.DraftListFormDTO; +import com.epmet.dto.form.GovArticleDetailFormDTO; +import com.epmet.dto.result.DraftDetailResultDTO; import com.epmet.dto.result.DraftListResultDTO; import com.epmet.service.DraftService; import org.springframework.beans.factory.annotation.Autowired; @@ -70,4 +73,17 @@ public class DraftController { ValidatorUtils.validateEntity(formDTO); return new Result>().ok(draftService.draftList(tokenDto, formDTO).getList()); } + + /** + * desc:政府端:带封面的预览 + * @param formDTO + * @return + */ + @PostMapping("detailwithcover") + public Result detailWithCover(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); + formDTO.setShowCover(true); + DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO); + return new Result().ok(draftDetailResultDTO); + } } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java index eb2b026fb7..3b1021a004 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java @@ -103,6 +103,11 @@ public class ArticleEntity extends BaseEpmetEntity { */ private String tags; + /** + * 发布方式 自动审核后发布:autoAudit;人工确认无误发布(不审核):manualNoAudit + */ + private String publishWay; + /** * 组织ID */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java index 4a5424c8af..6b69368795 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java @@ -206,4 +206,12 @@ public interface ArticleService extends BaseService { * @return */ void updateDraftPublishStatus(String draftId,String statusFlag); + + /** + * desc:人工发布文章 不走审核接口 + * @param tokenDto + * @param draftId + * @return + */ + void manualPublish(TokenDto tokenDto, String draftId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 2e3d296122..c5c4b74f0f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -63,7 +63,6 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; @@ -322,7 +321,7 @@ public class ArticleServiceImpl extends BaseServiceImpl { offLineGridId.append(StrConstant.COLON).append(off.getGridId()); }); - recordEntity.setGridIds(offLineGridId.toString().replaceFirst(StrConstant.COLON,"")); + recordEntity.setGridIds(offLineGridId.toString().replaceFirst(StrConstant.COLON, "")); recordEntity.setContent(content); recordEntity.setOpType(ArticleConstant.OFFLINE); recordEntity.setOpTime(date); @@ -641,7 +640,7 @@ public class ArticleServiceImpl extends BaseServiceImpl NumConstant.ZERO) { draftContents.forEach(content -> { @@ -1006,16 +1008,16 @@ public class ArticleServiceImpl extends BaseServiceImpl updateGridTagCacheDTOS = this.updateGridTag(tokenDto, draftId, updateCustomerTagCacheDTO); + this.addArticleTags(updateCustomerTagCacheDTO, draftId, tokenDto, articleEntity.getCreatedTime()); + + //更新redis + try { + this.updateCacheCustomerTag(updateCustomerTagCacheDTO); + this.updateCacheGridTag(updateGridTagCacheDTOS); + } catch (Exception e) { + log.error("manualPublish update redis exception", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } catch (RenException e) { + log.error("manualPublish exception", e); + } + } + /** * @param draftId diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java index 59e311c943..ceb961ac38 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java @@ -26,12 +26,14 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DraftConstant; +import com.epmet.dao.DraftCoverDao; import com.epmet.dao.DraftDao; import com.epmet.dto.DraftDTO; import com.epmet.dto.form.DeleteDraftFormDTO; import com.epmet.dto.form.DraftDetailFormDTO; import com.epmet.dto.form.DraftListFormDTO; import com.epmet.dto.result.*; +import com.epmet.entity.DraftCoverEntity; import com.epmet.entity.DraftEntity; import com.epmet.service.DraftService; import com.github.pagehelper.PageHelper; @@ -39,6 +41,7 @@ import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -57,6 +60,8 @@ import java.util.Map; public class DraftServiceImpl extends BaseServiceImpl implements DraftService { private Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private DraftCoverDao draftCoverDao; @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -179,6 +184,15 @@ public class DraftServiceImpl extends BaseServiceImpl imp }else{ draftDetailResultDTO.setTagNameList(new String[0]); } + if (formDTO.isShowCover()){ + DraftCoverEntity coverEntity = draftCoverDao.selectByDraftId(formDTO.getDraftId(), null); + if (coverEntity != null){ + CoverImgDTO coverImgDTO = ConvertUtils.sourceToTarget(coverEntity, CoverImgDTO.class); + draftDetailResultDTO.setCoverInfo(coverImgDTO); + }else{ + draftDetailResultDTO.setCoverInfo(new CoverImgDTO()); + } + } } return draftDetailResultDTO; } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql new file mode 100644 index 0000000000..50dc5ea180 --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.2__addAutoPublish.sql @@ -0,0 +1,2 @@ +ALTER TABLE `epmet_gov_voice`.`article` +ADD COLUMN `PUBLISH_WAY` varchar(16) NOT NULL DEFAULT 'autoAudit' COMMENT '发布方式 自动审核后发布:autoAudit;人工确认无误发布(不审核):manualNoAudit' AFTER `TAGS`; \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml index e97eb759b1..71330a10b8 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml @@ -142,7 +142,9 @@ ID AS "draftId", TITLE AS "title", IFNULL(PREVIEW_CONTENT, "") AS "content", - UNIX_TIMESTAMP(CREATED_TIME) AS "createdTime" + UNIX_TIMESTAMP(CREATED_TIME) AS "createdTime", + AUDIT_STATUS, + AUDIT_REASON FROM draft WHERE DEL_FLAG = '0' AND (STATUS_FLAG = 'unpublish' OR STATUS_FLAG = 'auditfail') @@ -169,7 +171,9 @@ + SELECT secret FROM customer_app where APP_ID = #{appId,jdbcType=VARCHAR} and ENABLE_FLAG = 1 and DEL_FLAG = 0 + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index de1c9c2f83..62c90892f6 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -6,11 +6,20 @@ import com.epmet.dto.form.CustomerFootBarFormDTO; import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CustomerFunctionListFormDTO; +import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; +import java.util.List; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + import java.util.List; /** @@ -25,4 +34,6 @@ public interface OperCustomizeOpenFeignClient { @PostMapping(value = "/oper/customize/customerfootbar/customerfootbars", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> getCustomerfootbars(@RequestBody CustomerFootBarFormDTO formDTO); + @PostMapping(value = "/oper/customize/customerfunction/getOpenedFunctionList", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> getOpenedFunctionList(@RequestBody CustomerFunctionListFormDTO formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index 0659ab1725..3958e89268 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -5,6 +5,11 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; import com.epmet.dto.form.CustomerFootBarFormDTO; +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.form.CustomerFunctionListFormDTO; +import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.feign.OperCustomizeOpenFeignClient; import org.springframework.stereotype.Component; @@ -22,4 +27,13 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe public Result> getCustomerfootbars(CustomerFootBarFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getCustomerfootbars", formDTO); } + /** + * 获取客户已开通的功能列表 + * + * @return + */ + @Override + public Result> getOpenedFunctionList(CustomerFunctionListFormDTO formDTO){ + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getOpenedFunctionList", formDTO); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java index 5af31e8e0b..45f4a7ed95 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionController.java @@ -34,6 +34,7 @@ import com.epmet.dto.CustomerFunctionDTO; import com.epmet.dto.form.CustomerFunctionListFormDTO; import com.epmet.dto.form.SaveCustomerFunctionFormDTO; import com.epmet.dto.result.CustomerFunctionListResultDTO; +import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.excel.CustomerFunctionExcel; import com.epmet.service.CustomerFunctionService; import org.springframework.beans.factory.annotation.Autowired; @@ -126,4 +127,14 @@ public class CustomerFunctionController { customerFunctionService.saveCustomerFunction(formDTO); return new Result(); } + + /** + * desc:获取客户已开通功能列表 + * @param formDTO + * @return + */ + @PostMapping("getOpenedFunctionList") + public Result> getOpenedFunctionList(@RequestBody CustomerFunctionListFormDTO formDTO) { + return new Result>().ok(customerFunctionService.getOpenedFunctionList(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java index 91c1e3eb1b..70b5c55404 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionService.java @@ -23,6 +23,7 @@ import com.epmet.dto.CustomerFunctionDTO; import com.epmet.dto.form.CustomerFunctionListFormDTO; import com.epmet.dto.form.SaveCustomerFunctionFormDTO; import com.epmet.dto.result.CustomerFunctionListResultDTO; +import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.entity.CustomerFunctionEntity; import java.util.List; @@ -111,4 +112,11 @@ public interface CustomerFunctionService extends BaseService getOpenedFunctionList(CustomerFunctionListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java index deae7d7406..8d57b09cdb 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionServiceImpl.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.FieldConstant; 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.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; @@ -41,15 +42,15 @@ import com.epmet.entity.CustomerFunctionEntity; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerFunctionRedis; import com.epmet.service.CustomerFunctionService; +import lombok.extern.slf4j.Slf4j; 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 org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 客户功能权限表 @@ -57,157 +58,185 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-10 */ +@Slf4j @Service public class CustomerFunctionServiceImpl extends BaseServiceImpl implements CustomerFunctionService { - @Autowired - private CustomerFunctionRedis customerFunctionRedis; - @Autowired - private FunctionDao functionDao; - @Autowired - private OperCrmFeignClient operCrmFeignClient; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, CustomerFunctionDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, CustomerFunctionDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - - @Override - public CustomerFunctionDTO get(String id) { - CustomerFunctionEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, CustomerFunctionDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(CustomerFunctionDTO dto) { - CustomerFunctionEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(CustomerFunctionDTO dto) { - CustomerFunctionEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 运营端-获取客户功能(已勾选、未勾选)详情列表 - **/ - @Override - public CustomerFunctionListResultDTO customerFunctionList(CustomerFunctionListFormDTO formDTO) { - CustomerFunctionListResultDTO resultDTO = new CustomerFunctionListResultDTO(); - //1:调用oper-crm服务。查询客户基本信息 - Result result = operCrmFeignClient.queryCustomerInfo(formDTO.getCustomerId()); - if (!result.success() || null == result.getData()) { - throw new RenException(CustomerFunctionConstant.SELECT_CUSTOMER_EXCEPTION); - } - CustomerDTO customerDTO = result.getData(); - resultDTO.setCustomerId(customerDTO.getId()); - resultDTO.setCustomerName(customerDTO.getCustomerName()); - resultDTO.setLogo(customerDTO.getLogo()); - - //2:查询所有已上架功能列表(默认、定制功能) - List funList = functionDao.selectShopFunctionList(NumConstant.ONE); - if(null==funList||funList.size() csList = baseDao.selectCustomerFunctionList(formDTO.getCustomerId()); - - //4:封装数据,客户已拥有但已下架的功能不展示 - List defaultFunctionList = new ArrayList<>(); - List customizedFunctionList = new ArrayList<>(); - funList.forEach(fun -> { - //默认功能 - if (fun.getFunctionGroup() == NumConstant.ZERO) { - DefaultFunctionListResultDTO df = new DefaultFunctionListResultDTO(); - df.setFunctionId(fun.getId()); - df.setFunctionName(fun.getFunctionName()); - csList.forEach(cs -> { - if (fun.getId().equals(cs.getFunctionId())) { - df.setFlag(true); - } - }); - defaultFunctionList.add(df); - } - //定制功能 - if (fun.getFunctionGroup() == NumConstant.ONE) { - CustomizedFunctionListResultDTO cf = new CustomizedFunctionListResultDTO(); - cf.setFunctionId(fun.getId()); - cf.setFunctionName(fun.getFunctionName()); - csList.forEach(cs -> { - if (fun.getId().equals(cs.getFunctionId())) { - cf.setFlag(true); - } - }); - customizedFunctionList.add(cf); - } - }); - resultDTO.setDefaultFunctionList(defaultFunctionList); - resultDTO.setCustomizedFunctionList(customizedFunctionList); - return resultDTO; - } - - /** - * @param formDTO - * @return - * @Author sun - * @Description 运营端-保存客户功能关系数据 - **/ - @Override - @Transactional(rollbackFor = Exception.class) - public void saveCustomerFunction(SaveCustomerFunctionFormDTO formDTO) { - //1:逻辑删除旧的客户功能关联数据 - baseDao.updateByCustomerId(formDTO.getCustomerId()); - - //2:批量新增新的客户功能关系数据 - List entityList = new ArrayList<>(); - formDTO.getDefaultFunctionList().forEach(dfId -> { - CustomerFunctionEntity entity = new CustomerFunctionEntity(); - entity.setCustomerId(formDTO.getCustomerId()); - entity.setFunctionId(dfId); - entityList.add(entity); - }); - formDTO.getCustomizedFunctionList().forEach(cfId -> { - CustomerFunctionEntity entity = new CustomerFunctionEntity(); - entity.setCustomerId(formDTO.getCustomerId()); - entity.setFunctionId(cfId); - entityList.add(entity); - }); - insertBatch(entityList); - } + @Autowired + private CustomerFunctionRedis customerFunctionRedis; + @Autowired + private FunctionDao functionDao; + @Autowired + private OperCrmFeignClient operCrmFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerFunctionDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerFunctionDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CustomerFunctionDTO get(String id) { + CustomerFunctionEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerFunctionDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerFunctionDTO dto) { + CustomerFunctionEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerFunctionDTO dto) { + CustomerFunctionEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 运营端-获取客户功能(已勾选、未勾选)详情列表 + **/ + @Override + public CustomerFunctionListResultDTO customerFunctionList(CustomerFunctionListFormDTO formDTO) { + CustomerFunctionListResultDTO resultDTO = new CustomerFunctionListResultDTO(); + //1:调用oper-crm服务。查询客户基本信息 + Result result = operCrmFeignClient.queryCustomerInfo(formDTO.getCustomerId()); + if (!result.success() || null == result.getData()) { + throw new RenException(CustomerFunctionConstant.SELECT_CUSTOMER_EXCEPTION); + } + CustomerDTO customerDTO = result.getData(); + resultDTO.setCustomerId(customerDTO.getId()); + resultDTO.setCustomerName(customerDTO.getCustomerName()); + resultDTO.setLogo(customerDTO.getLogo()); + + //2:查询所有已上架功能列表(默认、定制功能) + List funList = functionDao.selectShopFunctionList(NumConstant.ONE); + if (null == funList || funList.size() < NumConstant.ONE) { + return resultDTO; + } + + //3:查询当前客户已拥有的功能 + List csList = baseDao.selectCustomerFunctionList(formDTO.getCustomerId()); + + //4:封装数据,客户已拥有但已下架的功能不展示 + List defaultFunctionList = new ArrayList<>(); + List customizedFunctionList = new ArrayList<>(); + funList.forEach(fun -> { + //默认功能 + if (fun.getFunctionGroup() == NumConstant.ZERO) { + DefaultFunctionListResultDTO df = new DefaultFunctionListResultDTO(); + df.setFunctionId(fun.getId()); + df.setFunctionName(fun.getFunctionName()); + csList.forEach(cs -> { + if (fun.getId().equals(cs.getFunctionId())) { + df.setFlag(true); + } + }); + defaultFunctionList.add(df); + } + //定制功能 + if (fun.getFunctionGroup() == NumConstant.ONE) { + CustomizedFunctionListResultDTO cf = new CustomizedFunctionListResultDTO(); + cf.setFunctionId(fun.getId()); + cf.setFunctionName(fun.getFunctionName()); + csList.forEach(cs -> { + if (fun.getId().equals(cs.getFunctionId())) { + cf.setFlag(true); + } + }); + customizedFunctionList.add(cf); + } + }); + resultDTO.setDefaultFunctionList(defaultFunctionList); + resultDTO.setCustomizedFunctionList(customizedFunctionList); + return resultDTO; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 运营端-保存客户功能关系数据 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveCustomerFunction(SaveCustomerFunctionFormDTO formDTO) { + //1:逻辑删除旧的客户功能关联数据 + baseDao.updateByCustomerId(formDTO.getCustomerId()); + + //2:批量新增新的客户功能关系数据 + List entityList = new ArrayList<>(); + formDTO.getDefaultFunctionList().forEach(dfId -> { + CustomerFunctionEntity entity = new CustomerFunctionEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setFunctionId(dfId); + entityList.add(entity); + }); + formDTO.getCustomizedFunctionList().forEach(cfId -> { + CustomerFunctionEntity entity = new CustomerFunctionEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setFunctionId(cfId); + entityList.add(entity); + }); + insertBatch(entityList); + } + + @Override + public List getOpenedFunctionList(CustomerFunctionListFormDTO formDTO) { + if (StringUtils.isBlank(formDTO.getCustomerId())) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + List result = new ArrayList<>(); + //查询所有已上架功能列表(默认、定制功能) + List funList = functionDao.selectFunctionList(); + if (CollectionUtils.isEmpty(funList)) { + return result; + } + //查询当前客户已拥有的功能 + List openedList = baseDao.selectCustomerFunctionList(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(openedList)) { + log.warn("getOpenedFunctionList customerId:{} have any function", formDTO.getCustomerId()); + return result; + } + Set openedFunIdSet = openedList.stream().map(CustomerFunctionDTO::getFunctionId).collect(Collectors.toSet()); + return funList.stream().filter(fun -> openedFunIdSet.contains(fun.getId())) + .map(fun -> { + DefaultFunctionListResultDTO resultDTO = new DefaultFunctionListResultDTO(); + resultDTO.setFunctionId(fun.getId()); + resultDTO.setFunctionName(fun.getFunctionName()); + return resultDTO; + }).collect(Collectors.toList()); + } } \ No newline at end of file diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index dfa242462a..dd7611267b 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -40,6 +40,8 @@ data-statistical data-report epmet-third + epmet-heart + epmet-point diff --git a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml index 3aef647382..3fde6f4ec8 100644 --- a/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-guide/resi-guide-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-guide-server: container_name: resi-guide-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-guide-server:0.3.17 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-guide-server:0.3.18 ports: - "8091:8091" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/GenerateShortUserIdFormDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/GenerateShortUserIdFormDTO.java new file mode 100644 index 0000000000..64fce64ec1 --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/from/GenerateShortUserIdFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.mine.dto.from; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName MyResiUserInfoFormDTO + * @Auth wangc + * @Date 2020-05-22 17:27 + */ +@Data +public class GenerateShortUserIdFormDTO implements Serializable { + + /** + * 过期时间 单位秒 + */ + private Integer expires; + + /** + * 场景类型 + */ + private String bizType; +} diff --git a/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/ShortUserIdInfoResultDTO.java b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/ShortUserIdInfoResultDTO.java new file mode 100644 index 0000000000..19f2a9235e --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-client/src/main/java/com/epmet/resi/mine/dto/result/ShortUserIdInfoResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.resi.mine.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * desc: 生成用户短用户标识 result + * + * @date: 2020/7/22 10:50 + * @author: jianjun liu + */ +@Data +public class ShortUserIdInfoResultDTO implements Serializable { + + /** + * 12位用户标识 + */ + private String shortUserId; + /** + * 过期时间 + */ + private Date expiresTime; + + +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/eums/GenerateShortUserIdBizTypeEnum.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/eums/GenerateShortUserIdBizTypeEnum.java new file mode 100644 index 0000000000..170a11230c --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/eums/GenerateShortUserIdBizTypeEnum.java @@ -0,0 +1,41 @@ +package com.epmet.eums; + +/** + * 生成用户唯一标识 枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum GenerateShortUserIdBizTypeEnum { + POINT_EXCHANGE("pointExchange", "积分兑换") + ; + + private String code; + private String desc; + + + + GenerateShortUserIdBizTypeEnum(String code, String name) { + this.code = code; + this.desc = name; + } + + public static GenerateShortUserIdBizTypeEnum getEnum(String code) { + GenerateShortUserIdBizTypeEnum[] values = GenerateShortUserIdBizTypeEnum.values(); + for (GenerateShortUserIdBizTypeEnum value : values) { + if (code != null && value.getCode().equals(code)) { + return value; + } + } + return null; + } + + public String getCode() { + return code; + } + + public String getDesc() { + return desc; + } +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/MineController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/MineController.java index 174126f074..dccec06857 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/MineController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/mine/controller/MineController.java @@ -1,43 +1,91 @@ package com.epmet.modules.mine.controller; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +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.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Md5Util; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.eums.GenerateShortUserIdBizTypeEnum; import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.resi.mine.dto.from.GenerateShortUserIdFormDTO; import com.epmet.resi.mine.dto.from.MyResiUserInfoFormDTO; import com.epmet.resi.mine.dto.result.MyResiUserInfoResultDTO; +import com.epmet.resi.mine.dto.result.ShortUserIdInfoResultDTO; +import lombok.extern.slf4j.Slf4j; 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.Date; + /** * @Description * @ClassName MineController * @Auth wangc * @Date 2020-05-22 18:33 */ +@Slf4j @RestController @RequestMapping("mine") public class MineController { - @Autowired - EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private RedisUtils redisUtils; + + /** + * @param myResiUserInfoFormDTO + * @return MyResiUserInfoResultDTO + * @Description 居民端获取我的信息 + * @author wangc + * @date 2020.05.22 18:37 + **/ + @PostMapping("profile") + Result getMyResiInfo(@LoginUser TokenDto tokenDto, @RequestBody MyResiUserInfoFormDTO myResiUserInfoFormDTO) { + myResiUserInfoFormDTO.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(myResiUserInfoFormDTO); + return epmetUserFeignClient.resiMyselfMsg(myResiUserInfoFormDTO); + } - /** - * @Description 居民端获取我的信息 - * @param myResiUserInfoFormDTO - * @return MyResiUserInfoResultDTO - * @author wangc - * @date 2020.05.22 18:37 - **/ - @PostMapping("profile") - Result getMyResiInfo(@LoginUser TokenDto tokenDto, @RequestBody MyResiUserInfoFormDTO myResiUserInfoFormDTO){ - myResiUserInfoFormDTO.setUserId(tokenDto.getUserId()); - ValidatorUtils.validateEntity(myResiUserInfoFormDTO); - return epmetUserFeignClient.resiMyselfMsg(myResiUserInfoFormDTO); - } + /** + * desc:生成用户12位唯一标识 默认10分钟过期 + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("generateshortuserid") + Result generateShortUserId(TokenDto tokenDto, @RequestBody GenerateShortUserIdFormDTO formDTO) { + String userId = tokenDto.getUserId(); + GenerateShortUserIdBizTypeEnum bizTypeEnum = GenerateShortUserIdBizTypeEnum.getEnum(formDTO.getBizType()); + if (bizTypeEnum == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + String shortUserId = Md5Util.get12Char(bizTypeEnum.getCode().concat(userId)); + String redisKey = RedisKeys.getShortUserIdKey(shortUserId); + //过期时间 单位:秒 + int expires = formDTO.getExpires() == null ? NumConstant.TEN * NumConstant.SIXTY : formDTO.getExpires(); + if (redisUtils.hasKey(shortUserId)) { + redisUtils.expire(redisKey, expires); + } else { + redisUtils.setString(redisKey, userId, expires); + } + Date expiresDate = DateUtils.addDateSeconds(new Date(), expires); + ShortUserIdInfoResultDTO result = new ShortUserIdInfoResultDTO(); + result.setShortUserId(shortUserId); + result.setExpiresTime(expiresDate); + log.info("generateShortUserId success,result:{}", JSON.toJSONString(result)); + return new Result().ok(result); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java index 5785bf4489..bd54ec1604 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.resi.partymember.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; @@ -73,4 +74,14 @@ public interface ResiPartyMemberOpenFeignClient { **/ @PostMapping(value = "/resi/partymember/partymemberbaseinfo/delete", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result deltePartyMemberBaseInfo(@RequestBody DelPartyMemberBaseInfoFormDTO formDTO); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param userIdList + * @author yinzuomei + * @description 根据用户id查询认证通过的党员信息 + * @Date 2020/7/22 12:14 + **/ + @PostMapping(value = "/resi/partymember/partymemberinfo/queryPartymemberInfoByUserId", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> queryPartymemberInfoByUserId(@RequestBody List userIdList); } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java index 058af67dfa..df60a30abc 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; @@ -46,4 +47,18 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp public Result deltePartyMemberBaseInfo(DelPartyMemberBaseInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "deltePartyMemberBaseInfo", formDTO); } + + /** + * @param userIdList + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 根据用户id查询认证通过的党员信息 + * @Date 2020/7/22 12:14 + **/ + @Override + public Result> queryPartymemberInfoByUserId(List userIdList) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "queryPartymemberInfoByUserId", userIdList); + } + + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java index ab98cf565a..89b9d7c135 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java @@ -132,4 +132,16 @@ public class PartymemberInfoController { return new Result>().ok(list); } + /** + * @return com.epmet.commons.tools.utils.Result + * @param userIdList + * @author yinzuomei + * @description 根据用户id查询认证通过的党员信息 + * @Date 2020/7/22 12:18 + **/ + @PostMapping(value = "queryPartymemberInfoByUserId") + Result> queryPartymemberInfoByUserId(@RequestBody List userIdList) { + List list = partymemberInfoService.queryPartymemberInfoByUserId(userIdList); + return new Result>().ok(list); + } } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java index a66092f216..53854d8253 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java @@ -67,4 +67,12 @@ public interface PartymemberInfoDao extends BaseDao { */ CertifiedDetailResultDTO certifiedDetail(CertifiedDetailFormDTO formDTO); + /** + * @return com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO + * @param userId + * @author yinzuomei + * @description 根据用户id查询认证通过的党员信息,此sql用来初始化user_base_info用 + * @Date 2020/7/22 12:19 + **/ + PartymemberInfoDTO queryPartymemberInfoByUserId(String userId); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java index 0fe2142c08..b8b0b39694 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java @@ -19,7 +19,6 @@ package com.epmet.modules.partymember.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.utils.Result; import com.epmet.dto.result.CertifiedResultDTO; import com.epmet.modules.partymember.entity.PartymemberInfoEntity; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; @@ -27,7 +26,6 @@ import com.epmet.resi.partymember.dto.partymember.form.CertifiedDetailFormDTO; import com.epmet.resi.partymember.dto.partymember.form.CertifiedFormDTO; import com.epmet.resi.partymember.dto.partymember.result.CertifiedDetailResultDTO; import com.epmet.resi.partymember.dto.partymember.result.PartyAuthProcessingCountResultDTO; -import org.springframework.web.bind.annotation.RequestBody; import java.util.List; import java.util.Map; @@ -146,4 +144,13 @@ public interface PartymemberInfoService extends BaseService queryPartyMemberProcessingCount(List gridIdList); + + /** + * @return com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO + * @param userIdList + * @author yinzuomei + * @description 根据用户id查询认证通过的党员信息 + * @Date 2020/7/22 12:18 + **/ + List queryPartymemberInfoByUserId(List userIdList); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java index 4803ebef14..0aea73c30b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java @@ -219,5 +219,27 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl queryPartymemberInfoByUserId(List userIdList) { + if(null==userIdList||userIdList.size()<1){ + return new ArrayList<>(); + } + List list=new ArrayList<>(); + for(String userId:userIdList){ + PartymemberInfoDTO partymemberInfoDTO=baseDao.queryPartymemberInfoByUserId(userId); + if(null!=partymemberInfoDTO){ + list.add(partymemberInfoDTO); + } + } + return list; + } + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml index 61b7a60c9e..35447099f8 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml @@ -103,4 +103,17 @@ AND pi.confirm_result IN ( 'auto_confirm_success', 'approved' ) + + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.java new file mode 100644 index 0000000000..1530f1f3c9 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserBaseInfoDTO.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +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 UserBaseInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 姓名 + */ + private String realName; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ + private String nickname; + + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ + private String headImgUrl; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java new file mode 100644 index 0000000000..983bffec24 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserBaseInfoResultDTO.java @@ -0,0 +1,83 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户基本信息-居民录入的基本信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 9:26 + */ +@Data +public class UserBaseInfoResultDTO implements Serializable { + private static final long serialVersionUID = 3124057264557384333L; + @JsonIgnore + private String id; + /** + * 用户id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 姓名 + */ + private String realName; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ + private String nickname; + + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ + private String headImgUrl; + + /** + * 微信基本信息 + */ + private UserWechatResultDTO userWechatResultDTO; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWechatResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWechatResultDTO.java new file mode 100644 index 0000000000..e7a9886d41 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWechatResultDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户基本信息-微信信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/22 9:27 + */ +@Data +public class UserWechatResultDTO implements Serializable { + private static final long serialVersionUID = 5770079291635923923L; + + /** + * 用户ID + * */ + private String userId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 微信unionId + */ + private String unionId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别:0.未知 1.男性2女性 + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 138f2d0b40..89632db823 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -148,4 +148,35 @@ public interface EpmetUserOpenFeignClient { @PostMapping(value = "epmetuser/customerstaff/getcustomerstaffinfo", consumes = MediaType.APPLICATION_JSON_VALUE) Result getCustomerStaffInfo(@RequestBody CustomerStaffFormDTO customerStaffFormDTO); + /** + * @param userIdList + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:30 + **/ + @PostMapping("/epmetuser/userbaseinfo/queryuserbaseinfo") + Result> queryUserBaseInfo(@RequestBody List userIdList); + + /** + * 根据用户ID,查询用户所属角色: 多种身份 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:13 2020-07-23 + **/ + @GetMapping(value = "epmetuser/userrole/getuserroleinfobyuserid/{userId}") + Result> getUserRoleInfoByUserId(@PathVariable("userId") String userId); + + /** + * 同步-居民基础信息、用户微信信息 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:37 2020-07-23 + **/ + @PostMapping("epmetuser/user/updateUserBaseAndWxUserInfo") + Result updateUserBaseAndWxUserInfo(@RequestBody WxUserInfoFormDTO formDTO); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index 06c88baab1..1020220db8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java @@ -91,4 +91,26 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result getCustomerStaffInfo(CustomerStaffFormDTO customerStaffFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerStaffInfo", customerStaffFormDTO); } + + /** + * @param userIdList + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:30 + **/ + @Override + public Result> queryUserBaseInfo(List userIdList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "queryUserBaseInfo", userIdList); + } + + @Override + public Result> getUserRoleInfoByUserId(String userId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoleInfoByUserId", userId); + } + + @Override + public Result updateUserBaseAndWxUserInfo(WxUserInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateUserBaseAndWxUserInfo", formDTO); + } } diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 272e5e117d..4523fe51aa 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.80 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.81 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index 9aaabd5324..e1725c6df6 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.75 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.81 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml index c0efd1fb64..3a291ea73e 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.79 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.81 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index e0c626ead8..067c4cfdf9 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.80 + 0.3.81 com.epmet epmet-user diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java new file mode 100644 index 0000000000..046bc0f071 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -0,0 +1,120 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.excel.UserBaseInfoExcel; +import com.epmet.service.UserBaseInfoService; +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; + + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@RestController +@RequestMapping("userbaseinfo") +public class UserBaseInfoController { + + @Autowired + private UserBaseInfoService userBaseInfoService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = userBaseInfoService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + UserBaseInfoDTO data = userBaseInfoService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody UserBaseInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + userBaseInfoService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody UserBaseInfoDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + userBaseInfoService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + userBaseInfoService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = userBaseInfoService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, UserBaseInfoExcel.class); + } + + /** + * @param userIdList + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:34 + **/ + @PostMapping("queryuserbaseinfo") + public Result> queryUserBaseInfo(@RequestBody List userIdList) { + List list = userBaseInfoService.queryUserBaseInfo(userIdList); + return new Result>().ok(list); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 初始化历史用户信息到user_base_info数据 + * @Date 2020/7/22 10:42 + **/ + @PostMapping("initbaseinfo") + public Result initBaseInfo(){ + userBaseInfoService.initBaseInfo(); + return new Result(); + } +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java index 9c0f40c8ef..3d028bdfe7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserController.java @@ -132,4 +132,18 @@ public class UserController { return new Result().ok(userService.saveWxUser(formDTO)); } + /** + * 居民端个人信息-同步用户微信信息 + * 供Feign调用 + * + * @param wxUserInfoFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:51 2020-07-23 + **/ + @PostMapping("updateUserBaseAndWxUserInfo") + public Result updateUserBaseAndWxUserInfo(@RequestBody WxUserInfoFormDTO wxUserInfoFormDTO) { ; + ValidatorUtils.validateEntity(wxUserInfoFormDTO); + return userService.updateWxUserInfo(wxUserInfoFormDTO); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java index f442da6e7f..7a1bbbe99d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserRoleController.java @@ -120,4 +120,16 @@ public class UserRoleController { } -} \ No newline at end of file + /** + * 根据用户ID,查询用户所属角色: 多种身份 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:24 2020-07-23 + **/ + @GetMapping("getuserroleinfobyuserid/{userId}") + public Result> getUserRoleInfoByUserId(@PathVariable("userId") String userId) { + return userRoleService.getUserRoleInfoByUserId(userId); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java new file mode 100644 index 0000000000..f5ca5fc3aa --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserBaseInfoDao.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.UserWechatResultDTO; +import com.epmet.entity.UserBaseInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Mapper +public interface UserBaseInfoDao extends BaseDao { + + /** + * @return com.epmet.dto.result.UserBaseInfoResultDTO + * @param userId + * @author yinzuomei + * @description 根据用户id查询user_base_info基本信息 + * @Date 2020/7/22 9:46 + **/ + UserBaseInfoResultDTO selectListByUserIdList(String userId); + + /** + * @return com.epmet.dto.result.UserWechatResultDTO + * @param userId + * @author yinzuomei + * @description 根据用户id获取user_wechat表微信用户基本信息 + * @Date 2020/7/22 9:46 + **/ + UserWechatResultDTO selectUserWechatByUserId(String userId); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java index a47f215bdc..acb1ce5ab2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java @@ -78,4 +78,13 @@ public interface UserResiInfoDao extends BaseDao { * @date 2020/5/11 11:18 */ IssueInitiatorResultDTO selectIssueInitiator(IssueInitiatorFormDTO formDTO); + + /** + * @return com.epmet.dto.UserResiInfoDTO + * @param userId + * @author yinzuomei + * @description 根据要用户id,查询用户注册的信息 + * @Date 2020/7/22 10:58 + **/ + UserResiInfoDTO selectByUserId(String userId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java index 989c20b2f1..58b864bce3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserRoleDao.java @@ -18,16 +18,18 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.UserRoleDTO; import com.epmet.dto.form.UserRoleFormDTO; import com.epmet.dto.result.UserRoleResultDTO; import com.epmet.entity.UserRoleEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; /** - * 用户角色关系表 + * 用户角色关系表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-30 @@ -52,4 +54,13 @@ public interface UserRoleDao extends BaseDao { **/ List getUserRoleList(UserRoleFormDTO userRoleFormDTO); -} \ No newline at end of file + /** + * 根据用户ID,查询用户所属角色: 多种身份 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:24 2020-07-23 + **/ + Result> getUserRoleInfoByUserId(@Param("userId") String userId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java index 6d03a46a9c..fc00b799bf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserWechatDao.java @@ -55,4 +55,13 @@ public interface UserWechatDao extends BaseDao{ * @CreatedTime 2020/4/26 18:53 */ List selectUserHeadPhotoByUserId(List certifiedResultDTOS); + + /** + * @return com.epmet.entity.UserWechatEntity + * @param + * @author yinzuomei + * @description 查询已经授权的微信用户信息 + * @Date 2020/7/22 10:46 + **/ + List selectAll(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java new file mode 100644 index 0000000000..9a20ef3395 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/UserBaseInfoEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_base_info") +public class UserBaseInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + + /** + * 用户id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名称 + */ + private String name; + + /** + * 姓名 + */ + private String realName; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ + private String nickname; + + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ + private String headImgUrl; + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserBaseInfoExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserBaseInfoExcel.java new file mode 100644 index 0000000000..895c241afd --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/UserBaseInfoExcel.java @@ -0,0 +1,89 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Data +public class UserBaseInfoExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "用户id") + private String userId; + + @Excel(name = "手机号(注册手机号)") + private String mobile; + + @Excel(name = "姓氏") + private String surname; + + @Excel(name = "名称") + private String name; + + @Excel(name = "身份证号") + private String idNum; + + @Excel(name = "性别(1男2女0未知)") + private String gender; + + @Excel(name = "街道") + private String street; + + @Excel(name = "小区名称") + private String district; + + @Excel(name = "楼栋单元") + private String buildingAddress; + + @Excel(name = "昵称(目前来源于微信昵称,后续系统可支持用户有昵称)") + private String nickname; + + @Excel(name = "头像(目前来源于微信,后续系统顾客支持上传头像)") + private String headImgUrl; + + @Excel(name = "删除标识 0-否,1-是") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java new file mode 100644 index 0000000000..1e34bba718 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Component +public class UserBaseInfoRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java new file mode 100644 index 0000000000..d4c13a7c1c --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.entity.UserBaseInfoEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +public interface UserBaseInfoService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-19 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-19 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return UserBaseInfoDTO + * @author generator + * @date 2020-07-19 + */ + UserBaseInfoDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void save(UserBaseInfoDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-19 + */ + void update(UserBaseInfoDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-19 + */ + void delete(String[] ids); + + /** + * @return java.util.List + * @param userIdList + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:35 + **/ + List queryUserBaseInfo(List userIdList); + + /** + * @return void + * @param + * @author yinzuomei + * @description 初始化历史用户信息到user_base_info数据 + * @Date 2020/7/22 10:42 + **/ + void initBaseInfo(); +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java index a22191edb0..c431331236 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserRoleService.java @@ -113,4 +113,13 @@ public interface UserRoleService extends BaseService { */ Result saveUserRole(UserRoleDTO userRoleDTO); -} \ No newline at end of file + /** + * 根据用户ID,查询用户所属角色: 多种身份 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:24 2020-07-23 + **/ + Result> getUserRoleInfoByUserId(String userId); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java new file mode 100644 index 0000000000..f097d83000 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -0,0 +1,201 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.UserBaseInfoDao; +import com.epmet.dao.UserResiInfoDao; +import com.epmet.dao.UserWechatDao; +import com.epmet.dto.UserBaseInfoDTO; +import com.epmet.dto.UserResiInfoDTO; +import com.epmet.dto.UserWechatDTO; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.UserWechatResultDTO; +import com.epmet.entity.UserBaseInfoEntity; +import com.epmet.redis.UserBaseInfoRedis; +import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; +import com.epmet.service.UserBaseInfoService; +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.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-19 + */ +@Service +public class UserBaseInfoServiceImpl extends BaseServiceImpl implements UserBaseInfoService { + + @Autowired + private UserBaseInfoRedis userBaseInfoRedis; + @Autowired + private UserWechatDao userWechatDao; + @Autowired + private UserResiInfoDao userResiInfoDao; + @Autowired + private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, UserBaseInfoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, UserBaseInfoDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public UserBaseInfoDTO get(String id) { + UserBaseInfoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, UserBaseInfoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(UserBaseInfoDTO dto) { + UserBaseInfoEntity entity = ConvertUtils.sourceToTarget(dto, UserBaseInfoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(UserBaseInfoDTO dto) { + UserBaseInfoEntity entity = ConvertUtils.sourceToTarget(dto, UserBaseInfoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param userIdList + * @return java.util.List + * @author yinzuomei + * @description 传入用户id集合,返回用户的基本信息(包含微信基本信息) + * @Date 2020/7/22 9:35 + **/ + @Override + public List queryUserBaseInfo(List userIdList) { + if(null==userIdList||userIdList.size()<1){ + return new ArrayList<>(); + } + List userBaseInfoList=new ArrayList<>(); + for(String userId:userIdList){ + UserBaseInfoResultDTO userBaseInfoResultDTO=baseDao.selectListByUserIdList(userId); + if(null!=userBaseInfoResultDTO){ + UserWechatResultDTO userWechatResultDTO=baseDao.selectUserWechatByUserId(userId); + userBaseInfoResultDTO.setUserWechatResultDTO(userWechatResultDTO); + userBaseInfoList.add(userBaseInfoResultDTO); + } + } + return userBaseInfoList; + } + + /** + * @return void + * @author yinzuomei + * @description 初始化历史用户信息到user_base_info数据 + * @Date 2020/7/22 10:42 + **/ + @Override + public void initBaseInfo() { + List userWechatDTOList=userWechatDao.selectAll(); + List userIdList=new ArrayList<>(); + for(UserWechatDTO userWechatDTO:userWechatDTOList){ + userIdList.add(userWechatDTO.getUserId()); + } + Result> partymemberInfoDTOResult=resiPartyMemberOpenFeignClient.queryPartymemberInfoByUserId(userIdList); + List list=new ArrayList<>(); + if(partymemberInfoDTOResult.success()&&null!=partymemberInfoDTOResult.getData()&&partymemberInfoDTOResult.getData().size()>0){ + list=partymemberInfoDTOResult.getData(); + } + for(UserWechatDTO userWechatDTO:userWechatDTOList){ + //微信信息 + UserBaseInfoEntity userBaseInfoEntity=new UserBaseInfoEntity(); + userBaseInfoEntity.setNickname(userWechatDTO.getNickname()); + userBaseInfoEntity.setHeadImgUrl(userWechatDTO.getHeadImgUrl()); + userBaseInfoEntity.setIdNum(NumConstant.EMPTY_STR); + userBaseInfoEntity.setGender(userWechatDTO.getSex().toString()); + userBaseInfoEntity.setUserId(userWechatDTO.getUserId()); + //居民注册信息 + UserResiInfoDTO userResiInfoDTO=userResiInfoDao.selectByUserId(userWechatDTO.getUserId()); + if(null!=userResiInfoDTO){ + userBaseInfoEntity.setMobile(userResiInfoDTO.getRegMobile()); + userBaseInfoEntity.setSurname(userResiInfoDTO.getSurname()); + userBaseInfoEntity.setName(userResiInfoDTO.getName()); + userBaseInfoEntity.setRealName(userResiInfoDTO.getSurname()+userResiInfoDTO.getName()); + userBaseInfoEntity.setStreet(userResiInfoDTO.getStreet()); + userBaseInfoEntity.setDistrict(userResiInfoDTO.getDistrict()); + userBaseInfoEntity.setBuildingAddress(userResiInfoDTO.getBuildingAddress()); + } + //查询党员信息 + for(PartymemberInfoDTO partymemberInfo:list){ + if(userBaseInfoEntity.getUserId().equals(partymemberInfo.getUserId())){ + userBaseInfoEntity.setIdNum(partymemberInfo.getIdCard()); + break; + } + } + UserBaseInfoResultDTO userBaseInfoResultDTO=baseDao.selectListByUserIdList(userBaseInfoEntity.getUserId()); + if(null==userBaseInfoResultDTO){ + insert(userBaseInfoEntity); + }else{ + userBaseInfoEntity.setId(userBaseInfoResultDTO.getId()); + updateById(userBaseInfoEntity); + } + } + return; + } + + +} \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java index 3650de51fc..4c0eafdad9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserRoleServiceImpl.java @@ -132,4 +132,9 @@ public class UserRoleServiceImpl extends BaseServiceImpl> getUserRoleInfoByUserId(String userId) { + return baseDao.getUserRoleInfoByUserId(userId); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml new file mode 100644 index 0000000000..1bc8034712 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserBaseInfoDao.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml index a95fc89291..724d49a68b 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml @@ -153,4 +153,15 @@ AND uri.del_flag = 0 AND uw.del_flag = 0 + + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml index af3e8cbfbb..803fa40621 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserRoleDao.xml @@ -71,4 +71,21 @@ - \ No newline at end of file + + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml index 48786dc58a..6ed041a555 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserWechatDao.xml @@ -79,4 +79,14 @@ AND del_flag = 0 + +