Compare commits
38 Commits
release_v3
...
release_3.
Author | SHA1 | Date | |
---|---|---|---|
f28dd867ef | |||
8e6842a495 | |||
928cb2417f | |||
625694ba1e | |||
d6c0337c09 | |||
689efc0807 | |||
4540c3781e | |||
9d2c453bb0 | |||
9de47ce697 | |||
c79974ff77 | |||
fb0098aef8 | |||
419d7a971b | |||
83eda2a44d | |||
3182029bdd | |||
19d4a9960d | |||
2603150b33 | |||
f5e440390b | |||
91e525ec8e | |||
83afb9e6e2 | |||
19d4c6b778 | |||
d22200b8c7 | |||
43fe1150fd | |||
65b65f874f | |||
3b6bc859a5 | |||
cfc55a6c92 | |||
0a80c5662d | |||
02fd0d7e25 | |||
521142a792 | |||
c567e37423 | |||
b5e0814eb4 | |||
ca6c2aec96 | |||
34859c839b | |||
039f9d9cf8 | |||
224829dd1f | |||
1a5122209a | |||
48aff7cf37 | |||
e673f9be9d | |||
20469bd669 |
64
README.md
@ -2,9 +2,14 @@
|
||||
|
||||
# 小说精品屋-plus
|
||||
|
||||
[](https://github.com/201206030/novel-plus)
|
||||
[](https://github.com/201206030/novel-plus)
|
||||
[](https://gitee.com/novel_dev_team/novel-plus)
|
||||
[](https://gitee.com/novel_dev_team/novel-plus)
|
||||
|
||||
#### 官网
|
||||
|
||||
https://xiongxyang.gitee.io/home/
|
||||
https://xiongxyang.gitee.io
|
||||
|
||||
#### 新项目:小说精品屋-微服务版
|
||||
|
||||
@ -205,7 +210,7 @@ novel-plus -- 父工程
|
||||
|
||||

|
||||
|
||||
#### 安装步骤
|
||||
#### 安装步骤(源码,小白请看其他安装教程)
|
||||
|
||||
##### 数据库安装:
|
||||
|
||||
@ -216,23 +221,56 @@ novel-plus -- 父工程
|
||||
|
||||
##### 爬虫管理系统安装:
|
||||
|
||||
1. 修改novel-common模块下application-common-dev.yml配置文件中的数据库配置。
|
||||
1. 修改novel-common模块下application-common-dev.yml(dev环境,默认环境)或application-common-prod.yml(prod环境,需要在application.yml配置文件中切换)配置文件中的数据库配置。
|
||||
2. 修改novel-crawl模块下application.yml文件中的管理员账号密码。
|
||||
3. 启动程序,打开浏览器,默认8081端口访问。
|
||||
4. 选择已有或新增爬虫源(支持自定义爬虫规则),点击`开启`按钮,开始爬取小说数据。
|
||||
|
||||
##### 前台小说门户安装(jar包形式部署时,需要复制templates文件夹到jar文件的相同目录下):
|
||||
##### 前台小说门户安装(dev环境跳过3、4步骤):
|
||||
|
||||
1. 修改novel-common模块下application-common-dev.yml(dev环境,默认环境)或application-common-prod.yml(prod环境,需要在application.yml配置文件中切换)配置文件中的数据库配置。
|
||||
|
||||
1. 修改novel-common模块下application-common-dev.yml配置文件中的数据库配置。
|
||||
2. 修改novel-front模块下application-website配置文件中的网站信息。
|
||||

|
||||
3. 修改novel-front模块下application.yml配置文件中的模版名为你需要使用的模版名(templates文件夹下的模版文件夹名)(内置orange和dark两套模版)。
|
||||

|
||||
4. 启动程序,打开浏览器,默认8080端口访问。
|
||||
|
||||
```
|
||||
#网站配置
|
||||
website:
|
||||
#网站名
|
||||
name: 小说精品屋
|
||||
#域名
|
||||
domain: xiongxyang.gitee.io
|
||||
#SEO关键词
|
||||
keyword: ${website.name},小说,小说CMS,原创文学系统,开源小说系统,免费小说建站程序
|
||||
#SEO描述
|
||||
description: ${website.name}是一个多端(PC、WAP)阅读、功能完善的原创文学CMS系统,由前台门户系统、作家后台管理系统、平台后台管理系统、爬虫管理系统等多个子系统构成,支持会员充值、订阅模式、新闻发布和实时统计报表等功能,新书自动入库,老书自动更新。
|
||||
#联系QQ
|
||||
qq: 1179705413
|
||||
```
|
||||
|
||||
3. prod环境下需要修改novel-front模块下application-prod.yml配置文件中的模版名为你需要使用的模版名(templates文件夹下的模版文件夹名,内置orange和dark两套模版,prod环境下才支持多模版)。
|
||||
|
||||
```
|
||||
#模版配置
|
||||
templates:
|
||||
#模版名
|
||||
name: orange
|
||||
```
|
||||
|
||||
4. prod环境下的jar包形式部署时,需要复制templates文件夹到jar文件的相同目录下。
|
||||
|
||||
5. 启动程序,打开浏览器,默认8080端口访问。
|
||||
|
||||
**喜欢此项目的可以给我的GitHub和Gitee加个Star支持一下 。**
|
||||
|
||||
#### 其他安装教程
|
||||
#### 其他安装教程(如果链接打不开,可关注公众号获取)
|
||||
|
||||
##### version>=3.5.0版本
|
||||
|
||||
包安装及低版本升级教程:[点击前往](https://my.oschina.net/java2nb/blog/4914688)
|
||||
|
||||
##### 3.3.0<=version<3.5.0版本
|
||||
|
||||
包安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4842472)
|
||||
|
||||
##### version<3.3.0版本
|
||||
|
||||
@ -242,10 +280,6 @@ novel-plus -- 父工程
|
||||
|
||||
docker安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4271989)
|
||||
|
||||
##### version>=3.3.0版本
|
||||
|
||||
包安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4842472)
|
||||
|
||||
#### 代码仓库
|
||||
|
||||
GitHub仓库地址: https://github.com/201206030/novel-plus
|
||||
@ -254,7 +288,7 @@ docker安装教程:[点击前往](https://my.oschina.net/java2nb/blog/4271989)
|
||||
|
||||
#### QQ交流群
|
||||
|
||||
[点击前往官网查看](https://xiongxyang.gitee.io/home/service.htm)
|
||||
[点击前往官网查看](https://xiongxyang.gitee.io/service.htm)
|
||||
|
||||
问问题的三要素
|
||||
|
||||
|
@ -1836,4 +1836,6 @@ INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4900, 1, 235);
|
||||
INSERT INTO `sys_role_menu`(`id`, `role_id`, `menu_id`) VALUES (4888, 1, 234);
|
||||
|
||||
|
||||
delete from sys_menu where menu_id = 202;
|
||||
delete from sys_menu where menu_id = 202;
|
||||
|
||||
INSERT INTO crawl_source(`id`, `source_name`, `crawl_rule`, `source_status`, `create_time`, `update_time`) VALUES (16, 'i笔趣阁', '{\"bookListUrl\":\"http://m.ibiquge.net/xclass/{catId}/{page}.html\",\"catIdRule\":{\"catId1\":\"1\",\"catId2\":\"2\",\"catId3\":\"3\",\"catId4\":\"4\",\"catId5\":\"6\",\"catId6\":\"5\",\"catId7\":\"7\"},\"bookIdPatten\":\"href=\\\"/(\\\\d+_\\\\d+)/\\\"\",\"pagePatten\":\"value=\\\"(\\\\d+)/\\\\d+\\\"\",\"totalPagePatten\":\"value=\\\"\\\\d+/(\\\\d+)\\\"\",\"bookDetailUrl\":\"http://m.ibiquge.net/{bookId}/\",\"bookNamePatten\":\"<span class=\\\"title\\\">([^/]+)</span>\",\"authorNamePatten\":\"<a href=\\\"/author/\\\\d+/\\\">([^/]+)</a>\",\"picUrlPatten\":\"<img src=\\\"([^>]+)\\\"\\\\s+onerror=\\\"this.src=\",\"picUrlPrefix\":\"http://m.ibiquge.net\",\"statusPatten\":\">状态:([^/]+)</li>\",\"bookStatusRule\":{\"连载\":0,\"完结\":1},\"visitCountPatten\":\">点击:(\\\\d+)</li>\",\"descStart\":\"<p class=\\\"review\\\">\",\"descEnd\":\"</p>\",\"bookIndexUrl\":\"http://www.ibiquge.net/{bookId}/\",\"bookIndexStart\":\"正文</dt>\",\"indexIdPatten\":\"<a\\\\s+style=\\\"\\\"\\\\s+href=\\\"/\\\\d+_\\\\d+/(\\\\d+)\\\\.html\\\">[^/]+</a>\",\"indexNamePatten\":\"<a\\\\s+style=\\\"\\\"\\\\s+href=\\\"/\\\\d+_\\\\d+/\\\\d+\\\\.html\\\">([^/]+)</a>\",\"bookContentUrl\":\"http://www.ibiquge.net/{bookId}/{indexId}.html\",\"contentStart\":\"</p>\",\"contentEnd\":\"<div align=\\\"center\\\">\"}', 0, '2021-02-04 21:31:23', '2021-02-04 21:31:23');
|
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.java2nb</groupId>
|
||||
<artifactId>novel-admin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<version>3.5.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>novel-admin</name>
|
||||
|
@ -2,20 +2,18 @@ package com.java2nb;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
//关闭SpringSecurity的功能
|
||||
@EnableAutoConfiguration(exclude = {
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
|
||||
@EnableTransactionManagement
|
||||
@ServletComponentScan
|
||||
@MapperScan("com.java2nb.*.dao")
|
||||
@SpringBootApplication
|
||||
@SpringBootApplication(exclude = {
|
||||
org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class
|
||||
})
|
||||
@EnableCaching
|
||||
public class AdminApplication {
|
||||
public static void main(String[] args) {
|
||||
|
@ -1,19 +1,17 @@
|
||||
package com.java2nb.novel.controller;
|
||||
|
||||
import com.java2nb.common.utils.DateUtils;
|
||||
import com.java2nb.common.utils.PageBean;
|
||||
import com.java2nb.common.utils.Query;
|
||||
import com.java2nb.common.utils.R;
|
||||
import com.java2nb.novel.domain.AuthorCodeDO;
|
||||
import com.java2nb.novel.service.*;
|
||||
import com.java2nb.test.service.OrderService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.java2nb.novel.service.AuthorService;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
import com.java2nb.novel.service.PayService;
|
||||
import com.java2nb.novel.service.UserService;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
@ -1,135 +0,0 @@
|
||||
package com.java2nb.test.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
|
||||
import com.java2nb.test.domain.OrderDO;
|
||||
import com.java2nb.test.service.OrderService;
|
||||
import com.java2nb.common.utils.PageBean;
|
||||
import com.java2nb.common.utils.Query;
|
||||
import com.java2nb.common.utils.R;
|
||||
|
||||
/**
|
||||
* 付呗-订单信息表
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2019-11-25 11:57:16
|
||||
*/
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/test/order")
|
||||
public class OrderController {
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
@GetMapping()
|
||||
@RequiresPermissions("test:order:order")
|
||||
String Order() {
|
||||
return "test/order/order";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取付呗-订单信息表列表", notes = "获取付呗-订单信息表列表")
|
||||
@ResponseBody
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("test:order:order")
|
||||
public R list(@RequestParam Map<String, Object> params) {
|
||||
//查询列表数据
|
||||
Query query = new Query(params);
|
||||
List<OrderDO> orderList = orderService.list(query);
|
||||
int total = orderService.count(query);
|
||||
PageBean pageBean = new PageBean(orderList, total);
|
||||
return R.ok().put("data", pageBean);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增付呗-订单信息表页面", notes = "新增付呗-订单信息表页面")
|
||||
@GetMapping("/add")
|
||||
@RequiresPermissions("test:order:add")
|
||||
String add() {
|
||||
return "test/order/add";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改付呗-订单信息表页面", notes = "修改付呗-订单信息表页面")
|
||||
@GetMapping("/edit/{id}")
|
||||
@RequiresPermissions("test:order:edit")
|
||||
String edit(@PathVariable("id") Long id, Model model) {
|
||||
OrderDO order = orderService.get(id);
|
||||
model.addAttribute("order", order);
|
||||
return "test/order/edit";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查看付呗-订单信息表页面", notes = "查看付呗-订单信息表页面")
|
||||
@GetMapping("/detail/{id}")
|
||||
@RequiresPermissions("test:order:detail")
|
||||
String detail(@PathVariable("id") Long id, Model model) {
|
||||
OrderDO order = orderService.get(id);
|
||||
model.addAttribute("order", order);
|
||||
return "test/order/detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@ApiOperation(value = "新增付呗-订单信息表", notes = "新增付呗-订单信息表")
|
||||
@ResponseBody
|
||||
@PostMapping("/save")
|
||||
@RequiresPermissions("test:order:add")
|
||||
public R save( OrderDO order) {
|
||||
if (orderService.save(order) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@ApiOperation(value = "修改付呗-订单信息表", notes = "修改付呗-订单信息表")
|
||||
@ResponseBody
|
||||
@RequestMapping("/update")
|
||||
@RequiresPermissions("test:order:edit")
|
||||
public R update( OrderDO order) {
|
||||
orderService.update(order);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "删除付呗-订单信息表", notes = "删除付呗-订单信息表")
|
||||
@PostMapping("/remove")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("test:order:remove")
|
||||
public R remove( Long id) {
|
||||
if (orderService.remove(id) > 0) {
|
||||
return R.ok();
|
||||
}
|
||||
return R.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@ApiOperation(value = "批量删除付呗-订单信息表", notes = "批量删除付呗-订单信息表")
|
||||
@PostMapping("/batchRemove")
|
||||
@ResponseBody
|
||||
@RequiresPermissions("test:order:batchRemove")
|
||||
public R remove(@RequestParam("ids[]") Long[] ids) {
|
||||
orderService.batchRemove(ids);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
package com.java2nb.test.dao;
|
||||
|
||||
import com.java2nb.test.domain.OrderDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 付呗-订单信息表
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2019-11-25 11:57:16
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderDao {
|
||||
|
||||
OrderDO get(Long id);
|
||||
|
||||
List<OrderDO> list(Map<String,Object> map);
|
||||
|
||||
int count(Map<String,Object> map);
|
||||
|
||||
int save(OrderDO order);
|
||||
|
||||
int update(OrderDO order);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
}
|
@ -1,475 +0,0 @@
|
||||
package com.java2nb.test.domain;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.java2nb.common.jsonserializer.LongToStringSerializer;
|
||||
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 付呗-订单信息表
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2019-11-25 11:57:16
|
||||
*/
|
||||
public class OrderDO implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
//主键
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long id;
|
||||
//付呗商户号
|
||||
private String fbMerchantCode;
|
||||
//第三方商户的订单号
|
||||
private String merchantOrderSn;
|
||||
//付呗订单号
|
||||
private String orderSn;
|
||||
//平台方订单号
|
||||
private String platformOrderNo;
|
||||
//商户单号
|
||||
private String tradeNo;
|
||||
//订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消
|
||||
private Integer orderState;
|
||||
//蜂鸟优惠卷抵扣
|
||||
private Double fnCoupon;
|
||||
//红包抵扣
|
||||
private BigDecimal redPacket;
|
||||
//实收金额(元)
|
||||
private BigDecimal totalFee;
|
||||
//订单金额
|
||||
private BigDecimal orderPrice;
|
||||
//手续费(元)
|
||||
private BigDecimal fee;
|
||||
//对商品或交易的描述
|
||||
private String body;
|
||||
//附加数据
|
||||
private String attach;
|
||||
//付呗系统的门店id
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long storeId;
|
||||
//付呗系统的收银员id
|
||||
//java中的long能表示的范围比js中number大,也就意味着部分数值在js中存不下(变成不准确的值)
|
||||
//所以通过序列化成字符串来解决
|
||||
@JsonSerialize(using = LongToStringSerializer.class)
|
||||
private Long cashierId;
|
||||
//设备终端号
|
||||
private String deviceNo;
|
||||
//微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”
|
||||
private String userId;
|
||||
//支付宝顾客的账号
|
||||
private String userLogonId;
|
||||
//交易成功的时间
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date payTime;
|
||||
//支付通道:1微信、2支付宝、3银联
|
||||
private Integer payChannel;
|
||||
//免充值代金券金额(元)
|
||||
private BigDecimal noCashCouponFee;
|
||||
//预充值代金券金额(元)
|
||||
private BigDecimal cashCouponFee;
|
||||
//顾客实际支付金额(元)
|
||||
private BigDecimal cashFee;
|
||||
//签名
|
||||
private String sign;
|
||||
//其它选项
|
||||
private String options;
|
||||
//创建时间
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
//推送时间
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTime;
|
||||
//推送IP
|
||||
private String pushIp;
|
||||
//商户id
|
||||
private BigDecimal mchtId;
|
||||
//QR编号
|
||||
private String sn;
|
||||
|
||||
/**
|
||||
* 设置:主键
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
/**
|
||||
* 获取:主键
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* 设置:付呗商户号
|
||||
*/
|
||||
public void setFbMerchantCode(String fbMerchantCode) {
|
||||
this.fbMerchantCode = fbMerchantCode;
|
||||
}
|
||||
/**
|
||||
* 获取:付呗商户号
|
||||
*/
|
||||
public String getFbMerchantCode() {
|
||||
return fbMerchantCode;
|
||||
}
|
||||
/**
|
||||
* 设置:第三方商户的订单号
|
||||
*/
|
||||
public void setMerchantOrderSn(String merchantOrderSn) {
|
||||
this.merchantOrderSn = merchantOrderSn;
|
||||
}
|
||||
/**
|
||||
* 获取:第三方商户的订单号
|
||||
*/
|
||||
public String getMerchantOrderSn() {
|
||||
return merchantOrderSn;
|
||||
}
|
||||
/**
|
||||
* 设置:付呗订单号
|
||||
*/
|
||||
public void setOrderSn(String orderSn) {
|
||||
this.orderSn = orderSn;
|
||||
}
|
||||
/**
|
||||
* 获取:付呗订单号
|
||||
*/
|
||||
public String getOrderSn() {
|
||||
return orderSn;
|
||||
}
|
||||
/**
|
||||
* 设置:平台方订单号
|
||||
*/
|
||||
public void setPlatformOrderNo(String platformOrderNo) {
|
||||
this.platformOrderNo = platformOrderNo;
|
||||
}
|
||||
/**
|
||||
* 获取:平台方订单号
|
||||
*/
|
||||
public String getPlatformOrderNo() {
|
||||
return platformOrderNo;
|
||||
}
|
||||
/**
|
||||
* 设置:商户单号
|
||||
*/
|
||||
public void setTradeNo(String tradeNo) {
|
||||
this.tradeNo = tradeNo;
|
||||
}
|
||||
/**
|
||||
* 获取:商户单号
|
||||
*/
|
||||
public String getTradeNo() {
|
||||
return tradeNo;
|
||||
}
|
||||
/**
|
||||
* 设置:订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消
|
||||
*/
|
||||
public void setOrderState(Integer orderState) {
|
||||
this.orderState = orderState;
|
||||
}
|
||||
/**
|
||||
* 获取:订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消
|
||||
*/
|
||||
public Integer getOrderState() {
|
||||
return orderState;
|
||||
}
|
||||
/**
|
||||
* 设置:蜂鸟优惠卷抵扣
|
||||
*/
|
||||
public void setFnCoupon(Double fnCoupon) {
|
||||
this.fnCoupon = fnCoupon;
|
||||
}
|
||||
/**
|
||||
* 获取:蜂鸟优惠卷抵扣
|
||||
*/
|
||||
public Double getFnCoupon() {
|
||||
return fnCoupon;
|
||||
}
|
||||
/**
|
||||
* 设置:红包抵扣
|
||||
*/
|
||||
public void setRedPacket(BigDecimal redPacket) {
|
||||
this.redPacket = redPacket;
|
||||
}
|
||||
/**
|
||||
* 获取:红包抵扣
|
||||
*/
|
||||
public BigDecimal getRedPacket() {
|
||||
return redPacket;
|
||||
}
|
||||
/**
|
||||
* 设置:实收金额(元)
|
||||
*/
|
||||
public void setTotalFee(BigDecimal totalFee) {
|
||||
this.totalFee = totalFee;
|
||||
}
|
||||
/**
|
||||
* 获取:实收金额(元)
|
||||
*/
|
||||
public BigDecimal getTotalFee() {
|
||||
return totalFee;
|
||||
}
|
||||
/**
|
||||
* 设置:订单金额
|
||||
*/
|
||||
public void setOrderPrice(BigDecimal orderPrice) {
|
||||
this.orderPrice = orderPrice;
|
||||
}
|
||||
/**
|
||||
* 获取:订单金额
|
||||
*/
|
||||
public BigDecimal getOrderPrice() {
|
||||
return orderPrice;
|
||||
}
|
||||
/**
|
||||
* 设置:手续费(元)
|
||||
*/
|
||||
public void setFee(BigDecimal fee) {
|
||||
this.fee = fee;
|
||||
}
|
||||
/**
|
||||
* 获取:手续费(元)
|
||||
*/
|
||||
public BigDecimal getFee() {
|
||||
return fee;
|
||||
}
|
||||
/**
|
||||
* 设置:对商品或交易的描述
|
||||
*/
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
/**
|
||||
* 获取:对商品或交易的描述
|
||||
*/
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
/**
|
||||
* 设置:附加数据
|
||||
*/
|
||||
public void setAttach(String attach) {
|
||||
this.attach = attach;
|
||||
}
|
||||
/**
|
||||
* 获取:附加数据
|
||||
*/
|
||||
public String getAttach() {
|
||||
return attach;
|
||||
}
|
||||
/**
|
||||
* 设置:付呗系统的门店id
|
||||
*/
|
||||
public void setStoreId(Long storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
/**
|
||||
* 获取:付呗系统的门店id
|
||||
*/
|
||||
public Long getStoreId() {
|
||||
return storeId;
|
||||
}
|
||||
/**
|
||||
* 设置:付呗系统的收银员id
|
||||
*/
|
||||
public void setCashierId(Long cashierId) {
|
||||
this.cashierId = cashierId;
|
||||
}
|
||||
/**
|
||||
* 获取:付呗系统的收银员id
|
||||
*/
|
||||
public Long getCashierId() {
|
||||
return cashierId;
|
||||
}
|
||||
/**
|
||||
* 设置:设备终端号
|
||||
*/
|
||||
public void setDeviceNo(String deviceNo) {
|
||||
this.deviceNo = deviceNo;
|
||||
}
|
||||
/**
|
||||
* 获取:设备终端号
|
||||
*/
|
||||
public String getDeviceNo() {
|
||||
return deviceNo;
|
||||
}
|
||||
/**
|
||||
* 设置:微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”
|
||||
*/
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
/**
|
||||
* 获取:微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”
|
||||
*/
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
/**
|
||||
* 设置:支付宝顾客的账号
|
||||
*/
|
||||
public void setUserLogonId(String userLogonId) {
|
||||
this.userLogonId = userLogonId;
|
||||
}
|
||||
/**
|
||||
* 获取:支付宝顾客的账号
|
||||
*/
|
||||
public String getUserLogonId() {
|
||||
return userLogonId;
|
||||
}
|
||||
/**
|
||||
* 设置:交易成功的时间
|
||||
*/
|
||||
public void setPayTime(Date payTime) {
|
||||
this.payTime = payTime;
|
||||
}
|
||||
/**
|
||||
* 获取:交易成功的时间
|
||||
*/
|
||||
public Date getPayTime() {
|
||||
return payTime;
|
||||
}
|
||||
/**
|
||||
* 设置:支付通道:1微信、2支付宝、3银联
|
||||
*/
|
||||
public void setPayChannel(Integer payChannel) {
|
||||
this.payChannel = payChannel;
|
||||
}
|
||||
/**
|
||||
* 获取:支付通道:1微信、2支付宝、3银联
|
||||
*/
|
||||
public Integer getPayChannel() {
|
||||
return payChannel;
|
||||
}
|
||||
/**
|
||||
* 设置:免充值代金券金额(元)
|
||||
*/
|
||||
public void setNoCashCouponFee(BigDecimal noCashCouponFee) {
|
||||
this.noCashCouponFee = noCashCouponFee;
|
||||
}
|
||||
/**
|
||||
* 获取:免充值代金券金额(元)
|
||||
*/
|
||||
public BigDecimal getNoCashCouponFee() {
|
||||
return noCashCouponFee;
|
||||
}
|
||||
/**
|
||||
* 设置:预充值代金券金额(元)
|
||||
*/
|
||||
public void setCashCouponFee(BigDecimal cashCouponFee) {
|
||||
this.cashCouponFee = cashCouponFee;
|
||||
}
|
||||
/**
|
||||
* 获取:预充值代金券金额(元)
|
||||
*/
|
||||
public BigDecimal getCashCouponFee() {
|
||||
return cashCouponFee;
|
||||
}
|
||||
/**
|
||||
* 设置:顾客实际支付金额(元)
|
||||
*/
|
||||
public void setCashFee(BigDecimal cashFee) {
|
||||
this.cashFee = cashFee;
|
||||
}
|
||||
/**
|
||||
* 获取:顾客实际支付金额(元)
|
||||
*/
|
||||
public BigDecimal getCashFee() {
|
||||
return cashFee;
|
||||
}
|
||||
/**
|
||||
* 设置:签名
|
||||
*/
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
/**
|
||||
* 获取:签名
|
||||
*/
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
/**
|
||||
* 设置:其它选项
|
||||
*/
|
||||
public void setOptions(String options) {
|
||||
this.options = options;
|
||||
}
|
||||
/**
|
||||
* 获取:其它选项
|
||||
*/
|
||||
public String getOptions() {
|
||||
return options;
|
||||
}
|
||||
/**
|
||||
* 设置:创建时间
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
/**
|
||||
* 获取:创建时间
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
/**
|
||||
* 设置:推送时间
|
||||
*/
|
||||
public void setPushTime(Date pushTime) {
|
||||
this.pushTime = pushTime;
|
||||
}
|
||||
/**
|
||||
* 获取:推送时间
|
||||
*/
|
||||
public Date getPushTime() {
|
||||
return pushTime;
|
||||
}
|
||||
/**
|
||||
* 设置:推送IP
|
||||
*/
|
||||
public void setPushIp(String pushIp) {
|
||||
this.pushIp = pushIp;
|
||||
}
|
||||
/**
|
||||
* 获取:推送IP
|
||||
*/
|
||||
public String getPushIp() {
|
||||
return pushIp;
|
||||
}
|
||||
/**
|
||||
* 设置:商户id
|
||||
*/
|
||||
public void setMchtId(BigDecimal mchtId) {
|
||||
this.mchtId = mchtId;
|
||||
}
|
||||
/**
|
||||
* 获取:商户id
|
||||
*/
|
||||
public BigDecimal getMchtId() {
|
||||
return mchtId;
|
||||
}
|
||||
/**
|
||||
* 设置:QR编号
|
||||
*/
|
||||
public void setSn(String sn) {
|
||||
this.sn = sn;
|
||||
}
|
||||
/**
|
||||
* 获取:QR编号
|
||||
*/
|
||||
public String getSn() {
|
||||
return sn;
|
||||
}
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
package com.java2nb.test.service;
|
||||
|
||||
import com.java2nb.test.domain.OrderDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 付呗-订单信息表
|
||||
*
|
||||
* @author xiongxy
|
||||
* @email 1179705413@qq.com
|
||||
* @date 2019-11-25 11:57:16
|
||||
*/
|
||||
public interface OrderService {
|
||||
|
||||
OrderDO get(Long id);
|
||||
|
||||
List<OrderDO> list(Map<String, Object> map);
|
||||
|
||||
int count(Map<String, Object> map);
|
||||
|
||||
int save(OrderDO order);
|
||||
|
||||
int update(OrderDO order);
|
||||
|
||||
int remove(Long id);
|
||||
|
||||
int batchRemove(Long[] ids);
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
package com.java2nb.test.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.java2nb.test.dao.OrderDao;
|
||||
import com.java2nb.test.domain.OrderDO;
|
||||
import com.java2nb.test.service.OrderService;
|
||||
|
||||
|
||||
|
||||
@Service
|
||||
public class OrderServiceImpl implements OrderService {
|
||||
@Autowired
|
||||
private OrderDao orderDao;
|
||||
|
||||
@Override
|
||||
public OrderDO get(Long id){
|
||||
return orderDao.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderDO> list(Map<String, Object> map){
|
||||
return orderDao.list(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int count(Map<String, Object> map){
|
||||
return orderDao.count(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(OrderDO order){
|
||||
return orderDao.save(order);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(OrderDO order){
|
||||
return orderDao.update(order);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int remove(Long id){
|
||||
return orderDao.remove(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchRemove(Long[] ids){
|
||||
return orderDao.batchRemove(ids);
|
||||
}
|
||||
|
||||
}
|
@ -9,8 +9,8 @@ logging:
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
#password:
|
||||
|
@ -1,16 +1,19 @@
|
||||
java2nb:
|
||||
uploadPath: /var/java2nb/uploaded_files/
|
||||
uploadPath: /var/pic/
|
||||
username: admin
|
||||
password: 111111
|
||||
logging:
|
||||
level:
|
||||
root: error
|
||||
com.java2nb: info
|
||||
com.java2nb: error
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/java2nb?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: java2nb
|
||||
password: java2nb1019
|
||||
url: jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
#password:
|
||||
initialSize: 1
|
||||
minIdle: 3
|
||||
maxActive: 20
|
||||
@ -34,18 +37,18 @@ spring:
|
||||
# 合并多个DruidDataSource的监控数据
|
||||
#useGlobalDataSourceStat: true
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password:
|
||||
# 连接超时时间(毫秒)
|
||||
timeout: 10000
|
||||
jedis:
|
||||
pool:
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 10
|
||||
# 连接池最大连接数(使用负值表示没有限制)
|
||||
max-active: 100
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
password: test
|
||||
# 连接超时时间(毫秒)
|
||||
timeout: 10000
|
||||
jedis:
|
||||
pool:
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 10
|
||||
# 连接池最大连接数(使用负值表示没有限制)
|
||||
max-active: 100
|
||||
# 连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1
|
@ -1,6 +1,15 @@
|
||||
__ ________ ___.
|
||||
|__|____ ___ _______ \_____ \ ____\_ |__
|
||||
| \__ \\ \/ /\__ \ / ____/ / \| __ \
|
||||
| |/ __ \\ / / __ \_/ \| | \ \_\ \
|
||||
/\__| (____ /\_/ (____ /\_______ \___| /___ /
|
||||
\______| \/ \/ \/ \/ \/
|
||||
${AnsiColor.CYAN}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
${AnsiColor.RED}
|
||||
|| / | / /
|
||||
|| / | / / ___ // ___ ___ _ __
|
||||
|| / /||/ / //___) ) // // ) ) // ) ) // ) ) ) )
|
||||
||/ / | / // // // // / / // / / / /
|
||||
| / | / ((____ // ((____ ((___/ / // / / / / 小说精品屋欢迎您!!!
|
||||
|
||||
-------Powered By XXY
|
||||
${AnsiColor.CYAN}
|
||||
--------------------------------------------------------------------------------
|
||||
${AnsiColor.BRIGHT_YELLOW}
|
||||
::: Spring-Boot ${spring-boot.formatted-version} :::
|
@ -1,283 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.java2nb.test.dao.OrderDao">
|
||||
|
||||
<select id="get" resultType="com.java2nb.test.domain.OrderDO">
|
||||
select `id`,`fb_merchant_code`,`merchant_order_sn`,`order_sn`,`platform_order_no`,`trade_no`,`order_state`,`fn_coupon`,`red_packet`,`total_fee`,`order_price`,`fee`,`body`,`attach`,`store_id`,`cashier_id`,`device_no`,`user_id`,`user_logon_id`,`pay_time`,`pay_channel`,`no_cash_coupon_fee`,`cash_coupon_fee`,`cash_fee`,`sign`,`options`,`create_time`,`push_time`,`push_ip`,`mcht_id`,`sn` from fb_order where id = #{value}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.java2nb.test.domain.OrderDO">
|
||||
select `id`,`fb_merchant_code`,`merchant_order_sn`,`order_sn`,`platform_order_no`,`trade_no`,`order_state`,`fn_coupon`,`red_packet`,`total_fee`,`order_price`,`fee`,`body`,`attach`,`store_id`,`cashier_id`,`device_no`,`user_id`,`user_logon_id`,`pay_time`,`pay_channel`,`no_cash_coupon_fee`,`cash_coupon_fee`,`cash_fee`,`sign`,`options`,`create_time`,`push_time`,`push_ip`,`mcht_id`,`sn` from fb_order
|
||||
<where>
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="fbMerchantCode != null and fbMerchantCode != ''"> and fb_merchant_code = #{fbMerchantCode} </if>
|
||||
<if test="merchantOrderSn != null and merchantOrderSn != ''"> and merchant_order_sn = #{merchantOrderSn} </if>
|
||||
<if test="orderSn != null and orderSn != ''"> and order_sn = #{orderSn} </if>
|
||||
<if test="platformOrderNo != null and platformOrderNo != ''"> and platform_order_no = #{platformOrderNo} </if>
|
||||
<if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo} </if>
|
||||
<if test="orderState != null and orderState != ''"> and order_state = #{orderState} </if>
|
||||
<if test="fnCoupon != null and fnCoupon != ''"> and fn_coupon = #{fnCoupon} </if>
|
||||
<if test="redPacket != null and redPacket != ''"> and red_packet = #{redPacket} </if>
|
||||
<if test="totalFee != null and totalFee != ''"> and total_fee = #{totalFee} </if>
|
||||
<if test="orderPrice != null and orderPrice != ''"> and order_price = #{orderPrice} </if>
|
||||
<if test="fee != null and fee != ''"> and fee = #{fee} </if>
|
||||
<if test="body != null and body != ''"> and body = #{body} </if>
|
||||
<if test="attach != null and attach != ''"> and attach = #{attach} </if>
|
||||
<if test="storeId != null and storeId != ''"> and store_id = #{storeId} </if>
|
||||
<if test="cashierId != null and cashierId != ''"> and cashier_id = #{cashierId} </if>
|
||||
<if test="deviceNo != null and deviceNo != ''"> and device_no = #{deviceNo} </if>
|
||||
<if test="userId != null and userId != ''"> and user_id = #{userId} </if>
|
||||
<if test="userLogonId != null and userLogonId != ''"> and user_logon_id = #{userLogonId} </if>
|
||||
<if test="payTime != null and payTime != ''"> and pay_time = #{payTime} </if>
|
||||
<if test="payChannel != null and payChannel != ''"> and pay_channel = #{payChannel} </if>
|
||||
<if test="noCashCouponFee != null and noCashCouponFee != ''"> and no_cash_coupon_fee = #{noCashCouponFee} </if>
|
||||
<if test="cashCouponFee != null and cashCouponFee != ''"> and cash_coupon_fee = #{cashCouponFee} </if>
|
||||
<if test="cashFee != null and cashFee != ''"> and cash_fee = #{cashFee} </if>
|
||||
<if test="sign != null and sign != ''"> and sign = #{sign} </if>
|
||||
<if test="options != null and options != ''"> and options = #{options} </if>
|
||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||
<if test="pushTime != null and pushTime != ''"> and push_time = #{pushTime} </if>
|
||||
<if test="pushIp != null and pushIp != ''"> and push_ip = #{pushIp} </if>
|
||||
<if test="mchtId != null and mchtId != ''"> and mcht_id = #{mchtId} </if>
|
||||
<if test="sn != null and sn != ''"> and sn = #{sn} </if>
|
||||
</where>
|
||||
<choose>
|
||||
<when test="sort != null and sort.trim() != ''">
|
||||
order by ${sort} ${order}
|
||||
</when>
|
||||
<otherwise>
|
||||
order by id desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="offset != null and limit != null">
|
||||
limit #{offset}, #{limit}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="count" resultType="int">
|
||||
select count(*) from fb_order
|
||||
<where>
|
||||
<if test="id != null and id != ''"> and id = #{id} </if>
|
||||
<if test="fbMerchantCode != null and fbMerchantCode != ''"> and fb_merchant_code = #{fbMerchantCode} </if>
|
||||
<if test="merchantOrderSn != null and merchantOrderSn != ''"> and merchant_order_sn = #{merchantOrderSn} </if>
|
||||
<if test="orderSn != null and orderSn != ''"> and order_sn = #{orderSn} </if>
|
||||
<if test="platformOrderNo != null and platformOrderNo != ''"> and platform_order_no = #{platformOrderNo} </if>
|
||||
<if test="tradeNo != null and tradeNo != ''"> and trade_no = #{tradeNo} </if>
|
||||
<if test="orderState != null and orderState != ''"> and order_state = #{orderState} </if>
|
||||
<if test="fnCoupon != null and fnCoupon != ''"> and fn_coupon = #{fnCoupon} </if>
|
||||
<if test="redPacket != null and redPacket != ''"> and red_packet = #{redPacket} </if>
|
||||
<if test="totalFee != null and totalFee != ''"> and total_fee = #{totalFee} </if>
|
||||
<if test="orderPrice != null and orderPrice != ''"> and order_price = #{orderPrice} </if>
|
||||
<if test="fee != null and fee != ''"> and fee = #{fee} </if>
|
||||
<if test="body != null and body != ''"> and body = #{body} </if>
|
||||
<if test="attach != null and attach != ''"> and attach = #{attach} </if>
|
||||
<if test="storeId != null and storeId != ''"> and store_id = #{storeId} </if>
|
||||
<if test="cashierId != null and cashierId != ''"> and cashier_id = #{cashierId} </if>
|
||||
<if test="deviceNo != null and deviceNo != ''"> and device_no = #{deviceNo} </if>
|
||||
<if test="userId != null and userId != ''"> and user_id = #{userId} </if>
|
||||
<if test="userLogonId != null and userLogonId != ''"> and user_logon_id = #{userLogonId} </if>
|
||||
<if test="payTime != null and payTime != ''"> and pay_time = #{payTime} </if>
|
||||
<if test="payChannel != null and payChannel != ''"> and pay_channel = #{payChannel} </if>
|
||||
<if test="noCashCouponFee != null and noCashCouponFee != ''"> and no_cash_coupon_fee = #{noCashCouponFee} </if>
|
||||
<if test="cashCouponFee != null and cashCouponFee != ''"> and cash_coupon_fee = #{cashCouponFee} </if>
|
||||
<if test="cashFee != null and cashFee != ''"> and cash_fee = #{cashFee} </if>
|
||||
<if test="sign != null and sign != ''"> and sign = #{sign} </if>
|
||||
<if test="options != null and options != ''"> and options = #{options} </if>
|
||||
<if test="createTime != null and createTime != ''"> and create_time = #{createTime} </if>
|
||||
<if test="pushTime != null and pushTime != ''"> and push_time = #{pushTime} </if>
|
||||
<if test="pushIp != null and pushIp != ''"> and push_ip = #{pushIp} </if>
|
||||
<if test="mchtId != null and mchtId != ''"> and mcht_id = #{mchtId} </if>
|
||||
<if test="sn != null and sn != ''"> and sn = #{sn} </if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="save" parameterType="com.java2nb.test.domain.OrderDO" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into fb_order
|
||||
(
|
||||
`fb_merchant_code`,
|
||||
`merchant_order_sn`,
|
||||
`order_sn`,
|
||||
`platform_order_no`,
|
||||
`trade_no`,
|
||||
`order_state`,
|
||||
`fn_coupon`,
|
||||
`red_packet`,
|
||||
`total_fee`,
|
||||
`order_price`,
|
||||
`fee`,
|
||||
`body`,
|
||||
`attach`,
|
||||
`store_id`,
|
||||
`cashier_id`,
|
||||
`device_no`,
|
||||
`user_id`,
|
||||
`user_logon_id`,
|
||||
`pay_time`,
|
||||
`pay_channel`,
|
||||
`no_cash_coupon_fee`,
|
||||
`cash_coupon_fee`,
|
||||
`cash_fee`,
|
||||
`sign`,
|
||||
`options`,
|
||||
`create_time`,
|
||||
`push_time`,
|
||||
`push_ip`,
|
||||
`mcht_id`,
|
||||
`sn`
|
||||
)
|
||||
values
|
||||
(
|
||||
#{fbMerchantCode},
|
||||
#{merchantOrderSn},
|
||||
#{orderSn},
|
||||
#{platformOrderNo},
|
||||
#{tradeNo},
|
||||
#{orderState},
|
||||
#{fnCoupon},
|
||||
#{redPacket},
|
||||
#{totalFee},
|
||||
#{orderPrice},
|
||||
#{fee},
|
||||
#{body},
|
||||
#{attach},
|
||||
#{storeId},
|
||||
#{cashierId},
|
||||
#{deviceNo},
|
||||
#{userId},
|
||||
#{userLogonId},
|
||||
#{payTime},
|
||||
#{payChannel},
|
||||
#{noCashCouponFee},
|
||||
#{cashCouponFee},
|
||||
#{cashFee},
|
||||
#{sign},
|
||||
#{options},
|
||||
#{createTime},
|
||||
#{pushTime},
|
||||
#{pushIp},
|
||||
#{mchtId},
|
||||
#{sn}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="saveSelective" parameterType="com.java2nb.test.domain.OrderDO" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into fb_order
|
||||
(
|
||||
<if test="id != null"> `id`, </if>
|
||||
<if test="fbMerchantCode != null"> `fb_merchant_code`, </if>
|
||||
<if test="merchantOrderSn != null"> `merchant_order_sn`, </if>
|
||||
<if test="orderSn != null"> `order_sn`, </if>
|
||||
<if test="platformOrderNo != null"> `platform_order_no`, </if>
|
||||
<if test="tradeNo != null"> `trade_no`, </if>
|
||||
<if test="orderState != null"> `order_state`, </if>
|
||||
<if test="fnCoupon != null"> `fn_coupon`, </if>
|
||||
<if test="redPacket != null"> `red_packet`, </if>
|
||||
<if test="totalFee != null"> `total_fee`, </if>
|
||||
<if test="orderPrice != null"> `order_price`, </if>
|
||||
<if test="fee != null"> `fee`, </if>
|
||||
<if test="body != null"> `body`, </if>
|
||||
<if test="attach != null"> `attach`, </if>
|
||||
<if test="storeId != null"> `store_id`, </if>
|
||||
<if test="cashierId != null"> `cashier_id`, </if>
|
||||
<if test="deviceNo != null"> `device_no`, </if>
|
||||
<if test="userId != null"> `user_id`, </if>
|
||||
<if test="userLogonId != null"> `user_logon_id`, </if>
|
||||
<if test="payTime != null"> `pay_time`, </if>
|
||||
<if test="payChannel != null"> `pay_channel`, </if>
|
||||
<if test="noCashCouponFee != null"> `no_cash_coupon_fee`, </if>
|
||||
<if test="cashCouponFee != null"> `cash_coupon_fee`, </if>
|
||||
<if test="cashFee != null"> `cash_fee`, </if>
|
||||
<if test="sign != null"> `sign`, </if>
|
||||
<if test="options != null"> `options`, </if>
|
||||
<if test="createTime != null"> `create_time`, </if>
|
||||
<if test="pushTime != null"> `push_time`, </if>
|
||||
<if test="pushIp != null"> `push_ip`, </if>
|
||||
<if test="mchtId != null"> `mcht_id`, </if>
|
||||
<if test="sn != null"> `sn` </if>
|
||||
)
|
||||
values
|
||||
(
|
||||
<if test="id != null"> #{id}, </if>
|
||||
<if test="fbMerchantCode != null"> #{fbMerchantCode}, </if>
|
||||
<if test="merchantOrderSn != null"> #{merchantOrderSn}, </if>
|
||||
<if test="orderSn != null"> #{orderSn}, </if>
|
||||
<if test="platformOrderNo != null"> #{platformOrderNo}, </if>
|
||||
<if test="tradeNo != null"> #{tradeNo}, </if>
|
||||
<if test="orderState != null"> #{orderState}, </if>
|
||||
<if test="fnCoupon != null"> #{fnCoupon}, </if>
|
||||
<if test="redPacket != null"> #{redPacket}, </if>
|
||||
<if test="totalFee != null"> #{totalFee}, </if>
|
||||
<if test="orderPrice != null"> #{orderPrice}, </if>
|
||||
<if test="fee != null"> #{fee}, </if>
|
||||
<if test="body != null"> #{body}, </if>
|
||||
<if test="attach != null"> #{attach}, </if>
|
||||
<if test="storeId != null"> #{storeId}, </if>
|
||||
<if test="cashierId != null"> #{cashierId}, </if>
|
||||
<if test="deviceNo != null"> #{deviceNo}, </if>
|
||||
<if test="userId != null"> #{userId}, </if>
|
||||
<if test="userLogonId != null"> #{userLogonId}, </if>
|
||||
<if test="payTime != null"> #{payTime}, </if>
|
||||
<if test="payChannel != null"> #{payChannel}, </if>
|
||||
<if test="noCashCouponFee != null"> #{noCashCouponFee}, </if>
|
||||
<if test="cashCouponFee != null"> #{cashCouponFee}, </if>
|
||||
<if test="cashFee != null"> #{cashFee}, </if>
|
||||
<if test="sign != null"> #{sign}, </if>
|
||||
<if test="options != null"> #{options}, </if>
|
||||
<if test="createTime != null"> #{createTime}, </if>
|
||||
<if test="pushTime != null"> #{pushTime}, </if>
|
||||
<if test="pushIp != null"> #{pushIp}, </if>
|
||||
<if test="mchtId != null"> #{mchtId}, </if>
|
||||
<if test="sn != null"> #{sn} </if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update" parameterType="com.java2nb.test.domain.OrderDO">
|
||||
update fb_order
|
||||
<set>
|
||||
<if test="fbMerchantCode != null">`fb_merchant_code` = #{fbMerchantCode}, </if>
|
||||
<if test="merchantOrderSn != null">`merchant_order_sn` = #{merchantOrderSn}, </if>
|
||||
<if test="orderSn != null">`order_sn` = #{orderSn}, </if>
|
||||
<if test="platformOrderNo != null">`platform_order_no` = #{platformOrderNo}, </if>
|
||||
<if test="tradeNo != null">`trade_no` = #{tradeNo}, </if>
|
||||
<if test="orderState != null">`order_state` = #{orderState}, </if>
|
||||
<if test="fnCoupon != null">`fn_coupon` = #{fnCoupon}, </if>
|
||||
<if test="redPacket != null">`red_packet` = #{redPacket}, </if>
|
||||
<if test="totalFee != null">`total_fee` = #{totalFee}, </if>
|
||||
<if test="orderPrice != null">`order_price` = #{orderPrice}, </if>
|
||||
<if test="fee != null">`fee` = #{fee}, </if>
|
||||
<if test="body != null">`body` = #{body}, </if>
|
||||
<if test="attach != null">`attach` = #{attach}, </if>
|
||||
<if test="storeId != null">`store_id` = #{storeId}, </if>
|
||||
<if test="cashierId != null">`cashier_id` = #{cashierId}, </if>
|
||||
<if test="deviceNo != null">`device_no` = #{deviceNo}, </if>
|
||||
<if test="userId != null">`user_id` = #{userId}, </if>
|
||||
<if test="userLogonId != null">`user_logon_id` = #{userLogonId}, </if>
|
||||
<if test="payTime != null">`pay_time` = #{payTime}, </if>
|
||||
<if test="payChannel != null">`pay_channel` = #{payChannel}, </if>
|
||||
<if test="noCashCouponFee != null">`no_cash_coupon_fee` = #{noCashCouponFee}, </if>
|
||||
<if test="cashCouponFee != null">`cash_coupon_fee` = #{cashCouponFee}, </if>
|
||||
<if test="cashFee != null">`cash_fee` = #{cashFee}, </if>
|
||||
<if test="sign != null">`sign` = #{sign}, </if>
|
||||
<if test="options != null">`options` = #{options}, </if>
|
||||
<if test="createTime != null">`create_time` = #{createTime}, </if>
|
||||
<if test="pushTime != null">`push_time` = #{pushTime}, </if>
|
||||
<if test="pushIp != null">`push_ip` = #{pushIp}, </if>
|
||||
<if test="mchtId != null">`mcht_id` = #{mchtId}, </if>
|
||||
<if test="sn != null">`sn` = #{sn}</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="remove">
|
||||
delete from fb_order where id = #{value}
|
||||
</delete>
|
||||
|
||||
<delete id="batchRemove">
|
||||
delete from fb_order where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -1,18 +0,0 @@
|
||||
-- 菜单SQL
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
VALUES ('1', '付呗-订单信息表', 'test/order', 'test:order:order', '1', 'fa', '6');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
set @parentId = @@identity;
|
||||
|
||||
-- 菜单对应按钮SQL
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '查看', null, 'test:order:detail', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '新增', null, 'test:order:add', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '修改', null, 'test:order:edit', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '删除', null, 'test:order:remove', '2', null, '6';
|
||||
INSERT INTO `sys_menu` (`parent_id`, `name`, `url`, `perms`, `type`, `icon`, `order_num`)
|
||||
SELECT @parentId, '批量删除', null, 'test:order:batchRemove', '2', null, '6';
|
@ -1,327 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗商户号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fbMerchantCode" name="fbMerchantCode"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">第三方商户的订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="merchantOrderSn" name="merchantOrderSn"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="orderSn"
|
||||
name="orderSn"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="color">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">平台方订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="platformOrderNo"
|
||||
name="platformOrderNo"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="oa_leave_type">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="tradeNo" name="tradeNo"/>
|
||||
<div id="contentEditortradeNo">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="orderState"
|
||||
name="orderState"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="yes_no">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">蜂鸟优惠卷抵扣:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fnCoupon" name="fnCoupon"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">红包抵扣:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="redPacket" name="redPacket"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">实收金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="totalFee" name="totalFee"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="orderPrice" name="orderPrice"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手续费(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fee" name="fee"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">对商品或交易的描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<img title="点击选择图片" id="picImagebody"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
src="/img/webuploader.png"/>
|
||||
<input id="body" name="body"
|
||||
class="form-control"
|
||||
type="hidden">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">附加数据:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="attach" name="attach"/>
|
||||
<div id="contentEditorattach">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的门店id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="storeId" name="storeId"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的收银员id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashierId" name="cashierId"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备终端号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="deviceNo" name="deviceNo"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="userId" name="userId"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付宝顾客的账号:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="userLogonId" name="userLogonId"
|
||||
class="form-control"></textarea>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">交易成功的时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="laydate-icon layer-date form-control"
|
||||
id="payTime"
|
||||
name="payTime"
|
||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||
style="background-color: #fff;" readonly="readonly"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付通道:1微信、2支付宝、3银联:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="payChannel"
|
||||
name="payChannel"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="del_flag">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">免充值代金券金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="noCashCouponFee" name="noCashCouponFee"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">预充值代金券金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashCouponFee" name="cashCouponFee"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">顾客实际支付金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashFee" name="cashFee"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">签名:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="sign"
|
||||
name="sign"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="theme">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">其它选项:</label>
|
||||
<div class="col-sm-8">
|
||||
<img title="点击选择图片" id="picImageoptions"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
src="/img/webuploader.png"/>
|
||||
<input id="options" name="options"
|
||||
class="form-control"
|
||||
type="hidden">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">创建时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="laydate-icon layer-date form-control"
|
||||
id="createTime"
|
||||
name="createTime"
|
||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||
style="background-color: #fff;" readonly="readonly"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">推送时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="laydate-icon layer-date form-control"
|
||||
id="pushTime"
|
||||
name="pushTime"
|
||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||
style="background-color: #fff;" readonly="readonly"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">推送IP:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="pushIp" name="pushIp"/>
|
||||
<div id="contentEditorpushIp">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="mchtId" name="mchtId"
|
||||
class="form-control"
|
||||
type="number">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">QR编号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="sn" name="sn"
|
||||
class="form-control"
|
||||
type="text">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8 col-sm-offset-3">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||
<script type="text/javascript" src="/js/appjs/test/order/add.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,315 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<input id="id" name="id" th:value="${order.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗商户号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.fbMerchantCode}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">第三方商户的订单号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.merchantOrderSn}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗订单号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="color"
|
||||
th:attr="dict-value=${order.orderSn}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">平台方订单号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="oa_leave_type"
|
||||
th:attr="dict-value=${order.platformOrderNo}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户单号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:utext="${order.tradeNo}"></div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="yes_no"
|
||||
th:attr="dict-value=${order.orderState}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">蜂鸟优惠卷抵扣:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.fnCoupon}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">红包抵扣:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.redPacket}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">实收金额(元):</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.totalFee}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单金额:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.orderPrice}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手续费(元):</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.fee}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">对商品或交易的描述:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8">
|
||||
<img id="picImagebody"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
th:src="${order.body}==null?'/img/webuploader.png':${order.body}"/>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">附加数据:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:utext="${order.attach}"></div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的门店id:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.storeId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的收银员id:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.cashierId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备终端号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.deviceNo}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.userId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付宝顾客的账号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.userLogonId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">交易成功的时间:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.payTime}==null?null:${#dates.format(order.payTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付通道:1微信、2支付宝、3银联:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="del_flag"
|
||||
th:attr="dict-value=${order.payChannel}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">免充值代金券金额(元):</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.noCashCouponFee}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">预充值代金券金额(元):</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.cashCouponFee}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">顾客实际支付金额(元):</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.cashFee}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">签名:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8 dict-type" dict-type="theme"
|
||||
th:attr="dict-value=${order.sign}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">其它选项:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8">
|
||||
<img id="picImageoptions"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
th:src="${order.options}==null?'/img/webuploader.png':${order.options}"/>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">创建时间:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.createTime}==null?null:${#dates.format(order.createTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">推送时间:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.pushTime}==null?null:${#dates.format(order.pushTime,'yyyy-MM-dd HH:mm:ss')}">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">推送IP:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:utext="${order.pushIp}"></div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户id:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.mchtId}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">QR编号:</label>
|
||||
|
||||
<div style="padding-top:8px" class="col-sm-8"
|
||||
th:text="${order.sn}">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
</body>
|
||||
</html>
|
@ -1,323 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox float-e-margins">
|
||||
<div class="ibox-content">
|
||||
<form class="form-horizontal m-t" id="signupForm">
|
||||
<input id="id" name="id" th:value="${order.id}"
|
||||
type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗商户号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fbMerchantCode" name="fbMerchantCode"
|
||||
th:value="${order.fbMerchantCode}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">第三方商户的订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="merchantOrderSn" name="merchantOrderSn"
|
||||
th:value="${order.merchantOrderSn}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="orderSn"
|
||||
name="orderSn"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="color"
|
||||
th:attr="dict-value=${order.orderSn}" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">平台方订单号:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="platformOrderNo"
|
||||
name="platformOrderNo"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="oa_leave_type"
|
||||
th:attr="dict-value=${order.platformOrderNo}" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户单号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="tradeNo" name="tradeNo" th:value="${order.tradeNo}"/>
|
||||
<div id="contentEditortradeNo">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单状态,1:未支付,2:支付成功,3:支付失败,4:支付取消:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="orderState"
|
||||
name="orderState"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="yes_no"
|
||||
th:attr="dict-value=${order.orderState}" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">蜂鸟优惠卷抵扣:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fnCoupon" name="fnCoupon"
|
||||
th:value="${order.fnCoupon}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">红包抵扣:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="redPacket" name="redPacket"
|
||||
th:value="${order.redPacket}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">实收金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="totalFee" name="totalFee"
|
||||
th:value="${order.totalFee}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">订单金额:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="orderPrice" name="orderPrice"
|
||||
th:value="${order.orderPrice}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">手续费(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="fee" name="fee"
|
||||
th:value="${order.fee}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">对商品或交易的描述:</label>
|
||||
<div class="col-sm-8">
|
||||
<img title="点击选择图片" id="picImagebody"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
th:src="${order.body}==null?'/img/webuploader.png':${order.body}"/>
|
||||
<input id="body" name="body" th:value="${order.body}"
|
||||
class="form-control"
|
||||
type="hidden">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">附加数据:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="attach" name="attach" th:value="${order.attach}"/>
|
||||
<div id="contentEditorattach">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的门店id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="storeId" name="storeId"
|
||||
th:value="${order.storeId}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">付呗系统的收银员id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashierId" name="cashierId"
|
||||
th:value="${order.cashierId}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">设备终端号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="deviceNo" name="deviceNo"
|
||||
th:value="${order.deviceNo}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">微信顾客支付授权的“open_id”或者支付宝顾客的“buyer_user_id”:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="userId" name="userId"
|
||||
th:value="${order.userId}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付宝顾客的账号:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea id="userLogonId" name="userLogonId"
|
||||
class="form-control" th:text="${order.userLogonId}"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">交易成功的时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="laydate-icon layer-date form-control"
|
||||
id="payTime"
|
||||
name="payTime"
|
||||
th:value="${order.payTime}==null?null:${#dates.format(order.payTime,'yyyy-MM-dd HH:mm:ss')}"
|
||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||
style="background-color: #fff;" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">支付通道:1微信、2支付宝、3银联:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="payChannel"
|
||||
name="payChannel"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="del_flag"
|
||||
th:attr="dict-value=${order.payChannel}" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">免充值代金券金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="noCashCouponFee" name="noCashCouponFee"
|
||||
th:value="${order.noCashCouponFee}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">预充值代金券金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashCouponFee" name="cashCouponFee"
|
||||
th:value="${order.cashCouponFee}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">顾客实际支付金额(元):</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="cashFee" name="cashFee"
|
||||
th:value="${order.cashFee}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">签名:</label>
|
||||
<div class="col-sm-8">
|
||||
|
||||
<select data-placeholder="--选择--" id="sign"
|
||||
name="sign"
|
||||
class="form-control chosen-select" tabindex="2"
|
||||
dict-type="theme"
|
||||
th:attr="dict-value=${order.sign}" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">其它选项:</label>
|
||||
<div class="col-sm-8">
|
||||
<img title="点击选择图片" id="picImageoptions"
|
||||
style="cursor:pointer;width: 100px;height: 100px"
|
||||
th:src="${order.options}==null?'/img/webuploader.png':${order.options}"/>
|
||||
<input id="options" name="options" th:value="${order.options}"
|
||||
class="form-control"
|
||||
type="hidden">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">创建时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="laydate-icon layer-date form-control"
|
||||
id="createTime"
|
||||
name="createTime"
|
||||
th:value="${order.createTime}==null?null:${#dates.format(order.createTime,'yyyy-MM-dd HH:mm:ss')}"
|
||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||
style="background-color: #fff;" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">推送时间:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" class="laydate-icon layer-date form-control"
|
||||
id="pushTime"
|
||||
name="pushTime"
|
||||
th:value="${order.pushTime}==null?null:${#dates.format(order.pushTime,'yyyy-MM-dd HH:mm:ss')}"
|
||||
onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})"
|
||||
style="background-color: #fff;" readonly="readonly"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">推送IP:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="hidden" id="pushIp" name="pushIp" th:value="${order.pushIp}"/>
|
||||
<div id="contentEditorpushIp">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">商户id:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="mchtId" name="mchtId"
|
||||
th:value="${order.mchtId}"
|
||||
class="form-control"
|
||||
type="number">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">QR编号:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="sn" name="sn"
|
||||
th:value="${order.sn}"
|
||||
class="form-control"
|
||||
type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8 col-sm-offset-3">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div th:include="include::footer"></div>
|
||||
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>
|
||||
<script type="text/javascript" src="/js/appjs/test/order/edit.js">
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -1,66 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta charset="utf-8">
|
||||
<head th:include="include :: header"></head>
|
||||
<body class="gray-bg">
|
||||
<div class="wrapper wrapper-content ">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox">
|
||||
<div class="ibox-body">
|
||||
<div class="fixed-table-toolbar">
|
||||
<div class="columns pull-left">
|
||||
<button shiro:hasPermission="test:order:add" type="button"
|
||||
class="btn btn-primary" onclick="add()">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i>添加
|
||||
</button>
|
||||
<button shiro:hasPermission="test:order:batchRemove" type="button"
|
||||
class="btn btn-danger"
|
||||
onclick="batchRemove()">
|
||||
<i class="fa fa-trash" aria-hidden="true"></i>删除
|
||||
</button>
|
||||
</div>
|
||||
<div class="columns pull-right">
|
||||
<button class="btn btn-success" onclick="reLoad()">查询</button>
|
||||
</div>
|
||||
|
||||
<form id="searchForm">
|
||||
<div class="columns pull-right col-md-2">
|
||||
<input id="id" name="id" type="text" class="form-control"
|
||||
placeholder="主键">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<table id="exampleTable" data-mobile-responsive="true">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--shiro控制bootstraptable行内按钮看见性 -->
|
||||
<div>
|
||||
<script type="text/javascript">
|
||||
var s_detail_h = 'hidden';
|
||||
var s_edit_h = 'hidden';
|
||||
var s_remove_h = 'hidden';
|
||||
</script>
|
||||
</div>
|
||||
<div shiro:hasPermission="test:order:detail">
|
||||
<script type="text/javascript">
|
||||
s_detail_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div shiro:hasPermission="test:order:edit">
|
||||
<script type="text/javascript">
|
||||
s_edit_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div shiro:hasPermission="test:order:remove">
|
||||
<script type="text/javascript">
|
||||
var s_remove_h = '';
|
||||
</script>
|
||||
</div>
|
||||
<div th:include="include :: footer"></div>
|
||||
<script type="text/javascript" src="/js/appjs/test/order/order.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -1,25 +0,0 @@
|
||||
package com.java2nb.testDemo;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController()
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest
|
||||
public class TestDemo {
|
||||
@Autowired
|
||||
RedisTemplate redisTemplate;
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
redisTemplate.opsForValue().set("a", "b");
|
||||
System.out.println(redisTemplate.opsForValue().get("a"));
|
||||
}
|
||||
|
||||
;
|
||||
}
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>novel</artifactId>
|
||||
<groupId>com.java2nb</groupId>
|
||||
<version>3.4.1</version>
|
||||
<version>3.5.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@ -123,6 +123,12 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
@ -0,0 +1,53 @@
|
||||
package com.java2nb.novel.core.bean;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 封装通用分页数据,接收PageHelper、SpringData等框架的分页数据,转换成通用的PageBean对象
|
||||
* @author xiongxiaoyang
|
||||
* @version 1.0
|
||||
* @since 2021/2/4
|
||||
* @param <T> 分页集合类型
|
||||
*/
|
||||
@Data
|
||||
public class PageBean<T> {
|
||||
|
||||
private Integer pageNum;
|
||||
private Integer pageSize;
|
||||
private Long total;
|
||||
private List<? extends T> list;
|
||||
|
||||
|
||||
/**
|
||||
* 该构造函数用于PageHelper工具进行分页查询的场景
|
||||
* 接收PageHelper分页后的list
|
||||
*/
|
||||
public PageBean(List<T> list){
|
||||
PageInfo<T> pageInfo = new PageInfo<>(list);
|
||||
this.pageNum = pageInfo.getPageNum();
|
||||
this.pageSize = pageInfo.getPageSize();
|
||||
this.total = pageInfo.getTotal();
|
||||
this.list = pageInfo.getList();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 该构造函数用于通用分页查询的场景
|
||||
* 接收普通分页数据和普通集合
|
||||
*/
|
||||
public PageBean(Integer pageNum, Integer pageSize, Long total, List<T> list) {
|
||||
this.pageNum = pageNum;
|
||||
this.pageSize = pageSize;
|
||||
this.total = total;
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
|
||||
//TODO 使用其他的分页工具或框架进行分页查询的场景
|
||||
|
||||
|
||||
|
||||
}
|
@ -8,8 +8,9 @@ import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 自定义响应结构
|
||||
* @author 11797
|
||||
*
|
||||
* @param <T>
|
||||
* @author 11797
|
||||
*/
|
||||
@Data
|
||||
public class ResultBean<T> implements Serializable {
|
||||
@ -19,20 +20,20 @@ public class ResultBean<T> implements Serializable {
|
||||
|
||||
/**
|
||||
* 响应消息
|
||||
* */
|
||||
*/
|
||||
private String msg = ResponseStatus.OK.getMsg();
|
||||
/**
|
||||
* 响应中的数据
|
||||
* */
|
||||
*/
|
||||
private T data;
|
||||
|
||||
private ResultBean() {
|
||||
|
||||
}
|
||||
|
||||
private ResultBean(ResponseStatus ResponseStatus) {
|
||||
this.code = ResponseStatus.getCode();;
|
||||
this.msg = ResponseStatus.getMsg();
|
||||
private ResultBean(ResponseStatus responseStatus) {
|
||||
this.code = responseStatus.getCode();
|
||||
this.msg = responseStatus.getMsg();
|
||||
}
|
||||
|
||||
private ResultBean(T data) {
|
||||
@ -40,34 +41,33 @@ public class ResultBean<T> implements Serializable {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 业务处理成功,无数据返回
|
||||
* */
|
||||
public static ResultBean ok() {
|
||||
return new ResultBean();
|
||||
*/
|
||||
public static ResultBean<Void> ok() {
|
||||
return new ResultBean<>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务处理成功,有数据返回
|
||||
* */
|
||||
public static <T> ResultBean ok(T data) {
|
||||
return new ResultBean(data);
|
||||
*/
|
||||
public static <T> ResultBean<T> ok(T data) {
|
||||
return new ResultBean<>(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 业务处理失败
|
||||
* */
|
||||
public static ResultBean fail(ResponseStatus ResponseStatus) {
|
||||
return new ResultBean(ResponseStatus);
|
||||
*/
|
||||
public static ResultBean<Void> fail(ResponseStatus responseStatus) {
|
||||
return new ResultBean<>(responseStatus);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 系统错误
|
||||
* */
|
||||
public static ResultBean error() {
|
||||
return new ResultBean(ResponseStatus.ERROR);
|
||||
*/
|
||||
public static ResultBean<Void> error() {
|
||||
return new ResultBean<>(ResponseStatus.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,12 @@ public enum ResponseStatus {
|
||||
* */
|
||||
ES_SEARCH_FAIL(9001,"搜索引擎查询错误!"),
|
||||
|
||||
/**
|
||||
* 文件相关错误
|
||||
* */
|
||||
FILE_DIR_MAKE_FAIL(10001,"目录创建失败"),
|
||||
FILE_NOT_IMAGE(10002,"请上传图片类型的文件"),
|
||||
FILE_SIZE_LIMIT(10003,"文件大小超出限制"),
|
||||
|
||||
/**
|
||||
* 其他通用错误
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.java2nb.novel.core.utils;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.Charsets;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
@ -11,6 +12,7 @@ import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
@ -19,13 +21,14 @@ import java.util.Objects;
|
||||
* 文件操作工具类
|
||||
* @author 11797
|
||||
*/
|
||||
@UtilityClass
|
||||
@Slf4j
|
||||
public class FileUtil {
|
||||
|
||||
/**
|
||||
* 网络图片转本地
|
||||
* */
|
||||
public static String network2Local(String picSrc,String picSavePath,String visitPrefix) {
|
||||
public String network2Local(String picSrc,String picSavePath,String visitPrefix) {
|
||||
InputStream input = null;
|
||||
OutputStream out = null;
|
||||
try {
|
||||
@ -82,5 +85,21 @@ public class FileUtil {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断文件是否为图片
|
||||
* @param file 需要判断的文件
|
||||
* @return true:是图片,false:不是图片
|
||||
* */
|
||||
@SneakyThrows
|
||||
public boolean isImage(File file){
|
||||
|
||||
BufferedImage bi = ImageIO.read(file);
|
||||
|
||||
return bi != null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -71,8 +71,3 @@ sharding:
|
||||
|
||||
|
||||
|
||||
pic:
|
||||
save:
|
||||
type: 2 #图片保存方式, 1不保存,使用爬取的网络图片 ,2保存在自己的存储介质
|
||||
storage: local #存储介质,local:本地,OSS:阿里云对象存储,fastDfs:分布式文件系统
|
||||
path: /var/pic #图片保存路径
|
82
novel-common/src/main/resources/application-common-prod.yml
Normal file
@ -0,0 +1,82 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common]
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
#Redis服务器IP
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
#Redis服务器连接端口
|
||||
port: 6379
|
||||
#Redis服务器连接密码
|
||||
password: test
|
||||
jedis:
|
||||
pool:
|
||||
#连接池最大连接数(使用负值表示没有限制)
|
||||
max-active: 8
|
||||
#连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: 1
|
||||
#连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-idle: 8
|
||||
#连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
#连接超时时间(毫秒)
|
||||
timeout: 30000
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/novel_biz?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
|
||||
####使用shardingJdbc时,
|
||||
####所有的jdbcType都不能是LONGVARCHAR,否则会导致java.io.NotSerializableException: java.io.StringReader错误
|
||||
##### 应该替换所有的 LONGVARCHAR 类型为VARCHAR
|
||||
|
||||
sharding:
|
||||
jdbc:
|
||||
datasource:
|
||||
names: ds0 #,ds1
|
||||
ds0:
|
||||
type: com.zaxxer.hikari.HikariDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jdbc-url: jdbc:mysql://localhost:3306/novel_plus?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: test123456
|
||||
# ds1:
|
||||
# type: com.alibaba.druid.pool.DruidDataSource
|
||||
# driver-class-name: com.mysql.jdbc.Driver
|
||||
# url: jdbc:mysql://localhost:3306/novel_plus2
|
||||
# username: root
|
||||
# password: test123456
|
||||
config:
|
||||
sharding:
|
||||
props:
|
||||
sql.show: true
|
||||
tables:
|
||||
book_content: #book_content表
|
||||
key-generator-column-name: id #主键
|
||||
actual-data-nodes: ds${0}.book_content${0..9} #数据节点
|
||||
# database-strategy: #分库策略
|
||||
# inline:
|
||||
# sharding-column: book_id
|
||||
# algorithm-expression: ds${book_id % 10}
|
||||
table-strategy: #分表策略
|
||||
inline:
|
||||
shardingColumn: index_id
|
||||
algorithm-expression: book_content${index_id % 10}
|
||||
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: error
|
||||
com.java2nb: error
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,17 +0,0 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common]
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/novel_biz?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: root
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
|
||||
pic:
|
||||
save:
|
||||
type: 2 #图片保存方式, 1不保存,使用网络图片 ,2本地保存
|
||||
path: /var/pic #图片保存路径
|
||||
|
||||
|
||||
|
@ -11,6 +11,11 @@ spring:
|
||||
generator:
|
||||
write-numbers-as-strings: true
|
||||
|
||||
#上传文件的最大值(1M)
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 1048576
|
||||
|
||||
#缓存类型,ehcache(默认)、redis
|
||||
cache:
|
||||
type: ehcache
|
||||
@ -26,3 +31,5 @@ logging:
|
||||
config: classpath:logback-boot.xml
|
||||
|
||||
|
||||
|
||||
|
||||
|
15
novel-common/src/main/resources/banner.txt
Normal file
@ -0,0 +1,15 @@
|
||||
${AnsiColor.CYAN}
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
${AnsiColor.RED}
|
||||
|| / | / /
|
||||
|| / | / / ___ // ___ ___ _ __
|
||||
|| / /||/ / //___) ) // // ) ) // ) ) // ) ) ) )
|
||||
||/ / | / // // // // / / // / / / /
|
||||
| / | / ((____ // ((____ ((___/ / // / / / / 小说精品屋欢迎您!!!
|
||||
|
||||
-------Powered By XXY
|
||||
${AnsiColor.CYAN}
|
||||
--------------------------------------------------------------------------------
|
||||
${AnsiColor.BRIGHT_YELLOW}
|
||||
::: Spring-Boot ${spring-boot.formatted-version} :::
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>novel</artifactId>
|
||||
<groupId>com.java2nb</groupId>
|
||||
<version>3.4.1</version>
|
||||
<version>3.5.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -39,8 +39,7 @@ public class CrawlController {
|
||||
@GetMapping("listCrawlByPage")
|
||||
public ResultBean listCrawlByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize){
|
||||
|
||||
return ResultBean.ok(new PageInfo<>(BeanUtil.copyList(crawlService.listCrawlByPage(page,pageSize), CrawlSourceVO.class)
|
||||
));
|
||||
return ResultBean.ok(crawlService.listCrawlByPage(page,pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -71,8 +70,7 @@ public class CrawlController {
|
||||
@GetMapping("listCrawlSingleTaskByPage")
|
||||
public ResultBean listCrawlSingleTaskByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize){
|
||||
|
||||
return ResultBean.ok(new PageInfo<>(BeanUtil.copyList(crawlService.listCrawlSingleTaskByPage(page,pageSize), CrawlSingleTaskVO.class)
|
||||
));
|
||||
return ResultBean.ok(crawlService.listCrawlSingleTaskByPage(page,pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,8 +1,11 @@
|
||||
package com.java2nb.novel.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.core.crawl.RuleBean;
|
||||
import com.java2nb.novel.entity.CrawlSingleTask;
|
||||
import com.java2nb.novel.entity.CrawlSource;
|
||||
import com.java2nb.novel.vo.CrawlSourceVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -22,9 +25,9 @@ public interface CrawlService {
|
||||
* 爬虫源分页列表
|
||||
* @param page 当前页码
|
||||
* @param pageSize 分页大小
|
||||
*@return 爬虫源集合
|
||||
*@return 爬虫源分页数据
|
||||
* */
|
||||
List<CrawlSource> listCrawlByPage(int page, int pageSize);
|
||||
PageBean<CrawlSource> listCrawlByPage(int page, int pageSize);
|
||||
|
||||
/**
|
||||
* 开启或停止爬虫
|
||||
@ -83,9 +86,9 @@ public interface CrawlService {
|
||||
* 单本采集任务分页列表查询
|
||||
* @param page 当前页码
|
||||
* @param pageSize 分页大小
|
||||
* @return 单本采集任务集合
|
||||
* @return 单本采集任务分页数据
|
||||
* */
|
||||
List<CrawlSingleTask> listCrawlSingleTaskByPage(int page, int pageSize);
|
||||
PageBean<CrawlSingleTask> listCrawlSingleTaskByPage(int page, int pageSize);
|
||||
|
||||
/**
|
||||
* 删除采集任务
|
||||
|
@ -1,13 +1,17 @@
|
||||
package com.java2nb.novel.service.impl;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.core.cache.CacheKey;
|
||||
import com.java2nb.novel.core.cache.CacheService;
|
||||
import com.java2nb.novel.core.crawl.CrawlParser;
|
||||
import com.java2nb.novel.core.crawl.RuleBean;
|
||||
import com.java2nb.novel.core.enums.ResponseStatus;
|
||||
import com.java2nb.novel.core.exception.BusinessException;
|
||||
import com.java2nb.novel.core.utils.BeanUtil;
|
||||
import com.java2nb.novel.core.utils.IdWorker;
|
||||
import com.java2nb.novel.core.utils.SpringUtil;
|
||||
import com.java2nb.novel.core.utils.ThreadUtil;
|
||||
@ -16,6 +20,8 @@ import com.java2nb.novel.entity.CrawlSource;
|
||||
import com.java2nb.novel.mapper.*;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
import com.java2nb.novel.service.CrawlService;
|
||||
import com.java2nb.novel.vo.CrawlSingleTaskVO;
|
||||
import com.java2nb.novel.vo.CrawlSourceVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -66,14 +72,17 @@ public class CrawlServiceImpl implements CrawlService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CrawlSource> listCrawlByPage(int page, int pageSize) {
|
||||
public PageBean<CrawlSource> listCrawlByPage(int page, int pageSize) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
SelectStatementProvider render = select(id, sourceName, sourceStatus, createTime, updateTime)
|
||||
.from(crawlSource)
|
||||
.orderBy(updateTime)
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return crawlSourceMapper.selectMany(render);
|
||||
List<CrawlSource> crawlSources = crawlSourceMapper.selectMany(render);
|
||||
PageBean<CrawlSource> pageBean = new PageBean<>(crawlSources);
|
||||
pageBean.setList(BeanUtil.copyList(crawlSources, CrawlSourceVO.class));
|
||||
return pageBean;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@ -156,14 +165,17 @@ public class CrawlServiceImpl implements CrawlService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CrawlSingleTask> listCrawlSingleTaskByPage(int page, int pageSize) {
|
||||
public PageBean<CrawlSingleTask> listCrawlSingleTaskByPage(int page, int pageSize) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
SelectStatementProvider render = select(CrawlSingleTaskDynamicSqlSupport.crawlSingleTask.allColumns())
|
||||
.from(CrawlSingleTaskDynamicSqlSupport.crawlSingleTask)
|
||||
.orderBy(CrawlSingleTaskDynamicSqlSupport.createTime.descending())
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return crawlSingleTaskMapper.selectMany(render);
|
||||
List<CrawlSingleTask> crawlSingleTasks = crawlSingleTaskMapper.selectMany(render);
|
||||
PageBean<CrawlSingleTask> pageBean = new PageBean<>(crawlSingleTasks);
|
||||
pageBean.setList(BeanUtil.copyList(crawlSingleTasks, CrawlSingleTaskVO.class));
|
||||
return pageBean;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
3
novel-crawl/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,3 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common-prod]
|
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<artifactId>novel</artifactId>
|
||||
<groupId>com.java2nb</groupId>
|
||||
<version>3.4.1</version>
|
||||
<version>3.5.3</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
@ -47,8 +47,7 @@ public class AuthorController extends BaseController{
|
||||
@GetMapping("listBookByPage")
|
||||
public ResultBean listBookByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "10") int pageSize ,HttpServletRequest request){
|
||||
|
||||
return ResultBean.ok(new PageInfo<>(bookService.listBookPageByUserId(getUserDetails(request).getId(),page,pageSize)
|
||||
));
|
||||
return ResultBean.ok(bookService.listBookPageByUserId(getUserDetails(request).getId(),page,pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -161,6 +160,17 @@ public class AuthorController extends BaseController{
|
||||
return ResultBean.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改小说封面
|
||||
*/
|
||||
@PostMapping("updateBookPic")
|
||||
public ResultBean updateBookPic(@RequestParam("bookId") Long bookId,@RequestParam("bookPic") String bookPic,HttpServletRequest request) {
|
||||
Author author = checkAuthor(request);
|
||||
bookService.updateBookPic(bookId,bookPic, author.getId());
|
||||
return ResultBean.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 作家日收入统计数据分页列表查询
|
||||
* */
|
||||
@ -172,8 +182,7 @@ public class AuthorController extends BaseController{
|
||||
@RequestParam(value = "endTime",defaultValue = "2030-01-01") Date endTime,
|
||||
HttpServletRequest request){
|
||||
|
||||
return ResultBean.ok(new PageInfo<>(authorService.listIncomeDailyByPage(page,pageSize,getUserDetails(request).getId(),bookId,startTime,endTime)
|
||||
));
|
||||
return ResultBean.ok(authorService.listIncomeDailyByPage(page,pageSize,getUserDetails(request).getId(),bookId,startTime,endTime));
|
||||
}
|
||||
|
||||
|
||||
@ -186,8 +195,7 @@ public class AuthorController extends BaseController{
|
||||
@RequestParam(value = "bookId", defaultValue = "0") Long bookId,
|
||||
HttpServletRequest request){
|
||||
|
||||
return ResultBean.ok(new PageInfo<>(authorService.listIncomeMonthByPage(page,pageSize,getUserDetails(request).getId(),bookId)
|
||||
));
|
||||
return ResultBean.ok(authorService.listIncomeMonthByPage(page,pageSize,getUserDetails(request).getId(),bookId));
|
||||
}
|
||||
|
||||
private Author checkAuthor(HttpServletRequest request) {
|
||||
|
@ -1,11 +1,13 @@
|
||||
package com.java2nb.novel.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.core.bean.ResultBean;
|
||||
import com.java2nb.novel.core.bean.UserDetails;
|
||||
import com.java2nb.novel.core.enums.ResponseStatus;
|
||||
import com.java2nb.novel.entity.Book;
|
||||
import com.java2nb.novel.entity.BookComment;
|
||||
import com.java2nb.novel.search.BookSP;
|
||||
import com.java2nb.novel.vo.BookSpVO;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
import com.java2nb.novel.vo.BookVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@ -79,9 +81,8 @@ public class BookController extends BaseController{
|
||||
* 分页搜索
|
||||
* */
|
||||
@GetMapping("searchByPage")
|
||||
public ResultBean searchByPage(BookSP bookSP, @RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "20") int pageSize){
|
||||
PageInfo<BookVO> pageInfo = bookService.searchByPage(bookSP,page,pageSize);
|
||||
return ResultBean.ok(pageInfo);
|
||||
public ResultBean searchByPage(BookSpVO bookSP, @RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "20") int pageSize){
|
||||
return ResultBean.ok(bookService.searchByPage(bookSP,page,pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -143,7 +144,7 @@ public class BookController extends BaseController{
|
||||
* */
|
||||
@GetMapping("listCommentByPage")
|
||||
public ResultBean listCommentByPage(@RequestParam("bookId") Long bookId,@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize) {
|
||||
return ResultBean.ok(new PageInfo<>(bookService.listCommentByPage(null,bookId,page,pageSize)));
|
||||
return ResultBean.ok(bookService.listCommentByPage(null,bookId,page,pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -172,7 +173,7 @@ public class BookController extends BaseController{
|
||||
* */
|
||||
@GetMapping("/queryIndexList")
|
||||
public ResultBean indexList(Long bookId,@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize,@RequestParam(value = "orderBy",defaultValue = "index_num desc") String orderBy) {
|
||||
return ResultBean.ok(new PageInfo<>(bookService.queryIndexList(bookId,orderBy,page,pageSize)));
|
||||
return ResultBean.ok(new PageBean<>(bookService.queryIndexList(bookId,orderBy,page,pageSize)));
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,28 +2,23 @@ package com.java2nb.novel.controller;
|
||||
|
||||
import com.java2nb.novel.core.bean.ResultBean;
|
||||
import com.java2nb.novel.core.cache.CacheService;
|
||||
import com.java2nb.novel.core.enums.ResponseStatus;
|
||||
import com.java2nb.novel.core.exception.BusinessException;
|
||||
import com.java2nb.novel.core.utils.Constants;
|
||||
import com.java2nb.novel.core.utils.FileUtil;
|
||||
import com.java2nb.novel.core.utils.RandomValidateCodeUtil;
|
||||
import com.java2nb.novel.core.utils.RestTemplateUtil;
|
||||
import com.java2nb.novel.core.utils.UUIDUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.codec.Charsets;
|
||||
import org.apache.http.client.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.*;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
@ -63,29 +58,35 @@ public class FileController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
* 图片上传
|
||||
* @return
|
||||
*/
|
||||
@SneakyThrows
|
||||
@ResponseBody
|
||||
@PostMapping("/upload")
|
||||
ResultBean upload(@RequestParam("file") MultipartFile file) {
|
||||
@PostMapping("/picUpload")
|
||||
ResultBean<String> upload(@RequestParam("file") MultipartFile file) {
|
||||
Date currentDate = new Date();
|
||||
try {
|
||||
String savePath =
|
||||
Constants.LOCAL_PIC_PREFIX + DateUtils.formatDate(currentDate, "yyyy") + "/" +
|
||||
DateUtils.formatDate(currentDate, "MM") + "/" +
|
||||
DateUtils.formatDate(currentDate, "dd") ;
|
||||
String oriName = file.getOriginalFilename();
|
||||
String saveFileName = UUIDUtil.getUUID32() + oriName.substring(oriName.lastIndexOf("."));
|
||||
File saveFile = new File( picSavePath + savePath, saveFileName);
|
||||
if (!saveFile.getParentFile().exists()) {
|
||||
saveFile.getParentFile().mkdirs();
|
||||
String savePath =
|
||||
Constants.LOCAL_PIC_PREFIX + DateUtils.formatDate(currentDate, "yyyy") + "/" +
|
||||
DateUtils.formatDate(currentDate, "MM") + "/" +
|
||||
DateUtils.formatDate(currentDate, "dd");
|
||||
String oriName = file.getOriginalFilename();
|
||||
assert oriName != null;
|
||||
String saveFileName = UUIDUtil.getUUID32() + oriName.substring(oriName.lastIndexOf("."));
|
||||
File saveFile = new File(picSavePath + savePath, saveFileName);
|
||||
if (!saveFile.getParentFile().exists()) {
|
||||
boolean isSuccess = saveFile.getParentFile().mkdirs();
|
||||
if(!isSuccess){
|
||||
throw new BusinessException(ResponseStatus.FILE_DIR_MAKE_FAIL);
|
||||
}
|
||||
file.transferTo(saveFile);
|
||||
return ResultBean.ok(savePath+"/"+saveFileName);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return ResultBean.error();
|
||||
}
|
||||
file.transferTo(saveFile);
|
||||
if(!FileUtil.isImage(saveFile)){
|
||||
//上传的文件不是图片
|
||||
saveFile.delete();
|
||||
throw new BusinessException(ResponseStatus.FILE_NOT_IMAGE);
|
||||
};
|
||||
return ResultBean.ok(savePath + "/" + saveFileName);
|
||||
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ public class NewsController {
|
||||
* */
|
||||
@GetMapping("listByPage")
|
||||
public ResultBean listByPage(@RequestParam(value = "curr", defaultValue = "1") int page, @RequestParam(value = "limit", defaultValue = "5") int pageSize){
|
||||
return ResultBean.ok(new PageInfo<>(newsService.listByPage(page,pageSize)));
|
||||
return ResultBean.ok(newsService.listByPage(page,pageSize));
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,7 +5,7 @@ import com.alipay.api.DefaultAlipayClient;
|
||||
import com.alipay.api.internal.util.AlipaySignature;
|
||||
import com.alipay.api.request.AlipayTradePagePayRequest;
|
||||
import com.java2nb.novel.core.bean.UserDetails;
|
||||
import com.java2nb.novel.core.config.AlipayConfig;
|
||||
import com.java2nb.novel.core.config.AlipayProperties;
|
||||
import com.java2nb.novel.service.OrderService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
@ -31,7 +31,7 @@ import java.util.Map;
|
||||
public class PayController extends BaseController {
|
||||
|
||||
|
||||
private final AlipayConfig alipayConfig;
|
||||
private final AlipayProperties alipayConfig;
|
||||
|
||||
private final OrderService orderService;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.java2nb.novel.controller;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.java2nb.novel.core.bean.ResultBean;
|
||||
import com.java2nb.novel.core.bean.UserDetails;
|
||||
import com.java2nb.novel.core.cache.CacheService;
|
||||
@ -19,7 +18,6 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -147,7 +145,7 @@ public class UserController extends BaseController {
|
||||
if (userDetails == null) {
|
||||
return ResultBean.fail(ResponseStatus.NO_LOGIN);
|
||||
}
|
||||
return ResultBean.ok(new PageInfo<>(userService.listBookShelfByPage(userDetails.getId(),page,pageSize)));
|
||||
return ResultBean.ok(userService.listBookShelfByPage(userDetails.getId(),page,pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -159,7 +157,7 @@ public class UserController extends BaseController {
|
||||
if (userDetails == null) {
|
||||
return ResultBean.fail(ResponseStatus.NO_LOGIN);
|
||||
}
|
||||
return ResultBean.ok(new PageInfo<>(userService.listReadHistoryByPage(userDetails.getId(),page,pageSize)));
|
||||
return ResultBean.ok(userService.listReadHistoryByPage(userDetails.getId(),page,pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -197,7 +195,7 @@ public class UserController extends BaseController {
|
||||
if (userDetails == null) {
|
||||
return ResultBean.fail(ResponseStatus.NO_LOGIN);
|
||||
}
|
||||
return ResultBean.ok(new PageInfo<>(userService.listUserFeedBackByPage(userDetails.getId(),page,pageSize)));
|
||||
return ResultBean.ok(userService.listUserFeedBackByPage(userDetails.getId(),page,pageSize));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -257,7 +255,7 @@ public class UserController extends BaseController {
|
||||
if (userDetails == null) {
|
||||
return ResultBean.fail(ResponseStatus.NO_LOGIN);
|
||||
}
|
||||
return ResultBean.ok(new PageInfo<>(bookService.listCommentByPage(userDetails.getId(),null,page,pageSize)));
|
||||
return ResultBean.ok(bookService.listCommentByPage(userDetails.getId(),null,page,pageSize));
|
||||
}
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix="alipay")
|
||||
public class AlipayConfig {
|
||||
public class AlipayProperties {
|
||||
|
||||
private String appId;
|
||||
private String merchantPrivateKey;
|
@ -7,13 +7,13 @@ import org.springframework.stereotype.Component;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 作家收入配置
|
||||
* 作家收入配置属性
|
||||
* @author cd
|
||||
*/
|
||||
@Component
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "author.income")
|
||||
public class AuthorIncomeConfig {
|
||||
public class AuthorIncomeProperties {
|
||||
|
||||
private BigDecimal taxRate;
|
||||
|
@ -7,13 +7,13 @@ import org.springframework.stereotype.Component;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 章节费用配置
|
||||
* 章节费用配置属性
|
||||
* @author cd
|
||||
*/
|
||||
@Component
|
||||
@Data
|
||||
@ConfigurationProperties(prefix = "book.price")
|
||||
public class BookPriceConfig {
|
||||
public class BookPriceProperties {
|
||||
|
||||
private BigDecimal wordCount;
|
||||
|
@ -9,5 +9,5 @@ import org.springframework.jmx.support.RegistrationPolicy;
|
||||
*/
|
||||
@Configuration
|
||||
@EnableMBeanExport(registration= RegistrationPolicy.IGNORE_EXISTING)
|
||||
public class FdfsConfiguration {
|
||||
public class FdfsConfig {
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.java2nb.novel.core.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.concurrent.LinkedBlockingDeque;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 线程池配置
|
||||
* @author xiongxiaoyang
|
||||
*/
|
||||
@Configuration
|
||||
public class ThreadPoolConfig {
|
||||
|
||||
@Bean
|
||||
public ThreadPoolExecutor threadPoolExecutor(ThreadPoolProperties properties){
|
||||
return new ThreadPoolExecutor(properties.getCorePoolSize(),properties.getMaximumPoolSize(),properties.getKeepAliveTime()
|
||||
, TimeUnit.SECONDS, new LinkedBlockingDeque<>(properties.getQueueSize()),new ThreadPoolExecutor.AbortPolicy());
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.java2nb.novel.core.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 线程池配置属性
|
||||
* @author xiongxiaoyang
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "thread.pool")
|
||||
public class ThreadPoolProperties {
|
||||
|
||||
private Integer corePoolSize;
|
||||
private Integer maximumPoolSize;
|
||||
private Long keepAliveTime;
|
||||
private Integer queueSize;
|
||||
|
||||
|
||||
}
|
@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix="website")
|
||||
public class WebsiteConfig {
|
||||
public class WebsiteProperties {
|
||||
|
||||
private String name;
|
||||
private String domain;
|
@ -55,7 +55,7 @@ public class NovelFilter implements Filter {
|
||||
userMark = UUIDUtil.getUUID32();
|
||||
CookieUtil.setCookie(resp,Constants.USER_CLIENT_MARK_KEY,userMark);
|
||||
}
|
||||
ThreadLocalUtil.setCientId(userMark);
|
||||
ThreadLocalUtil.setClientId(userMark);
|
||||
//根据浏览器类型选择前端模板
|
||||
String to = req.getParameter("to");
|
||||
CacheService cacheService = SpringUtil.getBean(CacheService.class);
|
||||
|
@ -1,6 +1,6 @@
|
||||
package com.java2nb.novel.core.listener;
|
||||
|
||||
import com.java2nb.novel.core.config.WebsiteConfig;
|
||||
import com.java2nb.novel.core.config.WebsiteProperties;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@ -17,7 +17,7 @@ import javax.servlet.annotation.WebListener;
|
||||
@RequiredArgsConstructor
|
||||
public class StarterListener implements ServletContextListener {
|
||||
|
||||
private final WebsiteConfig websiteConfig;
|
||||
private final WebsiteProperties websiteConfig;
|
||||
|
||||
|
||||
@Override
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.java2nb.novel.core.schedule;
|
||||
|
||||
|
||||
import com.java2nb.novel.core.config.AuthorIncomeConfig;
|
||||
import com.java2nb.novel.core.utils.DateUtil;
|
||||
import com.java2nb.novel.entity.Author;
|
||||
import com.java2nb.novel.entity.AuthorIncomeDetail;
|
||||
|
@ -1,19 +1,17 @@
|
||||
package com.java2nb.novel.core.schedule;
|
||||
|
||||
|
||||
import com.java2nb.novel.core.config.AuthorIncomeConfig;
|
||||
import com.java2nb.novel.core.config.AuthorIncomeProperties;
|
||||
import com.java2nb.novel.core.utils.DateUtil;
|
||||
import com.java2nb.novel.entity.*;
|
||||
import com.java2nb.novel.service.AuthorService;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
import com.java2nb.novel.service.UserService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -31,7 +29,7 @@ public class MonthIncomeStaSchedule {
|
||||
|
||||
private final BookService bookService;
|
||||
|
||||
private final AuthorIncomeConfig authorIncomeConfig;
|
||||
private final AuthorIncomeProperties authorIncomeConfig;
|
||||
|
||||
/**
|
||||
* 每个月1号凌晨2点统计上个月数据
|
||||
|
@ -0,0 +1,20 @@
|
||||
package com.java2nb.novel.core.serialize;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class CommentUserNameSerialize extends JsonSerializer<String> {
|
||||
|
||||
@Override
|
||||
public void serialize(String s, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException {
|
||||
|
||||
if(StringUtils.isNotBlank(s)){
|
||||
jsonGenerator.writeString(s.substring(0, 4) + "****" + s.substring(s.length() - 3));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -29,7 +29,7 @@ public class Constants {
|
||||
/**
|
||||
* 首页设置的小说数量
|
||||
* */
|
||||
public static final int INDEX_BOOK_SETTING_NUM = 32;
|
||||
public static final int INDEX_BOOK_SETTING_NUM = 31;
|
||||
|
||||
/**
|
||||
* 累积的最大点击量
|
||||
|
@ -41,7 +41,7 @@ public class ThreadLocalUtil {
|
||||
/**
|
||||
* 设置当前访问线程的客户端ID
|
||||
* */
|
||||
public static void setCientId(String id){
|
||||
public static void setClientId(String id){
|
||||
clientId.set(id);
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,10 @@
|
||||
package com.java2nb.novel.mapper;
|
||||
|
||||
import com.java2nb.novel.entity.Book;
|
||||
import com.java2nb.novel.search.BookSP;
|
||||
import com.java2nb.novel.vo.BookSpVO;
|
||||
import com.java2nb.novel.vo.BookVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -14,7 +13,7 @@ import java.util.List;
|
||||
public interface FrontBookMapper extends BookMapper {
|
||||
|
||||
|
||||
List<BookVO> searchByPage(BookSP params);
|
||||
List<BookVO> searchByPage(BookSpVO params);
|
||||
|
||||
void addVisitCount(@Param("bookId") Long bookId, @Param("visitCount") Integer visitCount);
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.java2nb.novel.page;
|
||||
|
||||
import com.java2nb.novel.controller.BaseController;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.core.bean.UserDetails;
|
||||
import com.java2nb.novel.core.utils.ThreadLocalUtil;
|
||||
import com.java2nb.novel.entity.*;
|
||||
@ -8,6 +9,7 @@ import com.java2nb.novel.service.AuthorService;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
import com.java2nb.novel.service.NewsService;
|
||||
import com.java2nb.novel.service.UserService;
|
||||
import com.java2nb.novel.vo.BookCommentVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -19,7 +21,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* @author 11797
|
||||
@ -37,6 +42,8 @@ public class PageController extends BaseController {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final ThreadPoolExecutor threadPoolExecutor;
|
||||
|
||||
|
||||
@RequestMapping("{url}.html")
|
||||
public String module(@PathVariable("url") String url) {
|
||||
@ -44,9 +51,9 @@ public class PageController extends BaseController {
|
||||
}
|
||||
|
||||
@RequestMapping("{module}/{url}.html")
|
||||
public String module2(@PathVariable("module") String module, @PathVariable("url") String url,HttpServletRequest request) {
|
||||
public String module2(@PathVariable("module") String module, @PathVariable("url") String url, HttpServletRequest request) {
|
||||
|
||||
if(request.getRequestURI().startsWith("/author")) {
|
||||
if (request.getRequestURI().startsWith("/author")) {
|
||||
//访问作者专区
|
||||
UserDetails user = getUserDetails(request);
|
||||
if (user == null) {
|
||||
@ -56,7 +63,7 @@ public class PageController extends BaseController {
|
||||
|
||||
boolean isAuthor = authorService.isAuthor(user.getId());
|
||||
if (!isAuthor) {
|
||||
return "redirect:/author/register.html" ;
|
||||
return "redirect:/author/register.html";
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,15 +77,16 @@ public class PageController extends BaseController {
|
||||
|
||||
/**
|
||||
* 首页
|
||||
* */
|
||||
*/
|
||||
@RequestMapping(path = {"/", "/index", "/index.html"})
|
||||
public String index() {
|
||||
return ThreadLocalUtil.getTemplateDir()+"index";
|
||||
public String index(Model model) {
|
||||
model.addAttribute("bookMap", bookService.listBookSettingVO());
|
||||
return ThreadLocalUtil.getTemplateDir() + "index";
|
||||
}
|
||||
|
||||
/**
|
||||
* 作品页
|
||||
* */
|
||||
*/
|
||||
@RequestMapping("book/bookclass.html")
|
||||
public String bookClass() {
|
||||
return "book/bookclass";
|
||||
@ -86,129 +94,197 @@ public class PageController extends BaseController {
|
||||
|
||||
/**
|
||||
* 排行页
|
||||
* */
|
||||
*/
|
||||
@RequestMapping("book/book_ranking.html")
|
||||
public String bookRank() {
|
||||
|
||||
return ThreadLocalUtil.getTemplateDir()+"book/book_ranking";
|
||||
return ThreadLocalUtil.getTemplateDir() + "book/book_ranking";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 详情页
|
||||
* */
|
||||
*/
|
||||
@SneakyThrows
|
||||
@RequestMapping("/book/{bookId}.html")
|
||||
public String bookDetail(@PathVariable("bookId") Long bookId, Model model) {
|
||||
Book book = bookService.queryBookDetail(bookId);
|
||||
model.addAttribute("book",book);
|
||||
if(book.getLastIndexId() != null) {
|
||||
//查询首章目录ID
|
||||
Long firstBookIndexId = bookService.queryFirstBookIndexId(bookId);
|
||||
model.addAttribute("firstBookIndexId", firstBookIndexId);
|
||||
}
|
||||
return ThreadLocalUtil.getTemplateDir()+"book/book_detail";
|
||||
//加载小说基本信息线程
|
||||
CompletableFuture<Book> bookCompletableFuture = CompletableFuture.supplyAsync(() -> {
|
||||
//查询书籍
|
||||
Book book = bookService.queryBookDetail(bookId);
|
||||
log.debug("加载小说基本信息线程结束");
|
||||
return book;
|
||||
}, threadPoolExecutor);
|
||||
//加载小说评论列表线程
|
||||
CompletableFuture<PageBean<BookCommentVO>> bookCommentPageBeanCompletableFuture = CompletableFuture.supplyAsync(() -> {
|
||||
PageBean<BookCommentVO> bookCommentVOPageBean = bookService.listCommentByPage(null, bookId, 1, 5);
|
||||
log.debug("加载小说评论列表线程结束");
|
||||
return bookCommentVOPageBean;
|
||||
}, threadPoolExecutor);
|
||||
//加载小说首章信息线程,该线程在加载小说基本信息线程执行完毕后才执行
|
||||
CompletableFuture<Long> firstBookIndexIdCompletableFuture = bookCompletableFuture.thenApplyAsync((book) -> {
|
||||
if (book.getLastIndexId() != null) {
|
||||
//查询首章目录ID
|
||||
Long firstBookIndexId = bookService.queryFirstBookIndexId(bookId);
|
||||
log.debug("加载小说基本信息线程结束");
|
||||
return firstBookIndexId;
|
||||
}
|
||||
return null;
|
||||
}, threadPoolExecutor);
|
||||
//加载随机推荐小说线程,该线程在加载小说基本信息线程执行完毕后才执行
|
||||
CompletableFuture<List<Book>> recBookCompletableFuture = bookCompletableFuture.thenApplyAsync((book) -> {
|
||||
List<Book> books = bookService.listRecBookByCatId(book.getCatId());
|
||||
log.debug("加载随机推荐小说线程结束");
|
||||
return books;
|
||||
}, threadPoolExecutor);
|
||||
|
||||
|
||||
model.addAttribute("book", bookCompletableFuture.get());
|
||||
model.addAttribute("firstBookIndexId", firstBookIndexIdCompletableFuture.get());
|
||||
model.addAttribute("recBooks", recBookCompletableFuture.get());
|
||||
model.addAttribute("bookCommentPageBean", bookCommentPageBeanCompletableFuture.get());
|
||||
|
||||
return ThreadLocalUtil.getTemplateDir() + "book/book_detail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 目录页
|
||||
* */
|
||||
*/
|
||||
@SneakyThrows
|
||||
@RequestMapping("/book/indexList-{bookId}.html")
|
||||
public String indexList(@PathVariable("bookId") Long bookId, Model model) {
|
||||
Book book = bookService.queryBookDetail(bookId);
|
||||
model.addAttribute("book",book);
|
||||
List<BookIndex> bookIndexList = bookService.queryIndexList(bookId,null,1,null);
|
||||
model.addAttribute("bookIndexList",bookIndexList);
|
||||
model.addAttribute("bookIndexCount",bookIndexList.size());
|
||||
return ThreadLocalUtil.getTemplateDir()+"book/book_index";
|
||||
model.addAttribute("book", book);
|
||||
List<BookIndex> bookIndexList = bookService.queryIndexList(bookId, null, 1, null);
|
||||
model.addAttribute("bookIndexList", bookIndexList);
|
||||
model.addAttribute("bookIndexCount", bookIndexList.size());
|
||||
return ThreadLocalUtil.getTemplateDir() + "book/book_index";
|
||||
}
|
||||
|
||||
/**
|
||||
* 内容页
|
||||
* */
|
||||
*/
|
||||
@SneakyThrows
|
||||
@RequestMapping("/book/{bookId}/{bookIndexId}.html")
|
||||
public String indexList(@PathVariable("bookId") Long bookId,@PathVariable("bookIndexId") Long bookIndexId, HttpServletRequest request, Model model) {
|
||||
//查询书籍
|
||||
Book book = bookService.queryBookDetail(bookId);
|
||||
//查询目录
|
||||
BookIndex bookIndex = bookService.queryBookIndex(bookIndexId);
|
||||
model.addAttribute("book",book);
|
||||
model.addAttribute("bookIndex",bookIndex);
|
||||
//查询上一章节目录ID
|
||||
Long preBookIndexId = bookService.queryPreBookIndexId(bookId,bookIndex.getIndexNum());
|
||||
model.addAttribute("preBookIndexId",preBookIndexId);
|
||||
//查询下一章目录ID
|
||||
Long nextBookIndexId = bookService.queryNextBookIndexId(bookId,bookIndex.getIndexNum());
|
||||
model.addAttribute("nextBookIndexId",nextBookIndexId);
|
||||
//查询内容
|
||||
BookContent bookContent = bookService.queryBookContent(bookIndex.getId());
|
||||
model.addAttribute("bookContent",bookContent);
|
||||
public String indexList(@PathVariable("bookId") Long bookId, @PathVariable("bookIndexId") Long bookIndexId, HttpServletRequest request, Model model) {
|
||||
//加载小说基本信息线程
|
||||
CompletableFuture<Book> bookCompletableFuture = CompletableFuture.supplyAsync(() -> {
|
||||
//查询书籍
|
||||
Book book = bookService.queryBookDetail(bookId);
|
||||
log.debug("加载小说基本信息线程结束");
|
||||
return book;
|
||||
}, threadPoolExecutor);
|
||||
|
||||
boolean needBuy = false;
|
||||
//判断该目录是否收费
|
||||
if(bookIndex.getIsVip()!=null && bookIndex.getIsVip() == 1 ){
|
||||
UserDetails user = getUserDetails(request);
|
||||
if(user == null){
|
||||
//未登录
|
||||
return "redirect:/user/login.html?originUrl="+request.getRequestURI();
|
||||
//加载小说章节信息线程
|
||||
CompletableFuture<BookIndex> bookIndexCompletableFuture = CompletableFuture.supplyAsync(() -> {
|
||||
//查询目录
|
||||
BookIndex bookIndex = bookService.queryBookIndex(bookIndexId);
|
||||
log.debug("加载小说章节信息线程结束");
|
||||
return bookIndex;
|
||||
}, threadPoolExecutor);
|
||||
|
||||
//加载小说上一章节信息线程,该线程在加载小说章节信息线程执行完毕后才执行
|
||||
CompletableFuture<Long> preBookIndexIdCompletableFuture = bookIndexCompletableFuture.thenApplyAsync((bookIndex) -> {
|
||||
//查询上一章节目录ID
|
||||
Long preBookIndexId = bookService.queryPreBookIndexId(bookId, bookIndex.getIndexNum());
|
||||
log.debug("加载小说上一章节信息线程结束");
|
||||
return preBookIndexId;
|
||||
}, threadPoolExecutor);
|
||||
|
||||
//加载小说下一章节信息线程,该线程在加载小说章节信息线程执行完毕后才执行
|
||||
CompletableFuture<Long> nextBookIndexIdCompletableFuture = bookIndexCompletableFuture.thenApplyAsync((bookIndex) -> {
|
||||
//查询下一章目录ID
|
||||
Long nextBookIndexId = bookService.queryNextBookIndexId(bookId, bookIndex.getIndexNum());
|
||||
log.debug("加载小说下一章节信息线程结束");
|
||||
return nextBookIndexId;
|
||||
}, threadPoolExecutor);
|
||||
|
||||
//加载小说内容信息线程
|
||||
CompletableFuture<BookContent> bookContentCompletableFuture = CompletableFuture.supplyAsync(() -> {
|
||||
//查询内容
|
||||
BookContent bookContent = bookService.queryBookContent(bookIndexId);
|
||||
log.debug("加载小说内容信息线程结束");
|
||||
return bookContent;
|
||||
}, threadPoolExecutor);
|
||||
|
||||
|
||||
//判断用户是否需要购买线程,该线程在加载小说章节信息线程执行完毕后才执行
|
||||
CompletableFuture<Boolean> needBuyCompletableFuture = bookIndexCompletableFuture.thenApplyAsync((bookIndex) -> {
|
||||
//判断该目录是否收费
|
||||
if (bookIndex.getIsVip() != null && bookIndex.getIsVip() == 1) {
|
||||
//收费
|
||||
UserDetails user = getUserDetails(request);
|
||||
if (user == null) {
|
||||
//未登录,需要购买
|
||||
return true;
|
||||
}
|
||||
//判断用户是否购买过该目录
|
||||
boolean isBuy = userService.queryIsBuyBookIndex(user.getId(), bookIndexId);
|
||||
if (!isBuy) {
|
||||
//没有购买过,需要购买
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//收费,判断用户是否购买过该目录
|
||||
boolean isBuy = userService.queryIsBuyBookIndex(user.getId(),bookIndexId);
|
||||
if(!isBuy){
|
||||
//没有购买过,需要购买
|
||||
bookContent.setContent(null);
|
||||
needBuy = true;
|
||||
}
|
||||
}
|
||||
model.addAttribute("needBuy",needBuy);
|
||||
return ThreadLocalUtil.getTemplateDir()+"book/book_content";
|
||||
|
||||
log.debug("判断用户是否需要购买线程结束");
|
||||
return false;
|
||||
|
||||
}, threadPoolExecutor);
|
||||
|
||||
|
||||
model.addAttribute("book", bookCompletableFuture.get());
|
||||
model.addAttribute("bookIndex", bookIndexCompletableFuture.get());
|
||||
model.addAttribute("preBookIndexId", preBookIndexIdCompletableFuture.get());
|
||||
model.addAttribute("nextBookIndexId", nextBookIndexIdCompletableFuture.get());
|
||||
model.addAttribute("bookContent", bookContentCompletableFuture.get());
|
||||
model.addAttribute("needBuy", needBuyCompletableFuture.get());
|
||||
|
||||
return ThreadLocalUtil.getTemplateDir() + "book/book_content";
|
||||
}
|
||||
|
||||
/**
|
||||
* 评论页面
|
||||
* */
|
||||
*/
|
||||
@RequestMapping("/book/comment-{bookId}.html")
|
||||
public String commentList(@PathVariable("bookId") Long bookId, Model model) {
|
||||
//查询书籍
|
||||
Book book = bookService.queryBookDetail(bookId);
|
||||
model.addAttribute("book",book);
|
||||
model.addAttribute("book", book);
|
||||
return "book/book_comment";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新闻内容页面
|
||||
* */
|
||||
*/
|
||||
@RequestMapping("/about/newsInfo-{newsId}.html")
|
||||
public String newsInfo(@PathVariable("newsId") Long newsId, Model model) {
|
||||
//查询新闻
|
||||
News news = newsService.queryNewsInfo(newsId);
|
||||
model.addAttribute("news",news);
|
||||
model.addAttribute("news", news);
|
||||
return "about/news_info";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 作者注册页面
|
||||
* */
|
||||
*/
|
||||
@RequestMapping("author/register.html")
|
||||
public String authorRegister(Author author, HttpServletRequest request, Model model){
|
||||
public String authorRegister(Author author, HttpServletRequest request, Model model) {
|
||||
UserDetails user = getUserDetails(request);
|
||||
if(user == null){
|
||||
if (user == null) {
|
||||
//未登录
|
||||
return "redirect:/user/login.html?originUrl=/author/register.html";
|
||||
}
|
||||
|
||||
if(StringUtils.isNotBlank(author.getInviteCode())) {
|
||||
if (StringUtils.isNotBlank(author.getInviteCode())) {
|
||||
//提交作者注册信息
|
||||
String errorInfo = authorService.register(user.getId(), author);
|
||||
if(StringUtils.isBlank(errorInfo)){
|
||||
if (StringUtils.isBlank(errorInfo)) {
|
||||
//注册成功
|
||||
return "redirect:/author/index.html";
|
||||
}
|
||||
model.addAttribute("LabErr",errorInfo);
|
||||
model.addAttribute("author",author);
|
||||
model.addAttribute("LabErr", errorInfo);
|
||||
model.addAttribute("author", author);
|
||||
}
|
||||
return "author/register";
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.java2nb.novel.service;
|
||||
|
||||
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.entity.Author;
|
||||
import com.java2nb.novel.entity.AuthorIncome;
|
||||
import com.java2nb.novel.entity.AuthorIncomeDetail;
|
||||
@ -111,9 +112,9 @@ public interface AuthorService {
|
||||
* @param bookId 小说ID
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @return 日收入统计数据列表
|
||||
* @return 日收入统计数据分页数据
|
||||
*/
|
||||
List<AuthorIncomeDetail> listIncomeDailyByPage(int page, int pageSize, Long userId, Long bookId, Date startTime, Date endTime);
|
||||
PageBean<AuthorIncomeDetail> listIncomeDailyByPage(int page, int pageSize, Long userId, Long bookId, Date startTime, Date endTime);
|
||||
|
||||
|
||||
/**
|
||||
@ -122,7 +123,7 @@ public interface AuthorService {
|
||||
* @param pageSize 分页大小
|
||||
* @param userId 用户ID
|
||||
* @param bookId 小说ID
|
||||
* @return
|
||||
* @return 分页数据
|
||||
* */
|
||||
List<AuthorIncome> listIncomeMonthByPage(int page, int pageSize, Long userId, Long bookId);
|
||||
PageBean<AuthorIncome> listIncomeMonthByPage(int page, int pageSize, Long userId, Long bookId);
|
||||
}
|
||||
|
@ -2,7 +2,8 @@ package com.java2nb.novel.service;
|
||||
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.java2nb.novel.search.BookSP;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.vo.BookSpVO;
|
||||
import com.java2nb.novel.vo.BookCommentVO;
|
||||
import com.java2nb.novel.vo.BookSettingVO;
|
||||
import com.java2nb.novel.entity.*;
|
||||
@ -48,7 +49,7 @@ public interface BookService {
|
||||
* @param pageSize 分页大小
|
||||
* @return 小说集合分页信息
|
||||
* */
|
||||
PageInfo searchByPage(BookSP params, int page, int pageSize);
|
||||
PageBean searchByPage(BookSpVO params, int page, int pageSize);
|
||||
|
||||
/**
|
||||
* 查询小说分类列表
|
||||
@ -144,9 +145,9 @@ public interface BookService {
|
||||
* @param bookId 书籍ID
|
||||
* @param page 页码
|
||||
* @param pageSize 分页大小
|
||||
* @return 评论集合
|
||||
* @return 评论分页数据
|
||||
* */
|
||||
List<BookCommentVO> listCommentByPage(Long userId, Long bookId, int page, int pageSize);
|
||||
PageBean<BookCommentVO> listCommentByPage(Long userId, Long bookId, int page, int pageSize);
|
||||
|
||||
/**
|
||||
* 新增评价
|
||||
@ -202,9 +203,9 @@ public interface BookService {
|
||||
* @param userId 用户ID
|
||||
* @param page 页码
|
||||
* @param pageSize 分页大小
|
||||
* @return 小说集合
|
||||
* @return 小说分页数据
|
||||
* */
|
||||
List<Book> listBookPageByUserId(Long userId, int page, int pageSize);
|
||||
PageBean<Book> listBookPageByUserId(Long userId, int page, int pageSize);
|
||||
|
||||
/**
|
||||
* 发布小说
|
||||
@ -278,4 +279,12 @@ public interface BookService {
|
||||
* @param authorId
|
||||
*/
|
||||
void updateBookContent( Long indexId, String indexName, String content, Long authorId);
|
||||
|
||||
/**
|
||||
* 修改小说封面
|
||||
* @param bookId
|
||||
* @param bookPic
|
||||
* @param authorId
|
||||
*/
|
||||
void updateBookPic(Long bookId, String bookPic, Long authorId);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.java2nb.novel.service;
|
||||
|
||||
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.entity.News;
|
||||
import com.java2nb.novel.vo.NewsVO;
|
||||
|
||||
@ -28,7 +29,7 @@ public interface NewsService {
|
||||
* 分页查询新闻列表
|
||||
* @param page 页码
|
||||
* @param pageSize 分页大小
|
||||
* @return 新闻集合
|
||||
* @return 新闻分页数据
|
||||
* */
|
||||
List<NewsVO> listByPage(int page, int pageSize);
|
||||
PageBean<News> listByPage(int page, int pageSize);
|
||||
}
|
||||
|
@ -2,8 +2,11 @@ package com.java2nb.novel.service;
|
||||
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.entity.Book;
|
||||
import com.java2nb.novel.search.BookSP;
|
||||
import com.java2nb.novel.vo.BookSpVO;
|
||||
import com.java2nb.novel.vo.BookVO;
|
||||
import com.java2nb.novel.vo.EsBookVO;
|
||||
|
||||
/**
|
||||
* @author 11797
|
||||
@ -23,5 +26,5 @@ public interface SearchService {
|
||||
* @param pageSize 每页大小
|
||||
* @return 分页信息
|
||||
*/
|
||||
PageInfo searchBook(BookSP params, int page, int pageSize);
|
||||
PageBean<EsBookVO> searchBook(BookSpVO params, int page, int pageSize);
|
||||
}
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.java2nb.novel.service;
|
||||
|
||||
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.core.bean.UserDetails;
|
||||
import com.java2nb.novel.entity.UserBuyRecord;
|
||||
import com.java2nb.novel.entity.UserFeedback;
|
||||
import com.java2nb.novel.vo.BookReadHistoryVO;
|
||||
import com.java2nb.novel.vo.BookShelfVO;
|
||||
import com.java2nb.novel.entity.User;
|
||||
@ -58,9 +60,9 @@ public interface UserService {
|
||||
* @param userId 用户ID
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* @return 书架集合
|
||||
* @return 书架分页信息
|
||||
* */
|
||||
List<BookShelfVO> listBookShelfByPage(Long userId, int page, int pageSize);
|
||||
PageBean<BookShelfVO> listBookShelfByPage(Long userId, int page, int pageSize);
|
||||
|
||||
/**
|
||||
* 添加阅读记录
|
||||
@ -82,9 +84,9 @@ public interface UserService {
|
||||
* @param userId 用户ID
|
||||
* @param page 页码
|
||||
* @param pageSize 分页大小
|
||||
* @return 反馈集合
|
||||
* @return 反馈分页数据
|
||||
* */
|
||||
List<UserFeedbackVO> listUserFeedBackByPage(Long userId, int page, int pageSize);
|
||||
PageBean<UserFeedback> listUserFeedBackByPage(Long userId, int page, int pageSize);
|
||||
|
||||
/**
|
||||
* 查询个人信息
|
||||
@ -98,9 +100,9 @@ public interface UserService {
|
||||
* @param userId 用户id
|
||||
* @param page 页码
|
||||
* @param pageSize 分页大小
|
||||
* @return
|
||||
* @return 分页数据
|
||||
* */
|
||||
List<BookReadHistoryVO> listReadHistoryByPage(Long userId, int page, int pageSize);
|
||||
PageBean<BookReadHistoryVO> listReadHistoryByPage(Long userId, int page, int pageSize);
|
||||
|
||||
/**
|
||||
* 更新个人信息
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.java2nb.novel.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.core.cache.CacheKey;
|
||||
import com.java2nb.novel.core.cache.CacheService;
|
||||
import com.java2nb.novel.core.enums.ResponseStatus;
|
||||
@ -170,9 +171,9 @@ public class AuthorServiceImpl implements AuthorService {
|
||||
|
||||
|
||||
@Override
|
||||
public List<AuthorIncomeDetail> listIncomeDailyByPage(int page, int pageSize, Long userId, Long bookId, Date startTime, Date endTime) {
|
||||
public PageBean<AuthorIncomeDetail> listIncomeDailyByPage(int page, int pageSize, Long userId, Long bookId, Date startTime, Date endTime) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
return authorIncomeDetailMapper.selectMany(
|
||||
return new PageBean<>(authorIncomeDetailMapper.selectMany(
|
||||
select(AuthorIncomeDetailDynamicSqlSupport.incomeDate, AuthorIncomeDetailDynamicSqlSupport.incomeAccount
|
||||
, AuthorIncomeDetailDynamicSqlSupport.incomeCount, AuthorIncomeDetailDynamicSqlSupport.incomeNumber)
|
||||
.from(AuthorIncomeDetailDynamicSqlSupport.authorIncomeDetail)
|
||||
@ -182,14 +183,14 @@ public class AuthorServiceImpl implements AuthorService {
|
||||
.and(AuthorIncomeDetailDynamicSqlSupport.incomeDate, isLessThanOrEqualTo(endTime))
|
||||
.orderBy(AuthorIncomeDetailDynamicSqlSupport.incomeDate.descending())
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3));
|
||||
.render(RenderingStrategies.MYBATIS3)));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<AuthorIncome> listIncomeMonthByPage(int page, int pageSize, Long userId, Long bookId) {
|
||||
public PageBean<AuthorIncome> listIncomeMonthByPage(int page, int pageSize, Long userId, Long bookId) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
return authorIncomeMapper.selectMany(select(AuthorIncomeDynamicSqlSupport.incomeMonth
|
||||
return new PageBean<>(authorIncomeMapper.selectMany(select(AuthorIncomeDynamicSqlSupport.incomeMonth
|
||||
, AuthorIncomeDynamicSqlSupport.preTaxIncome
|
||||
, AuthorIncomeDynamicSqlSupport.afterTaxIncome
|
||||
, AuthorIncomeDynamicSqlSupport.payStatus
|
||||
@ -199,6 +200,6 @@ public class AuthorServiceImpl implements AuthorService {
|
||||
.and(AuthorIncomeDynamicSqlSupport.bookId, isEqualTo(bookId))
|
||||
.orderBy(AuthorIncomeDynamicSqlSupport.incomeMonth.descending())
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3));
|
||||
.render(RenderingStrategies.MYBATIS3)));
|
||||
}
|
||||
}
|
||||
|
@ -3,16 +3,17 @@ package com.java2nb.novel.service.impl;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.core.cache.CacheKey;
|
||||
import com.java2nb.novel.core.cache.CacheService;
|
||||
import com.java2nb.novel.core.config.BookPriceConfig;
|
||||
import com.java2nb.novel.core.config.BookPriceProperties;
|
||||
import com.java2nb.novel.core.enums.ResponseStatus;
|
||||
import com.java2nb.novel.core.exception.BusinessException;
|
||||
import com.java2nb.novel.core.utils.*;
|
||||
import com.java2nb.novel.entity.*;
|
||||
import com.java2nb.novel.entity.Book;
|
||||
import com.java2nb.novel.mapper.*;
|
||||
import com.java2nb.novel.search.BookSP;
|
||||
import com.java2nb.novel.vo.BookSpVO;
|
||||
import com.java2nb.novel.service.AuthorService;
|
||||
import com.java2nb.novel.service.BookService;
|
||||
import com.java2nb.novel.service.FileService;
|
||||
@ -89,7 +90,7 @@ public class BookServiceImpl implements BookService {
|
||||
|
||||
private final FileService fileService;
|
||||
|
||||
private final BookPriceConfig bookPriceConfig;
|
||||
private final BookPriceProperties bookPriceConfig;
|
||||
|
||||
|
||||
@SneakyThrows
|
||||
@ -125,9 +126,9 @@ public class BookServiceImpl implements BookService {
|
||||
type = 0;
|
||||
} else if (i < 14) {
|
||||
type = 1;
|
||||
} else if (i < 20) {
|
||||
} else if (i < 19) {
|
||||
type = 2;
|
||||
} else if (i < 26) {
|
||||
} else if (i < 25) {
|
||||
type = 3;
|
||||
} else {
|
||||
type = 4;
|
||||
@ -186,7 +187,7 @@ public class BookServiceImpl implements BookService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo searchByPage(BookSP params, int page, int pageSize) {
|
||||
public PageBean searchByPage(BookSpVO params, int page, int pageSize) {
|
||||
|
||||
|
||||
if (params.getUpdatePeriod() != null) {
|
||||
@ -213,7 +214,7 @@ public class BookServiceImpl implements BookService {
|
||||
if (StringUtils.isNotBlank(params.getSort())) {
|
||||
OrderByHelper.orderBy(params.getSort() + " desc");
|
||||
}
|
||||
return new PageInfo<>(bookMapper.searchByPage(params));
|
||||
return new PageBean(bookMapper.searchByPage(params));
|
||||
|
||||
|
||||
}
|
||||
@ -382,10 +383,10 @@ public class BookServiceImpl implements BookService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BookCommentVO> listCommentByPage(Long userId, Long bookId, int page, int pageSize) {
|
||||
public PageBean<BookCommentVO> listCommentByPage(Long userId, Long bookId, int page, int pageSize) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
OrderByHelper.orderBy("t1.create_time desc");
|
||||
return bookCommentMapper.listCommentByPage(userId, bookId);
|
||||
return new PageBean<>(bookCommentMapper.listCommentByPage(userId, bookId));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ -491,7 +492,7 @@ public class BookServiceImpl implements BookService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Book> listBookPageByUserId(Long userId, int page, int pageSize) {
|
||||
public PageBean<Book> listBookPageByUserId(Long userId, int page, int pageSize) {
|
||||
|
||||
PageHelper.startPage(page, pageSize);
|
||||
|
||||
@ -501,7 +502,7 @@ public class BookServiceImpl implements BookService {
|
||||
.orderBy(BookDynamicSqlSupport.createTime.descending())
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return bookMapper.selectMany(selectStatement);
|
||||
return new PageBean<>(bookMapper.selectMany(selectStatement));
|
||||
|
||||
}
|
||||
|
||||
@ -829,5 +830,18 @@ public class BookServiceImpl implements BookService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBookPic(Long bookId, String bookPic, Long authorId) {
|
||||
bookMapper.update(update(book)
|
||||
.set(picUrl)
|
||||
.equalTo(bookPic)
|
||||
.set(updateTime)
|
||||
.equalTo(new Date())
|
||||
.where(id, isEqualTo(bookId))
|
||||
.and(BookDynamicSqlSupport.authorId, isEqualTo(authorId))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.java2nb.novel.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.core.utils.BeanUtil;
|
||||
import com.java2nb.novel.service.NewsService;
|
||||
import com.java2nb.novel.core.cache.CacheKey;
|
||||
@ -59,14 +60,16 @@ public class NewsServiceImpl implements NewsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NewsVO> listByPage(int page, int pageSize) {
|
||||
public PageBean<News> listByPage(int page, int pageSize) {
|
||||
PageHelper.startPage(page,pageSize);
|
||||
SelectStatementProvider selectStatement = select(id, catName, catId, title,createTime)
|
||||
.from(news)
|
||||
.orderBy(createTime.descending())
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
|
||||
return BeanUtil.copyList(newsMapper.selectMany(selectStatement),NewsVO.class);
|
||||
List<News> news = newsMapper.selectMany(selectStatement);
|
||||
PageBean<News> pageBean = new PageBean<>(news);
|
||||
pageBean.setList(BeanUtil.copyList(news,NewsVO.class));
|
||||
return pageBean;
|
||||
}
|
||||
}
|
||||
|
@ -3,12 +3,14 @@ package com.java2nb.novel.service.impl;
|
||||
import com.fasterxml.jackson.databind.JavaType;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.core.enums.ResponseStatus;
|
||||
import com.java2nb.novel.core.exception.BusinessException;
|
||||
import com.java2nb.novel.core.utils.StringUtil;
|
||||
import com.java2nb.novel.entity.Book;
|
||||
import com.java2nb.novel.search.BookSP;
|
||||
import com.java2nb.novel.vo.BookSpVO;
|
||||
import com.java2nb.novel.service.SearchService;
|
||||
import com.java2nb.novel.vo.BookVO;
|
||||
import com.java2nb.novel.vo.EsBookVO;
|
||||
import io.searchbox.client.JestClient;
|
||||
import io.searchbox.core.Count;
|
||||
@ -71,7 +73,7 @@ public class SearchServiceImpl implements SearchService {
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public PageInfo searchBook(BookSP params, int page, int pageSize) {
|
||||
public PageBean<EsBookVO> searchBook(BookSpVO params, int page, int pageSize) {
|
||||
List<EsBookVO> bookList = new ArrayList<>(0);
|
||||
|
||||
//使用搜索引擎搜索
|
||||
@ -199,11 +201,7 @@ public class SearchServiceImpl implements SearchService {
|
||||
}
|
||||
}
|
||||
|
||||
PageInfo<EsBookVO> pageInfo = new PageInfo<>(bookList);
|
||||
pageInfo.setTotal(total.longValue());
|
||||
pageInfo.setPageNum(page);
|
||||
pageInfo.setPageSize(pageSize);
|
||||
return pageInfo;
|
||||
return new PageBean<>(page,pageSize,total.longValue(),bookList);
|
||||
}
|
||||
throw new BusinessException(ResponseStatus.ES_SEARCH_FAIL);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.java2nb.novel.service.impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.java2nb.novel.core.bean.PageBean;
|
||||
import com.java2nb.novel.core.bean.UserDetails;
|
||||
import com.java2nb.novel.core.utils.BeanUtil;
|
||||
import com.java2nb.novel.entity.*;
|
||||
@ -147,9 +148,9 @@ public class UserServiceImpl implements UserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BookShelfVO> listBookShelfByPage(Long userId, int page, int pageSize) {
|
||||
public PageBean<BookShelfVO> listBookShelfByPage(Long userId, int page, int pageSize) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
return userBookshelfMapper.listBookShelf(userId);
|
||||
return new PageBean<>(userBookshelfMapper.listBookShelf(userId));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@ -201,7 +202,7 @@ public class UserServiceImpl implements UserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserFeedbackVO> listUserFeedBackByPage(Long userId, int page, int pageSize) {
|
||||
public PageBean<UserFeedback> listUserFeedBackByPage(Long userId, int page, int pageSize) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
SelectStatementProvider selectStatement = select(UserFeedbackDynamicSqlSupport.content, UserFeedbackDynamicSqlSupport.createTime)
|
||||
.from(userFeedback)
|
||||
@ -209,7 +210,10 @@ public class UserServiceImpl implements UserService {
|
||||
.orderBy(UserFeedbackDynamicSqlSupport.id.descending())
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return BeanUtil.copyList(userFeedbackMapper.selectMany(selectStatement),UserFeedbackVO.class);
|
||||
List<UserFeedback> userFeedbacks = userFeedbackMapper.selectMany(selectStatement);
|
||||
PageBean<UserFeedback> pageBean = new PageBean<>(userFeedbacks);
|
||||
pageBean.setList(BeanUtil.copyList(userFeedbacks,UserFeedbackVO.class));
|
||||
return pageBean;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -223,9 +227,9 @@ public class UserServiceImpl implements UserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BookReadHistoryVO> listReadHistoryByPage(Long userId, int page, int pageSize) {
|
||||
public PageBean<BookReadHistoryVO> listReadHistoryByPage(Long userId, int page, int pageSize) {
|
||||
PageHelper.startPage(page, pageSize);
|
||||
return userReadHistoryMapper.listReadHistory(userId);
|
||||
return new PageBean<>(userReadHistoryMapper.listReadHistory(userId));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.java2nb.novel.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.java2nb.novel.core.serialize.CommentUserNameSerialize;
|
||||
import com.java2nb.novel.entity.BookComment;
|
||||
import lombok.Data;
|
||||
|
||||
@ -13,6 +15,7 @@ import java.util.Date;
|
||||
@Data
|
||||
public class BookCommentVO extends BookComment {
|
||||
|
||||
@JsonSerialize(using = CommentUserNameSerialize.class)
|
||||
private String createUserName;
|
||||
|
||||
private String createUserPhoto;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.java2nb.novel.search;
|
||||
package com.java2nb.novel.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@ -9,7 +9,7 @@ import java.util.Date;
|
||||
* @author 11797
|
||||
*/
|
||||
@Data
|
||||
public class BookSP {
|
||||
public class BookSpVO {
|
||||
|
||||
private String keyword;
|
||||
|
@ -1,13 +1,7 @@
|
||||
package com.java2nb.novel.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.java2nb.novel.entity.Book;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.annotation.Generated;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
|
@ -1,3 +1,24 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common-dev]
|
||||
profiles:
|
||||
include: [common-dev]
|
||||
|
||||
|
||||
pic:
|
||||
save:
|
||||
type: 1 #图片保存方式, 1不保存,使用爬取的网络图片 ,2保存在自己的存储介质
|
||||
storage: local #存储介质,local:本地,OSS:阿里云对象存储,fastDfs:分布式文件系统
|
||||
path: /Users/xiongxiaoyang/java #图片保存路径
|
||||
|
||||
|
||||
|
||||
#线程池配置
|
||||
thread:
|
||||
pool:
|
||||
#核心线程池数量
|
||||
core-pool-size: 10
|
||||
#最大线程池数量
|
||||
maximum-pool-size: 20
|
||||
#线程超时时间(秒)
|
||||
keep-alive-time: 10
|
||||
#队列大小
|
||||
queue-size: 100
|
37
novel-front/src/main/resources/application-prod.yml
Normal file
@ -0,0 +1,37 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common-prod]
|
||||
|
||||
#静态文件路径配置
|
||||
resources:
|
||||
static-locations: file:${user.dir}/templates/${templates.name}/static/
|
||||
#thymeleaf模版路径配置
|
||||
thymeleaf:
|
||||
prefix: file:${user.dir}/templates/${templates.name}/html/
|
||||
suffix: .html
|
||||
|
||||
#模版配置
|
||||
templates:
|
||||
name: orange
|
||||
|
||||
|
||||
pic:
|
||||
save:
|
||||
type: 2 #图片保存方式, 1不保存,使用爬取的网络图片 ,2保存在自己的存储介质
|
||||
storage: local #存储介质,local:本地,OSS:阿里云对象存储,fastDfs:分布式文件系统
|
||||
path: /var/pic #图片保存路径
|
||||
|
||||
|
||||
#线程池配置
|
||||
thread:
|
||||
pool:
|
||||
#核心线程池数量
|
||||
core-pool-size: 10
|
||||
#最大线程池数量
|
||||
maximum-pool-size: 20
|
||||
#线程超时时间(秒)
|
||||
keep-alive-time: 10
|
||||
#队列大小
|
||||
queue-size: 1000
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
spring:
|
||||
profiles:
|
||||
include: [common-test]
|
@ -3,7 +3,7 @@ website:
|
||||
#网站名
|
||||
name: 小说精品屋
|
||||
#域名
|
||||
domain: xiongxyang.gitee.io/home
|
||||
domain: xiongxyang.gitee.io
|
||||
#SEO关键词
|
||||
keyword: ${website.name},小说,小说CMS,原创文学系统,开源小说系统,免费小说建站程序
|
||||
#SEO描述
|
||||
|
@ -25,13 +25,7 @@ spring:
|
||||
jest:
|
||||
uris: http://192.168.0.105:9200
|
||||
|
||||
#thymeleaf模版路径配置
|
||||
thymeleaf:
|
||||
prefix: file:${user.dir}/templates/${templates.name}/html/
|
||||
suffix: .html
|
||||
#静态文件路径配置
|
||||
resources:
|
||||
static-locations: file:${user.dir}/templates/${templates.name}/static/
|
||||
|
||||
|
||||
redisson:
|
||||
singleServerConfig:
|
||||
@ -76,9 +70,7 @@ book:
|
||||
|
||||
|
||||
|
||||
#模版配置
|
||||
templates:
|
||||
name: orange
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
<mapper namespace="com.java2nb.novel.mapper.FrontBookMapper">
|
||||
|
||||
<select id="searchByPage" parameterType="com.java2nb.novel.search.BookSP" resultType="com.java2nb.novel.vo.BookVO">
|
||||
<select id="searchByPage" parameterType="com.java2nb.novel.vo.BookSpVO" resultType="com.java2nb.novel.vo.BookVO">
|
||||
select
|
||||
id,cat_id,cat_name,book_name,author_id,author_name,word_count,last_index_id,last_index_name,score,pic_url,book_status,last_index_update_time,book_desc
|
||||
from book where word_count > 0
|
||||
|
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 10 KiB |
@ -124,4 +124,36 @@ String.prototype.isNickName = function () {
|
||||
function logout() {
|
||||
$.cookie('Authorization', null,{ path: '/' });
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function isImg(str) {
|
||||
return !str.search("[.]+(jpg|jpeg|swf|gif|png|JPG|JPEG|SWF|GIF|PNG)$");
|
||||
}
|
||||
|
||||
|
||||
//校验图片上传
|
||||
function checkPicUpload(file){
|
||||
|
||||
if(!isImg(file.value.substr(file.value.lastIndexOf(".")))){
|
||||
layer.alert('只能上传图片格式的文件!');
|
||||
return false;
|
||||
}
|
||||
var fileSize = 0;
|
||||
var isIE = /msie/i.test(navigator.userAgent) && !window.opera;
|
||||
if (isIE && !file.files) {
|
||||
var filePath = file.value;
|
||||
var fileSystem = new ActiveXObject("Scripting.FileSystemfileect");
|
||||
var file = fileSystem.GetFile (filePath);
|
||||
fileSize = file.Size;
|
||||
}else {
|
||||
fileSize = file.files[0].size;
|
||||
}
|
||||
fileSize=Math.round(fileSize/1024*100)/100; //单位为KB
|
||||
if(fileSize>=1024){
|
||||
layer.alert('上传的图片大小不能超过1M!');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
180
novel-front/src/main/resources/static/javascript/lazyload.js
Normal file
@ -0,0 +1,180 @@
|
||||
/*!
|
||||
* Lazy Load - JavaScript plugin for lazy loading images
|
||||
*
|
||||
* Copyright (c) 2007-2019 Mika Tuupola
|
||||
*
|
||||
* Licensed under the MIT license:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Project home:
|
||||
* https://appelsiini.net/projects/lazyload
|
||||
*
|
||||
* Version: 2.0.0-rc.2
|
||||
*
|
||||
*/
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof exports === "object") {
|
||||
module.exports = factory(root);
|
||||
} else if (typeof define === "function" && define.amd) {
|
||||
define([], factory);
|
||||
} else {
|
||||
root.LazyLoad = factory(root);
|
||||
}
|
||||
}) (typeof global !== "undefined" ? global : this.window || this.global, function (root) {
|
||||
|
||||
"use strict";
|
||||
|
||||
if (typeof define === "function" && define.amd){
|
||||
root = window;
|
||||
}
|
||||
|
||||
const defaults = {
|
||||
src: "data-src",
|
||||
srcset: "data-srcset",
|
||||
selector: ".lazyload",
|
||||
root: null,
|
||||
rootMargin: "0px",
|
||||
threshold: 0
|
||||
};
|
||||
|
||||
/**
|
||||
* Merge two or more objects. Returns a new object.
|
||||
* @private
|
||||
* @param {Boolean} deep If true, do a deep (or recursive) merge [optional]
|
||||
* @param {Object} objects The objects to merge together
|
||||
* @returns {Object} Merged values of defaults and options
|
||||
*/
|
||||
const extend = function () {
|
||||
|
||||
let extended = {};
|
||||
let deep = false;
|
||||
let i = 0;
|
||||
let length = arguments.length;
|
||||
|
||||
/* Check if a deep merge */
|
||||
if (Object.prototype.toString.call(arguments[0]) === "[object Boolean]") {
|
||||
deep = arguments[0];
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Merge the object into the extended object */
|
||||
let merge = function (obj) {
|
||||
for (let prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
/* If deep merge and property is an object, merge properties */
|
||||
if (deep && Object.prototype.toString.call(obj[prop]) === "[object Object]") {
|
||||
extended[prop] = extend(true, extended[prop], obj[prop]);
|
||||
} else {
|
||||
extended[prop] = obj[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/* Loop through each object and conduct a merge */
|
||||
for (; i < length; i++) {
|
||||
let obj = arguments[i];
|
||||
merge(obj);
|
||||
}
|
||||
|
||||
return extended;
|
||||
};
|
||||
|
||||
function LazyLoad(images, options) {
|
||||
this.settings = extend(defaults, options || {});
|
||||
this.images = images || document.querySelectorAll(this.settings.selector);
|
||||
this.observer = null;
|
||||
this.init();
|
||||
}
|
||||
|
||||
LazyLoad.prototype = {
|
||||
init: function() {
|
||||
|
||||
/* Without observers load everything and bail out early. */
|
||||
if (!root.IntersectionObserver) {
|
||||
this.loadImages();
|
||||
return;
|
||||
}
|
||||
|
||||
let self = this;
|
||||
let observerConfig = {
|
||||
root: this.settings.root,
|
||||
rootMargin: this.settings.rootMargin,
|
||||
threshold: [this.settings.threshold]
|
||||
};
|
||||
|
||||
this.observer = new IntersectionObserver(function(entries) {
|
||||
Array.prototype.forEach.call(entries, function (entry) {
|
||||
if (entry.isIntersecting) {
|
||||
self.observer.unobserve(entry.target);
|
||||
let src = entry.target.getAttribute(self.settings.src);
|
||||
let srcset = entry.target.getAttribute(self.settings.srcset);
|
||||
if ("img" === entry.target.tagName.toLowerCase()) {
|
||||
if (src) {
|
||||
entry.target.src = src;
|
||||
}
|
||||
if (srcset) {
|
||||
entry.target.srcset = srcset;
|
||||
}
|
||||
} else {
|
||||
entry.target.style.backgroundImage = "url(" + src + ")";
|
||||
}
|
||||
}
|
||||
});
|
||||
}, observerConfig);
|
||||
|
||||
Array.prototype.forEach.call(this.images, function (image) {
|
||||
self.observer.observe(image);
|
||||
});
|
||||
},
|
||||
|
||||
loadAndDestroy: function () {
|
||||
if (!this.settings) { return; }
|
||||
this.loadImages();
|
||||
this.destroy();
|
||||
},
|
||||
|
||||
loadImages: function () {
|
||||
if (!this.settings) { return; }
|
||||
|
||||
let self = this;
|
||||
Array.prototype.forEach.call(this.images, function (image) {
|
||||
let src = image.getAttribute(self.settings.src);
|
||||
let srcset = image.getAttribute(self.settings.srcset);
|
||||
if ("img" === image.tagName.toLowerCase()) {
|
||||
if (src) {
|
||||
image.src = src;
|
||||
}
|
||||
if (srcset) {
|
||||
image.srcset = srcset;
|
||||
}
|
||||
} else {
|
||||
image.style.backgroundImage = "url('" + src + "')";
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
destroy: function () {
|
||||
if (!this.settings) { return; }
|
||||
this.observer.disconnect();
|
||||
this.settings = null;
|
||||
}
|
||||
};
|
||||
|
||||
root.lazyload = function(images, options) {
|
||||
return new LazyLoad(images, options);
|
||||
};
|
||||
|
||||
if (root.jQuery) {
|
||||
const $ = root.jQuery;
|
||||
$.fn.lazyload = function (options) {
|
||||
options = options || {};
|
||||
options.attribute = options.attribute || "data-src";
|
||||
new LazyLoad($.makeArray(this), options);
|
||||
return this;
|
||||
};
|
||||
}
|
||||
|
||||
return LazyLoad;
|
||||
});
|
@ -3,16 +3,6 @@ var UserPay = {
|
||||
czPayPalData: [[20, "10000屋币"], [50, "25000屋币"], [100, "50000屋币"], [80, "全站包年阅读"]],
|
||||
sendPay: function () {
|
||||
$("#payform").submit();
|
||||
},
|
||||
GetPayState: function (payId) {
|
||||
$.post("/api/book.aspx", { act: "getpaystatus", pid: payId }, function (data, textStatus) {
|
||||
if (data == "1") {
|
||||
location.href = '/pay/wx_return.aspx?out_trade_no=sc'+payId;
|
||||
}
|
||||
else {
|
||||
setTimeout("UserPay.GetPayState("+payId+")",3000);
|
||||
}
|
||||
}, "html");
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,20 +36,6 @@ $(function () {
|
||||
$("#ulZFWXXJ").show();
|
||||
}
|
||||
|
||||
var postUrl = "";
|
||||
switch (type)
|
||||
{
|
||||
case "1":
|
||||
postUrl = "sendalipay.aspx";
|
||||
break;
|
||||
case "2":
|
||||
postUrl = "sendwxpaynowqr.aspx";
|
||||
break;
|
||||
case "3":
|
||||
postUrl = "sendpaypal.aspx";
|
||||
break;
|
||||
}
|
||||
$("#payform").attr("action", postUrl);
|
||||
})
|
||||
|
||||
$("#ulZFWX li").click(function () {
|
||||
|
Before Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 83 KiB |
Before Width: | Height: | Size: 67 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 63 KiB |
Before Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 62 KiB |
Before Width: | Height: | Size: 55 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 49 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 439 KiB |
Before Width: | Height: | Size: 39 KiB |