findyguo
2021-03-04 05bbf3926ea6173b01fa51d933114a708760609e
http://panzhihua.nhys.cdnhxx.com/web/#/login
2个文件已修改
22 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMessageDAO.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMessageServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActMessageDAO.java
@@ -1,11 +1,19 @@
package com.panzhihua.service_community.dao;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.common.model.vos.partybuilding.ComPbServiceTeamVO;
import com.panzhihua.common.model.vos.partybuilding.PartyCommitteeVO;
import com.panzhihua.service_community.model.dos.ComActMessageDO;
@Mapper
public interface ComActMessageDAO extends BaseMapper<ComActMessageDO> {
    @Select("select * from com_pb_member_role where id=#{id}")
    PartyCommitteeVO selectPartyCommitteeById(@Param("id")Long id);
    @Select("select * from com_pb_service_team where id=#{id}")
    ComPbServiceTeamVO selectComPbServiceTeamById(@Param("id")Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActMessageServiceImpl.java
@@ -3,10 +3,13 @@
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActMessageVO;
import com.panzhihua.common.model.vos.partybuilding.ComPbServiceTeamVO;
import com.panzhihua.common.model.vos.partybuilding.PartyCommitteeVO;
import com.panzhihua.service_community.dao.ComActMessageDAO;
import com.panzhihua.service_community.model.dos.ComActMessageDO;
import com.panzhihua.service_community.service.ComActMessageService;
@@ -18,6 +21,17 @@
    @Override
    public R addMessage(ComActMessageVO comActMessageVO) {
        Long type = comActMessageVO.getType();
        String phone="";
        if(type==1) {
            ComPbServiceTeamVO team = comActMessageDAO.selectComPbServiceTeamById(comActMessageVO.getSendtoUserId());
            if(ObjectUtils.isEmpty(team)) return R.fail();
            phone=team.getPhone();
        }else if(type==2) {
            PartyCommitteeVO party = comActMessageDAO.selectPartyCommitteeById(comActMessageVO.getSendtoUserId());
            if(ObjectUtils.isEmpty(party)) return R.fail();
            phone=party.getPhone();
        }
        if(ObjectUtils.isEmpty(phone)) return R.fail("未找到联系方式");
        // TODO Auto-generated method stub
        return null;
    }