generated from root/miduo_server
gm权限管理,邮件系统优化
parent
1ff8fc755b
commit
e1aeb2246b
|
|
@ -1,23 +1,19 @@
|
|||
package com.jmfy.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jmfy.WebSecurityConfig;
|
||||
import com.jmfy.dao.CUserDao;
|
||||
import com.jmfy.dao.MailDao;
|
||||
import com.jmfy.dao.ServerInfoDao;
|
||||
import com.jmfy.dao.UserInfoDao;
|
||||
import com.jmfy.model.CUserInfo;
|
||||
import com.jmfy.model.PersonalMail;
|
||||
import com.jmfy.model.ServerInfo;
|
||||
import com.jmfy.model.ServerMail;
|
||||
import com.jmfy.model.*;
|
||||
import com.jmfy.model.vo.PowersEnum;
|
||||
import com.jmfy.model.vo.ServerMailVo;
|
||||
import com.jmfy.model.vo.ServerPMailVo;
|
||||
import com.jmfy.utils.*;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.util.WebUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -25,13 +21,13 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.InputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* 邮件
|
||||
*/
|
||||
@SuppressWarnings("ALL")
|
||||
@Controller
|
||||
public class MailController {
|
||||
|
||||
|
|
@ -43,6 +39,8 @@ public class MailController {
|
|||
private ServerInfoDao serverInfoDao;
|
||||
@Resource
|
||||
private UserInfoDao userInfoDao;
|
||||
@Resource
|
||||
private CUserDao cUserDao;
|
||||
|
||||
/**
|
||||
* 限制记录
|
||||
|
|
@ -55,6 +53,16 @@ public class MailController {
|
|||
*/
|
||||
private static int limitTime = 60;
|
||||
|
||||
private static final int SERVER_MAIL = 1;
|
||||
private static final int PERSONAL_MAIL = 2;
|
||||
|
||||
|
||||
/**
|
||||
* 根据类型前往不同的页面
|
||||
* @param map
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/toMailPage",method = RequestMethod.GET)
|
||||
public String toMailPage(ModelMap map,Integer type){
|
||||
Map<Integer, String> itemNameMap = FileCacheUtils.itemNameMap;
|
||||
|
|
@ -62,7 +70,6 @@ public class MailController {
|
|||
List<ServerInfo> allServerInfo = serverInfoDao.getAllServerInfo();
|
||||
map.addAttribute("serverInfo",allServerInfo);
|
||||
map.addAttribute("itemNameMap",itemNameMap);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -76,6 +83,12 @@ public class MailController {
|
|||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传用户list(excel表格)
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/uploadUserList", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public @ResponseBody String uploadUserList(HttpServletRequest request,HttpServletResponse response) {
|
||||
|
||||
|
|
@ -107,205 +120,272 @@ public class MailController {
|
|||
return dealResult;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/deleteSysMailCheck", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
/**
|
||||
* 审核,删除系统邮件
|
||||
* @param request
|
||||
* @return
|
||||
* 0: 失败
|
||||
* 1: 成功
|
||||
* 2: 没有权限
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/deleteMailCheck", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public @ResponseBody
|
||||
int removeSysMail(HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String id = parameterMap.get("mailId");
|
||||
if(null ==id){
|
||||
return -1;
|
||||
if(null == id){
|
||||
return 0;
|
||||
}
|
||||
// 权限验证
|
||||
String userName = (String) request.getSession().getAttribute("username");
|
||||
CAdmin admin = cUserDao.findAdmin(userName);
|
||||
if (!admin.getPowers().contains(PowersEnum.MAIL_AUDIT_JURISDICTION.getId())){
|
||||
return 2;
|
||||
}
|
||||
|
||||
mailDao.removeSysMail(Integer.valueOf(id));
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/deletePMailCheck", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
/**
|
||||
* 审核,拒绝系统邮件
|
||||
* @param request
|
||||
* @return
|
||||
* 1: 成功
|
||||
* 0: 邮件不存在
|
||||
* 2: 没有权限
|
||||
* 3: 邮件已审核
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/refuseMailCheck", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public @ResponseBody
|
||||
int removePMail(HttpServletRequest request) throws Exception {
|
||||
int refuseMailCheck(HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String id = parameterMap.get("mailId");
|
||||
if(null ==id){
|
||||
return -1;
|
||||
if(null == id){
|
||||
return 0;
|
||||
}
|
||||
mailDao.removePMail(Integer.valueOf(id));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/refuseSysMailCheck", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public @ResponseBody
|
||||
int refuseSysMailCheck(HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String id = parameterMap.get("mailId");
|
||||
if(null ==id){
|
||||
return -1;
|
||||
// 权限验证
|
||||
String userName = (String) request.getSession().getAttribute("username");
|
||||
CAdmin admin = cUserDao.findAdmin(userName);
|
||||
if (!admin.getPowers().contains(PowersEnum.MAIL_AUDIT_JURISDICTION.getId())){
|
||||
return 2;
|
||||
}
|
||||
// 审核状态检测
|
||||
ServerMail mail = mailDao.findSysMailId(Integer.valueOf(id));
|
||||
if(mail.getState()!=0){
|
||||
return 2;
|
||||
if(mail.getState() != 0){
|
||||
return 3;
|
||||
}
|
||||
mailDao.refreshSysMail(Integer.valueOf(id),1);
|
||||
return 0;
|
||||
|
||||
// 修改邮件信息
|
||||
mail.setState(1);
|
||||
mail.setAuditUser(userName);
|
||||
mail.setAuditTime(DateUtil.nowString());
|
||||
mailDao.updateMail(mail);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/refusePMailCheck", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
/**
|
||||
* 审核,发送系统邮件
|
||||
* @param request
|
||||
* @return
|
||||
* 0: 失败
|
||||
* 1: 成功
|
||||
* 2: 没有权限
|
||||
* 3:已经审核
|
||||
* 4: 需要等待更新时间,单人邮件专用
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/toSendMail", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public @ResponseBody
|
||||
int refusePMailCheck(HttpServletRequest request) throws Exception {
|
||||
int auditMail(HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String id = parameterMap.get("mailId");
|
||||
if(null ==id){
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
PersonalMail mail = mailDao.findPersonalMailId(Integer.valueOf(id));
|
||||
if(mail.getState()!=0){
|
||||
// 权限验证
|
||||
String userName = (String) request.getSession().getAttribute("username");
|
||||
CAdmin admin = cUserDao.findAdmin(userName);
|
||||
if (!admin.getPowers().contains(PowersEnum.MAIL_AUDIT_JURISDICTION.getId())){
|
||||
return 2;
|
||||
}
|
||||
mailDao.refreshPMail(Integer.valueOf(id),1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/toSendSysMail", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public @ResponseBody
|
||||
int sendSysMail(HttpServletRequest request) throws Exception {
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String id = parameterMap.get("mailId");
|
||||
if(null ==id){
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 邮件状态检测
|
||||
ServerMail mail = mailDao.findSysMailId(Integer.valueOf(id));
|
||||
if(mail.getState()!=0){
|
||||
return 2;
|
||||
}
|
||||
mailDao.refreshSysMail(Integer.valueOf(id),2);
|
||||
mailDao.sendSysMail(mail);
|
||||
return 0;
|
||||
}
|
||||
@PostMapping(value = "/tosendPersonalMail")
|
||||
public @ResponseBody
|
||||
int sendPersonalMail(HttpServletRequest request)throws Exception{
|
||||
HashMap<String, String> parameterMap = JsonUtil.getInstence().getParameterMap(request);
|
||||
String id = parameterMap.get("mailId");
|
||||
if(null ==id){
|
||||
return -1;
|
||||
if(mail.getState() != 0){
|
||||
return 3;
|
||||
}
|
||||
|
||||
PersonalMail mail = mailDao.findPersonalMailId(Integer.valueOf(id));
|
||||
if(mail.getState()!=0){
|
||||
return 2;
|
||||
// 修改邮件信息
|
||||
mail.setState(2);
|
||||
mail.setAuditUser(userName);
|
||||
mail.setAuditTime(DateUtil.nowString());
|
||||
mailDao.updateMail(mail);
|
||||
|
||||
// 全服邮件
|
||||
if (mail.getType() == SERVER_MAIL){
|
||||
mailDao.sendSysMail(mail);
|
||||
}
|
||||
// 同一区服审核时间加限制
|
||||
long now = DateUtil.now()/1000;
|
||||
Long oldTime = record.getOrDefault(mail.getServerId(), 0L);
|
||||
if(oldTime != 0 && (oldTime+limitTime)>now){
|
||||
return 5;
|
||||
// 个人邮件
|
||||
else {
|
||||
// 同一区服审核时间加限制
|
||||
long now = DateUtil.now()/1000;
|
||||
Long oldTime = record.getOrDefault(Integer.parseInt(mail.getServerId()), 0L);
|
||||
if(oldTime != 0 && (oldTime+limitTime)>now){
|
||||
return 4;
|
||||
}
|
||||
// 跟新时间
|
||||
record.put(Integer.parseInt(mail.getServerId()),now);
|
||||
mailDao.sendPersonalMail(mail);
|
||||
}
|
||||
|
||||
mailDao.refreshPMail(Integer.valueOf(id),2);
|
||||
mailDao.sendPersonalMail(mail);
|
||||
// 跟新时间
|
||||
record.put(mail.getServerId(),now);
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送系统邮件到审核
|
||||
* @param mail
|
||||
* @param session
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@PostMapping(value = "/sendSysMailWithBack")
|
||||
public @ResponseBody
|
||||
int sendSysMailWithBack(@RequestBody ServerMail mail,HttpSession session) throws Exception{
|
||||
String useName = (String) session.getAttribute(WebSecurityConfig.SESSION_KEY);
|
||||
if(null!= useName){
|
||||
mail.setCreateUser(useName);
|
||||
}
|
||||
mail.setCreateTime(DateUtil.stampToTime(System.currentTimeMillis()));
|
||||
mail.setId(seqUtils.getSequence("c_mail_id"));
|
||||
mailDao.sendSysMailWithBack(mail);
|
||||
return 0;
|
||||
}
|
||||
@PostMapping(value = "/sendPersonalMailWithBack")
|
||||
public @ResponseBody
|
||||
int sendPersonalMailWithBack(@RequestBody PersonalMail mail,HttpSession session)throws Exception{
|
||||
int insertMail(@RequestBody ServerMail mail,HttpSession session) throws Exception{
|
||||
String useName = (String) session.getAttribute(WebSecurityConfig.SESSION_KEY);
|
||||
if(null!= useName){
|
||||
mail.setCreateUser(useName);
|
||||
}
|
||||
|
||||
// 判断玩家id是否正确
|
||||
String[] split = mail.getUserId().split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
CUserInfo cUserInfo = userInfoDao.findUserInfoById(split[i]);
|
||||
if (cUserInfo == null || cUserInfo.getServerid() != mail.getServerId()){
|
||||
return 3;
|
||||
// 个人邮件
|
||||
if (mail.getType() == PERSONAL_MAIL){
|
||||
// 判断玩家id是否正确
|
||||
String[] split = mail.getUserId().split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
CUserInfo cUserInfo = userInfoDao.findUserInfoById(split[i]);
|
||||
if (cUserInfo == null || cUserInfo.getServerid() != Integer.parseInt(mail.getServerId())){
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mail.setCreateTime(DateUtil.stampToTime(System.currentTimeMillis()));
|
||||
mail.setState(0);
|
||||
mail.setCreateTime(DateUtil.nowString());
|
||||
mail.setId(seqUtils.getSequence("c_mail_id"));
|
||||
mailDao.sendPersonalMailWithBack(mail);
|
||||
mailDao.insertMail(mail);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "/sysMailCheck", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public String sysMailCheck (HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
|
||||
List<ServerMail> serverMails = mailDao.getSMailList();
|
||||
List<ServerMailVo> sServerMailListVo = new ArrayList<>();
|
||||
for (ServerMail serverMail :serverMails){
|
||||
ServerMailVo serverMailVo = new ServerMailVo();
|
||||
serverMailVo.setId(serverMail.getId());
|
||||
serverMailVo.setServerId(serverInfoDao.getAllServerName(serverMail.getServerId()));
|
||||
serverMailVo.setMailContent(serverMail.getMailContent());
|
||||
serverMailVo.setMailTitle(serverMail.getMailTitle());
|
||||
// serverMailVo.setVersion(serverMail.getVersion());
|
||||
serverMailVo.setMailSendTime(serverMail.getSendTime());
|
||||
serverMailVo.setCreateTime(serverMail.getCreateTime());
|
||||
serverMailVo.setState(serverMail.getState());
|
||||
serverMailVo.setCreateUser(serverMail.getCreateUser());
|
||||
String[] itemIds =new String[serverMail.getItemIds().size()];
|
||||
String[] itemNums = new String[serverMail.getItemNums().size()];
|
||||
for (int i = 0; i < serverMail.getItemIds().size(); i++) {
|
||||
itemIds[i]=String.valueOf(serverMail.getItemIds().get(i));
|
||||
/**
|
||||
* 系统邮件审核列表
|
||||
* @param map
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/getMailListToCheck", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public String getMailListToCheck (ModelMap map,int type) throws Exception {
|
||||
if (type == PERSONAL_MAIL){
|
||||
// 个人邮件,改版后,需要清理旧库中的数据,并添加到新库中
|
||||
clearOldPersonalMail();
|
||||
}else {
|
||||
// 全服邮件处理,改版后,添加type类型
|
||||
List<ServerMail> list = mailDao.getAllMailList();
|
||||
list.removeIf(v->v.getType() == PERSONAL_MAIL || v.getType() == SERVER_MAIL);
|
||||
for (ServerMail mail : list) {
|
||||
mail.setType(SERVER_MAIL);
|
||||
mailDao.updateMail(mail);
|
||||
}
|
||||
for (int i = 0; i < serverMail.getItemNums().size(); i++) {
|
||||
itemNums[i]=String.valueOf(serverMail.getItemNums().get(i));
|
||||
}
|
||||
serverMailVo.setRewards(JsonUtil.getInstence().getReward(itemIds,itemNums,true));
|
||||
sServerMailListVo.add(serverMailVo);
|
||||
}
|
||||
map.put("sServerMailListVo",sServerMailListVo);
|
||||
return "sendSysMailCheck";
|
||||
List<ServerMail> mails = mailDao.getMailList(type);
|
||||
List<ServerMailVo> mailVos = new ArrayList<>();
|
||||
for (ServerMail mail :mails){
|
||||
mailVos.add(mailToVo(mail));
|
||||
}
|
||||
String result;
|
||||
if (type == PERSONAL_MAIL){
|
||||
result = "sendPMailCheck";
|
||||
}else {
|
||||
result = "sendSysMailCheck";
|
||||
}
|
||||
map.put("sServerMailListVo",mailVos);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* serverMail 转 vo
|
||||
* @param serverMail
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private ServerMailVo mailToVo(ServerMail serverMail) throws Exception {
|
||||
ServerMailVo mailVo = new ServerMailVo();
|
||||
mailVo.setId(serverMail.getId());
|
||||
if (serverMail.getType() == SERVER_MAIL){
|
||||
mailVo.setServerId(serverInfoDao.getAllServerName(serverMail.getServerId()));
|
||||
}else {
|
||||
mailVo.setServerId(serverMail.getServerId());
|
||||
}
|
||||
mailVo.setUserId(serverMail.getUserId());
|
||||
mailVo.setVersion(serverMail.getVersion());
|
||||
mailVo.setMailContent(serverMail.getMailContent());
|
||||
mailVo.setMailTitle(serverMail.getMailTitle());
|
||||
mailVo.setMailSendTime(serverMail.getSendTime());
|
||||
mailVo.setCreateTime(serverMail.getCreateTime());
|
||||
mailVo.setState(serverMail.getState());
|
||||
mailVo.setCreateUser(serverMail.getCreateUser());
|
||||
mailVo.setAuditUser(serverMail.getAuditUser());
|
||||
mailVo.setAuditTime(serverMail.getAuditTime());
|
||||
String[] itemIds =new String[serverMail.getItemIds().size()];
|
||||
String[] itemNums = new String[serverMail.getItemNums().size()];
|
||||
for (int i = 0; i < serverMail.getItemIds().size(); i++) {
|
||||
itemIds[i]=String.valueOf(serverMail.getItemIds().get(i));
|
||||
}
|
||||
for (int i = 0; i < serverMail.getItemNums().size(); i++) {
|
||||
itemNums[i]=String.valueOf(serverMail.getItemNums().get(i));
|
||||
}
|
||||
mailVo.setRewards(JsonUtil.getInstence().getReward(itemIds,itemNums,true));
|
||||
return mailVo;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/pMailCheck", method = {RequestMethod.POST, RequestMethod.GET})
|
||||
public String pMailCheck (HttpSession session, ModelMap map , HttpServletRequest request) throws Exception {
|
||||
/**
|
||||
* 清理旧的个人邮件
|
||||
* @throws Exception
|
||||
*/
|
||||
private void clearOldPersonalMail() throws Exception {
|
||||
List<PersonalMail> personalMail = mailDao.getPMailList();
|
||||
for (PersonalMail mail : personalMail) {
|
||||
ServerMail serverMail = pTos(mail);
|
||||
|
||||
List<ServerPMailVo> sServerMailListVo = new ArrayList<>();
|
||||
for (PersonalMail serverMail :personalMail){
|
||||
ServerPMailVo serverMailVo = new ServerPMailVo();
|
||||
serverMailVo.setId(serverMail.getId());
|
||||
serverMailVo.setUserId(serverMail.getUserId());
|
||||
serverMailVo.setServerId(serverMail.getServerId());
|
||||
serverMailVo.setMailContent(serverMail.getMailContent());
|
||||
serverMailVo.setMailTitle(serverMail.getMailTitle());
|
||||
serverMailVo.setVersion(serverMail.getVersion());
|
||||
serverMailVo.setCreateTime(serverMail.getCreateTime());
|
||||
serverMailVo.setState(serverMail.getState());
|
||||
serverMailVo.setCreateUser(serverMail.getCreateUser());
|
||||
String[] itemIds =new String[serverMail.getItemIds().size()];
|
||||
String[] itemNums = new String[serverMail.getItemNums().size()];
|
||||
for (int i = 0; i < serverMail.getItemIds().size(); i++) {
|
||||
itemIds[i]=String.valueOf(serverMail.getItemIds().get(i));
|
||||
}
|
||||
for (int i = 0; i < serverMail.getItemNums().size(); i++) {
|
||||
itemNums[i]=String.valueOf(serverMail.getItemNums().get(i));
|
||||
}
|
||||
serverMailVo.setRewards(JsonUtil.getInstence().getReward(itemIds,itemNums,true));
|
||||
sServerMailListVo.add(serverMailVo);
|
||||
mailDao.removePMail(mail.getId());
|
||||
mailDao.insertMail(serverMail);
|
||||
}
|
||||
map.put("sServerMailListVo",sServerMailListVo);
|
||||
return "sendPMailCheck";
|
||||
}
|
||||
|
||||
/**
|
||||
* 旧个人邮件转换
|
||||
* @param personalMail
|
||||
* @return
|
||||
*/
|
||||
private ServerMail pTos(PersonalMail personalMail){
|
||||
ServerMail serverMail = new ServerMail();
|
||||
serverMail.setId(personalMail.getId());
|
||||
serverMail.setServerId(String.valueOf(personalMail.getServerId()));
|
||||
serverMail.setMailTitle(personalMail.getMailTitle());
|
||||
serverMail.setMailContent(personalMail.getMailContent());
|
||||
serverMail.setIsAttach(personalMail.getIsAttach());
|
||||
serverMail.setItemIds(personalMail.getItemIds());
|
||||
serverMail.setItemNums(personalMail.getItemNums());
|
||||
serverMail.setSendTime(personalMail.getSendTime());
|
||||
serverMail.setVersion(personalMail.getVersion());
|
||||
serverMail.setUserId(personalMail.getUserId());
|
||||
serverMail.setCreateTime(personalMail.getCreateTime());
|
||||
serverMail.setState(personalMail.getState());
|
||||
serverMail.setCreateUser(personalMail.getCreateUser());
|
||||
serverMail.setEffectTime(personalMail.getEffectTime());
|
||||
serverMail.setType(PERSONAL_MAIL);
|
||||
|
||||
return serverMail;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,24 +7,74 @@ import java.util.List;
|
|||
|
||||
public interface MailDao {
|
||||
|
||||
/**
|
||||
* 发送系统邮件
|
||||
* @param mail
|
||||
* @throws Exception
|
||||
*/
|
||||
void sendSysMail(ServerMail mail) throws Exception;
|
||||
|
||||
void sendPersonalMail(PersonalMail mail);
|
||||
/**
|
||||
* 发送个人邮件
|
||||
* @param mail
|
||||
*/
|
||||
void sendPersonalMail(ServerMail mail);
|
||||
|
||||
void sendSysMailWithBack(ServerMail mail) throws Exception;
|
||||
/**
|
||||
* 添加邮件
|
||||
* @param mail
|
||||
* @throws Exception
|
||||
*/
|
||||
void insertMail(ServerMail mail) throws Exception;
|
||||
|
||||
void sendPersonalMailWithBack(PersonalMail mail) throws Exception;
|
||||
/**
|
||||
* 根据类型获取邮件列表
|
||||
* @param type
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<ServerMail> getMailList(int type) throws Exception;
|
||||
|
||||
List<ServerMail> getSMailList() throws Exception;
|
||||
|
||||
List<PersonalMail> getPMailList() throws Exception;
|
||||
/**
|
||||
* 获取邮件列表
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<ServerMail> getAllMailList() throws Exception;
|
||||
|
||||
/**
|
||||
* 根据id查找邮件
|
||||
* @param id
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
ServerMail findSysMailId(int id) throws Exception;
|
||||
|
||||
PersonalMail findPersonalMailId(int id) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除邮件
|
||||
* @param id
|
||||
* @throws Exception
|
||||
*/
|
||||
void removeSysMail(int id) throws Exception;
|
||||
|
||||
/**
|
||||
* 修改邮件
|
||||
* @param mail
|
||||
* @throws Exception
|
||||
*/
|
||||
void updateMail(ServerMail mail) throws Exception;
|
||||
|
||||
/**
|
||||
* 删除个人邮件,遗留方法,少用
|
||||
* @param id
|
||||
* @throws Exception
|
||||
*/
|
||||
void removePMail(int id) throws Exception;
|
||||
void refreshSysMail(int id,int state) throws Exception;
|
||||
void refreshPMail(int id,int state) throws Exception;
|
||||
|
||||
/**
|
||||
* 获取个人邮件列表,遗留方法,少用
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
List<PersonalMail> getPMailList() throws Exception;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,36 +46,44 @@ public class MailDaoImpl implements MailDao {
|
|||
// 有效时间
|
||||
sysMail.setEffectiveTime(mail.getEffectTime());
|
||||
|
||||
// Date date = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").parse(mail.getPlayerRTime());
|
||||
// sysMail.setRegisterEndTime(date.getTime());
|
||||
// sysMail.setEffectiveTime(0);//todo 要修改
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(int i = 0 ; i <mail.getItemIds().size();i++){
|
||||
sb.append(mail.getItemIds().get(i)).append("#").append(mail.getItemNums().get(i));
|
||||
if(i!=mail.getItemIds().size()-1){
|
||||
sb.append("|");
|
||||
}
|
||||
}
|
||||
sysMail.setReward(sb.toString());
|
||||
LOGGER.info("sendSysMail serverId=>{},id=>{},reward=>{}",mail.getServerId(),mail.getVersion(),sb.toString());
|
||||
String sb = getItemStr(mail);
|
||||
sysMail.setReward(sb);
|
||||
LOGGER.info("sendSysMail serverId=>{},id=>{},reward=>{}",mail.getServerId(),mail.getVersion(),sb);
|
||||
Update update = Update.update(mongoKey, sysMail);
|
||||
|
||||
String[] split = mail.getServerId().split(comma);
|
||||
for (String serverId:split) {
|
||||
Query query = new Query();
|
||||
query.addCriteria(Criteria.where("_id").is(Integer.parseInt(serverId))); //_id区分引号 "1"和1
|
||||
//_id区分引号 "1"和1
|
||||
query.addCriteria(Criteria.where("_id").is(Integer.parseInt(serverId)));
|
||||
String dbName = MongoName.getMongoDBName(Integer.valueOf(serverId));
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(dbName);
|
||||
WriteResult upsert = mongoTemplate.upsert(query, update, "mailingSystem"); //有则更新,没有则新增
|
||||
//有则更新,没有则新增
|
||||
WriteResult result = mongoTemplate.upsert(query, update, "mailingSystem");
|
||||
RedisUtil.getInstence().putObject(serverId,RedisUserKey.MAIL_RED_POINT+":","",1000);
|
||||
System.out.println("mail=====" + serverId + "==========" + upsert.getN());
|
||||
System.out.println("mail=====" + serverId + "==========" + result.getN());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPersonalMail(PersonalMail mail) {
|
||||
public void sendPersonalMail(ServerMail mail) {
|
||||
String[] uid = mail.getUserId().split("#");
|
||||
String sb = getItemStr(mail);
|
||||
for (String s : uid) {
|
||||
LOGGER.info("sendMail uid=>{},reward=>{}", s.trim(), sb);
|
||||
MailPersonalCache mailPersonalCache = new MailPersonalCache();
|
||||
mailPersonalCache.setTitle(mail.getMailTitle());
|
||||
mailPersonalCache.setContent(mail.getMailContent());
|
||||
mailPersonalCache.setReward(sb);
|
||||
int sendTime = (int) (DateUtil.timeToStamp(mail.getSendTime()) / 1000);
|
||||
mailPersonalCache.setTime(sendTime);
|
||||
mailPersonalCache.setValidTime(mail.getEffectTime());
|
||||
RedisUtil.getInstence().putMapEntry(mail.getServerId(), RedisUserKey.READY_TO_USER_MAIL + RedisUserKey.Delimiter_colon, s.trim(), mailPersonalCache, 240);
|
||||
}
|
||||
}
|
||||
|
||||
private String getItemStr(ServerMail mail){
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for(int i = 0 ; i <mail.getItemIds().size();i++){
|
||||
sb.append(mail.getItemIds().get(i)).append("#").append(mail.getItemNums().get(i));
|
||||
|
|
@ -83,28 +91,23 @@ public class MailDaoImpl implements MailDao {
|
|||
sb.append("|");
|
||||
}
|
||||
}
|
||||
for(int i = 0;i<uid.length;i++){
|
||||
LOGGER.info("sendMail uid=>{},reward=>{}",uid[i].trim(),sb.toString());
|
||||
MailPersonalCache mailPersonalCache = new MailPersonalCache();
|
||||
mailPersonalCache.setTitle(mail.getMailTitle());
|
||||
mailPersonalCache.setContent(mail.getMailContent());
|
||||
mailPersonalCache.setReward(sb.toString());
|
||||
int sendTime = (int)(DateUtil.timeToStamp(mail.getSendTime())/1000);
|
||||
mailPersonalCache.setTime(sendTime);
|
||||
mailPersonalCache.setValidTime(mail.getEffectTime());
|
||||
RedisUtil.getInstence().putMapEntry(String.valueOf(mail.getServerId()),RedisUserKey.READY_TO_USER_MAIL+RedisUserKey.Delimiter_colon,uid[i].trim(),mailPersonalCache,240);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ServerMail> getSMailList() throws Exception {
|
||||
public List<ServerMail> getMailList(int type) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
Query query = new Query(Criteria.where("type").is(type));
|
||||
return mongoTemplate.find(query,ServerMail.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ServerMail> getAllMailList() throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
Query query = new Query();
|
||||
return mongoTemplate.find(query,ServerMail.class);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<PersonalMail> getPMailList() throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
|
|
@ -114,13 +117,7 @@ public class MailDaoImpl implements MailDao {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void sendSysMailWithBack(ServerMail mail) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
mongoTemplate.insert(mail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPersonalMailWithBack(PersonalMail mail)throws Exception {
|
||||
public void insertMail(ServerMail mail) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
mongoTemplate.insert(mail);
|
||||
}
|
||||
|
|
@ -132,13 +129,6 @@ public class MailDaoImpl implements MailDao {
|
|||
query.addCriteria(Criteria.where("_id").is(id));
|
||||
return mongoTemplate.findOne(query, ServerMail.class);
|
||||
}
|
||||
@Override
|
||||
public PersonalMail findPersonalMailId(int id) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
Query query = new Query();
|
||||
query.addCriteria(Criteria.where("_id").is(id));
|
||||
return mongoTemplate.findOne(query, PersonalMail.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeSysMail(int id) throws Exception {
|
||||
|
|
@ -157,21 +147,15 @@ public class MailDaoImpl implements MailDao {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void refreshSysMail(int id,int state) throws Exception {
|
||||
public void updateMail(ServerMail mail) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
Query query = new Query(Criteria.where("_id").is(id));
|
||||
Query query = new Query(Criteria.where("_id").is(mail.getId()));
|
||||
Update update = new Update();
|
||||
update.set("state",state);
|
||||
update.set("state",mail.getState());
|
||||
update.set("type",mail.getType());
|
||||
update.set("auditUser",mail.getAuditUser());
|
||||
update.set("auditTime",mail.getAuditTime());
|
||||
mongoTemplate.updateMulti(query, update, ServerMail.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refreshPMail(int id ,int state) throws Exception {
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete(Constant.dbName);
|
||||
Query query = new Query(Criteria.where("_id").is(id));
|
||||
Update update = new Update();
|
||||
update.set("state",state);
|
||||
mongoTemplate.updateMulti(query, update, PersonalMail.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,16 @@ public class PersonalMail {
|
|||
private String createUser;//创建者
|
||||
@Field(value = "effectTime")
|
||||
private int effectTime;// 有效时间
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
@Field(value = "auditUser")
|
||||
private String auditUser;
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@Field(value = "auditTime")
|
||||
private String auditTime;
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
|
|
@ -157,4 +167,20 @@ public class PersonalMail {
|
|||
public void setEffectTime(int effectTime) {
|
||||
this.effectTime = effectTime;
|
||||
}
|
||||
|
||||
public String getAuditUser() {
|
||||
return auditUser;
|
||||
}
|
||||
|
||||
public void setAuditUser(String auditUser) {
|
||||
this.auditUser = auditUser;
|
||||
}
|
||||
|
||||
public String getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(String auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,55 +12,98 @@ public class ServerMail {
|
|||
@Id
|
||||
private int id;
|
||||
|
||||
/**
|
||||
* 服务器id
|
||||
*/
|
||||
@Field(value = "serverId")
|
||||
private String serverId;
|
||||
|
||||
/**
|
||||
* 邮件标题
|
||||
*/
|
||||
@Field(value = "mailTitle")
|
||||
private String mailTitle;
|
||||
|
||||
/**
|
||||
* 邮件内容
|
||||
*/
|
||||
@Field(value = "mailContent")
|
||||
private String mailContent;
|
||||
|
||||
/**
|
||||
* 是否包含附件
|
||||
*/
|
||||
@Field(value = "isAttach")
|
||||
private int isAttach;
|
||||
|
||||
/**
|
||||
* 物品id list
|
||||
*/
|
||||
@Field(value = "itemIds")
|
||||
private List<Integer> itemIds;
|
||||
|
||||
/**
|
||||
* 物品数量 list
|
||||
* 和id对应
|
||||
*/
|
||||
@Field(value = "itemNums")
|
||||
private List<Integer> itemNums;
|
||||
|
||||
/**
|
||||
* 发送着userId,可能为一长串并用#链接
|
||||
* 发送单人邮件使用,全服邮件不用
|
||||
*/
|
||||
@Field(value = "userId")
|
||||
public String userId;
|
||||
/**
|
||||
* 发送时间
|
||||
*/
|
||||
@Field(value = "sendTime")
|
||||
private String sendTime;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Field(value = "createtime")
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
@Field(value = "version")
|
||||
private int version;
|
||||
|
||||
/**
|
||||
* 状态: 0待审核 1拒绝 2通过
|
||||
*/
|
||||
@Field(value = "state")
|
||||
private int state;//0 -1拒绝 1 审核通过
|
||||
private int state;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@Field(value = "createUser")
|
||||
private String createUser;//创建者
|
||||
|
||||
private String createUser;
|
||||
/**
|
||||
* 用户截至注册时间
|
||||
*/
|
||||
@Field(value = "playerRTime")
|
||||
private String playerRTime;
|
||||
|
||||
/**
|
||||
* 有效时间
|
||||
*/
|
||||
@Field(value = "effectTime")
|
||||
private int effectTime;
|
||||
/**
|
||||
* 邮件类型 1:全服,2:个人
|
||||
*/
|
||||
@Field(value = "type")
|
||||
private int type;
|
||||
/**
|
||||
* 审核人
|
||||
*/
|
||||
@Field(value = "auditUser")
|
||||
private String auditUser;
|
||||
/**
|
||||
* 审核时间
|
||||
*/
|
||||
@Field(value = "auditTime")
|
||||
private String auditTime;
|
||||
|
||||
/**************************************** setter and getter ******************************************/
|
||||
|
||||
// "mailTitle": mailTitle,
|
||||
// "mailContent": mailContent,
|
||||
// "isAttach": isAttach,
|
||||
// "itemIds[]": itemIds,
|
||||
// "itemNums[]": itemNums,
|
||||
// "itemTypes[]": itemTypes,
|
||||
// "sendTime": sendTime,
|
||||
// "playerRTime": playerRTime,
|
||||
// "effectTime": effectTime,
|
||||
// "version": version
|
||||
public String getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
|
@ -180,4 +223,36 @@ public class ServerMail {
|
|||
public void setEffectTime(int effectTime) {
|
||||
this.effectTime = effectTime;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getAuditUser() {
|
||||
return auditUser;
|
||||
}
|
||||
|
||||
public void setAuditUser(String auditUser) {
|
||||
this.auditUser = auditUser;
|
||||
}
|
||||
|
||||
public String getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(String auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ public enum PowersEnum {
|
|||
MAIL_AUDIT(900,"邮件审核",900),
|
||||
SYSTEM_MAIL_AUDIT(901,"系统邮件审核",900),
|
||||
SINGLE_MAIL_AUDIT(902,"个人邮件审核",900),
|
||||
MAIL_AUDIT_JURISDICTION(903,"邮件审核权限",900),
|
||||
|
||||
// 聊天信息管理1000-1099
|
||||
CHAT_INFO_MANAGER(1000,"聊天信息管理",1000),
|
||||
CHAT_INFO_QUERY(1001,"聊天信息查询",1000),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ public class ServerMailVo {
|
|||
private int id;
|
||||
|
||||
private String serverId;
|
||||
|
||||
private String userId;
|
||||
private String mailTitle;
|
||||
|
||||
private String createTime;
|
||||
|
|
@ -15,6 +15,8 @@ public class ServerMailVo {
|
|||
private int state;
|
||||
private String createUser;
|
||||
private String mailSendTime;
|
||||
private String auditUser;
|
||||
private String auditTime;
|
||||
|
||||
public String getServerId() {
|
||||
return serverId;
|
||||
|
|
@ -32,6 +34,13 @@ public class ServerMailVo {
|
|||
return mailContent;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public void setMailTitle(String mailTitle) {
|
||||
this.mailTitle = mailTitle;
|
||||
|
|
@ -98,4 +107,20 @@ public class ServerMailVo {
|
|||
public void setMailSendTime(String mailSendTime) {
|
||||
this.mailSendTime = mailSendTime;
|
||||
}
|
||||
|
||||
public String getAuditUser() {
|
||||
return auditUser;
|
||||
}
|
||||
|
||||
public void setAuditUser(String auditUser) {
|
||||
this.auditUser = auditUser;
|
||||
}
|
||||
|
||||
public String getAuditTime() {
|
||||
return auditTime;
|
||||
}
|
||||
|
||||
public void setAuditTime(String auditTime) {
|
||||
this.auditTime = auditTime;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,101 +0,0 @@
|
|||
package com.jmfy.model.vo;
|
||||
|
||||
public class ServerPMailVo {
|
||||
|
||||
private int id;
|
||||
|
||||
private int serverId;
|
||||
private String userId;
|
||||
|
||||
private String mailTitle;
|
||||
|
||||
private String createTime;
|
||||
private String mailContent;
|
||||
private String rewards;
|
||||
private int version;
|
||||
private int state;
|
||||
private String createUser;
|
||||
|
||||
public int getServerId() {
|
||||
return serverId;
|
||||
}
|
||||
|
||||
public void setServerId(int serverId) {
|
||||
this.serverId = serverId;
|
||||
}
|
||||
|
||||
public String getMailTitle() {
|
||||
return mailTitle;
|
||||
}
|
||||
|
||||
public String getMailContent() {
|
||||
return mailContent;
|
||||
}
|
||||
|
||||
|
||||
public void setMailTitle(String mailTitle) {
|
||||
this.mailTitle = mailTitle;
|
||||
}
|
||||
|
||||
public void setMailContent(String mailContent) {
|
||||
this.mailContent = mailContent;
|
||||
}
|
||||
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getRewards() {
|
||||
return rewards;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public void setRewards(String rewards) {
|
||||
this.rewards = rewards;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(int state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return createUser;
|
||||
}
|
||||
|
||||
public void setCreateUser(String createUser) {
|
||||
this.createUser = createUser;
|
||||
}
|
||||
}
|
||||
|
|
@ -60,9 +60,9 @@
|
|||
<span class="c-red">*</span>
|
||||
游戏公告内容:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
中文<textarea rows="10" cols="150" wrap="soft" id="content1" name="content1" style="width:31%;"></textarea>
|
||||
英文<textarea rows="10" cols="150" wrap="soft" id="content2" name="content2" style="width:31%;"></textarea>
|
||||
越南文<textarea rows="10" cols="150" wrap="soft" id="content3" name="content3" style="width:29%;"></textarea>
|
||||
中文<textarea rows="5" cols="150" wrap="soft" id="content1" name="content1" style="width:100%;border:solid 1px #ddd"></textarea>
|
||||
英文<textarea rows="5" cols="150" wrap="soft" id="content2" name="content2" style="width:100%;border:solid 1px #ddd"></textarea>
|
||||
越南文<textarea rows="5" cols="150" wrap="soft" id="content3" name="content3" style="width:100%;border:solid 1px #ddd"></textarea>
|
||||
<span class="ROLEID"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@
|
|||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-2">
|
||||
<span class="c-red">*</span>
|
||||
用户id:</label>
|
||||
账号Id:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<textarea class="textarea" name="userIds" placeholder="用户id"></textarea>
|
||||
<textarea class="textarea" name="userIds" placeholder="账号id(openId)"></textarea>
|
||||
<span class="USERIDS"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@
|
|||
<div class="row cl">
|
||||
<label class="form-label col-xs-4 col-sm-2">
|
||||
<span class="c-red">*</span>
|
||||
用户id:</label>
|
||||
账号id:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<textarea class="textarea" name="opendid" placeholder="openid"></textarea>
|
||||
<textarea class="textarea" name="opendid" placeholder="openId"></textarea>
|
||||
<span class="USERIDS"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
<label class="form-label col-xs-4 col-sm-2">
|
||||
角色id:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
<textarea class="textarea" name="uid" placeholder="roleid"></textarea>
|
||||
<textarea class="textarea" name="uid" placeholder="userId"></textarea>
|
||||
<span class="UID"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -204,9 +204,9 @@
|
|||
</dt>
|
||||
<dd>
|
||||
<ul>
|
||||
<li th:if="${#lists.contains(pos.powers,901)} "><a data-href="sysMailCheck" data-title="系统邮件审核"
|
||||
<li th:if="${#lists.contains(pos.powers,901)} "><a data-href="getMailListToCheck?type=1" data-title="系统邮件审核"
|
||||
href="javascript:void(0)">系统邮件审核</a></li>
|
||||
<li th:if="${#lists.contains(pos.powers,902)} "><a data-href="pMailCheck" data-title="个人邮件审核"
|
||||
<li th:if="${#lists.contains(pos.powers,902)} "><a data-href="getMailListToCheck?type=2" data-title="个人邮件审核"
|
||||
href="javascript:void(0)">个人邮件审核</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@
|
|||
<body>
|
||||
<nav class="breadcrumb">
|
||||
<i class="Hui-iconfont"></i> 首页
|
||||
<span class="c-gray en">></span> 审核信息 <span class="c-gray en">></span> 个人邮件审核
|
||||
<span class="c-gray en">></span> 审核信息
|
||||
<span class="c-gray en">></span> 个人邮件审核
|
||||
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont"></i></a>
|
||||
</nav>
|
||||
<div class="page-container" style="text-align: center">
|
||||
<h2><span style="color:red;">审核信息</span></h2>
|
||||
|
|
@ -32,15 +34,17 @@
|
|||
<thead>
|
||||
<tr class="text-c">
|
||||
<!--<th width="25"><input type="checkbox" name="" value=""/></th>-->
|
||||
<th width="200">服务器id</th>
|
||||
<th width="100">服务器id</th>
|
||||
<th width="200">玩家id</th>
|
||||
<th width="200">标题</th>
|
||||
<th width="200">内容</th>
|
||||
<th width="200">创建时间</th>
|
||||
<th width="200">附件</th>
|
||||
<th width="200">客户端版本号</th>
|
||||
<th width="200">发件人</th>
|
||||
<th width="200">状态</th>
|
||||
<th width="100">客户端版本号</th>
|
||||
<th width="100">发件人</th>
|
||||
<th width="100">状态</th>
|
||||
<th width="100">审核人</th>
|
||||
<th width="100">审核时间</th>
|
||||
<th width="200">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -60,6 +64,8 @@
|
|||
<span th:case="1" class="Hui-iconfont" style="color: #8b0000">拒绝</span>
|
||||
<span th:case="2" class="Hui-iconfont" style="color: #00B83F">通过</span>
|
||||
</th>
|
||||
<td th:text="${obj.auditUser}" style="text-align: center;"></td>
|
||||
<td th:text="${obj.auditTime}" style="text-align: center;"></td>
|
||||
<td style="text-align: center; width: 300px">
|
||||
<button type="button" th:id="${obj.id}" class="btn btn-primary"
|
||||
onclick="return deleteMail(this)"><i class="Hui-iconfont"></i> 删除
|
||||
|
|
@ -67,7 +73,8 @@
|
|||
<button type="button" th:id="${obj.id}" class="btn btn-primary"
|
||||
onclick="return refuseMail(this)"><i class="Hui-iconfont"></i> 拒绝
|
||||
</button>
|
||||
<button type="button" th:id="${obj.id}" class="btn btn-success" onclick="return sendMail(this)">
|
||||
<button type="button" th:id="${obj.id}" class="btn btn-success"
|
||||
onclick="return sendMail(this)">
|
||||
<i class="Hui-iconfont"></i> 确认并发送
|
||||
</button>
|
||||
</td>
|
||||
|
|
@ -97,23 +104,24 @@
|
|||
]
|
||||
});
|
||||
|
||||
function refuseMail(obj, mailId) {
|
||||
mailId = $(obj).attr("id");
|
||||
function refuseMail(obj) {
|
||||
var mailId = $(obj).attr("id");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {"mailId": mailId},
|
||||
url: "/refusePMailCheck",
|
||||
url: "/refuseMailCheck",
|
||||
success: function (data) {
|
||||
if (data < 0) {
|
||||
if (data === 0) {
|
||||
layer.msg('操作失败!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 0) {
|
||||
if (data === 1) {
|
||||
layer.msg('操作成功!', {icon: 6, time: 1000});
|
||||
window.location.reload();
|
||||
}
|
||||
if (data == 1) {
|
||||
if (data === 2) {
|
||||
layer.msg('没有权限!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 2) {
|
||||
if (data === 3) {
|
||||
layer.msg('此邮件已被审核 请刷新页面!', {icon: 6, time: 1000});
|
||||
}
|
||||
}
|
||||
|
|
@ -121,18 +129,22 @@
|
|||
)
|
||||
}
|
||||
|
||||
function deleteMail(obj, mailId) {
|
||||
mailId = $(obj).attr("id");
|
||||
function deleteMail(obj) {
|
||||
var mailId = $(obj).attr("id");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {"mailId": mailId},
|
||||
url: "/deletePMailCheck",
|
||||
url: "/deleteMailCheck",
|
||||
success: function (data) {
|
||||
if (data < 0) {
|
||||
if (data === 0) {
|
||||
layer.msg('操作失败!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 0) {
|
||||
layer.msg('删除成功!', {icon: 6, time: 1000});
|
||||
if (data === 1) {
|
||||
layer.msg('操作成功!', {icon: 6, time: 1000});
|
||||
window.location.reload();
|
||||
}
|
||||
if (data === 2) {
|
||||
layer.msg('没有权限!', {icon: 6, time: 1000});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -140,33 +152,29 @@
|
|||
}
|
||||
|
||||
|
||||
function sendMail(obj, mailId) {
|
||||
mailId = $(obj).attr("id");
|
||||
function sendMail(obj) {
|
||||
var mailId = $(obj).attr("id");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {"mailId": mailId},
|
||||
url: "/tosendPersonalMail",
|
||||
data: {
|
||||
"mailId": mailId,
|
||||
"uid": 123123,
|
||||
},
|
||||
url: "/toSendMail",
|
||||
success: function (data) {
|
||||
if (data < 0) {
|
||||
if (data === 0) {
|
||||
layer.msg('操作失败!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 0) {
|
||||
layer.msg('发送成功!', {icon: 6, time: 1000});
|
||||
if (data === 1) {
|
||||
layer.msg('操作成功!', {icon: 6, time: 1000});
|
||||
window.location.reload();
|
||||
}
|
||||
if (data == 1) {
|
||||
if (data === 2) {
|
||||
layer.msg('没有权限!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 2) {
|
||||
if (data === 3) {
|
||||
layer.msg('此邮件已被审核 请刷新页面!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 5) {
|
||||
if (data === 4) {
|
||||
layer.msg('操作失败,请间隔一分钟再操作!', {icon: 6, time: 1000});
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,9 +86,9 @@
|
|||
<span class="c-red">*</span>
|
||||
邮件正文:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
中文<textarea class="textarea" name="mailContent1" style="width:31%;"></textarea>
|
||||
英文<textarea class="textarea" name="mailContent2" style="width:31%;"></textarea>
|
||||
越南文<textarea class="textarea" name="mailContent3" style="width:29%;"></textarea>
|
||||
中文<textarea rows="5" cols="150" wrap="soft" name="mailContent1" style="width:100%;border:solid 1px #ddd"></textarea>
|
||||
英文<textarea rows="5" cols="150" wrap="soft" name="mailContent2" style="width:100%;border:solid 1px #ddd"></textarea>
|
||||
越南文<textarea rows="5" cols="150" wrap="soft" name="mailContent3" style="width:100%;border:solid 1px #ddd"></textarea>
|
||||
<span class="MAILCONTENT"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -392,17 +392,18 @@
|
|||
"itemNums": itemNums,
|
||||
"sendTime": sendTime,
|
||||
"effectTime": effectTime,
|
||||
"version": version
|
||||
"version": version,
|
||||
"type": 1
|
||||
}),
|
||||
dataType: "json",
|
||||
contentType:'application/json',
|
||||
|
||||
url: "/sendPersonalMailWithBack",
|
||||
success: function (data) {
|
||||
if (data == 0) {
|
||||
if (data === 0) {
|
||||
layer.msg('发送邮件成功!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 1) {
|
||||
if (data === 1) {
|
||||
layer.msg('发送邮件失败!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data === 2) {
|
||||
|
|
|
|||
|
|
@ -85,9 +85,9 @@
|
|||
<span class="c-red">*</span>
|
||||
邮件正文:</label>
|
||||
<div class="formControls col-xs-8 col-sm-9">
|
||||
中文<textarea class="textarea" name="mailContent1" style="width:31%;"></textarea>
|
||||
英文<textarea class="textarea" name="mailContent2" style="width:31%;"></textarea>
|
||||
越南文<textarea class="textarea" name="mailContent3" style="width:29%;"></textarea>
|
||||
中文<textarea rows="5" cols="150" wrap="soft" name="mailContent1" style="width:100%;border:solid 1px #ddd"></textarea>
|
||||
英文<textarea rows="5" cols="150" wrap="soft" name="mailContent2" style="width:100%;border:solid 1px #ddd"></textarea>
|
||||
越南文<textarea rows="5" cols="150" wrap="soft" name="mailContent3" style="width:100%;border:solid 1px #ddd"></textarea>
|
||||
<span class="MAILCONTENT"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -397,7 +397,8 @@
|
|||
"sendTime": sendTime,
|
||||
"playerRTime": playerRTime,
|
||||
"effectTime": effectTime,
|
||||
"version": version
|
||||
"version": version,
|
||||
"type": 0
|
||||
})
|
||||
,
|
||||
url: "/sendSysMailWithBack",
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@
|
|||
<body>
|
||||
<nav class="breadcrumb">
|
||||
<i class="Hui-iconfont"></i> 首页
|
||||
<span class="c-gray en">></span> 审核信息 <span class="c-gray en">></span> 全服邮件审核
|
||||
<span class="c-gray en">></span> 审核信息
|
||||
<span class="c-gray en">></span> 全服邮件审核
|
||||
<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont"></i></a>
|
||||
</nav>
|
||||
<div class="page-container" style="text-align: center">
|
||||
<h2><span style="color:red;">审核信息</span></h2>
|
||||
|
|
@ -32,14 +34,16 @@
|
|||
<thead>
|
||||
<tr class="text-c">
|
||||
<!--<th width="25"><input type="checkbox" name="" value=""/></th>-->
|
||||
<th width="200">服务器</th>
|
||||
<th width="100">服务器</th>
|
||||
<th width="200">标题</th>
|
||||
<th width="200">内容</th>
|
||||
<th width="200">创建时间</th>
|
||||
<th width="100">创建时间</th>
|
||||
<th width="200">附件</th>
|
||||
<th width="200">邮件发送时间</th>
|
||||
<th width="200">发件人</th>
|
||||
<th width="200">状态</th>
|
||||
<th width="100">邮件发送时间</th>
|
||||
<th width="100">发件人</th>
|
||||
<th width="100">状态</th>
|
||||
<th width="100">审核人</th>
|
||||
<th width="100">审核时间</th>
|
||||
<th width="200">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -58,6 +62,8 @@
|
|||
<span th:case="1" class="Hui-iconfont" style="color: #8b0000">拒绝</span>
|
||||
<span th:case="2" class="Hui-iconfont" style="color: #00B83F">通过</span>
|
||||
</th>
|
||||
<td th:text="${obj.auditUser}" style="text-align: center;"></td>
|
||||
<td th:text="${obj.auditTime}" style="text-align: center;"></td>
|
||||
<td style="text-align: center; width: 300px">
|
||||
<button type="button" th:id="${obj.id}" class="btn btn-primary"
|
||||
onclick="return deleteMail(this)"><i class="Hui-iconfont"></i> 删除
|
||||
|
|
@ -95,23 +101,24 @@
|
|||
]
|
||||
});
|
||||
|
||||
function refuseMail(obj, mailId) {
|
||||
mailId = $(obj).attr("id");
|
||||
function refuseMail(obj) {
|
||||
var mailId = $(obj).attr("id");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {"mailId": mailId},
|
||||
url: "/refuseSysMailCheck",
|
||||
url: "/refuseMailCheck",
|
||||
success: function (data) {
|
||||
if (data < 0) {
|
||||
if (data === 0) {
|
||||
layer.msg('操作失败!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 0) {
|
||||
if (data === 1) {
|
||||
layer.msg('操作成功!', {icon: 6, time: 1000});
|
||||
window.location.reload();
|
||||
}
|
||||
if (data == 1) {
|
||||
if (data === 2) {
|
||||
layer.msg('没有权限!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 2) {
|
||||
if (data === 3) {
|
||||
layer.msg('此邮件已被审核 请刷新页面!', {icon: 6, time: 1000});
|
||||
}
|
||||
}
|
||||
|
|
@ -119,18 +126,22 @@
|
|||
)
|
||||
}
|
||||
|
||||
function deleteMail(obj, mailId) {
|
||||
mailId = $(obj).attr("id");
|
||||
function deleteMail(obj) {
|
||||
var mailId = $(obj).attr("id");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {"mailId": mailId},
|
||||
url: "/deleteSysMailCheck",
|
||||
url: "/deleteMailCheck",
|
||||
success: function (data) {
|
||||
if (data < 0) {
|
||||
if (data === 0) {
|
||||
layer.msg('操作失败!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 0) {
|
||||
layer.msg('删除成功!', {icon: 6, time: 1000});
|
||||
if (data === 1) {
|
||||
layer.msg('操作成功!', {icon: 6, time: 1000});
|
||||
window.location.reload();
|
||||
}
|
||||
if (data === 2) {
|
||||
layer.msg('没有权限!', {icon: 6, time: 1000});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -138,30 +149,29 @@
|
|||
}
|
||||
|
||||
|
||||
function sendMail(obj, mailId) {
|
||||
mailId = $(obj).attr("id");
|
||||
function sendMail(obj) {
|
||||
var mailId = $(obj).attr("id");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {"mailId": mailId},
|
||||
url: "/toSendSysMail",
|
||||
data: {
|
||||
"mailId": mailId,
|
||||
"uid": 123123,
|
||||
},
|
||||
url: "/toSendMail",
|
||||
success: function (data) {
|
||||
if (data < 0) {
|
||||
if (data === 0) {
|
||||
layer.msg('操作失败!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 0) {
|
||||
layer.msg('发送成功!', {icon: 6, time: 1000});
|
||||
if (data === 1) {
|
||||
layer.msg('操作成功!', {icon: 6, time: 1000});
|
||||
window.location.reload();
|
||||
}
|
||||
if (data == 1) {
|
||||
if (data === 2) {
|
||||
layer.msg('没有权限!', {icon: 6, time: 1000});
|
||||
}
|
||||
if (data == 2) {
|
||||
if (data === 3) {
|
||||
layer.msg('此邮件已被审核 请刷新页面!', {icon: 6, time: 1000});
|
||||
}
|
||||
|
||||
if (data === 4) {
|
||||
layer.msg('操作失败,请间隔一分钟再操作!', {icon: 6, time: 1000});
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue