| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | |
| | | public class ComActMessageServiceImpl extends ServiceImpl<ComActMessageDAO, ComActMessageDO> implements ComActMessageService { |
| | | @Resource |
| | | private ComActMessageDAO comActMessageDAO; |
| | | |
| | | @Override |
| | | public R addMessage(ComActMessageVO comActMessageVO) { |
| | | Long type = comActMessageVO.getType(); |
| | | String phone=""; |
| | | if(type==1) { |
| | | String phone = ""; |
| | | String sendtoUserName = ""; |
| | | |
| | | if (type == 1) { |
| | | ComPbServiceTeamVO team = comActMessageDAO.selectComPbServiceTeamById(comActMessageVO.getSendtoUserId()); |
| | | if(ObjectUtils.isEmpty(team)) return R.fail(); |
| | | phone=team.getPhone(); |
| | | }else if(type==2) { |
| | | if (ObjectUtils.isEmpty(team)) |
| | | return R.fail(); |
| | | phone = team.getPhone(); |
| | | sendtoUserName = team.getName(); |
| | | } else if (type == 2) { |
| | | PartyCommitteeVO party = comActMessageDAO.selectPartyCommitteeById(comActMessageVO.getSendtoUserId()); |
| | | if(ObjectUtils.isEmpty(party)) return R.fail(); |
| | | phone=party.getPhone(); |
| | | if (ObjectUtils.isEmpty(party)) |
| | | return R.fail(); |
| | | phone = party.getPhone(); |
| | | sendtoUserName = party.getName(); |
| | | } |
| | | if(ObjectUtils.isEmpty(phone)) return R.fail("未找到联系方式"); |
| | | // TODO Auto-generated method stub |
| | | return null; |
| | | if (ObjectUtils.isEmpty(phone)) |
| | | return R.fail("未找到联系方式"); |
| | | comActMessageVO.setPhone(phone); |
| | | comActMessageVO.setSendtoUserName(sendtoUserName); |
| | | ComActMessageDO comActMessageDO = new ComActMessageDO(); |
| | | BeanUtils.copyProperties(comActMessageVO, comActMessageDO); |
| | | int insert = comActMessageDAO.insert(comActMessageDO); |
| | | if (insert > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | |
| | | @Override |
| | | public R pageMyMessageApplets(ComActMessageVO comActMessageVO) { |
| | | // TODO Auto-generated method stub |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R pageSendToMessageApplets(ComActMessageVO comActMessageVO) { |
| | | // TODO Auto-generated method stub |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R pageMyCommunityMessageApplets(ComActMessageVO comActMessageVO) { |
| | | // TODO Auto-generated method stub |
| | | return null; |
| | | } |
| | | |