|
@ -19,12 +19,14 @@ package com.epmet.modules.warmhearted.service.impl; |
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
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.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
|
|
import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant; |
|
|
import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao; |
|
|
import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao; |
|
|
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; |
|
|
import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; |
|
|
import com.epmet.modules.warmhearted.redis.ResiWarmheartedApplyRedis; |
|
|
import com.epmet.modules.warmhearted.redis.ResiWarmheartedApplyRedis; |
|
@ -32,6 +34,7 @@ import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService; |
|
|
import com.epmet.modules.warmhearted.service.ResiWarmheartedVisitService; |
|
|
import com.epmet.modules.warmhearted.service.ResiWarmheartedVisitService; |
|
|
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; |
|
|
import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; |
|
|
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|
|
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; |
|
|
|
|
|
import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedSubmitFormDTO; |
|
|
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|
|
import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmheartedResultDTO; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
@ -39,9 +42,13 @@ import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
import java.util.Arrays; |
|
|
|
|
|
import java.util.Date; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 热心居民申请表 |
|
|
* 热心居民申请表 |
|
|
* |
|
|
* |
|
@ -51,6 +58,7 @@ import java.util.Map; |
|
|
@Service |
|
|
@Service |
|
|
public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmheartedApplyDao, ResiWarmheartedApplyEntity> implements ResiWarmheartedApplyService { |
|
|
public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmheartedApplyDao, ResiWarmheartedApplyEntity> implements ResiWarmheartedApplyService { |
|
|
|
|
|
|
|
|
|
|
|
private static final Logger log = LoggerFactory.getLogger(ResiWarmheartedApplyServiceImpl.class); |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ResiWarmheartedApplyRedis resiWarmheartedApplyRedis; |
|
|
private ResiWarmheartedApplyRedis resiWarmheartedApplyRedis; |
|
|
@Autowired |
|
|
@Autowired |
|
@ -112,7 +120,7 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Result<ResiWarmheartedResultDTO> getResiWarmheartedApply(ResiWarmheartedFormDTO formDTO) { |
|
|
public Result<ResiWarmheartedResultDTO> init(ResiWarmheartedFormDTO formDTO) { |
|
|
//1:热心居民申请行为记录表新增数据
|
|
|
//1:热心居民申请行为记录表新增数据
|
|
|
ResiWarmheartedResultDTO resiWarmheartedResultDTO = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO); |
|
|
ResiWarmheartedResultDTO resiWarmheartedResultDTO = resiWarmheartedVisitService.saveResiWarmheartedVisit(formDTO); |
|
|
//2:查询是否已申请热心居民
|
|
|
//2:查询是否已申请热心居民
|
|
@ -126,5 +134,39 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl<ResiWarmhea |
|
|
return new Result<ResiWarmheartedResultDTO>().ok(resiWarmheartedResultDTO); |
|
|
return new Result<ResiWarmheartedResultDTO>().ok(resiWarmheartedResultDTO); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Result submit(ResiWarmheartedSubmitFormDTO formDTO) { |
|
|
|
|
|
//1:将申请记录存入热心居民申请表中
|
|
|
|
|
|
saveResiWarmApply(formDTO); |
|
|
|
|
|
//2:将最后一次操作行为更新到热心居民申请行为记录表中
|
|
|
|
|
|
resiWarmheartedVisitService.updateResiWarmVisit(formDTO); |
|
|
|
|
|
return new Result(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 热心居民申请表新增数据 |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return |
|
|
|
|
|
*/ |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
|
public void saveResiWarmApply(ResiWarmheartedSubmitFormDTO formDTO) { |
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
|
ResiWarmheartedApplyDTO resiWarmheartedApplyDTO = new ResiWarmheartedApplyDTO(); |
|
|
|
|
|
resiWarmheartedApplyDTO.setCustomerId(formDTO.getCustomerId()); |
|
|
|
|
|
resiWarmheartedApplyDTO.setGridId(formDTO.getGridId()); |
|
|
|
|
|
resiWarmheartedApplyDTO.setUserId(formDTO.getUserId()); |
|
|
|
|
|
resiWarmheartedApplyDTO.setReason(formDTO.getReason()); |
|
|
|
|
|
resiWarmheartedApplyDTO.setResiWarmVisitId(formDTO.getResiWarmVisitId()); |
|
|
|
|
|
resiWarmheartedApplyDTO.setAuditStatus(ResiWarmheartedVisitConstant.UNDER_AUDITTING); |
|
|
|
|
|
//UUID
|
|
|
|
|
|
resiWarmheartedApplyDTO.setId(IdWorker.get32UUID()); |
|
|
|
|
|
resiWarmheartedApplyDTO.setDelFlag(NumConstant.ZERO); |
|
|
|
|
|
resiWarmheartedApplyDTO.setRevision(NumConstant.ZERO); |
|
|
|
|
|
resiWarmheartedApplyDTO.setCreatedBy(formDTO.getUserId()); |
|
|
|
|
|
resiWarmheartedApplyDTO.setCreatedTime(date); |
|
|
|
|
|
resiWarmheartedApplyDTO.setUpdatedBy(formDTO.getUserId()); |
|
|
|
|
|
resiWarmheartedApplyDTO.setUpdatedTime(date); |
|
|
|
|
|
resiWarmheartedApplyDao.saveResiWarmApply(resiWarmheartedApplyDTO); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |