|
|
@ -19,23 +19,29 @@ package com.epmet.service.impl; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
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.constant.UserResiRegisterConstant; |
|
|
|
import com.epmet.dao.UserResiInfoDao; |
|
|
|
import com.epmet.dto.UserResiInfoDTO; |
|
|
|
import com.epmet.dto.form.UserResiInfoFormDTO; |
|
|
|
import com.epmet.entity.UserResiInfoEntity; |
|
|
|
import com.epmet.redis.UserResiInfoRedis; |
|
|
|
import com.epmet.service.RegisterRelationService; |
|
|
|
import com.epmet.service.UserResiInfoService; |
|
|
|
import com.epmet.service.UserResiRegisterVisitService; |
|
|
|
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.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
@ -50,6 +56,12 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private UserResiInfoRedis userResiInfoRedis; |
|
|
|
@Autowired |
|
|
|
private UserResiRegisterVisitService userResiRegisterVisitService; |
|
|
|
@Autowired |
|
|
|
private UserResiInfoDao userResiInfoDao; |
|
|
|
@Autowired |
|
|
|
private RegisterRelationService registerRelationService; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<UserResiInfoDTO> page(Map<String, Object> params) { |
|
|
@ -120,4 +132,42 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us |
|
|
|
return new Result<UserResiInfoDTO>().ok(userResiInfoDTO); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result submit(UserResiInfoDTO userResiInfoDTO) { |
|
|
|
Result result = new Result(); |
|
|
|
//1:手机验证码数据校验//TODO
|
|
|
|
|
|
|
|
//2:验证码校验失败则更新行为记录表数据 返回前台结果
|
|
|
|
if (false) { |
|
|
|
userResiRegisterVisitService.updateResiRegisterVisit(false, userResiInfoDTO); |
|
|
|
result.setMsg(UserResiRegisterConstant.MOBILECODE_EXCEPTION); |
|
|
|
return result; |
|
|
|
} |
|
|
|
//3:校验成功 数据存入居民注册表 更新行为记录表数据
|
|
|
|
saveUserResiInfo(userResiInfoDTO); |
|
|
|
result = userResiRegisterVisitService.updateResiRegisterVisit(true, userResiInfoDTO); |
|
|
|
//4:居民注册关系表新增数据 首次注册数加一 注册数加一 参与数加一
|
|
|
|
result = registerRelationService.saveRegisterRelation(userResiInfoDTO); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 居民注册信息表新增数据 |
|
|
|
* |
|
|
|
* @param userResiInfoDTO |
|
|
|
* @Author sun |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void saveUserResiInfo(UserResiInfoDTO userResiInfoDTO) { |
|
|
|
Date date = new Date(); |
|
|
|
userResiInfoDTO.setId(IdWorker.get32UUID()); |
|
|
|
userResiInfoDTO.setDelFlag(NumConstant.ZERO); |
|
|
|
userResiInfoDTO.setRevision(NumConstant.ZERO); |
|
|
|
userResiInfoDTO.setCreatedBy(userResiInfoDTO.getUserId()); |
|
|
|
userResiInfoDTO.setCreatedTime(date); |
|
|
|
userResiInfoDTO.setUpdatedBy(userResiInfoDTO.getUserId()); |
|
|
|
userResiInfoDTO.setUpdatedTime(date); |
|
|
|
userResiInfoDao.saveUserResiInfo(userResiInfoDTO); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|