Browse Source

王公峰:打卡列表

feature/dangjian
wanggongfeng 6 years ago
parent
commit
80a46a3908
  1. 48
      esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppClockListDTO.java
  2. 22
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java
  3. 9
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java
  4. 5
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java
  5. 8
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java
  6. 7
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java
  7. 62
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockListDTO.java
  8. 46
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppClockListDTO.java
  9. 6
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserClockLogController.java
  10. 11
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/AppActUserRelationController.java
  11. 24
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActUserRelationDao.java
  12. 13
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActUserRelationService.java
  13. 15
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java
  14. 36
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserRelationServiceImpl.java
  15. 26
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

48
esua-epdc/epdc-module/epdc-api/epdc-api-client/src/main/java/com/elink/esua/epdc/dto/result/EpdcAppClockListDTO.java

@ -0,0 +1,48 @@
/**
* 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.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 打卡列表
*
* @author wanggongfeng
* @since v1.0.0 2019-12-18
*/
@Data
public class EpdcAppClockListDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 活动打卡人次
*/
private int clockNum;
/**
* 打卡列表
*/
private List<Object> clocks;
}

22
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiActUserRelationController.java

@ -2,6 +2,7 @@ package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.common.token.util.IdentityNoAnalysisUtil;
import com.elink.esua.epdc.commons.tools.annotation.LoginUser;
@ -9,6 +10,7 @@ import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.epdc.result.EpdcUserInfoResultDTO;
import com.elink.esua.epdc.dto.form.EpdcAppActUserClockLogDTO;
import com.elink.esua.epdc.dto.result.EpdcAppClockListDTO;
import com.elink.esua.epdc.service.ActUserRelationService;
import com.elink.esua.epdc.service.AppUserService;
import org.springframework.beans.factory.annotation.Autowired;
@ -116,6 +118,26 @@ public class ApiActUserRelationController {
}
/**
* 打卡列表
*
* @param tokenDto
* @param actId
* @return com.elink.esua.epdc.commons.tools.utils.Result
* @author wanggongfeng
* @date 2019/12/13 14:41
*/
@GetMapping("clockList")
public Result<EpdcAppClockListDTO> getClockList(@LoginUser TokenDto tokenDto, @PathVariable("actId") String actId) {
Result<AppClockListDTO> result = actUserRelationService.getClockList(actId);
EpdcAppClockListDTO epdcAppClockListDTO = ConvertUtils.sourceToTarget(result.getData(), EpdcAppClockListDTO.class);
Result<EpdcAppClockListDTO> result1 = new Result<EpdcAppClockListDTO>();
result1.setData(epdcAppClockListDTO);
return result1;
}
}

9
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/AppActUserRelationFeignClient.java

@ -2,6 +2,7 @@ package com.elink.esua.epdc.feign;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.feign.fallback.AppActUserRelationFeignClientFallback;
@ -36,6 +37,14 @@ public interface AppActUserRelationFeignClient {
@GetMapping("heart/appactuserrelation/activityCancelSignUp/{userId}/{actId}")
Result activityCancelSignUp(@PathVariable("userId") String userId,@PathVariable("actId") String actId);
/**
* 通过活动ID查询人员活动关心信息
* @param actId
* @return
*/
@GetMapping(value = "heart/appactuserrelation/selectListActUserRelation/{actId}")
Result<AppClockListDTO> selectListActUserRelation(@PathVariable("actId") String actId);
/**
* 活动打卡
* @param appActUserClockLogDTO

5
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/AppActUserRelationFeignClientFallback.java

@ -24,6 +24,11 @@ public class AppActUserRelationFeignClientFallback implements AppActUserRelation
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "activityCancelSignUp", userId,actId);
}
@Override
public Result selectListActUserRelation(String actId) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "selectListActUserRelation", actId);
}
@Override
public Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_HEART_SERVER, "activityClock", appActUserClockLogDTO);

8
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/ActUserRelationService.java

@ -2,6 +2,7 @@ package com.elink.esua.epdc.service;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
/**
@ -35,6 +36,13 @@ public interface ActUserRelationService {
*/
Result activityClock(AppActUserClockLogDTO appActUserClockLogDTO);
/**
* 获取活动列表
* @param actId
* @Author wanggongfeng
* @return
*/
Result<AppClockListDTO> getClockList(String actId);

7
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/ActUserRelationServiceImpl.java

@ -2,6 +2,7 @@ package com.elink.esua.epdc.service.impl;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.feign.AppActUserRelationFeignClient;
import com.elink.esua.epdc.service.ActUserRelationService;
@ -39,5 +40,11 @@ public class ActUserRelationServiceImpl implements ActUserRelationService {
return dataResult;
}
@Override
public Result<AppClockListDTO> getClockList(String actId) {
//根据actID获取人员活动关系数据
Result<AppClockListDTO> result = actInfoFeignClient.selectListActUserRelation(actId);
return result;
}
}

