| @@ -0,0 +1,51 @@ | |||
| package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.domain.po.WxGroup; | |||
| import com.simple.mapper.WxGroupMapper; | |||
| import com.simple.service.WxGroupService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| @Service | |||
| public class WxGroupServiceImpl implements WxGroupService { | |||
| @Autowired | |||
| WxGroupMapper wxGroupMapper; | |||
| @Override | |||
| public PageInfo<WxGroup> listAsPage(WxGroup record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxGroupMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxGroup getById(String id) { | |||
| return wxGroupMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxGroup record) { | |||
| if (record.getId() == null) { | |||
| record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| wxGroupMapper.insertSelective(record); | |||
| } else { | |||
| wxGroupMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(String id) { | |||
| wxGroupMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -122,12 +122,14 @@ public class WxMsgModelServiceImpl implements WxMsgModelService { | |||
| public void deleteById(Long id) { | |||
| wxMsgModelMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public ResultData getmodellist() { | |||
| WxMsgModel wxMsgModel = new WxMsgModel(); | |||
| wxMsgModel.setTenantId("1"); | |||
| List<WxMsgModel> list = wxMsgModelMapper.findList(wxMsgModel); | |||
| return new ResultData(list); | |||
| } | |||
| } | |||
| @@ -47,18 +47,24 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| //2手机多条以逗号分隔,直接通过实体得到wxmsg.getphones | |||
| //3通过标签 | |||
| String phones=wxMsg.getPhones(); | |||
| if(!phones.equals("")){ | |||
| if(!wxMsg.getExcelpath().equals("")) | |||
| if(phones.equals("")){ | |||
| if(null!=wxMsg.getExcelpath() && !wxMsg.getExcelpath().equals("")) | |||
| phones=parseexcle(wxMsg.getExcelpath()); | |||
| else | |||
| phones=parselabel(wxMsg.getLabel()); | |||
| } | |||
| if(phones.equals("")){ | |||
| return new ResultData(Result.SUCCESS, "您需要添加要发送的手机号"); | |||
| } | |||
| if (wxMsg.getId() == null) { | |||
| //草稿 | |||
| if (wxMsg.getSendstatus() == 2) { | |||
| if (wxMsg.getStatus() == 2) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| wxMsg.setId(idWorker.nextId()); | |||
| wxMsg.setTenantId("1"); | |||
| wxMsg.setCreatetime(new Date()); | |||
| wxMsgMapper.insertSelective(wxMsg); | |||
| return new ResultData(Result.SUCCESS, "已保存到草稿箱"); | |||
| @@ -72,13 +78,15 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| wxMsg.setStatus(0); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| wxMsg.setId(idWorker.nextId()); | |||
| wxMsg.setTenantId("1"); | |||
| wxMsg.setCreatetime(new Date()); | |||
| wxMsgMapper.insertSelective(wxMsg); | |||
| return new ResultData(Result.SUCCESS, "短信会在预设时间发送"); | |||
| } | |||
| } else { | |||
| //草稿 | |||
| if (wxMsg.getSendstatus() == 2) { | |||
| if (wxMsg.getStatus() == 2) { | |||
| wxMsgMapper.updateByPrimaryKeySelective(wxMsg); | |||
| return new ResultData(Result.SUCCESS, "已保存到草稿箱"); | |||
| } | |||
| @@ -179,6 +187,8 @@ public class WxMsgServiceImpl implements WxMsgService { | |||
| if (wxMsg.getId() == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| wxMsg.setId(idWorker.nextId()); | |||
| wxMsg.setTenantId("1"); | |||
| wxMsg.setCreatetime(new Date()); | |||
| wxMsgMapper.insertSelective(wxMsg); | |||
| } else { | |||
| wxMsgMapper.updateByPrimaryKeySelective(wxMsg); | |||
| @@ -3,6 +3,8 @@ package com.simple.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.simple.common.ResultData; | |||
| import com.simple.domain.po.WxMsgModel; | |||
| import com.simple.domain.po.WxMsgSignature; | |||
| import com.simple.mapper.WxMsgSignatureMapper; | |||
| import com.simple.service.WxMsgSignatureService; | |||
| @@ -45,12 +47,14 @@ public class WxMsgSignatureServiceImpl implements WxMsgSignatureService { | |||
| public void deleteById(Long id) { | |||
| wxMsgSignatureMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public ResultData getsignaturelist() { | |||
| WxMsgSignature wxMsgSignature = new WxMsgSignature(); | |||
| wxMsgSignature.setTenantId("1"); | |||
| List<WxMsgSignature> list = wxMsgSignatureMapper.findList(wxMsgSignature); | |||
| return new ResultData(list); | |||
| } | |||
| } | |||