|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|
|
@ -18,18 +19,19 @@ import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.HouseInfoCache; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.MessageConstant; |
|
|
|
import com.epmet.constant.ReadFlagConstant; |
|
|
|
import com.epmet.constant.UserMessageTypeConstant; |
|
|
|
import com.epmet.dao.IcResiUserConfirmDao; |
|
|
|
import com.epmet.dao.IcResiUserDao; |
|
|
|
import com.epmet.dto.IcResiUserConfirmDTO; |
|
|
|
import com.epmet.dto.form.ConfirmListFormDTO; |
|
|
|
import com.epmet.dto.form.IcResiUserConfirmGetDTO; |
|
|
|
import com.epmet.dto.form.IcResiUserConfirmSubmitDTO; |
|
|
|
import com.epmet.dto.form.MoveOutMemberFormDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.ConfirmListResultDTO; |
|
|
|
import com.epmet.dto.result.MoveOutDetailResultDTO; |
|
|
|
import com.epmet.entity.IcResiUserConfirmEntity; |
|
|
|
import com.epmet.entity.IcResiUserEntity; |
|
|
|
import com.epmet.enums.UserConfirmEnum; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
import com.epmet.redis.IcResiUserConfirmRedis; |
|
|
|
import com.epmet.service.IcResiUserConfirmService; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
@ -41,9 +43,8 @@ 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; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
/** |
|
|
|
* 居民信息审核表 |
|
|
@ -64,6 +65,9 @@ public class IcResiUserConfirmServiceImpl extends BaseServiceImpl<IcResiUserConf |
|
|
|
@Autowired |
|
|
|
private IcResiUserConfirmDao icResiUserConfirmDao; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<IcResiUserConfirmDTO> page(Map<String, Object> params) { |
|
|
|
IPage<IcResiUserConfirmEntity> page = baseDao.selectPage( |
|
|
@ -333,6 +337,42 @@ public class IcResiUserConfirmServiceImpl extends BaseServiceImpl<IcResiUserConf |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void moveOutConfirm(IcResiUserConfirmDTO formDTO) { |
|
|
|
baseDao.updateById(ConvertUtils.sourceToTarget(formDTO, IcResiUserConfirmEntity.class)); |
|
|
|
//审核不通过,发送消息
|
|
|
|
if (NumConstant.TWO_STR.equals(formDTO.getConfirmResult())) { |
|
|
|
String msg = String.format(MessageConstant.OVE_OUT_REJECTED_MSG, formDTO.getReason()); |
|
|
|
IcResiUserConfirmEntity entity = baseDao.selectById(formDTO.getId()); |
|
|
|
sendMessage(entity.getCustomerId(),entity.getGridId(), entity.getId(), entity.getCreatedBy(), msg); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void sendMessage(String customerId, String gridId, String targetId, String userId, String userMsg) { |
|
|
|
UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO(); |
|
|
|
userMessageFormDTO.setCustomerId(customerId); |
|
|
|
userMessageFormDTO.setGridId(gridId); |
|
|
|
userMessageFormDTO.setApp(AppClientConstant.APP_RESI); |
|
|
|
userMessageFormDTO.setTitle(MessageConstant.MOVE_OUT_TITLE); |
|
|
|
userMessageFormDTO.setMessageType(UserMessageTypeConstant.MOVE_OUT_HOME); |
|
|
|
userMessageFormDTO.setTargetId(targetId); |
|
|
|
userMessageFormDTO.setMessageContent(userMsg); |
|
|
|
userMessageFormDTO.setReadFlag(ReadFlagConstant.UN_READ); |
|
|
|
userMessageFormDTO.setUserId(userId); |
|
|
|
|
|
|
|
//发送微信订阅消息
|
|
|
|
WxSubscribeMessageFormDTO wxSubscribeMessageFormDTO = new WxSubscribeMessageFormDTO(); |
|
|
|
wxSubscribeMessageFormDTO.setCustomerId(customerId); |
|
|
|
wxSubscribeMessageFormDTO.setUserId(userId); |
|
|
|
wxSubscribeMessageFormDTO.setClientType(AppClientConstant.APP_RESI); |
|
|
|
wxSubscribeMessageFormDTO.setGridId(gridId); |
|
|
|
wxSubscribeMessageFormDTO.setBehaviorType(MessageConstant.MOVE_OUT_TITLE); |
|
|
|
wxSubscribeMessageFormDTO.setMessageContent(userMsg); |
|
|
|
wxSubscribeMessageFormDTO.setMessageTime(new Date()); |
|
|
|
List<WxSubscribeMessageFormDTO> msgList = new ArrayList<>(); |
|
|
|
msgList.add(wxSubscribeMessageFormDTO); |
|
|
|
epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList); |
|
|
|
//保存消息
|
|
|
|
epmetMessageOpenFeignClient.saveUserMessage(userMessageFormDTO); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|