格式化代码
This commit is contained in:
parent
2ed8ab7a8b
commit
60add8972d
|
|
@ -42,10 +42,9 @@ public class AccountController {
|
|||
private AccountService accountService;
|
||||
|
||||
|
||||
|
||||
@Root
|
||||
@RequestMapping(value = "getallaccount",method = RequestMethod.POST)
|
||||
private Result<Map<String,Object>> getAllAccount(HttpServletRequest request){
|
||||
@RequestMapping(value = "getallaccount", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> getAllAccount(HttpServletRequest request) {
|
||||
try {
|
||||
Map<String, Object> modelMap = new HashMap<String, Object>();
|
||||
Integer size = HttpServletRequestUtil.getInteger(request, "size");
|
||||
|
|
@ -53,18 +52,18 @@ public class AccountController {
|
|||
if (size == -1 || page == -1) {
|
||||
return new Result(false, 0, "数量和页数不能为空");
|
||||
}
|
||||
String phone = HttpServletRequestUtil.getString(request,"phone");
|
||||
String username = HttpServletRequestUtil.getString(request,"username");
|
||||
Integer identiyId = HttpServletRequestUtil.getInteger(request,"identiyId");
|
||||
String email = HttpServletRequestUtil.getString(request,"email");
|
||||
AccountSelect accountSelect = new AccountSelect(page,size,phone,username,identiyId,email);
|
||||
String phone = HttpServletRequestUtil.getString(request, "phone");
|
||||
String username = HttpServletRequestUtil.getString(request, "username");
|
||||
Integer identiyId = HttpServletRequestUtil.getInteger(request, "identiyId");
|
||||
String email = HttpServletRequestUtil.getString(request, "email");
|
||||
AccountSelect accountSelect = new AccountSelect(page, size, phone, username, identiyId, email);
|
||||
AccountRootExcution accountRootExcution = accountService.getAllAccount(accountSelect);
|
||||
if (accountRootExcution.getState()==1){
|
||||
modelMap.put("list",accountRootExcution.getAccountRoots());
|
||||
modelMap.put("count",accountRootExcution.getCount());
|
||||
return new Result<>(true,modelMap);
|
||||
}else {
|
||||
return new Result<>(false,accountRootExcution.getState(),accountRootExcution.getMsg());
|
||||
if (accountRootExcution.getState() == 1) {
|
||||
modelMap.put("list", accountRootExcution.getAccountRoots());
|
||||
modelMap.put("count", accountRootExcution.getCount());
|
||||
return new Result<>(true, modelMap);
|
||||
} else {
|
||||
return new Result<>(false, accountRootExcution.getState(), accountRootExcution.getMsg());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
|
|
@ -165,6 +164,7 @@ public class AccountController {
|
|||
|
||||
/**
|
||||
* 设置密保
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -184,11 +184,11 @@ public class AccountController {
|
|||
if (ncryptedAnswers == null) {
|
||||
return new Result(false, 0, "密保答案不能为空");
|
||||
}
|
||||
Account eaccount = new Account(account.getId(),ncryptedProble,ncryptedAnswers);
|
||||
Account eaccount = new Account(account.getId(), ncryptedProble, ncryptedAnswers);
|
||||
boolean start = accountService.editAccountEncrypted(eaccount);
|
||||
if (start){
|
||||
if (start) {
|
||||
return new Result(true, 0, "密保设置成功!");
|
||||
}else {
|
||||
} else {
|
||||
return new Result(false, 0, "密保设置失败!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
@ -332,15 +332,15 @@ public class AccountController {
|
|||
@RequestMapping(value = "/checkencrypted", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> checkEncrypted(HttpServletRequest request) {
|
||||
try {
|
||||
String phone = HttpServletRequestUtil.getString(request,"phone");
|
||||
if (phone == null||!phone.matches("^1[3|4|5|7|8][0-9]{9}$")) {
|
||||
String phone = HttpServletRequestUtil.getString(request, "phone");
|
||||
if (phone == null || !phone.matches("^1[3|4|5|7|8][0-9]{9}$")) {
|
||||
return new Result(false, 0, "");
|
||||
}
|
||||
Integer state = accountService.checkEncrypted(phone);
|
||||
if (state ==1){
|
||||
return new Result(true,1,"可以找回密码!");
|
||||
}else {
|
||||
return new Result(false,0,"您并未设置密码问题,无法找回密码,请联系管理员帮忙找回!");
|
||||
if (state == 1) {
|
||||
return new Result(true, 1, "可以找回密码!");
|
||||
} else {
|
||||
return new Result(false, 0, "您并未设置密码问题,无法找回密码,请联系管理员帮忙找回!");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
|
|
@ -349,7 +349,4 @@ public class AccountController {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class CategoryController {
|
|||
String details = HttpServletRequestUtil.getString(request, "details");
|
||||
Integer onnav = HttpServletRequestUtil.getInteger(request, "nonav");
|
||||
Integer sort = HttpServletRequestUtil.getInteger(request, "sort");
|
||||
Category category = new Category(id, pid, name, details, onnav,sort);
|
||||
Category category = new Category(id, pid, name, details, onnav, sort);
|
||||
boolean type = categoryService.editCategory(category);
|
||||
if (type) {
|
||||
return new Result(true, 1, "修改成功");
|
||||
|
|
@ -92,7 +92,7 @@ public class CategoryController {
|
|||
if (name == null) {
|
||||
return new Result(false, 0, "name不能为空");
|
||||
}
|
||||
Category category = new Category(pid, name, details, onnav,sort);
|
||||
Category category = new Category(pid, name, details, onnav, sort);
|
||||
boolean type = categoryService.addCategory(category);
|
||||
if (type) {
|
||||
return new Result(true, 1, "添加成功");
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ public class ComplaintController {
|
|||
private Result getComplaintCount(HttpServletRequest request) {
|
||||
try {
|
||||
ServerResult serverResult = complaintService.getComplaintCount();
|
||||
if (serverResult.isStart()){
|
||||
return new Result(true,serverResult.getData());
|
||||
}else {
|
||||
return new Result(false,-1,serverResult.getMsg());
|
||||
if (serverResult.isStart()) {
|
||||
return new Result(true, serverResult.getData());
|
||||
} else {
|
||||
return new Result(false, -1, serverResult.getMsg());
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
|
|
|
|||
|
|
@ -31,11 +31,12 @@ public class DataShowController {
|
|||
|
||||
/**
|
||||
* 获取数据信息
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Public
|
||||
@RequestMapping(value = "/getdatashowinfo",method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/getdatashowinfo", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> getSelfOrderList(HttpServletRequest request) {
|
||||
Account account = (Account) request.getSession().getAttribute("account");
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -34,22 +34,23 @@ public class FlatsController {
|
|||
|
||||
/**
|
||||
* 添加公寓信息
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Root
|
||||
@RequestMapping(value = "/addflats",method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/addflats", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> addFlats(HttpServletRequest request) {
|
||||
try {
|
||||
String flatsName = HttpServletRequestUtil.getString(request,"name");
|
||||
String desc = HttpServletRequestUtil.getString(request,"desc");
|
||||
Flats flats = new Flats(flatsName,desc);
|
||||
String flatsName = HttpServletRequestUtil.getString(request, "name");
|
||||
String desc = HttpServletRequestUtil.getString(request, "desc");
|
||||
Flats flats = new Flats(flatsName, desc);
|
||||
Integer type = flatsService.addFlats(flats);
|
||||
if (type != 1){
|
||||
if (type != 1) {
|
||||
return new Result(false, -1, "添加失败");
|
||||
}
|
||||
return new Result(true, 1,"添加成功");
|
||||
}catch (RuntimeException e){
|
||||
return new Result(true, 1, "添加成功");
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
|
||||
|
|
@ -58,23 +59,24 @@ public class FlatsController {
|
|||
|
||||
/**
|
||||
* 删除公寓信息
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Root
|
||||
@RequestMapping(value = "/removeflats",method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/removeflats", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> removeFlats(HttpServletRequest request) {
|
||||
try {
|
||||
Integer id = HttpServletRequestUtil.getInteger(request,"id");
|
||||
if (id==-1){
|
||||
Integer id = HttpServletRequestUtil.getInteger(request, "id");
|
||||
if (id == -1) {
|
||||
return new Result(false, -1, "id不能为空");
|
||||
}
|
||||
Integer type = flatsService.removeFlats(id);
|
||||
if (type != 1){
|
||||
if (type != 1) {
|
||||
return new Result(false, -1, "删除失败");
|
||||
}
|
||||
return new Result(true, 1,"删除成功");
|
||||
}catch (RuntimeException e){
|
||||
return new Result(true, 1, "删除成功");
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
|
||||
|
|
@ -83,27 +85,28 @@ public class FlatsController {
|
|||
|
||||
/**
|
||||
* 修改公寓信息
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Root
|
||||
@RequestMapping(value = "/editflats",method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/editflats", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> editFlats(HttpServletRequest request) {
|
||||
try {
|
||||
Integer id = HttpServletRequestUtil.getInteger(request,"id");
|
||||
String flatsName = HttpServletRequestUtil.getString(request,"name");
|
||||
String desc = HttpServletRequestUtil.getString(request,"desc");
|
||||
if (id==-1){
|
||||
Integer id = HttpServletRequestUtil.getInteger(request, "id");
|
||||
String flatsName = HttpServletRequestUtil.getString(request, "name");
|
||||
String desc = HttpServletRequestUtil.getString(request, "desc");
|
||||
if (id == -1) {
|
||||
return new Result(false, -1, "id不能为空");
|
||||
}
|
||||
Flats flats = new Flats(id,flatsName,desc);
|
||||
Flats flats = new Flats(id, flatsName, desc);
|
||||
Integer type = flatsService.editFlats(flats);
|
||||
if (type != 1){
|
||||
if (type != 1) {
|
||||
return new Result(false, -1, "修改失败");
|
||||
}
|
||||
return new Result(true, 1,"修改成功");
|
||||
|
||||
}catch (RuntimeException e){
|
||||
return new Result(true, 1, "修改成功");
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
|
||||
|
|
@ -112,22 +115,23 @@ public class FlatsController {
|
|||
|
||||
/**
|
||||
* 获取公寓信息
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PassToken
|
||||
@RequestMapping(value = "/getallflats",method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/getallflats", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> getAllFlats(HttpServletRequest request) {
|
||||
try {
|
||||
List<Flats> flatsList = flatsService.getAllFlats();
|
||||
if (flatsList == null){
|
||||
if (flatsList == null) {
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
}
|
||||
if (flatsList.size()>0){
|
||||
if (flatsList.size() > 0) {
|
||||
return new Result(true, flatsList);
|
||||
}
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ public class MailConfigController {
|
|||
private Result testSendMail(HttpServletRequest request) {
|
||||
try {
|
||||
Account account = (Account) request.getSession().getAttribute("account");
|
||||
if (account==null){
|
||||
return new Result(false,0,"系统错误");
|
||||
if (account == null) {
|
||||
return new Result(false, 0, "系统错误");
|
||||
}
|
||||
ServerResult serverResult = mailConfigService.testSendMessage(account);
|
||||
return new Result(serverResult.isStart(),0 ,serverResult.getMsg());
|
||||
return new Result(serverResult.isStart(), 0, serverResult.getMsg());
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new Result(false, -1, "系统错误!");
|
||||
|
|
|
|||
|
|
@ -35,35 +35,35 @@ public class MessageController {
|
|||
private MessageService messageService;
|
||||
|
||||
@Root
|
||||
@RequestMapping(value = "sendmessage",method = RequestMethod.POST)
|
||||
private Result sendMessage (HttpServletRequest request) {
|
||||
@RequestMapping(value = "sendmessage", method = RequestMethod.POST)
|
||||
private Result sendMessage(HttpServletRequest request) {
|
||||
try {
|
||||
Integer msgwho = HttpServletRequestUtil.getInteger(request,"msgwho");
|
||||
Integer msgOneGrade = HttpServletRequestUtil.getInteger(request,"msgOneGrade");
|
||||
String phone = HttpServletRequestUtil.getString(request,"phone");
|
||||
String msgTitle = HttpServletRequestUtil.getString(request,"msgTitle");
|
||||
String content = HttpServletRequestUtil.getString(request,"content");
|
||||
if (msgwho<1||msgwho>2){
|
||||
return new Result(false,0,"发送给谁不能为空");
|
||||
Integer msgwho = HttpServletRequestUtil.getInteger(request, "msgwho");
|
||||
Integer msgOneGrade = HttpServletRequestUtil.getInteger(request, "msgOneGrade");
|
||||
String phone = HttpServletRequestUtil.getString(request, "phone");
|
||||
String msgTitle = HttpServletRequestUtil.getString(request, "msgTitle");
|
||||
String content = HttpServletRequestUtil.getString(request, "content");
|
||||
if (msgwho < 1 || msgwho > 2) {
|
||||
return new Result(false, 0, "发送给谁不能为空");
|
||||
}
|
||||
if (msgwho == 1 && (msgOneGrade<1||msgOneGrade>3)){
|
||||
return new Result(false,0,"对象级别不能为空");
|
||||
if (msgwho == 1 && (msgOneGrade < 1 || msgOneGrade > 3)) {
|
||||
return new Result(false, 0, "对象级别不能为空");
|
||||
}
|
||||
if (msgwho ==2 && phone == null){
|
||||
return new Result(false,0,"发送对象电话不能为空");
|
||||
if (msgwho == 2 && phone == null) {
|
||||
return new Result(false, 0, "发送对象电话不能为空");
|
||||
}
|
||||
if (msgTitle==null){
|
||||
return new Result(false,0,"标题不能为空");
|
||||
if (msgTitle == null) {
|
||||
return new Result(false, 0, "标题不能为空");
|
||||
}
|
||||
if (content==null){
|
||||
return new Result(false,0,"内容不能为空");
|
||||
if (content == null) {
|
||||
return new Result(false, 0, "内容不能为空");
|
||||
}
|
||||
SendMessage sendMessage = new SendMessage(msgwho,msgOneGrade,phone,msgTitle,content);
|
||||
SendMessage sendMessage = new SendMessage(msgwho, msgOneGrade, phone, msgTitle, content);
|
||||
ServerResult serverResult = messageService.sendMessage(sendMessage);
|
||||
if (serverResult.isStart()){
|
||||
return new Result(true,1,"发送成功");
|
||||
}else {
|
||||
return new Result(false,-1,serverResult.getMsg());
|
||||
if (serverResult.isStart()) {
|
||||
return new Result(true, 1, "发送成功");
|
||||
} else {
|
||||
return new Result(false, -1, serverResult.getMsg());
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
|
|
@ -81,10 +81,10 @@ public class MessageController {
|
|||
}
|
||||
try {
|
||||
ServerResult serverResult = messageService.getMessageReaderCount(account.getId());
|
||||
if (serverResult.isStart()){
|
||||
return new Result(true,serverResult.getData());
|
||||
}else {
|
||||
return new Result(false,0,serverResult.getMsg());
|
||||
if (serverResult.isStart()) {
|
||||
return new Result(true, serverResult.getData());
|
||||
} else {
|
||||
return new Result(false, 0, serverResult.getMsg());
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
|
|
|
|||
|
|
@ -35,26 +35,27 @@ public class OrderController {
|
|||
|
||||
/**
|
||||
* 用户取消订单
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@UserLoginToken
|
||||
@RequestMapping(value = "/cancel", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> cancel(HttpServletRequest request) {
|
||||
Account account = (Account)request.getSession().getAttribute("account");
|
||||
try{
|
||||
Account account = (Account) request.getSession().getAttribute("account");
|
||||
try {
|
||||
Integer orderid = HttpServletRequestUtil.getInteger(request, "orderid");
|
||||
Integer type = orderService.cancelOrder(orderid, account.getId());
|
||||
if (type==1){
|
||||
if (type == 1) {
|
||||
return new Result(true, "删除成功");
|
||||
}else if (type==0){
|
||||
} else if (type == 0) {
|
||||
return new Result(false, "删除失败");
|
||||
}else if (type == 2){
|
||||
} else if (type == 2) {
|
||||
return new Result(false, "订单已无法删除");
|
||||
}else {
|
||||
} else {
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
}
|
||||
}catch (RuntimeException e) {
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
}
|
||||
|
|
@ -62,6 +63,7 @@ public class OrderController {
|
|||
|
||||
/**
|
||||
* 用户确认快递送达
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -86,6 +88,7 @@ public class OrderController {
|
|||
|
||||
/**
|
||||
* 快递员送达快递
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -99,7 +102,7 @@ public class OrderController {
|
|||
try {
|
||||
Integer id = HttpServletRequestUtil.getInteger(request, "id");
|
||||
OrderModifyState orderModifyState = new OrderModifyState(id, account.getId(), 3);
|
||||
OrderExcution orderExcution = orderService.changDelivery(orderModifyState,account );
|
||||
OrderExcution orderExcution = orderService.changDelivery(orderModifyState, account);
|
||||
if (orderExcution.getState() == 1) {
|
||||
return new Result(true, 1, "派送成功");
|
||||
} else {
|
||||
|
|
@ -113,6 +116,7 @@ public class OrderController {
|
|||
|
||||
/**
|
||||
* 快递员获取自己的任务列表
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -156,6 +160,7 @@ public class OrderController {
|
|||
|
||||
/**
|
||||
* 快递员获取任务
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -221,6 +226,7 @@ public class OrderController {
|
|||
|
||||
/**
|
||||
* 管理员获取所有的的订单列表
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -260,6 +266,7 @@ public class OrderController {
|
|||
|
||||
/**
|
||||
* 用户获取自己的的订单列表
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -267,7 +274,7 @@ public class OrderController {
|
|||
@RequestMapping(value = "/getselforderlist", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> getSelfOrderList(HttpServletRequest request) {
|
||||
Map<String, Object> modelMap = new HashMap<String, Object>();
|
||||
Account account = (Account)request.getSession().getAttribute("account");
|
||||
Account account = (Account) request.getSession().getAttribute("account");
|
||||
try {
|
||||
Integer size = HttpServletRequestUtil.getInteger(request, "size");
|
||||
Integer page = HttpServletRequestUtil.getInteger(request, "page");
|
||||
|
|
@ -299,6 +306,7 @@ public class OrderController {
|
|||
|
||||
/**
|
||||
* 添加订单
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -35,23 +35,24 @@ public class PriceController {
|
|||
|
||||
/**
|
||||
* 添加价格
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Root
|
||||
@RequestMapping(value = "addprice",method = RequestMethod.POST)
|
||||
private Result addPrice(HttpServletRequest request){
|
||||
@RequestMapping(value = "addprice", method = RequestMethod.POST)
|
||||
private Result addPrice(HttpServletRequest request) {
|
||||
try {
|
||||
Double prices = HttpServletRequestUtil.getDouble(request,"price");
|
||||
String desc = HttpServletRequestUtil.getString(request,"desc");
|
||||
Price price = new Price(prices,desc);
|
||||
Double prices = HttpServletRequestUtil.getDouble(request, "price");
|
||||
String desc = HttpServletRequestUtil.getString(request, "desc");
|
||||
Price price = new Price(prices, desc);
|
||||
ServerResult serverResult = priceSercie.addPrice(price);
|
||||
if (serverResult.isStart()){
|
||||
return new Result(true,1,serverResult.getMsg());
|
||||
}else {
|
||||
return new Result(false,-1,serverResult.getMsg());
|
||||
if (serverResult.isStart()) {
|
||||
return new Result(true, 1, serverResult.getMsg());
|
||||
} else {
|
||||
return new Result(false, -1, serverResult.getMsg());
|
||||
}
|
||||
}catch (RuntimeException e) {
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
}
|
||||
|
|
@ -60,53 +61,54 @@ public class PriceController {
|
|||
|
||||
/**
|
||||
* 删除价格
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Root
|
||||
@RequestMapping(value = "/removeprice",method = RequestMethod.POST)
|
||||
private Result removePrice(HttpServletRequest request){
|
||||
@RequestMapping(value = "/removeprice", method = RequestMethod.POST)
|
||||
private Result removePrice(HttpServletRequest request) {
|
||||
try {
|
||||
Integer id = HttpServletRequestUtil.getInteger(request,"id");
|
||||
Integer id = HttpServletRequestUtil.getInteger(request, "id");
|
||||
ServerResult serverResult = priceSercie.removePrice(id);
|
||||
if (serverResult.isStart()){
|
||||
return new Result(true,1,serverResult.getMsg());
|
||||
}else {
|
||||
return new Result(false,-1,serverResult.getMsg());
|
||||
if (serverResult.isStart()) {
|
||||
return new Result(true, 1, serverResult.getMsg());
|
||||
} else {
|
||||
return new Result(false, -1, serverResult.getMsg());
|
||||
}
|
||||
}catch (RuntimeException e) {
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 快递类型和价格
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@Root
|
||||
@RequestMapping(value = "/editprice",method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/editprice", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> editPrice(HttpServletRequest request) {
|
||||
try {
|
||||
Integer id = HttpServletRequestUtil.getInteger(request,"id");
|
||||
Double price = HttpServletRequestUtil.getDouble(request,"price");
|
||||
String desc = HttpServletRequestUtil.getString(request,"desc");
|
||||
if (id==-1){
|
||||
Integer id = HttpServletRequestUtil.getInteger(request, "id");
|
||||
Double price = HttpServletRequestUtil.getDouble(request, "price");
|
||||
String desc = HttpServletRequestUtil.getString(request, "desc");
|
||||
if (id == -1) {
|
||||
return new Result(false, -1, "id不能为空");
|
||||
}
|
||||
if (price<0.01){
|
||||
if (price < 0.01) {
|
||||
return new Result(false, -1, "价格不能低于0.01");
|
||||
}
|
||||
Price prices = new Price(id,price,desc);
|
||||
Price prices = new Price(id, price, desc);
|
||||
Integer type = priceSercie.editPrice(prices);
|
||||
if (type!=1){
|
||||
if (type != 1) {
|
||||
return new Result(false, -1, "修改失败");
|
||||
}
|
||||
return new Result(true, 1,"修改成功");
|
||||
}catch (RuntimeException e) {
|
||||
return new Result(true, 1, "修改成功");
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
}
|
||||
|
|
@ -115,22 +117,23 @@ public class PriceController {
|
|||
|
||||
/**
|
||||
* 获取快递类型
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@PassToken
|
||||
@RequestMapping(value = "/getpricelist",method = RequestMethod.POST)
|
||||
@RequestMapping(value = "/getpricelist", method = RequestMethod.POST)
|
||||
private Result<Map<String, Object>> getPriceList(HttpServletRequest request) {
|
||||
try {
|
||||
List<Price> priceList = priceSercie.getAllPrice();
|
||||
if (priceList == null){
|
||||
if (priceList == null) {
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
}
|
||||
if (priceList.size()>0){
|
||||
if (priceList.size() > 0) {
|
||||
return new Result(true, priceList);
|
||||
}
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
}catch (RuntimeException e) {
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new Result(false, OrderEnum.OFFLINE.getState(), OrderEnum.OFFLINE.getStateInfo());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,17 +39,17 @@ public class TestController {
|
|||
|
||||
|
||||
@PassToken
|
||||
@RequestMapping(value = "/test",method = RequestMethod.POST)
|
||||
private Map<String,Object> test(){
|
||||
Map<String,Object> modeMap = new HashMap<String, Object>();
|
||||
@RequestMapping(value = "/test", method = RequestMethod.POST)
|
||||
private Map<String, Object> test() {
|
||||
Map<String, Object> modeMap = new HashMap<String, Object>();
|
||||
// modeMap.put("qureyCountStateAdmin",dataShowDao.qureyCountStateAdmin(0));
|
||||
// modeMap.put("qureyPriceStateAdmin",dataShowDao.qureyPriceStateAdmin(0));
|
||||
// modeMap.put("qureyCountStateCourier",dataShowDao.qureyCountStateCourier(2,0));
|
||||
// modeMap.put("qureyPriceStateCourier",dataShowDao.qureyPriceStateCourier(2,0));
|
||||
// modeMap.put("qureyCountStateSelf",dataShowDao.qureyCountStateSelf(3,0));
|
||||
// modeMap.put("qureyPriceStateSelf",dataShowDao.qureyPriceStateSelf(3,0));
|
||||
modeMap.put("data",mailConfigDao.getMailConfig());
|
||||
modeMap.put("dataa",accountDao.queryAccountForOrderId(44));
|
||||
modeMap.put("data", mailConfigDao.getMailConfig());
|
||||
modeMap.put("dataa", accountDao.queryAccountForOrderId(44));
|
||||
|
||||
return modeMap;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ public interface AccountDao {
|
|||
|
||||
/**
|
||||
* 没有条件获取所有用户信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<AccountRoot> queryAccount();
|
||||
|
|
@ -30,12 +31,14 @@ public interface AccountDao {
|
|||
|
||||
/**
|
||||
* 获取用户总数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Integer queryAccountCount(@Param("accountSelect") AccountSelect accountSelect);
|
||||
|
||||
/**
|
||||
* 检查是否有密保
|
||||
*
|
||||
* @param phone
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -52,6 +55,7 @@ public interface AccountDao {
|
|||
|
||||
/**
|
||||
* 通过订单id获取到用户信息
|
||||
*
|
||||
* @param orderID
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -59,6 +63,7 @@ public interface AccountDao {
|
|||
|
||||
/**
|
||||
* 添加用户
|
||||
*
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -66,6 +71,7 @@ public interface AccountDao {
|
|||
|
||||
/**
|
||||
* 修改用户权限
|
||||
*
|
||||
* @param id
|
||||
* @param identityId
|
||||
* @return
|
||||
|
|
@ -74,6 +80,7 @@ public interface AccountDao {
|
|||
|
||||
/**
|
||||
* 修改密码
|
||||
*
|
||||
* @param id
|
||||
* @param password
|
||||
* @return
|
||||
|
|
@ -82,6 +89,7 @@ public interface AccountDao {
|
|||
|
||||
/**
|
||||
* 更新用户信息
|
||||
*
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -89,6 +97,7 @@ public interface AccountDao {
|
|||
|
||||
/**
|
||||
* 设置密保问题
|
||||
*
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.util.List;
|
|||
public interface ComplaintDao {
|
||||
/**
|
||||
* 新增投诉建议
|
||||
*
|
||||
* @param complaint
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -22,12 +23,14 @@ public interface ComplaintDao {
|
|||
|
||||
/**
|
||||
* 获取投诉建议
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Complaint> queryComplaint(@Param("complaintSelect") ComplaintSelect complaintSelect);
|
||||
|
||||
/**
|
||||
* 获取列表总数
|
||||
*
|
||||
* @param complaintSelect
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -35,6 +38,7 @@ public interface ComplaintDao {
|
|||
|
||||
/**
|
||||
* 阅读投诉建议
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -42,6 +46,7 @@ public interface ComplaintDao {
|
|||
|
||||
/**
|
||||
* 删除投诉与建议
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -49,6 +54,7 @@ public interface ComplaintDao {
|
|||
|
||||
/**
|
||||
* 获取投诉和建议未读消息数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Integer getComplaintCount();
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ public interface DataShowDao {
|
|||
/**
|
||||
* 管理员通过状态获取订单数量
|
||||
* 0 为获取全部
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Integer qureyCountStateAdmin(@Param("state") Integer state);
|
||||
|
|
@ -19,6 +20,7 @@ public interface DataShowDao {
|
|||
/**
|
||||
* 管理员通过状态获取收入
|
||||
* 0 为获取全部
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Double qureyPriceStateAdmin(@Param("state") Integer state);
|
||||
|
|
@ -26,36 +28,40 @@ public interface DataShowDao {
|
|||
/**
|
||||
* 快递员通过状态获取订单总数
|
||||
* 0 为获取全部
|
||||
*
|
||||
* @param courierId
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
Integer qureyCountStateCourier(@Param("courierId") Integer courierId,@Param("state") Integer state);
|
||||
Integer qureyCountStateCourier(@Param("courierId") Integer courierId, @Param("state") Integer state);
|
||||
|
||||
/**
|
||||
* 快递员通过状态获取收入
|
||||
*
|
||||
* @param courierId
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
Double qureyPriceStateCourier(@Param("courierId") Integer courierId,@Param("state") Integer state);
|
||||
Double qureyPriceStateCourier(@Param("courierId") Integer courierId, @Param("state") Integer state);
|
||||
|
||||
|
||||
/**
|
||||
* 用户获取自己的订单总数
|
||||
*
|
||||
* @param selfId
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
Integer qureyCountStateSelf(@Param("selfId") Integer selfId,@Param("state") Integer state);
|
||||
Integer qureyCountStateSelf(@Param("selfId") Integer selfId, @Param("state") Integer state);
|
||||
|
||||
/**
|
||||
* 用户获取自己的价格总数
|
||||
*
|
||||
* @param selfId
|
||||
* @param state
|
||||
* @return
|
||||
*/
|
||||
Double qureyPriceStateSelf(@Param("selfId") Integer selfId,@Param("state") Integer state);
|
||||
Double qureyPriceStateSelf(@Param("selfId") Integer selfId, @Param("state") Integer state);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,12 +14,14 @@ import java.util.List;
|
|||
public interface FlatsDao {
|
||||
/**
|
||||
* 获取公寓列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Flats> queryAllFlat();
|
||||
|
||||
/**
|
||||
* 添加公寓
|
||||
*
|
||||
* @param flats
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -27,6 +29,7 @@ public interface FlatsDao {
|
|||
|
||||
/**
|
||||
* 删除公寓
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -34,6 +37,7 @@ public interface FlatsDao {
|
|||
|
||||
/**
|
||||
* 修改公寓
|
||||
*
|
||||
* @param flats
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import org.apache.ibatis.annotations.Param;
|
|||
public interface MailConfigDao {
|
||||
/**
|
||||
* 获取邮件配置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
MailConfig getMailConfig();
|
||||
|
|
|
|||
|
|
@ -16,8 +16,10 @@ public interface MessagesDao {
|
|||
|
||||
|
||||
int sendMessages(List<Messages> messagesList);
|
||||
|
||||
/**
|
||||
* 添加信息
|
||||
*
|
||||
* @param messages
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -25,22 +27,25 @@ public interface MessagesDao {
|
|||
|
||||
/**
|
||||
* 阅读信息
|
||||
*
|
||||
* @param id
|
||||
* @param accountId
|
||||
* @return
|
||||
*/
|
||||
Integer readMessage(@Param("id") Integer id ,@Param("accountId") Integer accountId);
|
||||
Integer readMessage(@Param("id") Integer id, @Param("accountId") Integer accountId);
|
||||
|
||||
/**
|
||||
* 删除信息
|
||||
*
|
||||
* @param id
|
||||
* @param accountId
|
||||
* @return
|
||||
*/
|
||||
Integer deleteMessage(@Param("id") Integer id,@Param("accountId") Integer accountId);
|
||||
Integer deleteMessage(@Param("id") Integer id, @Param("accountId") Integer accountId);
|
||||
|
||||
/**
|
||||
* 获取用户信息
|
||||
*
|
||||
* @param messageSelect
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -52,5 +57,4 @@ public interface MessagesDao {
|
|||
Integer getMessageReaderCount(@Param("accountId") Integer accountId);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import java.util.List;
|
|||
public interface OrderDao {
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param orderInsert
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -22,6 +23,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 获取全部订单列表
|
||||
*
|
||||
* @param orderSelect
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -29,6 +31,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 获取全部订单列表总数
|
||||
*
|
||||
* @param orderSelect
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -36,6 +39,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 获取用户自己订单列表
|
||||
*
|
||||
* @param orderSelect
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -43,6 +47,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 获取用户自己订单列表总数
|
||||
*
|
||||
* @param orderSelect
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -50,6 +55,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 快递员获取任务列表
|
||||
*
|
||||
* @param orderSelect
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -57,6 +63,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 快递员获取任务列表总数
|
||||
*
|
||||
* @param orderSelect
|
||||
* @param courierId
|
||||
* @return
|
||||
|
|
@ -65,6 +72,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 快递员获取自己任务列表
|
||||
*
|
||||
* @param orderSelect
|
||||
* @param courierId
|
||||
* @return
|
||||
|
|
@ -73,6 +81,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 快递员获取自己任务列表总数
|
||||
*
|
||||
* @param orderSelect
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -80,6 +89,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 通过id查询订单状态
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -87,6 +97,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 修改订单状态
|
||||
*
|
||||
* @param orderModifyState
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -96,6 +107,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 快递员送达快递切换状态
|
||||
*
|
||||
* @param orderModifyState
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -103,6 +115,7 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 客户收取快递
|
||||
*
|
||||
* @param orderModifyState
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -110,9 +123,10 @@ public interface OrderDao {
|
|||
|
||||
/**
|
||||
* 删除订单
|
||||
*
|
||||
* @param orderid
|
||||
* @return
|
||||
*/
|
||||
Integer deleteOrder(@Param("orderid") Integer orderid,@Param("accountid") Integer accountid);
|
||||
Integer deleteOrder(@Param("orderid") Integer orderid, @Param("accountid") Integer accountid);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,12 +15,15 @@ public interface PriceDao {
|
|||
|
||||
/**
|
||||
* 删除价格
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Integer deletePrice(@Param("id") Integer id);
|
||||
|
||||
/**
|
||||
* 新增价格表
|
||||
*
|
||||
* @param price
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -28,12 +31,14 @@ public interface PriceDao {
|
|||
|
||||
/**
|
||||
* 获取快递类型
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Price> queryAllPrice();
|
||||
|
||||
/**
|
||||
* 通过id获取快递类型对应价格
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -41,6 +46,7 @@ public interface PriceDao {
|
|||
|
||||
/**
|
||||
* 修改价格
|
||||
*
|
||||
* @param price
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,16 +17,18 @@ public class AccountExecution {
|
|||
private int count;
|
||||
private int state;
|
||||
private String stateInfo;
|
||||
public AccountExecution(){
|
||||
|
||||
public AccountExecution() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个的构造器
|
||||
*
|
||||
* @param account
|
||||
* @param loginEnum
|
||||
*/
|
||||
public AccountExecution(Account account, LoginEnum loginEnum) {
|
||||
public AccountExecution(Account account, LoginEnum loginEnum) {
|
||||
this.account = account;
|
||||
this.state = loginEnum.getState();
|
||||
this.stateInfo = loginEnum.getStateInfo();
|
||||
|
|
@ -34,6 +36,7 @@ public class AccountExecution {
|
|||
|
||||
/**
|
||||
* 获取多个的构造器
|
||||
*
|
||||
* @param accountList
|
||||
* @param loginEnum
|
||||
* @param count
|
||||
|
|
@ -47,9 +50,10 @@ public class AccountExecution {
|
|||
|
||||
/**
|
||||
* 失败的构造器
|
||||
*
|
||||
* @param loginEnum
|
||||
*/
|
||||
public AccountExecution( LoginEnum loginEnum) {
|
||||
public AccountExecution(LoginEnum loginEnum) {
|
||||
this.state = loginEnum.getState();
|
||||
this.stateInfo = loginEnum.getStateInfo();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ public class OrderCourier extends Order {
|
|||
|
||||
public OrderCourier() {
|
||||
}
|
||||
|
||||
public String getFlats() {
|
||||
return flats;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ public class OrderModifyState {
|
|||
private Integer paymentStatus;
|
||||
|
||||
|
||||
|
||||
|
||||
public OrderModifyState(Integer id, Integer courierId, Integer status) {
|
||||
this.id = id;
|
||||
this.courierId = courierId;
|
||||
|
|
|
|||
|
|
@ -15,14 +15,14 @@ public class ServerResult<T> {
|
|||
public ServerResult() {
|
||||
}
|
||||
|
||||
public ServerResult( boolean start, T data, Integer count) {
|
||||
public ServerResult(boolean start, T data, Integer count) {
|
||||
this.data = data;
|
||||
this.count = count;
|
||||
this.start = start;
|
||||
this.msg = "操作成功";
|
||||
}
|
||||
|
||||
public ServerResult(boolean start,T data) {
|
||||
public ServerResult(boolean start, T data) {
|
||||
this.data = data;
|
||||
this.start = start;
|
||||
this.msg = "操作成功";
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ public class Account {
|
|||
private String ncryptedAnswers;
|
||||
|
||||
|
||||
|
||||
public Account() {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class Category {
|
|||
|
||||
private List<Category> children;
|
||||
|
||||
public Category(Integer id, Integer pid, String name, String details, Integer onnav,Integer sort) {
|
||||
public Category(Integer id, Integer pid, String name, String details, Integer onnav, Integer sort) {
|
||||
this.id = id;
|
||||
this.pid = pid;
|
||||
this.name = name;
|
||||
|
|
@ -30,7 +30,7 @@ public class Category {
|
|||
public Category() {
|
||||
}
|
||||
|
||||
public Category(Integer pid, String name, String details, Integer onnav,Integer sort) {
|
||||
public Category(Integer pid, String name, String details, Integer onnav, Integer sort) {
|
||||
this.pid = pid;
|
||||
this.name = name;
|
||||
this.details = details;
|
||||
|
|
@ -83,9 +83,9 @@ public class Category {
|
|||
}
|
||||
|
||||
public void setChildren(List<Category> children) {
|
||||
if (children.size() == 0){
|
||||
if (children.size() == 0) {
|
||||
this.children = null;
|
||||
}else {
|
||||
} else {
|
||||
this.children = children;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,98 +7,98 @@ import java.util.Date;
|
|||
|
||||
public class Complaint {
|
||||
|
||||
private Integer cId;
|
||||
private String cName;
|
||||
private String cPhone;
|
||||
private String cContent;
|
||||
@DateTimeFormat(
|
||||
pattern = "yyyy-MM-dd hh:mm"
|
||||
)
|
||||
private Date cCreateTime;
|
||||
private Integer cIsreader;
|
||||
private Integer cId;
|
||||
private String cName;
|
||||
private String cPhone;
|
||||
private String cContent;
|
||||
@DateTimeFormat(
|
||||
pattern = "yyyy-MM-dd hh:mm"
|
||||
)
|
||||
private Date cCreateTime;
|
||||
private Integer cIsreader;
|
||||
|
||||
public Complaint() {
|
||||
}
|
||||
public Complaint() {
|
||||
}
|
||||
|
||||
public Complaint(String cName, String cPhone, String cContent) {
|
||||
this.cName = cName;
|
||||
this.cPhone = cPhone;
|
||||
this.cContent = cContent;
|
||||
this.cCreateTime = new Date();
|
||||
this.cIsreader = 1;
|
||||
}
|
||||
public Complaint(String cName, String cPhone, String cContent) {
|
||||
this.cName = cName;
|
||||
this.cPhone = cPhone;
|
||||
this.cContent = cContent;
|
||||
this.cCreateTime = new Date();
|
||||
this.cIsreader = 1;
|
||||
}
|
||||
|
||||
public Integer getcId() {
|
||||
return cId;
|
||||
}
|
||||
public Integer getcId() {
|
||||
return cId;
|
||||
}
|
||||
|
||||
public void setcId(Integer cId) {
|
||||
this.cId = cId;
|
||||
}
|
||||
public void setcId(Integer cId) {
|
||||
this.cId = cId;
|
||||
}
|
||||
|
||||
public String getcName() {
|
||||
return cName;
|
||||
}
|
||||
public String getcName() {
|
||||
return cName;
|
||||
}
|
||||
|
||||
public void setcName(String cName) {
|
||||
this.cName = cName;
|
||||
}
|
||||
public void setcName(String cName) {
|
||||
this.cName = cName;
|
||||
}
|
||||
|
||||
public String getcPhone() {
|
||||
return cPhone;
|
||||
}
|
||||
public String getcPhone() {
|
||||
return cPhone;
|
||||
}
|
||||
|
||||
public void setcPhone(String cPhone) {
|
||||
this.cPhone = cPhone;
|
||||
}
|
||||
public void setcPhone(String cPhone) {
|
||||
this.cPhone = cPhone;
|
||||
}
|
||||
|
||||
public String getcContent() {
|
||||
return cContent;
|
||||
}
|
||||
public String getcContent() {
|
||||
return cContent;
|
||||
}
|
||||
|
||||
public void setcContent(String cContent) {
|
||||
this.cContent = cContent;
|
||||
}
|
||||
public void setcContent(String cContent) {
|
||||
this.cContent = cContent;
|
||||
}
|
||||
|
||||
public Date getcCreateTime() {
|
||||
return cCreateTime;
|
||||
}
|
||||
public Date getcCreateTime() {
|
||||
return cCreateTime;
|
||||
}
|
||||
|
||||
public void setcCreateTime(Date cCreateTime) {
|
||||
this.cCreateTime = cCreateTime;
|
||||
}
|
||||
public void setcCreateTime(Date cCreateTime) {
|
||||
this.cCreateTime = cCreateTime;
|
||||
}
|
||||
|
||||
public String getCName() {
|
||||
return cName;
|
||||
}
|
||||
public String getCName() {
|
||||
return cName;
|
||||
}
|
||||
|
||||
public void setCName(String cName) {
|
||||
this.cName = cName;
|
||||
}
|
||||
public void setCName(String cName) {
|
||||
this.cName = cName;
|
||||
}
|
||||
|
||||
|
||||
public String getCPhone() {
|
||||
return cPhone;
|
||||
}
|
||||
public String getCPhone() {
|
||||
return cPhone;
|
||||
}
|
||||
|
||||
public void setCPhone(String cPhone) {
|
||||
this.cPhone = cPhone;
|
||||
}
|
||||
public void setCPhone(String cPhone) {
|
||||
this.cPhone = cPhone;
|
||||
}
|
||||
|
||||
|
||||
public String getCContent() {
|
||||
return cContent;
|
||||
}
|
||||
public String getCContent() {
|
||||
return cContent;
|
||||
}
|
||||
|
||||
public void setCContent(String cContent) {
|
||||
this.cContent = cContent;
|
||||
}
|
||||
public void setCContent(String cContent) {
|
||||
this.cContent = cContent;
|
||||
}
|
||||
|
||||
public Integer getcIsreader() {
|
||||
return cIsreader;
|
||||
}
|
||||
public Integer getcIsreader() {
|
||||
return cIsreader;
|
||||
}
|
||||
|
||||
public void setcIsreader(Integer cIsreader) {
|
||||
this.cIsreader = cIsreader;
|
||||
}
|
||||
public void setcIsreader(Integer cIsreader) {
|
||||
this.cIsreader = cIsreader;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,42 +2,42 @@ package live.tomey.api.express.entity;
|
|||
|
||||
public class Flats {
|
||||
|
||||
private long id;
|
||||
private String flatsName;
|
||||
private String desc;
|
||||
private long id;
|
||||
private String flatsName;
|
||||
private String desc;
|
||||
|
||||
public Flats(long id, String flatsName, String desc) {
|
||||
this.id = id;
|
||||
this.flatsName = flatsName;
|
||||
this.desc = desc;
|
||||
}
|
||||
public Flats(long id, String flatsName, String desc) {
|
||||
this.id = id;
|
||||
this.flatsName = flatsName;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Flats(String flatsName, String desc) {
|
||||
this.flatsName = flatsName;
|
||||
this.desc = desc;
|
||||
}
|
||||
public Flats(String flatsName, String desc) {
|
||||
this.flatsName = flatsName;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFlatsName() {
|
||||
return flatsName;
|
||||
}
|
||||
public String getFlatsName() {
|
||||
return flatsName;
|
||||
}
|
||||
|
||||
public void setFlatsName(String flatsName) {
|
||||
this.flatsName = flatsName;
|
||||
}
|
||||
public void setFlatsName(String flatsName) {
|
||||
this.flatsName = flatsName;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,108 +2,108 @@ package live.tomey.api.express.entity;
|
|||
|
||||
public class MailConfig {
|
||||
|
||||
private String sender;
|
||||
private String personal;
|
||||
private String emailSmtpHost;
|
||||
private String emailSmtpPort;
|
||||
private String username;
|
||||
private String password;
|
||||
private String encryption;
|
||||
private Integer state;
|
||||
private String testMail;
|
||||
private String sender;
|
||||
private String personal;
|
||||
private String emailSmtpHost;
|
||||
private String emailSmtpPort;
|
||||
private String username;
|
||||
private String password;
|
||||
private String encryption;
|
||||
private Integer state;
|
||||
private String testMail;
|
||||
|
||||
|
||||
public MailConfig() {
|
||||
}
|
||||
public MailConfig() {
|
||||
}
|
||||
|
||||
public MailConfig(String sender, String personal, String emailSmtpHost, String emailSmtpPort, String username, String password, String encryption, Integer state, String testMail) {
|
||||
this.sender = sender;
|
||||
this.personal = personal;
|
||||
this.emailSmtpHost = emailSmtpHost;
|
||||
this.emailSmtpPort = emailSmtpPort;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.encryption = encryption;
|
||||
this.state = state;
|
||||
this.testMail = testMail;
|
||||
}
|
||||
public MailConfig(String sender, String personal, String emailSmtpHost, String emailSmtpPort, String username, String password, String encryption, Integer state, String testMail) {
|
||||
this.sender = sender;
|
||||
this.personal = personal;
|
||||
this.emailSmtpHost = emailSmtpHost;
|
||||
this.emailSmtpPort = emailSmtpPort;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.encryption = encryption;
|
||||
this.state = state;
|
||||
this.testMail = testMail;
|
||||
}
|
||||
|
||||
public String getSender() {
|
||||
return sender;
|
||||
}
|
||||
public String getSender() {
|
||||
return sender;
|
||||
}
|
||||
|
||||
public void setSender(String sender) {
|
||||
this.sender = sender;
|
||||
}
|
||||
public void setSender(String sender) {
|
||||
this.sender = sender;
|
||||
}
|
||||
|
||||
|
||||
public String getPersonal() {
|
||||
return personal;
|
||||
}
|
||||
public String getPersonal() {
|
||||
return personal;
|
||||
}
|
||||
|
||||
public void setPersonal(String personal) {
|
||||
this.personal = personal;
|
||||
}
|
||||
public void setPersonal(String personal) {
|
||||
this.personal = personal;
|
||||
}
|
||||
|
||||
|
||||
public String getEmailSmtpHost() {
|
||||
return emailSmtpHost;
|
||||
}
|
||||
public String getEmailSmtpHost() {
|
||||
return emailSmtpHost;
|
||||
}
|
||||
|
||||
public void setEmailSmtpHost(String emailSmtpHost) {
|
||||
this.emailSmtpHost = emailSmtpHost;
|
||||
}
|
||||
public void setEmailSmtpHost(String emailSmtpHost) {
|
||||
this.emailSmtpHost = emailSmtpHost;
|
||||
}
|
||||
|
||||
|
||||
public String getEmailSmtpPort() {
|
||||
return emailSmtpPort;
|
||||
}
|
||||
public String getEmailSmtpPort() {
|
||||
return emailSmtpPort;
|
||||
}
|
||||
|
||||
public void setEmailSmtpPort(String emailSmtpPort) {
|
||||
this.emailSmtpPort = emailSmtpPort;
|
||||
}
|
||||
public void setEmailSmtpPort(String emailSmtpPort) {
|
||||
this.emailSmtpPort = emailSmtpPort;
|
||||
}
|
||||
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
public String getEncryption() {
|
||||
return encryption;
|
||||
}
|
||||
public String getEncryption() {
|
||||
return encryption;
|
||||
}
|
||||
|
||||
public void setEncryption(String encryption) {
|
||||
this.encryption = encryption;
|
||||
}
|
||||
public void setEncryption(String encryption) {
|
||||
this.encryption = encryption;
|
||||
}
|
||||
|
||||
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(Integer state) {
|
||||
this.state = state;
|
||||
}
|
||||
public void setState(Integer state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getTestMail() {
|
||||
return testMail;
|
||||
}
|
||||
public String getTestMail() {
|
||||
return testMail;
|
||||
}
|
||||
|
||||
public void setTestMail(String testMail) {
|
||||
this.testMail = testMail;
|
||||
}
|
||||
public void setTestMail(String testMail) {
|
||||
this.testMail = testMail;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,74 +6,74 @@ import java.util.Date;
|
|||
|
||||
public class Messages {
|
||||
|
||||
private long id;
|
||||
private long accountId;
|
||||
private String title;
|
||||
private String content;
|
||||
private Integer isRead;
|
||||
@DateTimeFormat(
|
||||
pattern = "yyyy-MM-dd hh:mm"
|
||||
)
|
||||
private Date sendTime;
|
||||
private long id;
|
||||
private long accountId;
|
||||
private String title;
|
||||
private String content;
|
||||
private Integer isRead;
|
||||
@DateTimeFormat(
|
||||
pattern = "yyyy-MM-dd hh:mm"
|
||||
)
|
||||
private Date sendTime;
|
||||
|
||||
public Messages() {
|
||||
}
|
||||
public Messages() {
|
||||
}
|
||||
|
||||
public Messages(long accountId, String title, String content) {
|
||||
this.accountId = accountId;
|
||||
this.title = title;
|
||||
this.content = content;
|
||||
this.isRead = 1;
|
||||
this.sendTime = new Date();
|
||||
}
|
||||
public Messages(long accountId, String title, String content) {
|
||||
this.accountId = accountId;
|
||||
this.title = title;
|
||||
this.content = content;
|
||||
this.isRead = 1;
|
||||
this.sendTime = new Date();
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
public long getAccountId() {
|
||||
return accountId;
|
||||
}
|
||||
|
||||
public void setAccountId(long accountId) {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
public void setAccountId(long accountId) {
|
||||
this.accountId = accountId;
|
||||
}
|
||||
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public Integer getIsRead() {
|
||||
return isRead;
|
||||
}
|
||||
public Integer getIsRead() {
|
||||
return isRead;
|
||||
}
|
||||
|
||||
public void setIsRead(Integer isRead) {
|
||||
this.isRead = isRead;
|
||||
}
|
||||
public void setIsRead(Integer isRead) {
|
||||
this.isRead = isRead;
|
||||
}
|
||||
|
||||
public Date getSendTime() {
|
||||
return sendTime;
|
||||
}
|
||||
public Date getSendTime() {
|
||||
return sendTime;
|
||||
}
|
||||
|
||||
public void setSendTime(Date sendTime) {
|
||||
this.sendTime = sendTime;
|
||||
}
|
||||
public void setSendTime(Date sendTime) {
|
||||
this.sendTime = sendTime;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,138 +7,138 @@ import java.util.Date;
|
|||
|
||||
public class Order {
|
||||
|
||||
private Integer id;
|
||||
private String number;
|
||||
private String company;
|
||||
private String name;
|
||||
private String phone;
|
||||
private String hostel;
|
||||
@DateTimeFormat(
|
||||
pattern = "yyyy-MM-dd hh:mm"
|
||||
)
|
||||
private Date createTime;
|
||||
@DateTimeFormat(
|
||||
pattern = "yyyy-MM-dd hh:mm"
|
||||
)
|
||||
private Date lastTime;
|
||||
private Integer status;
|
||||
private Integer paymentStatus;
|
||||
private String decs;
|
||||
private String typeDesc;
|
||||
private Integer id;
|
||||
private String number;
|
||||
private String company;
|
||||
private String name;
|
||||
private String phone;
|
||||
private String hostel;
|
||||
@DateTimeFormat(
|
||||
pattern = "yyyy-MM-dd hh:mm"
|
||||
)
|
||||
private Date createTime;
|
||||
@DateTimeFormat(
|
||||
pattern = "yyyy-MM-dd hh:mm"
|
||||
)
|
||||
private Date lastTime;
|
||||
private Integer status;
|
||||
private Integer paymentStatus;
|
||||
private String decs;
|
||||
private String typeDesc;
|
||||
|
||||
public Order() {
|
||||
}
|
||||
public Order() {
|
||||
}
|
||||
|
||||
|
||||
public Order(String number, String company, String name, String phone, String hostel, String decs) {
|
||||
this.number = number;
|
||||
this.company = company;
|
||||
this.name = name;
|
||||
this.phone = phone;
|
||||
this.hostel = hostel;
|
||||
this.decs = decs;
|
||||
this.createTime = new Date();
|
||||
this.lastTime = new Date();
|
||||
this.paymentStatus = 2;
|
||||
this.status = 1;
|
||||
public Order(String number, String company, String name, String phone, String hostel, String decs) {
|
||||
this.number = number;
|
||||
this.company = company;
|
||||
this.name = name;
|
||||
this.phone = phone;
|
||||
this.hostel = hostel;
|
||||
this.decs = decs;
|
||||
this.createTime = new Date();
|
||||
this.lastTime = new Date();
|
||||
this.paymentStatus = 2;
|
||||
this.status = 1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public String getTypeDesc() {
|
||||
return typeDesc;
|
||||
}
|
||||
public String getTypeDesc() {
|
||||
return typeDesc;
|
||||
}
|
||||
|
||||
public void setTypeDesc(String typeDesc) {
|
||||
this.typeDesc = typeDesc;
|
||||
}
|
||||
public void setTypeDesc(String typeDesc) {
|
||||
this.typeDesc = typeDesc;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
public String getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
public void setNumber(String number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(String company) {
|
||||
this.company = company;
|
||||
}
|
||||
public void setCompany(String company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
|
||||
public String getHostel() {
|
||||
return hostel;
|
||||
}
|
||||
public String getHostel() {
|
||||
return hostel;
|
||||
}
|
||||
|
||||
public void setHostel(String hostel) {
|
||||
this.hostel = hostel;
|
||||
}
|
||||
public void setHostel(String hostel) {
|
||||
this.hostel = hostel;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getLastTime() {
|
||||
return lastTime;
|
||||
}
|
||||
public Date getLastTime() {
|
||||
return lastTime;
|
||||
}
|
||||
|
||||
public void setLastTime(Date lastTime) {
|
||||
this.lastTime = lastTime;
|
||||
}
|
||||
public void setLastTime(Date lastTime) {
|
||||
this.lastTime = lastTime;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getPaymentStatus() {
|
||||
return paymentStatus;
|
||||
}
|
||||
public Integer getPaymentStatus() {
|
||||
return paymentStatus;
|
||||
}
|
||||
|
||||
public void setPaymentStatus(Integer paymentStatus) {
|
||||
this.paymentStatus = paymentStatus;
|
||||
}
|
||||
public void setPaymentStatus(Integer paymentStatus) {
|
||||
this.paymentStatus = paymentStatus;
|
||||
}
|
||||
|
||||
public String getDecs() {
|
||||
return decs;
|
||||
}
|
||||
public String getDecs() {
|
||||
return decs;
|
||||
}
|
||||
|
||||
public void setDecs(String decs) {
|
||||
this.decs = decs;
|
||||
}
|
||||
public void setDecs(String decs) {
|
||||
this.decs = decs;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,44 +2,44 @@ package live.tomey.api.express.entity;
|
|||
|
||||
public class Price {
|
||||
|
||||
private Integer id;
|
||||
private double price;
|
||||
private String desc;
|
||||
private Integer id;
|
||||
private double price;
|
||||
private String desc;
|
||||
|
||||
public Price(double price, String desc) {
|
||||
this.price = price;
|
||||
this.desc = desc;
|
||||
}
|
||||
public Price(double price, String desc) {
|
||||
this.price = price;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Price(Integer id, double price, String desc) {
|
||||
this.id = id;
|
||||
this.price = price;
|
||||
this.desc = desc;
|
||||
}
|
||||
public Price(Integer id, double price, String desc) {
|
||||
this.id = id;
|
||||
this.price = price;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ package live.tomey.api.express.enums;
|
|||
* @mail 20932067@zju.edu.cn
|
||||
* @date 2020/12/2 16:54
|
||||
*/
|
||||
public enum CategoryEnum {
|
||||
public enum CategoryEnum {
|
||||
|
||||
OFFLINE(-1, "系统错误"),SUCCESS(1, "操作成功"),NULL(1, "查询结果为空"),NO_POWER(-2,"您没有权限!");
|
||||
OFFLINE(-1, "系统错误"), SUCCESS(1, "操作成功"), NULL(1, "查询结果为空"), NO_POWER(-2, "您没有权限!");
|
||||
|
||||
private int state;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ package live.tomey.api.express.enums;
|
|||
*/
|
||||
public enum LoginEnum {
|
||||
OFFLINE(-1, "系统错误"), SUCCESS(1, "操作成功"), USERNAME_NULL(-1001, "电话号码不能为空"), PASSWORD_NULL(
|
||||
-1002, "密码不能为空"),NULL_ACCOUNT(-1003,"此用户未注册,请先注册"),Password_mistake(-1004,"密码错误");
|
||||
-1002, "密码不能为空"), NULL_ACCOUNT(-1003, "此用户未注册,请先注册"), Password_mistake(-1004, "密码错误");
|
||||
|
||||
private int state;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ package live.tomey.api.express.enums;
|
|||
*/
|
||||
public enum OrderEnum {
|
||||
|
||||
OFFLINE(-1, "系统错误"),EREE(3, "操作失败"),SUCCESS(1, "操作成功"),NULL(2, "查询结果为空"),NO_POWER(-2,"您没有权限!"),GETON(2,"无效操作"),;
|
||||
OFFLINE(-1, "系统错误"), EREE(3, "操作失败"), SUCCESS(1, "操作成功"), NULL(2, "查询结果为空"), NO_POWER(-2, "您没有权限!"), GETON(2, "无效操作"),
|
||||
;
|
||||
|
||||
private int state;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package live.tomey.api.express.exceptions;
|
|||
* @mail 20932067@zju.edu.cn
|
||||
* @date 2020/12/2 12:06
|
||||
*/
|
||||
public class AccountOperationException extends RuntimeException{
|
||||
public class AccountOperationException extends RuntimeException {
|
||||
public AccountOperationException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package live.tomey.api.express.exceptions;
|
|||
* @mail 20932067@zju.edu.cn
|
||||
* @date 2020/12/2 16:59
|
||||
*/
|
||||
public class CategoryOperationException extends RuntimeException{
|
||||
public class CategoryOperationException extends RuntimeException {
|
||||
public CategoryOperationException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ package live.tomey.api.express.exceptions;
|
|||
* @mail 20932067@zju.edu.cn
|
||||
* @date 2020/12/2 12:06
|
||||
*/
|
||||
public class OrderOperationException extends RuntimeException{
|
||||
public class OrderOperationException extends RuntimeException {
|
||||
public OrderOperationException(String msg) {
|
||||
super(msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,31 +49,31 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
|
|||
}
|
||||
String token = request.getHeader("token");
|
||||
JSONObject res = new JSONObject();
|
||||
if (token == null){
|
||||
res.put("success",false);
|
||||
res.put("msg","缺少必要参数");
|
||||
res.put("errorCode",-1);
|
||||
if (token == null) {
|
||||
res.put("success", false);
|
||||
res.put("msg", "缺少必要参数");
|
||||
res.put("errorCode", -1);
|
||||
response.getWriter().write(res.toString());
|
||||
return false;
|
||||
}
|
||||
Account account = verifyToken(token);
|
||||
if (account == null){
|
||||
res.put("success",false);
|
||||
res.put("msg","token有误或者过期");
|
||||
res.put("errorCode",-2);
|
||||
if (account == null) {
|
||||
res.put("success", false);
|
||||
res.put("msg", "token有误或者过期");
|
||||
res.put("errorCode", -2);
|
||||
response.getWriter().write(res.toString());
|
||||
return false;
|
||||
}
|
||||
res.put("data","null");
|
||||
request.getSession().setAttribute("account",account);
|
||||
res.put("data", "null");
|
||||
request.getSession().setAttribute("account", account);
|
||||
if (method.isAnnotationPresent(Root.class)) {
|
||||
Root root = method.getAnnotation(Root.class);
|
||||
if (root.required()) {
|
||||
// 执行认证
|
||||
if (account.getIdentityId() !=1){
|
||||
res.put("success",false);
|
||||
res.put("msg","您没有权限");
|
||||
res.put("errorCode",-2);
|
||||
if (account.getIdentityId() != 1) {
|
||||
res.put("success", false);
|
||||
res.put("msg", "您没有权限");
|
||||
res.put("errorCode", -2);
|
||||
response.getWriter().write(res.toString());
|
||||
return false;
|
||||
}
|
||||
|
|
@ -84,13 +84,13 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
|
|||
Admin admin = method.getAnnotation(Admin.class);
|
||||
if (admin.required()) {
|
||||
// 执行认证
|
||||
if (account.getIdentityId() == 1){
|
||||
if (account.getIdentityId() == 1) {
|
||||
return true;
|
||||
}
|
||||
if (account.getIdentityId() !=2){
|
||||
res.put("success",false);
|
||||
res.put("msg","您没有权限");
|
||||
res.put("errorCode",-2);
|
||||
if (account.getIdentityId() != 2) {
|
||||
res.put("success", false);
|
||||
res.put("msg", "您没有权限");
|
||||
res.put("errorCode", -2);
|
||||
response.getWriter().write(res.toString());
|
||||
return false;
|
||||
}
|
||||
|
|
@ -101,13 +101,13 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
|
|||
UserLoginToken userLoginToken = method.getAnnotation(UserLoginToken.class);
|
||||
if (userLoginToken.required()) {
|
||||
// 执行认证
|
||||
if (account.getIdentityId() == 2){
|
||||
if (account.getIdentityId() == 2) {
|
||||
return true;
|
||||
}
|
||||
if (account.getIdentityId() !=3){
|
||||
res.put("success",false);
|
||||
res.put("msg","您没有权限");
|
||||
res.put("errorCode",-2);
|
||||
if (account.getIdentityId() != 3) {
|
||||
res.put("success", false);
|
||||
res.put("msg", "您没有权限");
|
||||
res.put("errorCode", -2);
|
||||
response.getWriter().write(res.toString());
|
||||
return false;
|
||||
}
|
||||
|
|
@ -125,7 +125,8 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
|
|||
|
||||
return true;
|
||||
}
|
||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView){
|
||||
|
||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) {
|
||||
|
||||
// HandlerMethod handlerMethod = (HandlerMethod) handler;
|
||||
// Method method = handlerMethod.getMethod();
|
||||
|
|
@ -143,8 +144,8 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
|
|||
String password = jwt.getClaim("password").asString();
|
||||
String phone = jwt.getClaim("phone").asString();
|
||||
AccountExecution accountExecution = accountService.getAccountByPhone(phone);
|
||||
if (accountExecution.getState() == 1){
|
||||
if (accountExecution.getAccount().getPassword().equals(password)){
|
||||
if (accountExecution.getState() == 1) {
|
||||
if (accountExecution.getAccount().getPassword().equals(password)) {
|
||||
return accountExecution.getAccount();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ public interface AccountService {
|
|||
|
||||
/**
|
||||
* 设置密保
|
||||
*
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -23,6 +24,7 @@ public interface AccountService {
|
|||
|
||||
/**
|
||||
* 检查是否存在密保
|
||||
*
|
||||
* @param phone
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -31,12 +33,14 @@ public interface AccountService {
|
|||
|
||||
/**
|
||||
* 获取所有用户信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
AccountRootExcution getAllAccount(AccountSelect accountSelect);
|
||||
|
||||
/**
|
||||
* 通过电话查询用户信息
|
||||
*
|
||||
* @param phone
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -44,6 +48,7 @@ public interface AccountService {
|
|||
|
||||
/**
|
||||
* 添加用户
|
||||
*
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -51,6 +56,7 @@ public interface AccountService {
|
|||
|
||||
/**
|
||||
* 超级管理员修改用户权限
|
||||
*
|
||||
* @param id
|
||||
* @param identityId
|
||||
* @return
|
||||
|
|
@ -59,6 +65,7 @@ public interface AccountService {
|
|||
|
||||
/**
|
||||
* 修改密码
|
||||
*
|
||||
* @param id
|
||||
* @param password
|
||||
* @return
|
||||
|
|
@ -67,6 +74,7 @@ public interface AccountService {
|
|||
|
||||
/**
|
||||
* 完善用户信息
|
||||
*
|
||||
* @param account
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import live.tomey.api.express.entity.Complaint;
|
|||
public interface ComplaintService {
|
||||
/**
|
||||
* 新增投诉与建议
|
||||
*
|
||||
* @param complaint
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -21,6 +22,7 @@ public interface ComplaintService {
|
|||
|
||||
/**
|
||||
* 获取投诉与建议
|
||||
*
|
||||
* @param complaintSelect
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -28,6 +30,7 @@ public interface ComplaintService {
|
|||
|
||||
/**
|
||||
* 阅读投诉与建议
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -35,6 +38,7 @@ public interface ComplaintService {
|
|||
|
||||
/**
|
||||
* 删除投诉与建议
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,6 +21,4 @@ public interface FlatsService {
|
|||
List<Flats> getAllFlats();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@ public interface OrderService {
|
|||
|
||||
OrderExcution<List<OrderCourier>> courierGetAllList(OrderSelect orderSelect);
|
||||
|
||||
OrderExcution changeState(OrderModifyState orderModifyState,Account courier);
|
||||
OrderExcution changeState(OrderModifyState orderModifyState, Account courier);
|
||||
|
||||
OrderExcution courierGetSelfList(OrderSelect orderSelect,Integer courierId);
|
||||
OrderExcution courierGetSelfList(OrderSelect orderSelect, Integer courierId);
|
||||
|
||||
OrderExcution changDelivery(OrderModifyState orderModifyState,Account courier);
|
||||
OrderExcution changDelivery(OrderModifyState orderModifyState, Account courier);
|
||||
|
||||
OrderExcution changCharge(OrderModifyState orderModifyState);
|
||||
|
||||
Integer cancelOrder(Integer orderid,Integer acountid);
|
||||
Integer cancelOrder(Integer orderid, Integer acountid);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,14 +78,14 @@ public class AccountServiceImpl implements AccountService {
|
|||
accountSelect.setPage(PageCalculator.calculateRowIndex(accountSelect.getPage(), accountSelect.getSize()));
|
||||
List<AccountRoot> accountRoots = accountDao.queryAccountList(accountSelect);
|
||||
Integer count = accountDao.queryAccountCount(accountSelect);
|
||||
if (accountRoots.size() > 0&&count>0) {
|
||||
return new AccountRootExcution(accountRoots,1,count);
|
||||
}else {
|
||||
return new AccountRootExcution(0,"查询结果为空");
|
||||
if (accountRoots.size() > 0 && count > 0) {
|
||||
return new AccountRootExcution(accountRoots, 1, count);
|
||||
} else {
|
||||
return new AccountRootExcution(0, "查询结果为空");
|
||||
}
|
||||
} catch (AccountOperationException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new AccountRootExcution(-1,"系统错误");
|
||||
return new AccountRootExcution(-1, "系统错误");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@ public class CategoryServiceImpl implements CategoryService {
|
|||
public CategoryExecution getCategoryList() {
|
||||
try {
|
||||
List<Category> categoryList = categoryDao.queryCategoryList();
|
||||
if (categoryList.size()>0){
|
||||
return new CategoryExecution(categoryList,CategoryEnum.SUCCESS);
|
||||
}else {
|
||||
if (categoryList.size() > 0) {
|
||||
return new CategoryExecution(categoryList, CategoryEnum.SUCCESS);
|
||||
} else {
|
||||
return new CategoryExecution(CategoryEnum.NULL);
|
||||
}
|
||||
} catch (CategoryOperationException e) {
|
||||
|
|
@ -47,12 +47,12 @@ public class CategoryServiceImpl implements CategoryService {
|
|||
public boolean addCategory(Category category) {
|
||||
try {
|
||||
Integer init = categoryDao.insertCategory(category);
|
||||
if (init >0){
|
||||
if (init > 0) {
|
||||
return true;
|
||||
}else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}catch (CategoryOperationException e){
|
||||
} catch (CategoryOperationException e) {
|
||||
logger.error(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
|
|
@ -62,12 +62,12 @@ public class CategoryServiceImpl implements CategoryService {
|
|||
public boolean removeCategory(Integer id) {
|
||||
try {
|
||||
Integer init = categoryDao.deleteCategory(id);
|
||||
if (init == 1){
|
||||
if (init == 1) {
|
||||
return true;
|
||||
}else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}catch (CategoryOperationException e){
|
||||
} catch (CategoryOperationException e) {
|
||||
logger.error(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
|
|
@ -77,12 +77,12 @@ public class CategoryServiceImpl implements CategoryService {
|
|||
public boolean editCategory(Category category) {
|
||||
try {
|
||||
Integer init = categoryDao.updataCategory(category);
|
||||
if (init == 1){
|
||||
if (init == 1) {
|
||||
return true;
|
||||
}else {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}catch (CategoryOperationException e){
|
||||
} catch (CategoryOperationException e) {
|
||||
logger.error(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,14 +30,14 @@ public class ComplaintServiceImpl implements ComplaintService {
|
|||
public ServerResult addComplaint(Complaint complaint) {
|
||||
try {
|
||||
Integer type = complaintDao.insertComplaint(complaint);
|
||||
if (type>0){
|
||||
return new ServerResult(true,"操作成功!");
|
||||
}else {
|
||||
return new ServerResult(false,"操作失败!");
|
||||
if (type > 0) {
|
||||
return new ServerResult(true, "操作成功!");
|
||||
} else {
|
||||
return new ServerResult(false, "操作失败!");
|
||||
}
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new ServerResult(false,"系统错误!");
|
||||
return new ServerResult(false, "系统错误!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -47,14 +47,14 @@ public class ComplaintServiceImpl implements ComplaintService {
|
|||
try {
|
||||
List<Complaint> complaintList = complaintDao.queryComplaint(complaintSelect);
|
||||
Integer count = complaintDao.queryComplaintCount(complaintSelect);
|
||||
if (complaintList.size()>0&&count>0){
|
||||
return new ServerResult(true,complaintList,count);
|
||||
}else {
|
||||
return new ServerResult(false,"查询结果为空!");
|
||||
if (complaintList.size() > 0 && count > 0) {
|
||||
return new ServerResult(true, complaintList, count);
|
||||
} else {
|
||||
return new ServerResult(false, "查询结果为空!");
|
||||
}
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new ServerResult(false,"系统错误!");
|
||||
return new ServerResult(false, "系统错误!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -62,14 +62,14 @@ public class ComplaintServiceImpl implements ComplaintService {
|
|||
public ServerResult readerComplaint(Integer id) {
|
||||
try {
|
||||
Integer type = complaintDao.readerComplaint(id);
|
||||
if (type>0){
|
||||
return new ServerResult(true,"操作成功!");
|
||||
}else {
|
||||
return new ServerResult(false,"操作失败!");
|
||||
if (type > 0) {
|
||||
return new ServerResult(true, "操作成功!");
|
||||
} else {
|
||||
return new ServerResult(false, "操作失败!");
|
||||
}
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new ServerResult(false,"系统错误!");
|
||||
return new ServerResult(false, "系统错误!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -77,24 +77,24 @@ public class ComplaintServiceImpl implements ComplaintService {
|
|||
public ServerResult removeComplaint(Integer id) {
|
||||
try {
|
||||
Integer type = complaintDao.deleteComplaint(id);
|
||||
if (type>0){
|
||||
return new ServerResult(true,"操作成功!");
|
||||
}else {
|
||||
return new ServerResult(false,"操作失败!");
|
||||
if (type > 0) {
|
||||
return new ServerResult(true, "操作成功!");
|
||||
} else {
|
||||
return new ServerResult(false, "操作失败!");
|
||||
}
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new ServerResult(false,"系统错误!");
|
||||
return new ServerResult(false, "系统错误!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerResult getComplaintCount() {
|
||||
try {
|
||||
return new ServerResult(true,complaintDao.getComplaintCount());
|
||||
}catch (RuntimeException e){
|
||||
return new ServerResult(true, complaintDao.getComplaintCount());
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new ServerResult(false,"系统错误!");
|
||||
return new ServerResult(false, "系统错误!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public class DataShowServiceImpl implements DataShowService {
|
|||
|
||||
/**
|
||||
* 管理员获取订单数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -34,11 +35,11 @@ public class DataShowServiceImpl implements DataShowService {
|
|||
public Map<String, Object> dataShowAdminInfo() {
|
||||
Map<String, Object> modeMap = new HashMap<String, Object>();
|
||||
try {
|
||||
for (int i=0;i<=4;i++){
|
||||
modeMap.put("show"+i,new DataShow(dataShowDao.qureyCountStateAdmin(i),dataShowDao.qureyPriceStateAdmin(i)));
|
||||
for (int i = 0; i <= 4; i++) {
|
||||
modeMap.put("show" + i, new DataShow(dataShowDao.qureyCountStateAdmin(i), dataShowDao.qureyPriceStateAdmin(i)));
|
||||
}
|
||||
return modeMap;
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
|
@ -46,6 +47,7 @@ public class DataShowServiceImpl implements DataShowService {
|
|||
|
||||
/**
|
||||
* 快递员获取订单数据
|
||||
*
|
||||
* @param courierId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -54,11 +56,11 @@ public class DataShowServiceImpl implements DataShowService {
|
|||
public Map<String, Object> dataShowCourierInfo(Integer courierId) {
|
||||
Map<String, Object> modeMap = new HashMap<String, Object>();
|
||||
try {
|
||||
for (int i=0;i<=4;i++){
|
||||
modeMap.put("show"+i,new DataShow(dataShowDao.qureyCountStateCourier(courierId,i),dataShowDao.qureyPriceStateCourier(courierId,i)));
|
||||
for (int i = 0; i <= 4; i++) {
|
||||
modeMap.put("show" + i, new DataShow(dataShowDao.qureyCountStateCourier(courierId, i), dataShowDao.qureyPriceStateCourier(courierId, i)));
|
||||
}
|
||||
return modeMap;
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
|
@ -66,6 +68,7 @@ public class DataShowServiceImpl implements DataShowService {
|
|||
|
||||
/**
|
||||
* 用户获取订单数据
|
||||
*
|
||||
* @param selfId
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -74,11 +77,11 @@ public class DataShowServiceImpl implements DataShowService {
|
|||
public Map<String, Object> dataShowSelfInfo(Integer selfId) {
|
||||
Map<String, Object> modeMap = new HashMap<String, Object>();
|
||||
try {
|
||||
for (Integer i=0;i<=4;i++){
|
||||
modeMap.put("show"+i,new DataShow(dataShowDao.qureyCountStateSelf(selfId,i),dataShowDao.qureyPriceStateSelf(selfId,i)));
|
||||
for (Integer i = 0; i <= 4; i++) {
|
||||
modeMap.put("show" + i, new DataShow(dataShowDao.qureyCountStateSelf(selfId, i), dataShowDao.qureyPriceStateSelf(selfId, i)));
|
||||
}
|
||||
return modeMap;
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ public class FlatsServiceImpl implements FlatsService {
|
|||
|
||||
/**
|
||||
* 添加公寓
|
||||
*
|
||||
* @param flats
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -32,7 +33,7 @@ public class FlatsServiceImpl implements FlatsService {
|
|||
public Integer addFlats(Flats flats) {
|
||||
try {
|
||||
return flatsDao.isnertFlats(flats);
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -40,6 +41,7 @@ public class FlatsServiceImpl implements FlatsService {
|
|||
|
||||
/**
|
||||
* 删除公寓
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -47,7 +49,7 @@ public class FlatsServiceImpl implements FlatsService {
|
|||
public Integer removeFlats(Integer id) {
|
||||
try {
|
||||
return flatsDao.deleteFlats(id);
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -55,6 +57,7 @@ public class FlatsServiceImpl implements FlatsService {
|
|||
|
||||
/**
|
||||
* 修改公寓
|
||||
*
|
||||
* @param flats
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -62,7 +65,7 @@ public class FlatsServiceImpl implements FlatsService {
|
|||
public Integer editFlats(Flats flats) {
|
||||
try {
|
||||
return flatsDao.updataFlats(flats);
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -70,13 +73,14 @@ public class FlatsServiceImpl implements FlatsService {
|
|||
|
||||
/**
|
||||
* 获取所有公寓
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<Flats> getAllFlats() {
|
||||
try {
|
||||
return flatsDao.queryAllFlat();
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,14 +33,14 @@ public class MailConfigServiceImpl implements MailConfigService {
|
|||
public ServerResult<MailConfig> getMailConfig() {
|
||||
try {
|
||||
MailConfig mailConfig = mailConfigDao.getMailConfig();
|
||||
if (mailConfig!=null){
|
||||
return new ServerResult<>(true,mailConfig);
|
||||
}else {
|
||||
return new ServerResult<>(false,"查询结果为空");
|
||||
if (mailConfig != null) {
|
||||
return new ServerResult<>(true, mailConfig);
|
||||
} else {
|
||||
return new ServerResult<>(false, "查询结果为空");
|
||||
}
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new ServerResult<>(false,"系统错误");
|
||||
return new ServerResult<>(false, "系统错误");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -49,14 +49,14 @@ public class MailConfigServiceImpl implements MailConfigService {
|
|||
public ServerResult editMailConfig(MailConfig mailConfig) {
|
||||
try {
|
||||
Integer statr = mailConfigDao.updateMailConfig(mailConfig);
|
||||
if (statr == 1){
|
||||
return new ServerResult(true,"修改成功");
|
||||
}else {
|
||||
return new ServerResult(false,"修改失败");
|
||||
if (statr == 1) {
|
||||
return new ServerResult(true, "修改成功");
|
||||
} else {
|
||||
return new ServerResult(false, "修改失败");
|
||||
}
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new ServerResult(false,"系统错误");
|
||||
return new ServerResult(false, "系统错误");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -64,23 +64,23 @@ public class MailConfigServiceImpl implements MailConfigService {
|
|||
public ServerResult testSendMessage(Account account) {
|
||||
try {
|
||||
MailConfig mailConfig = mailConfigDao.getMailConfig();
|
||||
if (mailConfig.getSender()==null){
|
||||
return new ServerResult(false,"发件人地址为空");
|
||||
if (mailConfig.getSender() == null) {
|
||||
return new ServerResult(false, "发件人地址为空");
|
||||
}
|
||||
if (mailConfig.getPersonal()==null){
|
||||
return new ServerResult(false,"发件人昵称为空");
|
||||
if (mailConfig.getPersonal() == null) {
|
||||
return new ServerResult(false, "发件人昵称为空");
|
||||
}
|
||||
if (mailConfig.getEmailSmtpHost()==null){
|
||||
return new ServerResult(false,"服务器地址为空");
|
||||
if (mailConfig.getEmailSmtpHost() == null) {
|
||||
return new ServerResult(false, "服务器地址为空");
|
||||
}
|
||||
if (mailConfig.getEmailSmtpPort()==null){
|
||||
return new ServerResult(false,"服务器端口号为空");
|
||||
if (mailConfig.getEmailSmtpPort() == null) {
|
||||
return new ServerResult(false, "服务器端口号为空");
|
||||
}
|
||||
if (mailConfig.getUsername()==null){
|
||||
return new ServerResult(false,"用户名为空");
|
||||
if (mailConfig.getUsername() == null) {
|
||||
return new ServerResult(false, "用户名为空");
|
||||
}
|
||||
if (mailConfig.getPassword()==null){
|
||||
return new ServerResult(false,"密码为空");
|
||||
if (mailConfig.getPassword() == null) {
|
||||
return new ServerResult(false, "密码为空");
|
||||
}
|
||||
String title = "测试邮件";
|
||||
String content = "<div class=\"text2\">\n" +
|
||||
|
|
@ -94,17 +94,17 @@ public class MailConfigServiceImpl implements MailConfigService {
|
|||
" \n" +
|
||||
" </div>";
|
||||
account.setEmail(mailConfig.getTestMail());
|
||||
boolean type = MailUnit.sendTheMail(account,mailConfig,title,content);
|
||||
if (type){
|
||||
logger.info(account.getEmail()+"与"+new Date() + "发送邮件成功");
|
||||
return new ServerResult(true,"发送成功");
|
||||
}else {
|
||||
logger.info(account.getEmail()+"与"+new Date() + "发送邮件失败");
|
||||
return new ServerResult(false,"发送失败");
|
||||
boolean type = MailUnit.sendTheMail(account, mailConfig, title, content);
|
||||
if (type) {
|
||||
logger.info(account.getEmail() + "与" + new Date() + "发送邮件成功");
|
||||
return new ServerResult(true, "发送成功");
|
||||
} else {
|
||||
logger.info(account.getEmail() + "与" + new Date() + "发送邮件失败");
|
||||
return new ServerResult(false, "发送失败");
|
||||
}
|
||||
}catch (RuntimeException e){
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new ServerResult(false,"系统错误");
|
||||
return new ServerResult(false, "系统错误");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,14 +34,14 @@ public class PriceSercieImpl implements PriceSercie {
|
|||
public ServerResult addPrice(Price price) {
|
||||
try {
|
||||
Integer count = priceDao.insertPrice(price);
|
||||
if (count>0){
|
||||
return new ServerResult(true,"添加成功!");
|
||||
}else {
|
||||
return new ServerResult(false,"操作失败!");
|
||||
if (count > 0) {
|
||||
return new ServerResult(true, "添加成功!");
|
||||
} else {
|
||||
return new ServerResult(false, "操作失败!");
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new ServerResult(false,"操作失败!");
|
||||
return new ServerResult(false, "操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -55,14 +55,14 @@ public class PriceSercieImpl implements PriceSercie {
|
|||
public ServerResult removePrice(Integer id) {
|
||||
try {
|
||||
Integer count = priceDao.deletePrice(id);
|
||||
if (count>0){
|
||||
return new ServerResult(true,"删除成功!");
|
||||
}else {
|
||||
return new ServerResult(false,"删除失败!");
|
||||
if (count > 0) {
|
||||
return new ServerResult(true, "删除成功!");
|
||||
} else {
|
||||
return new ServerResult(false, "删除失败!");
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
logger.error(e.getMessage());
|
||||
return new ServerResult(false,"操作失败!");
|
||||
return new ServerResult(false, "操作失败!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ public class DESUtil {
|
|||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// System.out.println(getEncryptString("123456789"));
|
||||
// System.out.println(getEncryptString("jdbc:mysql://34.96.189.60:3306/mall?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true"));
|
||||
|
|
|
|||
|
|
@ -5,61 +5,61 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.Date;
|
||||
|
||||
public class HttpServletRequestUtil {
|
||||
public static Integer getInteger(HttpServletRequest request, String key) {
|
||||
try {
|
||||
return Integer.decode(request.getParameter(key));
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
public static Integer getInteger(HttpServletRequest request, String key) {
|
||||
try {
|
||||
return Integer.decode(request.getParameter(key));
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Date getDate(HttpServletRequest request, String key) {
|
||||
String datetime = request.getParameter(key);//获取表单信息
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");//设置为指定格式
|
||||
try {
|
||||
return sdf.parse(datetime);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static Date getDate(HttpServletRequest request, String key) {
|
||||
String datetime = request.getParameter(key);//获取表单信息
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");//设置为指定格式
|
||||
try {
|
||||
return sdf.parse(datetime);
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static long getLong(HttpServletRequest request, String key) {
|
||||
try {
|
||||
return Long.valueOf(request.getParameter(key));
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
public static long getLong(HttpServletRequest request, String key) {
|
||||
try {
|
||||
return Long.valueOf(request.getParameter(key));
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public static Double getDouble(HttpServletRequest request, String key) {
|
||||
try {
|
||||
return Double.valueOf(request.getParameter(key));
|
||||
} catch (Exception e) {
|
||||
return -1d;
|
||||
}
|
||||
}
|
||||
public static Double getDouble(HttpServletRequest request, String key) {
|
||||
try {
|
||||
return Double.valueOf(request.getParameter(key));
|
||||
} catch (Exception e) {
|
||||
return -1d;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean getBoolean(HttpServletRequest request, String key) {
|
||||
try {
|
||||
return Boolean.valueOf(request.getParameter(key));
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public static boolean getBoolean(HttpServletRequest request, String key) {
|
||||
try {
|
||||
return Boolean.valueOf(request.getParameter(key));
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static String getString(HttpServletRequest request, String key) {
|
||||
try {
|
||||
String result = request.getParameter(key);
|
||||
if (result != null) {
|
||||
result = result.trim();
|
||||
}
|
||||
if ("".equals(result)) {
|
||||
result = null;
|
||||
}
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static String getString(HttpServletRequest request, String key) {
|
||||
try {
|
||||
String result = request.getParameter(key);
|
||||
if (result != null) {
|
||||
result = result.trim();
|
||||
}
|
||||
if ("".equals(result)) {
|
||||
result = null;
|
||||
}
|
||||
return result;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,7 +1,7 @@
|
|||
package live.tomey.api.express.unit;
|
||||
|
||||
public class PageCalculator {
|
||||
public static int calculateRowIndex(int pageIndex, int pageSize) {
|
||||
return (pageIndex > 0) ? (pageIndex - 1) * pageSize : 0;
|
||||
}
|
||||
public static int calculateRowIndex(int pageIndex, int pageSize) {
|
||||
return (pageIndex > 0) ? (pageIndex - 1) * pageSize : 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue