Browse Source

代码提交

feature/dangjian
李鹏飞 6 years ago
parent
commit
dc14815e8d
  1. 4
      esua-epdc/epdc-module/epdc-demo/epdc-demo-server/pom.xml
  2. 6
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java
  3. 96
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserPointsLogDTO.java
  4. 4
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoFormDTO.java
  5. 59
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActPointCheckFormDTO.java
  6. 75
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoClockResultDTO.java
  7. 4
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoResultDTO.java
  8. 91
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockLogResultDTO.java
  9. 131
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockResultDTO.java
  10. 40
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActStateConstant.java
  11. 2
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java
  12. 33
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserClockLogController.java
  13. 94
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserPointsLogController.java
  14. 7
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java
  15. 33
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserPointsLogDao.java
  16. 11
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java
  17. 66
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserPointsLogEntity.java
  18. 71
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserPointsLogExcel.java
  19. 47
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserPointsLogRedis.java
  20. 8
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserClockLogService.java
  21. 95
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserPointsLogService.java
  22. 6
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java
  23. 89
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java
  24. 104
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserPointsLogServiceImpl.java
  25. 13
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
  26. 18
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java
  27. 47
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/PointsFeignClient.java
  28. 10
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java
  29. 4
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml
  30. 48
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml
  31. 22
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserPointsLogDao.xml
  32. 113
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml
  33. 7
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/controller/PointsLogsController.java
  34. 13
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java

4
esua-epdc/epdc-module/epdc-demo/epdc-demo-server/pom.xml

@ -86,10 +86,6 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

6
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActInfoDTO.java

@ -95,6 +95,12 @@ public class ActInfoDTO implements Serializable {
*/
private BigDecimal actLatitude;
/**
*活动报名默认状态
*/
private String actUserDefaultState;
/**
* 活动签到打卡地点
*/

96
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActUserPointsLogDTO.java

@ -0,0 +1,96 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.activity;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
*
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-21
*/
@Data
public class ActUserPointsLogDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 用户活动关系表ID
*/
private String actUserId;
/**
* 操作类型 0-系统确认积分2-管理员确认积分4-取消报名扣减积分6-管理员扣减积分8-拒绝积分
*/
private String operationType;
/**
* 操作积分类型 0-减积分1-加积分
*/
private String operationPointsType;
/**
* 操作积分值
*/
private Integer points;
/**
* 处理原因
*/
private String operationReason;
/**
* 删除标识 0-1-
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

4
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActInfoFormDTO.java

@ -65,6 +65,10 @@ public class ActInfoFormDTO implements Serializable {
* 活动开始时间
*/
private Date actStartTime;
/**
*活动报名默认状态
*/
private String actUserDefaultState;
/**
* 活动结束时间

59
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActPointCheckFormDTO.java

@ -0,0 +1,59 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.activity.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 活动信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-11
*/
@Data
public class ActPointCheckFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@NotBlank(message = "id不能为空")
private String id;
/**
* 活动
*/
private String actId;
/**
* 状态
*/
@NotBlank(message = "状态不能为空")
private String status;
/**
* 未通过原因仅当未通过时录入并读取
*/
@NotBlank(message = "原因不能为空")
private String failureReason;
}

75
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoClockResultDTO.java

@ -0,0 +1,75 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.activity.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 活动信息表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-11
*/
@Data
public class ActInfoClockResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 活动
*/
private String actId;
/**
* 活动签到打卡地点
*/
private String address;
/**
* 状态
*/
private String status;
/**
* 原因
*/
private String failureReason;
/**
* 活动签到打卡位置经度
*/
private BigDecimal longitude;
/**
* 活动签到打卡位置纬度
*/
private BigDecimal latitude;
/**
* 活动签到打卡半径(单位)
*/
private Integer radius;
}

4
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActInfoResultDTO.java

@ -53,6 +53,10 @@ public class ActInfoResultDTO implements Serializable {
* 报名开始时间
*/
private Date signupStartTime;
/**
*活动报名默认状态
*/
private String actUserDefaultState;
/**
* 报名截止时间

91
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockLogResultDTO.java

@ -0,0 +1,91 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.activity.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 用户打卡日志表 用户打卡日志表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-17
*/
@Data
public class ActUserClockLogResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 打卡时间
*/
private Date clockTime;
/**
* 打卡位置经度
*/
private BigDecimal clockLongitude;
/**
* 打卡位置纬度
*/
private BigDecimal clockLatitude;
/**
* 打卡地址
*/
private String clockAddress;
/**
* 打卡描述
*/
private String clockDesc;
/**
* 报名人真实姓名
*/
private String realName;
/**
* 性别(0-1-)
*/
private String sex;
/**
* 年龄
*/
private Integer age;
/**
* 联系电话
*/
private String mobile;
/**
* 联系电话
*/
private String clockPic;
}

131
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/result/ActUserClockResultDTO.java

@ -0,0 +1,131 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.activity.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户活动关系表
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-16
*/
@Data
public class ActUserClockResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 活动ID
*/
private String actId;
/**
* 用户ID
*/
private String userId;
/**
* 用户昵称
*/
private String nickname;
/**
* 用户头像
*/
private String faceImg;
/**
* 党员标识0-1-
*/
private String partyFlag;
/**
* 报名人真实姓名
*/
private String realName;
/**
* 性别(0-1-)
*/
private String sex;
/**
* 年龄
*/
private Integer age;
/**
* 联系电话
*/
private String mobile;
/**
* 打卡地点
*/
private String clockAddress;
/**
* 打卡次数
*/
private String clockCount;
/**
* 是否发放积分
*/
private String checkPoint;
/**
* 是否发放积分
*/
private String point;
/**
* 身份证号
*/
private String identityNo;
/**
* 当前状态0-报名1-审核通过2-打卡3-取消报名4-审核不通过
*/
private String status;
/**
* 未通过原因仅当未通过时录入并读取
*/
private String failureReason;
/**
* 审核时间
*/
private Date auditTime;
/**
* 报名时间
*/
private Date signupTime;
}

40
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/constant/ActStateConstant.java

@ -42,6 +42,46 @@ public interface ActStateConstant {
*/
String ACT_USER_RELATION_STATUS_AUDITREJECT = "4";
/**
* 活动报名状态-确认积分
*/
String ACT_USER_RELATION_STATUS_POINTPASS = "5";
/**
* 活动报名状态-拒绝积分
*/
String ACT_USER_RELATION_STATUS_POINTREJECT = "6";
/**
* 积分操作类型-系统通过
*/
String POINT_OPERATION_TYPE_SYSTEMPASS = "0";
/**
* 积分操作类型-管理员通过
*/
String POINT_OPERATION_TYPE_ADMINPASS = "1";
/**
* 积分操作类型-取消扣除
*/
String POINT_OPERATION_TYPE_CANCELDEDUCT = "4";
/**
* 积分操作类型-管理员扣除
*/
String POINT_OPERATION_TYPE_ADMINDEDUCT = "6";
/**
* 积分操作类型-管理员拒绝
*/
String POINT_OPERATION_TYPE_ADMINREJECT = "8";
/**
* 积分类型-增加
*/
String OPERATION_POINTS_TYPE_ADD = "1";
/**
* 积分类型-扣除
*/
String OPERATION_POINTS_TYPE_DEDUCT = "0";
}

2
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActInfoController.java

