Browse Source

积分清零bug修改

feature/screenDataPush
songyunpeng 4 years ago
parent
commit
1680ad88c8
  1. 8
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/dao/PointsLogsDao.java
  2. 7
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java
  3. 6
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml
  4. 3
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java

8
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/dao/PointsLogsDao.java

@ -198,4 +198,12 @@ public interface PointsLogsDao extends BaseDao<PointsLogsEntity> {
* @return void
**/
void maBindUnIdLogs(@Param("oldUserId") String oldUserId, @Param("newUserId") String newUserId, @Param("faceImg") String faceImg);
/**
* @Description 批量新增
* @Author songyunpeng
* @Date 2021/7/29
* @Param [list]
* @return void
**/
void insertBatchPointsResetLogs(List<PointsLogsEntity> list);
}

7
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/java/com/elink/esua/epdc/service/impl/PointsLogsServiceImpl.java

@ -594,9 +594,10 @@ public class PointsLogsServiceImpl extends BaseServiceImpl<PointsLogsDao, Points
@Override
public Result insertPointsResetLogs(List<UserDTO> formDTO) {
List<PointsLogsEntity> list = new ArrayList<>();
Result<BehaviorResultDto> behaviorCodeInfoByBehaviorCode = pointsBehaviorService.getBehaviorCodeInfoByBehaviorCode(BehaviorEnum.POINTS_RESET.getValue());
for (UserDTO formDto : formDTO) {
//根据动作编码获取动作信息
Result<BehaviorResultDto> behaviorCodeInfoByBehaviorCode = pointsBehaviorService.getBehaviorCodeInfoByBehaviorCode(BehaviorEnum.POINTS_RESET.getValue());
PointsLogsEntity pointsLogsEntity = new PointsLogsEntity();
pointsLogsEntity.setUserId(formDto.getId());
pointsLogsEntity.setNickname(formDto.getNickname());
@ -619,9 +620,9 @@ public class PointsLogsServiceImpl extends BaseServiceImpl<PointsLogsDao, Points
pointsLogsEntity.setAllDeptNames(formDto.getAllDeptNames());
pointsLogsEntity.setParentDeptIds(formDto.getParentDeptIds());
pointsLogsEntity.setParentDeptNames(formDto.getParentDeptNames());
insert(pointsLogsEntity);
list.add(pointsLogsEntity);
}
baseDao.insertBatchPointsResetLogs(list);
return new Result();
}

6
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/mapper/PointsLogsDao.xml

@ -22,6 +22,12 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<insert id="insertBatchPointsResetLogs">
insert into epdc_points_logs(ID, USER_ID, NICKNAME, REFERENCE_ID, RULE_CODE, BEHAVIOR_CODE, OPERATION_TYPE, POINTS, OPERATION_DESC, OPERATION_TIME, OPERATION_MODE, LAVE_POINTS, REVISION, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME, FACE_IMG, VOLUNTEER_ID, GRID_ID, GRID, ALL_DEPT_IDS, ALL_DEPT_NAMES, PARENT_DEPT_IDS, PARENT_DEPT_NAMES,REMARK, REAL_NAME) VALUES
<foreach collection="list" item="points" separator=",">
(MD5(UUID()),#{points.userId},#{points.nickname},#{points.referenceId},#{points.ruleCode},#{points.behaviorCode},#{points.operationType},#{points.points},#{points.operationDesc},#{points.operationTime},#{points.operationMode},#{points.lavePoints},0,0,0,now(),0,now(),#{points.faceImg},#{points.volunteerId},#{points.gridId},#{points.grid},#{points.allDeptIds},#{points.allDeptNames},#{points.parentDeptIds},#{points.parentDeptNames},#{points.remark},#{points.realName})
</foreach>
</insert>
<select id="selectListPointsRecord" resultType="com.elink.esua.epdc.dto.result.EpdcAppPointsRecordResultDTO">
SELECT

3
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java

@ -1560,6 +1560,9 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
QueryWrapper<UserEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.gt("POINTS",0);
List<UserEntity> userEntities = baseDao.selectList(queryWrapper);
if(userEntities.size()==0){
return new Result();
}
//插入到积分日志表 - 新增积分清零记录
Result result = pointsFeignClient.insertPointsResetLogs(ConvertUtils.sourceToTarget(userEntities, UserDTO.class));
if(result.success()){

Loading…
Cancel
Save