62
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/ActClockListDTO.java

@ -0,0 +1,62 @@
/**
* 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 lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 用户打卡列表
*
* @author wanggongfeng
* @since v1.0.0 2019-12-17
*/
@Data
public class ActClockListDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 打卡日志表主键ID
*/
private String id;
/**
* 用户姓名
*/
private String nickname;
/**
* 头像
*/
private String faceImg;
/**
* 党员标志
*/
private String partyFlag;
/**
* 打卡时间
*/
private Date clockTime;
/**
* 打卡描述
*/
private String clockDesc;
}

46
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/AppClockListDTO.java

@ -0,0 +1,46 @@
/**
* 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 lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 用户打卡列表
*
* @author wanggongfeng
* @since v1.0.0 2019-12-17
*/
@Data
public class AppClockListDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 活动打卡人次
*/
private int clockNum;
/**
* 打卡列表
*/
private List<Object> clocks;
}

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

@ -43,7 +43,11 @@ public class AppActUserClockLogController {
@Autowired
private ActUserClockLogService actUserClockLogService;
/**
* 活动打卡
* @param appActUserClockLogDTO
* @return
*/
@PutMapping
public Result activityClock(@RequestBody AppActUserClockLogDTO appActUserClockLogDTO){
//效验数据

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

@ -18,6 +18,7 @@
package com.elink.esua.epdc.modules.activity.controller;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppClockListDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.activity.service.ActUserRelationService;
import org.springframework.beans.factory.annotation.Autowired;
@ -56,4 +57,14 @@ public class AppActUserRelationController {
return actUserRelationService.activityCancelSignUp(userId,actId);
}
/**
* 通过活动ID查询人员活动关心信息
* @param actId
* @return
*/
@GetMapping("selectListActUserRelation/{actId}")
public Result<AppClockListDTO> selectListActUserRelation(@PathVariable("actId")String actId){
return actUserRelationService.selectListActUserRelation(actId);
}
}

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

@ -17,6 +17,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.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.commons.tools.utils.Result;
@ -24,6 +26,8 @@ import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 用户活动关系表
*
@ -40,5 +44,25 @@ public interface ActUserRelationDao extends BaseDao<ActUserRelationEntity> {
*/
int isSignUp(@Param("userId")String userId, @Param("actId")String actId);
/**
* 获取用户活动关系表主键ID
* @param userId
* @param actId
* @return
*/
Result<ActUserRelationDTO> selectOneActUserRelationInfo(@Param("userId")String userId, @Param("actId")String actId);
/**
* 通过活动ID查询人员活动关心信息
* @param actId
* @return
*/
List<ActClockListDTO> selectListActUserRelation(@Param("actId")String actId);
/**
* 查询打卡图片
* @param idArr
* @return
*/
List<ActClockPicDTO> selectListClockImg(@Param("idArr")String[] idArr);
}

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

@ -17,9 +17,10 @@
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.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity;
@ -133,5 +134,15 @@ public interface ActUserRelationService extends BaseService<ActUserRelationEntit
*/
Result updateActivityStatus(ActUserRelationDTO actUserRelationDTO);
/**
* 通过活动ID查询人员活动关心信息
*
* @param actId
* @return ActUserRelationDTO
* @author wanggongfeng
* @date 2019-12-16
*/
Result<AppClockListDTO> selectListActUserRelation(String actId);
}

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