@ -20,6 +20,7 @@ package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActBannerDTO;
import com.elink.esua.epdc.activity.ActInfoDTO;
import com.elink.esua.epdc.activity.form.ActInfoFormDTO;
import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO;
import com.elink.esua.epdc.activity.result.ActInfoResultDTO;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
@ -75,6 +76,7 @@ public class ActInfoController {
return new Result<ActInfoDTO>().ok(data);
}
@PostMapping
@Transactional(rollbackFor=Exception.class)
public Result save(@RequestBody ActInfoDTO dto){

33
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserClockLogController.java

@ -17,6 +17,11 @@
package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActInfoDTO;
import com.elink.esua.epdc.activity.form.ActPointCheckFormDTO;
import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO;
import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO;
import com.elink.esua.epdc.activity.result.ActUserClockResultDTO;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
@ -28,6 +33,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.activity.ActUserClockLogDTO;
import com.elink.esua.epdc.modules.activity.excel.ActUserClockLogExcel;
import com.elink.esua.epdc.modules.activity.service.ActUserClockLogService;
import com.elink.esua.epdc.modules.activity.service.ActUserRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -49,10 +55,24 @@ public class ActUserClockLogController {
@Autowired
private ActUserClockLogService actUserClockLogService;
@Autowired
private ActUserRelationService actUserRelationService;
@GetMapping("page")
public Result<PageData<ActUserClockLogDTO>> page(@RequestParam Map<String, Object> params){
PageData<ActUserClockLogDTO> page = actUserClockLogService.page(params);
return new Result<PageData<ActUserClockLogDTO>>().ok(page);
public Result<PageData<ActUserClockLogResultDTO>> page(@RequestParam Map<String, Object> params){
PageData<ActUserClockLogResultDTO> page = actUserClockLogService.getActUserClockLogFromPC(params);
return new Result<PageData<ActUserClockLogResultDTO>>().ok(page);
}
@GetMapping("clockPage")
public Result<PageData<ActUserClockResultDTO>> clockPage(@RequestParam Map<String, Object> params){
PageData<ActUserClockResultDTO> page = actUserRelationService.getActUserClockPageFromPC(params);
return new Result<PageData<ActUserClockResultDTO>>().ok(page);
}
@GetMapping("clockDetail/{id}")
public Result<ActInfoClockResultDTO> clockDetail(@PathVariable("id") String id){
ActInfoClockResultDTO data = actUserRelationService.getActDetail(id);
return new Result<ActInfoClockResultDTO>().ok(data);
}
@GetMapping("{id}")
@ -68,6 +88,13 @@ public class ActUserClockLogController {
actUserClockLogService.save(dto);
return new Result();
}
@PostMapping
public Result pointCheck(@RequestBody ActPointCheckFormDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
actUserClockLogService.pointCheck(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ActUserClockLogDTO dto){

94
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActUserPointsLogController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActUserPointsLogDTO;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ExcelUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.AssertUtils;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
import com.elink.esua.epdc.commons.tools.validator.group.AddGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.modules.activity.excel.ActUserPointsLogExcel;
import com.elink.esua.epdc.modules.activity.service.ActUserPointsLogService;
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 qu qu@elink-cn.com
* @since v1.0.0 2019-12-21
*/
@RestController
@RequestMapping("actuserpointslog")
public class ActUserPointsLogController {
@Autowired
private ActUserPointsLogService actUserPointsLogService;
@GetMapping("page")
public Result<PageData<ActUserPointsLogDTO>> page(@RequestParam Map<String, Object> params){
PageData<ActUserPointsLogDTO> page = actUserPointsLogService.page(params);
return new Result<PageData<ActUserPointsLogDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ActUserPointsLogDTO> get(@PathVariable("id") String id){
ActUserPointsLogDTO data = actUserPointsLogService.get(id);
return new Result<ActUserPointsLogDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ActUserPointsLogDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
actUserPointsLogService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ActUserPointsLogDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
actUserPointsLogService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
actUserPointsLogService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ActUserPointsLogDTO> list = actUserPointsLogService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ActUserPointsLogExcel.class);
}
}

7
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserClockLogDao.java

@ -17,10 +17,15 @@
package com.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO;
import com.elink.esua.epdc.activity.result.ActUserClockResultDTO;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
import java.util.Map;
/**
* 用户打卡日志表 用户打卡日志表
*
@ -29,5 +34,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ActUserClockLogDao extends BaseDao<ActUserClockLogEntity> {
List<ActUserClockLogResultDTO> getActUserClockLogFromPC(Map<String, Object> params);
}

33
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserPointsLogDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity;
import org.apache.ibatis.annotations.Mapper;
/**
*
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-21
*/
@Mapper
public interface ActUserPointsLogDao extends BaseDao<ActUserPointsLogEntity> {
}

11
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java

@ -20,6 +20,8 @@ package com.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.activity.ActClockListDTO;
import com.elink.esua.epdc.activity.ActClockPicDTO;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO;
import com.elink.esua.epdc.activity.result.ActUserClockResultDTO;
import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
@ -60,6 +62,13 @@ public interface ActUserRelationDao extends BaseDao<ActUserRelationEntity> {
*/
List<ActClockListDTO> selectListActUserRelation(@Param("actId")String actId);
/**
* 通过人员活动关系信息
* @param id
* @return
*/
ActInfoClockResultDTO getActDetail(@Param("id")String id);
/**
* 查询打卡图片
* @param idArr
@ -74,4 +83,6 @@ public interface ActUserRelationDao extends BaseDao<ActUserRelationEntity> {
* @Date: 2019/9/5 19:42
*/
List<ActUserRelationResultDTO> getActUserRelationPageFromPC(Map<String, Object> params);
List<ActUserClockResultDTO> getActUserClockPageFromPC(Map<String, Object> params);
}

66
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/entity/ActUserPointsLogEntity.java

@ -0,0 +1,66 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.BaseEpdcEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("epdc_act_user_points_log")
public class ActUserPointsLogEntity extends BaseEpdcEntity {
private static final long serialVersionUID = 1L;
/**
* 用户活动关系表ID
*/
private String actUserId;
/**
* 操作类型 0-系统确认积分2-管理员确认积分4-取消报名扣减积分6-管理员扣减积分8-拒绝积分
*/
private String operationType;
/**
* 操作积分类型 0-减积分1-加积分
*/
private String operationPointsType;
/**
* 操作积分值
*/
private Integer points;
/**
* 处理原因
*/
private String operationReason;
}

71
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/excel/ActUserPointsLogExcel.java

@ -0,0 +1,71 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
*
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-21
*/
@Data
public class ActUserPointsLogExcel {
@Excel(name = "主键")
private String id;
@Excel(name = "用户活动关系表ID")
private String actUserId;
@Excel(name = "操作类型 0-系统确认积分,2-管理员确认积分,4-取消报名扣减积分,6-管理员扣减积分,8-拒绝积分")
private String operationType;
@Excel(name = "操作积分类型 0-减积分,1-加积分")
private String operationPointsType;
@Excel(name = "操作积分值")
private Integer points;
@Excel(name = "处理原因")
private String operationReason;
@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;
}

47
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/redis/ActUserPointsLogRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.redis;
import com.elink.esua.epdc.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
*
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-21
*/
@Component
public class ActUserPointsLogRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

8
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserClockLogService.java

@ -19,6 +19,9 @@ package com.elink.esua.epdc.modules.activity.service;
import com.elink.esua.epdc.activity.ActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.form.ActPointCheckFormDTO;
import com.elink.esua.epdc.activity.result.ActInfoResultDTO;
import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
@ -45,6 +48,9 @@ public interface ActUserClockLogService extends BaseService<ActUserClockLogEntit
*/
PageData<ActUserClockLogDTO> page(Map<String, Object> params);
PageData<ActUserClockLogResultDTO> getActUserClockLogFromPC(Map<String, Object> params);
/**
* 默认查询
*
@ -75,6 +81,8 @@ public interface ActUserClockLogService extends BaseService<ActUserClockLogEntit
*/
void save(ActUserClockLogDTO dto);
void pointCheck(ActPointCheckFormDTO dto);
/**
* 默认更新
*

95
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserPointsLogService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.service;
import com.elink.esua.epdc.activity.ActUserPointsLogDTO;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity;
import java.util.List;
import java.util.Map;
/**
*
*
* @author qu qu@elink-cn.com
* @since v1.0.0 2019-12-21
*/
public interface ActUserPointsLogService extends BaseService<ActUserPointsLogEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ActUserPointsLogDTO>
* @author generator
* @date 2019-12-21
*/
PageData<ActUserPointsLogDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ActUserPointsLogDTO>
* @author generator
* @date 2019-12-21
*/
List<ActUserPointsLogDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ActUserPointsLogDTO
* @author generator
* @date 2019-12-21
*/
ActUserPointsLogDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2019-12-21
*/
void save(ActUserPointsLogDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2019-12-21
*/
void update(ActUserPointsLogDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2019-12-21
*/
void delete(String[] ids);
}

6
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java

@ -20,6 +20,8 @@ package com.elink.esua.epdc.modules.activity.service;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.activity.form.ActUserRelationAuditFormDTO;
import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO;
import com.elink.esua.epdc.activity.result.ActUserClockResultDTO;
import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO;
import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
@ -69,6 +71,10 @@ public interface ActUserRelationService extends BaseService<ActUserRelationEntit
PageData<ActUserRelationResultDTO> getActUserRelationPageFromPC (Map<String, Object> params);
PageData<ActUserClockResultDTO> getActUserClockPageFromPC (Map<String, Object> params);
ActInfoClockResultDTO getActDetail(String id);
/**
* 默认保存
*

89
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java

@ -20,18 +20,23 @@ package com.elink.esua.epdc.modules.activity.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.activity.*;
import com.elink.esua.epdc.activity.form.ActPointCheckFormDTO;
import com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO;
import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.ActStateConstant;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.modules.activity.dao.ActUserClockLogDao;
import com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity;
import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
import com.elink.esua.epdc.modules.activity.redis.ActUserClockLogRedis;
import com.elink.esua.epdc.modules.activity.service.ActClockPicService;
import com.elink.esua.epdc.modules.activity.service.ActUserClockLogService;
import com.elink.esua.epdc.modules.activity.service.ActUserLogService;
import com.elink.esua.epdc.modules.activity.service.ActUserRelationService;
import com.elink.esua.epdc.modules.activity.service.*;
import com.elink.esua.epdc.modules.feign.UserFeignClient;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -62,6 +67,14 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
@Autowired
private ActUserLogService actUserLogService;
@Autowired
private ActUserPointsLogService actUserPointsLogService;
@Autowired
private ActInfoService actInfoService;
@Autowired
private UserFeignClient userFeignClient;
@Override
public PageData<ActUserClockLogDTO> page(Map<String, Object> params) {
@ -71,6 +84,12 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
);
return getPageData(page, ActUserClockLogDTO.class);
}
@Override
public PageData<ActUserClockLogResultDTO> getActUserClockLogFromPC(Map<String, Object> params) {
IPage<ActUserClockLogResultDTO> page = getPage(params);
List<ActUserClockLogResultDTO> list = baseDao.getActUserClockLogFromPC(params);
return new PageData<>(list, page.getTotal());
}
@Override
public List<ActUserClockLogDTO> list(Map<String, Object> params) {
@ -100,7 +119,69 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
ActUserClockLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserClockLogEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void pointCheck(ActPointCheckFormDTO dto) {
ActInfoDTO actInfoDTO = actInfoService.get(dto.getActId());
ActUserPointsLogDTO pointsLogEntity = new ActUserPointsLogDTO();
pointsLogEntity.setActUserId(dto.getId());
pointsLogEntity.setOperationReason(dto.getFailureReason());
//确认加积分
Integer point = 0;
if (ActStateConstant.ACT_USER_RELATION_STATUS_POINTPASS.equals(dto.getStatus())) {
pointsLogEntity.setOperationType(ActStateConstant.POINT_OPERATION_TYPE_ADMINPASS);
pointsLogEntity.setOperationPointsType(ActStateConstant.OPERATION_POINTS_TYPE_ADD);
point =actInfoDTO.getReward();
pointsLogEntity.setPoints(point);
//拒绝加积分
} else if (ActStateConstant.ACT_USER_RELATION_STATUS_POINTREJECT.equals(dto.getStatus())) {
pointsLogEntity.setOperationType(ActStateConstant.POINT_OPERATION_TYPE_ADMINREJECT);
pointsLogEntity.setOperationPointsType(ActStateConstant.OPERATION_POINTS_TYPE_DEDUCT);
pointsLogEntity.setPoints(point);
}
//增加积分记录
actUserPointsLogService.save(pointsLogEntity);
// 更新用户状态
userInfoHandle(dto,point);
}
private Result userInfoHandle(ActPointCheckFormDTO dto,Integer point){
boolean resultFlg = false;
//用户关系表状态更新
ActUserRelationDTO checkDTO =actUserRelationService.get(dto.getId());
ActUserRelationDTO actUserRelationEntity = new ActUserRelationDTO();
actUserRelationEntity.setId(dto.getId());
actUserRelationEntity.setStatus(dto.getStatus());
actUserRelationEntity.setFailureReason(dto.getFailureReason());
actUserRelationService.update(actUserRelationEntity);
//存储活动日志表 epdc_act_user_log
ActUserLogDTO actUserLogDTO = new ActUserLogDTO();
actUserLogDTO.setUserId(checkDTO.getUserId());
actUserLogDTO.setActId(dto.getActId());
actUserLogDTO.setOperationType(dto.getStatus());
actUserLogDTO.setOperationTime(new Date());
actUserLogService.save(actUserLogDTO);
//更新用户积分
Result<UserDTO> result = userFeignClient.getUserInfoById(checkDTO.getUserId());
if (result.success() && null != result.getData()) {
UserDTO updateUserDTO = result.getData();
//增加用户积分
updateUserDTO.setPoints(updateUserDTO.getPoints() + point);
Result userResult = userFeignClient.updateUserInfo(updateUserDTO);
if (userResult.success()) {
return null;
} else {
return new Result().error("用户信息更新失败。");
}
} else {
return new Result().error("用户信息获取失败。");
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ActUserClockLogDTO dto) {

104
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserPointsLogServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.elink.esua.epdc.modules.activity.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.activity.ActUserPointsLogDTO;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.modules.activity.dao.ActUserPointsLogDao;
import com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity;
import com.elink.esua.epdc.modules.activity.redis.ActUserPointsLogRedis;
import com.elink.esua.epdc.modules.activity.service.ActUserPointsLogService;
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 qu qu@elink-cn.com
* @since v1.0.0 2019-12-21
*/
@Service
public class ActUserPointsLogServiceImpl extends BaseServiceImpl<ActUserPointsLogDao, ActUserPointsLogEntity> implements ActUserPointsLogService {
@Autowired
private ActUserPointsLogRedis actUserPointsLogRedis;
@Override
public PageData<ActUserPointsLogDTO> page(Map<String, Object> params) {
IPage<ActUserPointsLogEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ActUserPointsLogDTO.class);
}
@Override
public List<ActUserPointsLogDTO> list(Map<String, Object> params) {
List<ActUserPointsLogEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ActUserPointsLogDTO.class);
}
private QueryWrapper<ActUserPointsLogEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ActUserPointsLogEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ActUserPointsLogDTO get(String id) {
ActUserPointsLogEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ActUserPointsLogDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ActUserPointsLogDTO dto) {
ActUserPointsLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserPointsLogEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ActUserPointsLogDTO dto) {
ActUserPointsLogEntity entity = ConvertUtils.sourceToTarget(dto, ActUserPointsLogEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

13
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java

@ -22,6 +22,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.activity.ActUserLogDTO;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.form.ActUserRelationAuditFormDTO;
import com.elink.esua.epdc.activity.result.ActInfoClockResultDTO;
import com.elink.esua.epdc.activity.result.ActUserClockResultDTO;
import com.elink.esua.epdc.activity.result.ActUserRelationResultDTO;
import com.elink.esua.epdc.activity.*;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
@ -71,7 +73,18 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
List<ActUserRelationResultDTO> list = baseDao.getActUserRelationPageFromPC(params);
return new PageData<>(list, page.getTotal());
}
@Override
public PageData<ActUserClockResultDTO> getActUserClockPageFromPC(Map<String, Object> params) {
IPage<ActUserClockResultDTO> page = getPage(params);
List<ActUserClockResultDTO> list = baseDao.getActUserClockPageFromPC(params);
return new PageData<>(list, page.getTotal());
}
@Override
public ActInfoClockResultDTO getActDetail(String id) {
ActInfoClockResultDTO resultDTO = baseDao.getActDetail(id);
return resultDTO;
}
@Override
public List<ActUserRelationDTO> list(Map<String, Object> params) {
List<ActUserRelationEntity> entityList = baseDao.selectList(getWrapper(params));

18
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/UserFeignClient.java

@ -2,10 +2,13 @@ package com.elink.esua.epdc.modules.feign;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO;
import com.elink.esua.epdc.modules.feign.fallback.UserFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@ -27,4 +30,19 @@ public interface UserFeignClient {
@GetMapping("app-user/epdc-app/volunteerinfo/getRankingList")
Result<List<EpdcGetVolunteerRankDTO>> getRankingList();
@GetMapping("app-user/epdc-app/user/getById/{userId}")
Result<UserDTO> getUserInfoById(@PathVariable("userId") String userId);
/**
* 更新用户信息
*
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @params [userDTO]
* @author liuchuang
* @since 2019/10/25 17:07
*/
@PostMapping("app-user/epdc-app/user/updateUserInfo")
Result updateUserInfo(UserDTO userDTO);
}

47
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/PointsFeignClient.java

@ -0,0 +1,47 @@
package com.elink.esua.epdc.modules.feign.fallback;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
/**
*
* 调用用户模块
*
* @Authorwanggongfeng
* @Date2019/12/16 17:36
*/
@FeignClient(name = ServiceConstant., fallback = UserFeignClientFallback.class)
public interface PointsFeignClient {
/**
* 获取排行榜
*
* @return
*/
@GetMapping("app-user/epdc-app/volunteerinfo/getRankingList")
Result<List<EpdcGetVolunteerRankDTO>> getRankingList();
@GetMapping("app-user/epdc-app/user/getById/{userId}")
Result<UserDTO> getUserInfoById(@PathVariable("userId") String userId);
/**
* 更新用户信息
*
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @params [userDTO]
* @author liuchuang
* @since 2019/10/25 17:07
*/
@PostMapping("app-user/epdc-app/user/updateUserInfo")
Result updateUserInfo(UserDTO userDTO);
}

10
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/UserFeignClientFallback.java

@ -3,6 +3,7 @@ package com.elink.esua.epdc.modules.feign.fallback;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.UserDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO;
import com.elink.esua.epdc.modules.feign.UserFeignClient;
import org.springframework.stereotype.Component;
@ -25,5 +26,12 @@ public class UserFeignClientFallback implements UserFeignClient {
public Result<List<EpdcGetVolunteerRankDTO>> getRankingList() {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getRankingList");
}
@Override
public Result<UserDTO> getUserInfoById(String userId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "getUserInfoById", userId);
}
@Override
public Result updateUserInfo(UserDTO userDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "updateUserInfo", userDTO);
}
}

4
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActInfoDao.xml

@ -74,6 +74,7 @@
<result property="deptId" column="DEPT_ID"/>
<result property="punishmentPoints" column="PUNISHMENT_POINTS"/>
<result property="reward" column="REWARD"/>
<result property="ACT_USER_DEFAULT_STATE" column="actUserDefaultState"/>
</resultMap>
<select id="getActInfoPageFromPC" resultMap="actResultMap">
SELECT
@ -109,7 +110,8 @@
actInfo.SPONSOR,
actInfo.DEPT_ID,
actInfo.PUNISHMENT_POINTS,
actInfo.REWARD
actInfo.REWARD,
actInfo.ACT_USER_DEFAULT_STATE
FROM
epdc_act_info actInfo
WHERE

48
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserClockLogDao.xml

@ -5,19 +5,49 @@
<resultMap type="com.elink.esua.epdc.modules.activity.entity.ActUserClockLogEntity" id="actUserClockLogMap">
<result property="id" column="ID"/>
<result property="actUserId" column="ACT_USER_ID"/>
<result property="clockType" column="CLOCK_TYPE"/>
<result property="clockTime" column="CLOCK_TIME"/>
<result property="clockLongitude" column="CLOCK_LONGITUDE"/>
<result property="clockLatitude" column="CLOCK_LATITUDE"/>
<result property="clockAddress" column="CLOCK_ADDRESS"/>
<result property="clockDesc" column="CLOCK_DESC"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<resultMap type="com.elink.esua.epdc.activity.result.ActUserClockLogResultDTO" id="actUserClockLogResultMap">
<result property="id" column="ID"/>
<result property="clockTime" column="CLOCK_TIME"/>
<result property="clockLongitude" column="CLOCK_LONGITUDE"/>
<result property="clockLatitude" column="CLOCK_LATITUDE"/>
<result property="clockAddress" column="CLOCK_ADDRESS"/>
<result property="clockDesc" column="CLOCK_DESC"/>
<result property="realName" column="REAL_NAME"/>
<result property="sex" column="SEX"/>
<result property="age" column="AGE"/>
<result property="mobile" column="MOBILE"/>
<result property="clockPic" column="CLOCK_PIC"/>
</resultMap>
<select id="getActUserClockLogFromPC" resultMap="actUserClockLogResultMap">
SELECT
log.ID,
log.CLOCK_TIME,
log.CLOCK_LONGITUDE,
log.CLOCK_LATITUDE,
log.CLOCK_ADDRESS,
log.CLOCK_DESC,
relation.REAL_NAME,
relation.SEX,
relation.AGE,
relation.MOBILE,
pic.CLOCK_PIC
FROM
epdc_act_user_clock_log log
LEFT JOIN epdc_act_user_relation relation ON log.ACT_USER_ID = relation.ID
AND relation.DEL_FLAG = '0'
LEFT JOIN epdc_act_clock_pic pic ON pic.CLOCK_ID = log.ID
AND pic.DEL_FLAG = '0'
WHERE
log.DEL_FLAG = '0'
<if test="id != null and id != ''">
AND log.ACT_USER_ID = #{id}
</if>
ORDER BY log.CREATED_TIME DESC
</select>
</mapper>

22
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserPointsLogDao.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.elink.esua.epdc.dao.ActUserPointsLogDao">
<resultMap type="com.elink.esua.epdc.modules.activity.entity.ActUserPointsLogEntity" id="actUserPointsLogMap">
<result property="id" column="ID"/>
<result property="actUserId" column="ACT_USER_ID"/>
<result property="operationType" column="OPERATION_TYPE"/>
<result property="operationPointsType" column="OPERATION_POINTS_TYPE"/>
<result property="points" column="POINTS"/>
<result property="operationReason" column="OPERATION_REASON"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

113
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

@ -100,6 +100,119 @@
ORDER BY
relation.CREATED_TIME DESC
</select>
<resultMap type="com.elink.esua.epdc.activity.result.ActUserClockResultDTO" id="actUserClockResultMap">
<result property="id" column="ID"/>
<result property="actId" column="ACT_ID"/>
<result property="userId" column="USER_ID"/>
<result property="nickname" column="NICKNAME"/>
<result property="faceImg" column="FACE_IMG"/>
<result property="partyFlag" column="PARTY_FLAG"/>
<result property="realName" column="REAL_NAME"/>
<result property="sex" column="SEX"/>
<result property="age" column="AGE"/>
<result property="mobile" column="MOBILE"/>
<result property="identityNo" column="IDENTITY_NO"/>
<result property="status" column="STATUS"/>
<result property="failureReason" column="FAILURE_REASON"/>
<result property="auditTime" column="AUDIT_TIME"/>
<result property="signupTime" column="SIGNUP_TIME"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="getActUserClockPageFromPC" resultMap="actUserClockResultMap">
SELECT
relation.ID,
relation.ACT_ID,
relation.USER_ID,
relation.NICKNAME,
relation.FACE_IMG,
relation.PARTY_FLAG,
relation.REAL_NAME,
relation.SEX,
relation.AGE,
relation.MOBILE,
relation.IDENTITY_NO,
relation.STATUS,
relation.FAILURE_REASON,
relation.AUDIT_TIME,
relation.SIGNUP_TIME,
info.SIGNIN_ADDRESS AS clockAddress,
IF(relation.STATUS ='5','1','0') as checkPoint,
info.REWARD as point,
clock.clockCount
FROM
epdc_act_user_relation relation
LEFT JOIN
(SELECT
COUNT( * ) AS clockCount,
ACT_USER_ID
FROM
epdc_act_user_clock_log
WHERE
DEL_FLAG = '0'
GROUP BY
ACT_USER_ID) clock
ON clock.ACT_USER_ID = relation.ID
LEFT JOIN
epdc_act_info info
ON info.ID = relation.ACT_ID AND info.DEL_FLAG = '0'
WHERE
relation.DEL_FLAG = '0'
AND relation.STATUS IN ('1','2','5','6')
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
AND DATE_FORMAT( relation.CREATED_TIME, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
</if>
<if test="status != null and status != ''">
AND relation.STATUS = #{status}
</if>
<if test="mobile != null and mobile != ''">
AND relation.MOBILE = #{mobile}
</if>
<if test="realName != null and realName != ''">
AND relation.REAL_NAME = #{realName}
</if>
<if test="actId != null and actId != ''">
AND relation.ACT_ID = #{actId}
</if>
ORDER BY
relation.CREATED_TIME DESC
</select>
<resultMap type="com.elink.esua.epdc.activity.result.ActInfoClockResultDTO" id="actInfoClockResultMap">
<result property="id" column="ID"/>
<result property="actId" column="ACT_ID"/>
<result property="status" column="STATUS"/>
<result property="failureReason" column="FAILURE_REASON"/>
<result property="address" column="SIGNIN_ADDRESS"/>
<result property="latitude" column="SIGNIN_LATITUDE"/>
<result property="longitude" column="SIGNIN_LONGITUDE"/>
<result property="radius" column="CLOCK_RADIUS"/>
</resultMap>
<select id="getActDetail" resultMap="actInfoClockResultMap">
SELECT
relation.ID,
relation.ACT_ID,
relation.STATUS,
relation.FAILURE_REASON,
info.SIGNIN_ADDRESS,
info.SIGNIN_LATITUDE,
info.SIGNIN_LONGITUDE,
info.CLOCK_RADIUS
FROM
epdc_act_user_relation relation
LEFT JOIN
epdc_act_info info
ON info.ID = relation.ACT_ID AND info.DEL_FLAG = '0'
WHERE
relation.DEL_FLAG = '0'
AND relation.ID = #{id}
ORDER BY
relation.CREATED_TIME DESC
</select>
<select id="selectListActUserRelation" resultType="com.elink.esua.epdc.activity.ActClockListDTO" parameterType="String">
select

7
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/modules/logs/controller/PointsLogsController.java

@ -69,7 +69,12 @@ public class PointsLogsController {
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return pointsLogsService.save(dto);
}
@PostMapping("addPointsLog")
public Result addPointsLog(@RequestBody PointsLogsDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
return pointsLogsService.save(dto);
}
@PutMapping
public Result update(@RequestBody PointsLogsDTO dto){
//效验数据

13
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/controller/EpdcAppUserController.java

@ -242,6 +242,19 @@ public class EpdcAppUserController {
userService.update(user);
return new Result();
}
/**
* 更新用户信息
*
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @params [userDTO]
* @author liuchuang
* @since 2019/10/25 17:10
*/
@PostMapping("updateUserInfo")
public Result updateUserInfo(@RequestBody UserDTO userDto) {
userService.update(userDto);
return new Result();
}
/**
* 验证用户完善个人信息时提交的数据校验成功返回用户当前状态

Loading…
Cancel
Save