Default Changelist

This commit is contained in:
20932067@zju.edu.cn 2021-03-23 10:12:57 +08:00
parent b453f4a3bf
commit 121de5a9d7
10 changed files with 98 additions and 42 deletions

View File

@ -74,7 +74,7 @@ public class MvcConfiguration implements ApplicationContextAware, WebMvcConfigur
"Access-Control-Allow-Origin",
"access-control-max-age",
"X-Frame-Options")
.allowCredentials(false).maxAge(3600);
.allowCredentials(true).maxAge(3600);
WebMvcConfigurer.super.addCorsMappings(registry);
}
}

View File

@ -31,9 +31,9 @@ public class DataSourceConfiguration {
public ComboPooledDataSource createDataSource() throws PropertyVetoException {
ComboPooledDataSource dataSource = new ComboPooledDataSource();
dataSource.setDriverClass(DESUtil.getDecryptString(jdbcDriver));
dataSource.setJdbcUrl(DESUtil.getDecryptString(jdbcUrl));
dataSource.setUser(DESUtil.getDecryptString(jdbcUserNmae));
dataSource.setPassword(DESUtil.getDecryptString(jdbcPassWord));
dataSource.setJdbcUrl(jdbcUrl);
dataSource.setUser(jdbcUserNmae);
dataSource.setPassword(jdbcPassWord);
dataSource.setMaxPoolSize(30);
dataSource.setMinPoolSize(10);
dataSource.setAutoCommitOnClose(false);

View File

@ -44,10 +44,10 @@ public class MessageController {
String msgTitle = HttpServletRequestUtil.getString(request,"msgTitle");
String content = HttpServletRequestUtil.getString(request,"content");
if (msgwho<1||msgwho>2){
return new Result(false,0,"msgwho值错误");
return new Result(false,0,"发送给谁不能为空");
}
if (msgwho == 1 && (msgOneGrade<1||msgOneGrade>3)){
return new Result(false,0,"msgOneGrade值错误");
return new Result(false,0,"对象级别不能为空");
}
if (msgwho ==2 && phone == null){
return new Result(false,0,"发送对象电话不能为空");

View File

@ -51,7 +51,7 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
JSONObject res = new JSONObject();
if (token == null){
res.put("success",false);
res.put("errorMsg","缺少必要参数");
res.put("msg","缺少必要参数");
res.put("errorCode",-1);
response.getWriter().write(res.toString());
return false;
@ -59,7 +59,7 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
Account account = verifyToken(token);
if (account == null){
res.put("success",false);
res.put("errorMsg","token有误或者过期");
res.put("msg","token有误或者过期");
res.put("errorCode",-2);
response.getWriter().write(res.toString());
return false;
@ -72,7 +72,7 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
// 执行认证
if (account.getIdentityId() !=1){
res.put("success",false);
res.put("errorMsg","您没有权限");
res.put("msg","您没有权限");
res.put("errorCode",-2);
response.getWriter().write(res.toString());
return false;
@ -89,7 +89,7 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
}
if (account.getIdentityId() !=2){
res.put("success",false);
res.put("errorMsg","您没有权限");
res.put("msg","您没有权限");
res.put("errorCode",-2);
response.getWriter().write(res.toString());
return false;
@ -106,7 +106,7 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
}
if (account.getIdentityId() !=3){
res.put("success",false);
res.put("errorMsg","您没有权限");
res.put("msg","您没有权限");
res.put("errorCode",-2);
response.getWriter().write(res.toString());
return false;

View File

@ -68,6 +68,7 @@ public class OrderServiceImpl implements OrderService {
/**
* 管理员获取所有的的订单列表
*
* @param orderSelect
* @return
*/
@ -92,6 +93,7 @@ public class OrderServiceImpl implements OrderService {
/**
* 用户获取自己的的订单列表
*
* @param orderSelect
* @return
*/
@ -116,6 +118,7 @@ public class OrderServiceImpl implements OrderService {
/**
* 任务大厅,快递员领取任务列表
*
* @param orderSelect
* @return
*/
@ -159,23 +162,23 @@ public class OrderServiceImpl implements OrderService {
Date nowDate = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");
String title = "校园小飞侠系统提醒您";
String msgcontent = "您发布的订单在"+simpleDateFormat.format(nowDate.getTime())+"被配送员 "+courier.getUsername()+" 接单啦,联系电话为:"+courier.getPhone()+"邮箱为:"+courier.getEmail()+"详情在我的订单>>当前订单 查看";
String msgcontent = "您发布的订单在" + simpleDateFormat.format(nowDate.getTime()) + "被配送员 " + courier.getUsername() + " 接单啦,联系电话为:" + courier.getPhone() + "邮箱为:" + courier.getEmail() + "详情在我的订单>>当前订单 查看";
String mailcontent = "<div class=\"text2\">\n" +
"\t\t\t尊敬的"+account.getUsername()+"您好:\n" +
"\t\t\t尊敬的" + account.getUsername() + "您好:\n" +
"\t\t</div>\n" +
"\t\t<div class=\"text3\">\n" +
"\t\t\t您的快递已被小飞侠"+simpleDateFormat.format(nowDate.getTime())+"代取!<br /><br />\n" +
"\t\t\t您的快递已被小飞侠" + courier.getUsername() + "代取!<br /><br />\n" +
"\t\t</div>\n" +
"\t\t<div class=\"text4\">\n" +
"\t\t\t代取时间:"+simpleDateFormat.format(nowDate.getTime())+"<br /><br />\n" +
"\t\t\t联系方式:"+courier.getPhone()+" \n" +
"\t\t\t联系方式:" + courier.getPhone() + " \n" +
"\t\t\t代取时间:" + simpleDateFormat.format(nowDate.getTime()) + "<br /><br />\n" +
"\t\t</div>";
Messages messages = new Messages(account.getId(),title,msgcontent);
Messages messages = new Messages(account.getId(), title, msgcontent);
Integer mtype = messagesDao.insertMessage(messages);
if (mtype !=1 ){
if (mtype != 1) {
logger.error("信息发送失败");
}
sendMail(account,title,mailcontent);
sendMail(account, title, mailcontent);
return new OrderExcution<List<OrderCourier>>(OrderEnum.SUCCESS);
} else {
return new OrderExcution<List<OrderCourier>>(OrderEnum.EREE);
@ -189,6 +192,7 @@ public class OrderServiceImpl implements OrderService {
/**
* 快递员获取自己的任务列表
*
* @param orderSelect
* @param courierId
* @return
@ -213,6 +217,7 @@ public class OrderServiceImpl implements OrderService {
/**
* 快递员送达快递
*
* @param orderModifyState
* @param courier
* @return
@ -230,25 +235,25 @@ public class OrderServiceImpl implements OrderService {
Date nowDate = new Date();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");
String title = "校园小飞侠系统提醒您";
String msgcontent = "派送员与:"+simpleDateFormat.format(nowDate.getTime())+"申请订单完成!派送员姓名:"+courier.getUsername()+"联系电话为:"+courier.getPhone()+"邮箱为:"+courier.getEmail()+"您是否收到快递? \n" +
String msgcontent = "派送员与:" + simpleDateFormat.format(nowDate.getTime()) + "申请订单完成!派送员姓名:" + courier.getUsername() + "联系电话为:" + courier.getPhone() + "邮箱为:" + courier.getEmail() + "您是否收到快递? \n" +
" 收到快递则可在 我的订单>>当前订单 选择完成订单.\n" +
" 很高兴为您服务,欢迎再次使用";
String mailcontent = "<div class=\"text2\">\n" +
"\t\t\t尊敬的"+account.getUsername()+"您好:\n" +
"\t\t\t尊敬的" + account.getUsername() + "您好:\n" +
"\t\t</div>\n" +
"\t\t<div class=\"text3\">\n" +
"\t\t\t您的快递已被小飞侠"+simpleDateFormat.format(nowDate.getTime())+"送达!<br /><br />\n" +
"\t\t\t您的快递已被小飞侠" + courier.getUsername() + "送达!<br /><br />\n" +
"\t\t</div>\n" +
"\t\t<div class=\"text4\">\n" +
"\t\t\t送达时间:"+courier.getPhone()+"<br /><br />\n" +
"\t\t\t联系方式:"+courier.getPhone()+" \n" +
"\t\t\t联系方式:" + courier.getPhone() + " \n" +
"\t\t\t送达时间:" + simpleDateFormat.format(nowDate.getTime()) + "<br /><br />\n" +
"\t\t</div>";
Messages messages = new Messages(account.getId(),title,msgcontent);
Messages messages = new Messages(account.getId(), title, msgcontent);
Integer mtype = messagesDao.insertMessage(messages);
if (mtype !=1 ){
if (mtype != 1) {
logger.error("信息发送失败");
}
sendMail(account,title,mailcontent);
sendMail(account, title, mailcontent);
return new OrderExcution<List<OrderCourier>>(OrderEnum.SUCCESS);
} else {
return new OrderExcution<List<OrderCourier>>(OrderEnum.EREE);
@ -262,6 +267,7 @@ public class OrderServiceImpl implements OrderService {
/**
* 用户确认快递送达
*
* @param orderModifyState
* @return
*/
@ -287,6 +293,7 @@ public class OrderServiceImpl implements OrderService {
/**
* 用户取消订单
*
* @param orderid
* @param acountid
* @return
@ -310,17 +317,17 @@ public class OrderServiceImpl implements OrderService {
}
}
public void sendMail(Account account,String title,String content){
public void sendMail(Account account, String title, String content) {
// todo 后期加入邮件发送表
MailConfig mailConfig = mailConfigDao.getMailConfig();
boolean type =false;
if (mailConfig.getState()==1){
type = MailUnit.sendTheMail(account,mailConfig,title,content);
boolean type = false;
if (mailConfig.getState() == 1) {
type = MailUnit.sendTheMail(account, mailConfig, title, content);
}
if (type){
logger.info(account.getEmail()+""+new Date() + "发送邮件成功");
}else {
logger.info(account.getEmail()+""+new Date() + "发送邮件失败");
if (type) {
logger.info(account.getEmail() + "" + new Date() + "发送邮件成功");
} else {
logger.info(account.getEmail() + "" + new Date() + "发送邮件失败");
}
}
}

View File

@ -106,7 +106,7 @@ public class DESUtil {
// System.out.println(getDecryptString("xW6OiZLo8/ly0RW0vIm4nLovV+Cp9HuqfGXYUO1QtqN9nov1i1mGCu8wfdlb0IvGQHy33l1ok5iSMx9lhN6SddVTN8vsBv7h4gCCwYDigan+8xhhH6uqF/HKdged+cE/06RLny3n8Yrcdip9/pz8lH3HZ+yT8kTf9VR6z1T2+x7Kdbs8O5h4aUZN0O7ExVaX"));
// DecodedJWT jwt = null;
// System.out.println(getEncryptString("mall"));
System.out.println(getDecryptString("EGLUqBf4x5ofJAfVsP+M2w=="));
System.out.println(getDecryptString("xW6OiZLo8/kiW6baGG4kKlxB11i7ytYuDXFcirNE/QxgG6+R9g0kSMNfA3gR9TiRFSQZJ52gM2PVPnmwI8p1dBl0yiCdG7wJXEojUovXnEeESCOUiTu5t9AAB0WAn4P/HJUrZHOeJHdRwMGTTMrHyS4RDb+iakxCQOVpH5Ht8qe3dXTHHXY65A=="));
// JWTVerifier verifier = JWT.require(Algorithm.HMAC256("root")).build();
// jwt = verifier.verify("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJyb290In0.nMqswrNZRESPR3tx8YgRN-jZ2y80XgvuLM5gFFKIRm0");
//

View File

@ -101,6 +101,15 @@ public class MailUnit {
" padding-left: 200px;\n" +
" }\n" +
"\n" +
"\n" +
"#mailContentContainer{\n" +
" height: 600px !important;\n" +
"}" +
"\n" +
".box{\n" +
" height: 610px;\n" +
" margin-bottom: 50px;\n" +
"}" +
" .text4 {\n" +
" font-size: 20px;\n" +
" padding-left: 200px;\n" +

View File

@ -0,0 +1,41 @@
package live.tomey.api.express.unit;
import java.util.Scanner;
/**
* @Author 18209
* @Date 2021/3/20 21:03
* @Version 1.0
*/
public class Run1 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double a, b, sum = 0;
String op, ch = "";
do {
System.out.println(("请输入第一个数:"));
a = scanner.nextDouble();
System.out.println(("请输入第二个数:"));
b = scanner.nextDouble();
System.out.println("请输入运算符:");
op = scanner.next();
if (op.equals("+")) {
sum = a + b;
} else if (op.equals("-")) {
sum = a - b;
} else if (op.equals("*")) {
sum = a * b;
} else if (op.equals("/")) {
sum = a / b;
} else {
System.out.println("错误");
continue;
}
System.out.println("结果" + a + op + b + "=" + sum);
System.out.println("是否还要继续运算?(y/n)");
ch = scanner.next();
} while (ch.equals("y") | ch.equals("Y"));
System.out.println("程序结束!");
}
}

View File

@ -24,13 +24,12 @@ spring.servlet.multipart.maxRequestSize=200MB
# 数据库dataSource
jdbc.driver=8zQIdS8RzOBmd4qRctgYdYM/fdvrjnIJHyQH1bD/jNs=
#服务器本地127.0.0.1
jdbc.url=xW6OiZLo8/kYFd+0f9nXNXXZg17CJWnfoV5JrAnJaOAhvoLVW/PHqSV0jFnpOIVAxA0arcvd8KTK5pmV8Pi3bPJxQoH6zwkUve3efptPE0f+GUBKpacl+rFIuiDIGGARWhD3wSn+1Q8t+jGw15GlDz/ASsSv8SiOXSlZnsWSVKIbTqDgaMM1VA==
jdbc.urlA=xW6OiZLo8/kYFd+0f9nXNXXZg17CJWnfoV5JrAnJaOAhvoLVW/PHqSV0jFnpOIVAxA0arcvd8KTK5pmV8Pi3bPJxQoH6zwkUve3efptPE0f+GUBKpacl+rFIuiDIGGARWhD3wSn+1Q8t+jGw15GlDz/ASsSv8SiOXSlZnsWSVKIbTqDgaMM1VA==
#azure
jdbc.urla=xW6OiZLo8/kiW6baGG4kKlxB11i7ytYuDXFcirNE/QxgG6+R9g0kSMNfA3gR9TiRFSQZJ52gM2PVPnmwI8p1dBl0yiCdG7wJXEojUovXnEeESCOUiTu5t9AAB0WAn4P/HJUrZHOeJHdRwMGTTMrHyS4RDb+iakxCQOVpH5Ht8qe3dXTHHXY65A==
jdbc.url=jdbc:mysql://40.83.126.15:3306/mall?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
#服务器ip
jdbc.urls=xW6OiZLo8/ly0RW0vIm4nFrLZaXQTX62SFF7HwCqLmpgG6+R9g0kSMNfA3gR9TiRFSQZJ52gM2PVPnmwI8p1dBl0yiCdG7wJXEojUovXnEeESCOUiTu5t9AAB0WAn4P/HJUrZHOeJHdRwMGTTMrHyS4RDb+iakxCQOVpH5Ht8qe3dXTHHXY65A==
jdbc.username=j00C+YEiqH4=
jdbc.password=gBWrKLHw61rRzq6cZbP0Hh8kB9Ww/4zb
jdbc.username=mall
jdbc.password=dr4ap4dbnyCMZTcr
# Mybatis
mybatis_config_file=mybatis-config.xml

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
m<!DOCTYPE mapper
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="live.tomey.api.express.dao.MessagesDao">