@ -19,6 +19,7 @@ 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.ActClockPicDTO;
import com.elink.esua.epdc.activity.ActUserClockLogDTO;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.AppActUserClockLogDTO;
@ -30,6 +31,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result;
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.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.ActUserRelationService;
import org.apache.commons.lang3.StringUtils;
@ -57,6 +59,9 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
@Autowired
private ActUserRelationService actUserRelationService;
@Autowired
private ActClockPicService actClockPicService;
@Override
public PageData<ActUserClockLogDTO> page(Map<String, Object> params) {
IPage<ActUserClockLogEntity> page = baseDao.selectPage(
@ -124,8 +129,14 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
actUserRelationDTO.setStatus("2");
actUserRelationService.updateActivityStatus(actUserRelationDTO);
//存储打卡图片
List<String> imgList = appActUserClockLogDTO.getImages();
for(int i = 0 ; i < imgList.size() ; i++){
String imgUrl = imgList.get(i);
ActClockPicDTO actClockPicDTO = new ActClockPicDTO();
actClockPicDTO.setClockId(clockId);
actClockPicDTO.setClockPic(imgUrl);
actClockPicService.save(actClockPicDTO);
}
return new Result().ok("打卡成功");
}

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

@ -19,8 +19,7 @@ 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.ActUserLogDTO;
import com.elink.esua.epdc.activity.ActUserRelationDTO;
import com.elink.esua.epdc.activity.*;
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;
@ -36,10 +35,7 @@ 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;
import java.util.*;
/**
* 用户活动关系表
@ -179,4 +175,32 @@ public class ActUserRelationServiceImpl extends BaseServiceImpl<ActUserRelationD
return new Result().ok("更新成功");
}
@Override
public Result<AppClockListDTO> selectListActUserRelation(String actId) {
List<ActClockListDTO> list = baseDao.selectListActUserRelation(actId);
List<Object> resultList = new ArrayList<Object>();
String[] idArr = new String[list.size()];
for(int k = 0 ; k < list.size() ; k++){
Map<String,Object> map = new HashMap<String,Object>();
map.put("nickname",list.get(k).getNickname());
map.put("faceImg",list.get(k).getFaceImg());
map.put("partyFlag",list.get(k).getPartyFlag());
map.put("clockDesc",list.get(k).getClockDesc());
map.put("createdTime",list.get(k).getClockTime());
//查询打卡对应图片
idArr[k] = list.get(k).getId();
List<String> imgList = new ArrayList<String>();
List<ActClockPicDTO> listLog = baseDao.selectListClockImg(idArr);
for(int i = 0 ; i < listLog.size() ; i++){
imgList.add(listLog.get(i).getClockPic());
}
map.put("images",imgList);
resultList.add(map);
}
AppClockListDTO appClockListDTO = new AppClockListDTO();
appClockListDTO.setClockNum(resultList.size());
appClockListDTO.setClocks(resultList);
return new Result<AppClockListDTO>().ok(appClockListDTO);
}
}

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

@ -33,12 +33,36 @@
</select>
<select id="selectOneActUserRelationInfo" resultType="com.elink.esua.epdc.activity.ActUserRelationDTO" parameterType="String">
select *
select ID,ACT_ID,USER_ID,FACE_IMG,NICKNAME,REAL_NAME,PARTY_FLAG
from epdc_act_user_relation
where USER_ID = #{userId}
and ACT_ID = #{actId}
and status not in ('3' ,'4')
</select>
<select id="selectListActUserRelation" resultType="List" parameterType="String">
select
aur.FACE_IMG,
aur.NICKNAME,
aur.PARTY_FLAG,
auc.CLOCK_TIME,
auc.CLOCK_DESC,
auc.ID
from epdc_act_user_relation aur
left join epdc_act_user_clock_log auc on aur.ID = auc.ACT_USER_ID
where aur.DEL_FLAG = '0' and auc.DEL_FLAG = '0'
and aur.ACT_ID = #{actId}
and aur.status in ('2')
</select>
<select id="selectListClockImg" resultType="List">
select CLOCK_ID,CLOCK_PIC
from epdc_act_clock_pic
where DEL_FLAG = '0' and CLOCK_ID IN
<foreach collection="idArr" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
</select>
</mapper>
Loading…
Cancel
Save