Compare commits
123 Commits
wjl/ban1
...
wumedical/
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e53b954769 | ||
|
|
6aa20d72b7 | ||
|
|
f131faa58b | ||
|
|
4014812781 | ||
|
|
7575a89e4b | ||
|
|
20c9e2249b | ||
|
|
0a8db2b2cc | ||
|
|
e92258dfe6 | ||
|
|
ad4651da74 | ||
|
|
2a00c09e0a | ||
|
|
229fd2513b | ||
|
|
eb1a5c5f9b | ||
|
|
b68d7201d6 | ||
|
|
c536752f14 | ||
|
|
66b9cb6a0b | ||
|
|
d099c05e90 | ||
|
|
3cef570c97 | ||
|
|
63fdd2759e | ||
|
|
36bb3fc194 | ||
|
|
c3ca9f32f9 | ||
|
|
0c740d33a0 | ||
|
|
5385745056 | ||
|
|
ce9fbaa319 | ||
|
|
cf2fa5daf6 | ||
|
|
e6d1250cf6 | ||
|
|
fb1426398f | ||
|
|
6526b4f3d3 | ||
|
|
81ab5d5b03 | ||
|
|
bae3ad563d | ||
|
|
d4ea32c6d7 | ||
|
|
9a6f2a0da1 | ||
|
|
f2a015dc1a | ||
|
|
a6c2a9fd84 | ||
|
|
413f63c67c | ||
|
|
8d3a6e11aa | ||
|
|
a885f2230f | ||
|
|
be8303fc2c | ||
|
|
e8a5bf08ad | ||
|
|
325dd75bfa | ||
|
|
928a959998 | ||
|
|
25814e03ff | ||
|
|
506e8d6b84 | ||
|
|
3f46c1f562 | ||
|
|
89fd0725f7 | ||
|
|
7fa201590c | ||
|
|
5268a0646d | ||
|
|
5331ed184f | ||
|
|
484946b2f5 | ||
|
|
62e33a19fc | ||
|
|
b3bef83b95 | ||
|
|
ca136ec6a6 | ||
|
|
d0866fbda9 | ||
|
|
1682e0390b | ||
|
|
f7c6e426dd | ||
|
|
ba6e58f954 | ||
|
|
dd99620669 | ||
|
|
ff5ad58300 | ||
|
|
fc3b9e5118 | ||
|
|
f0c464ab1a | ||
|
|
1313f78c4a | ||
|
|
9745cbfefe | ||
|
|
bab3941807 | ||
|
|
be33a443dc | ||
|
|
27e11c968e | ||
|
|
c6102c966a | ||
|
|
2808e2d3c2 | ||
|
|
573ae138c5 | ||
|
|
39ac9cf4dd | ||
|
|
34882f7d41 | ||
|
|
ab74b8fa21 | ||
|
|
a2f023451f | ||
|
|
812ee419ba | ||
|
|
e631a38674 | ||
|
|
ec10376492 | ||
|
|
3c70438366 | ||
|
|
8254514f8c | ||
|
|
40f2f46da0 | ||
|
|
62bc356219 | ||
|
|
eccc736079 | ||
|
|
67c645fcd3 | ||
|
|
892e29571b | ||
|
|
2cf70e4f6a | ||
|
|
43ce513550 | ||
|
|
889adeb00c | ||
|
|
f7659aa7bf | ||
|
|
aea90d41a0 | ||
|
|
acf3f7522a | ||
|
|
078c001198 | ||
|
|
79efe0b151 | ||
|
|
f1fb1938ef | ||
|
|
cdb6cb79be | ||
|
|
e85ad408a6 | ||
|
|
6c6887c629 | ||
|
|
f9d95718cd | ||
|
|
b19d04f09d | ||
|
|
a2a3904347 | ||
|
|
16039baadd | ||
|
|
3e3b3755f9 | ||
|
|
2f6013bbcf | ||
|
|
1bde058be9 | ||
|
|
c93679804b | ||
|
|
ef1f48cf9a | ||
|
|
fafa2ecc73 | ||
|
|
229ce39c5e | ||
|
|
032cfc9266 | ||
|
|
d12949549d | ||
|
|
42cbc1155e | ||
|
|
8d88be960e | ||
|
|
065cce514f | ||
|
|
b527976180 | ||
|
|
a3b3c1f5f6 | ||
|
|
af081f6e81 | ||
|
|
6a42c41ec2 | ||
|
|
508a260a5a | ||
|
|
3219a332e6 | ||
|
|
ecaaf81dcf | ||
|
|
fa036179b1 | ||
|
|
9423e99e20 | ||
|
|
047065b828 | ||
|
|
c3453e3aa5 | ||
|
|
a88a12fd76 | ||
|
|
97028bb4ee | ||
|
|
1ff200ba2a |
6
pom.xml
6
pom.xml
@@ -92,7 +92,11 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
<artifactId>javax.mail</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.songxinqiang</groupId>
|
||||
<artifactId>com.baidu.ueditor</artifactId>
|
||||
|
||||
163
src/main/java/com/peanut/common/utils/CertificateUtil.java
Normal file
163
src/main/java/com/peanut/common/utils/CertificateUtil.java
Normal file
@@ -0,0 +1,163 @@
|
||||
package com.peanut.common.utils;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class CertificateUtil extends Thread{
|
||||
|
||||
String inputSrc;
|
||||
String outputSrc;
|
||||
String no;
|
||||
String name;
|
||||
String time;
|
||||
String des;
|
||||
String trans;
|
||||
String trans2;
|
||||
String trans3;
|
||||
String endy;
|
||||
String endm;
|
||||
String endd;
|
||||
|
||||
public CertificateUtil(String inputSrc,String outputSrc,String no,String name,String time,
|
||||
String des,String trans,String trans2,String trans3,String endy,String endm,String endd){
|
||||
this.inputSrc=inputSrc;
|
||||
this.outputSrc = outputSrc;
|
||||
this.no = no;
|
||||
this.name = name;
|
||||
this.time = time;
|
||||
this.des = des;
|
||||
this.trans = trans;
|
||||
this.trans2 = trans2;
|
||||
this.trans3 = trans3;
|
||||
this.endy = endy;
|
||||
this.endm = endm;
|
||||
this.endd = endd;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// System.out.println(name+"-开始!");
|
||||
try {
|
||||
Image src = ImageIO.read(new File(inputSrc));
|
||||
// 获取图片的高和宽
|
||||
int wideth = src.getWidth(null);
|
||||
int height = src.getHeight(null);
|
||||
// 新增一个图片缓冲
|
||||
BufferedImage image = new BufferedImage(wideth, height, BufferedImage.TYPE_INT_RGB);
|
||||
Graphics2D g = image.createGraphics();
|
||||
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
g.drawImage(src, 0, 0, wideth, height, null);
|
||||
|
||||
// 设置字体颜色(颜色也可以直接new定义rgba,例如new Color(17, 16, 44))
|
||||
g.setColor(new Color(51,82,132));
|
||||
// size字体大小,Font.BOLD字体加粗
|
||||
g.setFont(new Font("Arial", Font.BOLD, 80));
|
||||
FontMetrics metrics = g.getFontMetrics();
|
||||
int nox = (wideth - metrics.stringWidth(no))/2;
|
||||
int noy = 1405 - metrics.getHeight();//1305
|
||||
g.drawString(no, nox, noy);
|
||||
|
||||
// 设置字体颜色(颜色也可以直接new定义rgba,例如new Color(17, 16, 44))
|
||||
g.setColor(Color.BLACK);
|
||||
// size字体大小,Font.BOLD字体加粗
|
||||
g.setFont(new Font("宋体", Font.BOLD, 150));
|
||||
FontMetrics metricss = g.getFontMetrics();
|
||||
int namex = (wideth - metricss.stringWidth(name))/2;
|
||||
int namey = 2055 - metricss.getHeight();//1935
|
||||
g.drawString(name, namex, namey);
|
||||
|
||||
g.setFont(new Font("宋体", Font.BOLD, 115));
|
||||
FontMetrics times = g.getFontMetrics();
|
||||
int timex = (wideth - times.stringWidth(time))/2;
|
||||
int timey = 2370 - times.getHeight();//2270
|
||||
g.drawString(time, timex, timey);
|
||||
|
||||
FontMetrics dess = g.getFontMetrics();
|
||||
int desx = (wideth - dess.stringWidth(des))/2;
|
||||
int desy = 2635 - dess.getHeight();//2535
|
||||
g.drawString(des, desx, desy);
|
||||
|
||||
g.setFont(new Font("Arial", Font.BOLD, 75));
|
||||
FontMetrics transs = g.getFontMetrics();
|
||||
int transx = (wideth - transs.stringWidth(trans))/2;
|
||||
int transy = 2735 - transs.getHeight();//2685
|
||||
g.drawString(trans, transx, transy);
|
||||
|
||||
FontMetrics trans2s = g.getFontMetrics();
|
||||
int trans2x = (wideth - trans2s.stringWidth(trans2))/2;
|
||||
g.drawString(trans2, trans2x, transy+120);
|
||||
|
||||
FontMetrics trans3s = g.getFontMetrics();
|
||||
int trans3x = (wideth - trans3s.stringWidth(trans3))/2;
|
||||
g.drawString(trans3, trans3x, transy+240);
|
||||
|
||||
g.setFont(new Font("宋体", Font.BOLD, 80));
|
||||
g.drawString(endy,1800,3440);
|
||||
g.drawString(endm,2090,3440);
|
||||
g.drawString(endd,2250,3440);
|
||||
|
||||
// 释放资源
|
||||
g.dispose();
|
||||
String filename = UUID.randomUUID().toString() + System.currentTimeMillis();
|
||||
File outputfile = new File(outputSrc+ filename +".jpg");
|
||||
ImageIO.write(image, "jpg", outputfile);
|
||||
|
||||
System.out.println(no +","+ name +","+ filename);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) throws Exception{
|
||||
String nameflie = "F:\\aimg\\name.txt"; //人名,一列
|
||||
String inputSrc = "F:\\aimg\\c.png"; //图片模板
|
||||
String outputSrc = "F:\\aimg\\形质病\\"; //生成地址
|
||||
String no = "No.XZB202401";
|
||||
int nostart = 0;
|
||||
String time = "于2024年1月4日至5日";
|
||||
String des = "圆满完成中医形质病学培训班";
|
||||
String trans = "Successful completion of the";
|
||||
String trans2 = "Training course on TCM somatology";
|
||||
String trans3 = "on 2024.01.04-05";
|
||||
//Traditional Chinese Medicine Morphology and Disease Training Course
|
||||
String endy = "2024";
|
||||
String endm = "1";
|
||||
String endd = "6";
|
||||
|
||||
// 1、创建服务,创建线程池
|
||||
ExecutorService service = Executors.newFixedThreadPool(30);
|
||||
|
||||
try (BufferedReader br = new BufferedReader(new FileReader(nameflie))) {
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
// 对每一行进行处理
|
||||
nostart++;
|
||||
CertificateUtil c1 = new CertificateUtil(inputSrc,outputSrc,no+String.format("%03d",nostart),line,
|
||||
time,des,trans,trans2,trans3,endy,endm,endd);
|
||||
service.execute(c1);
|
||||
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
57
src/main/java/com/peanut/common/utils/MailUtil.java
Normal file
57
src/main/java/com/peanut/common/utils/MailUtil.java
Normal file
@@ -0,0 +1,57 @@
|
||||
package com.peanut.common.utils;
|
||||
|
||||
import com.sun.mail.util.MailSSLSocketFactory;
|
||||
|
||||
import javax.mail.Authenticator;
|
||||
import javax.mail.Session;
|
||||
import javax.mail.Transport;
|
||||
import javax.mail.internet.InternetAddress;
|
||||
import javax.mail.internet.MimeMessage;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MailUtil {
|
||||
|
||||
private final static String mailName = "fengzidushu@163.com";
|
||||
private final static String mailToken = "GJIPUCQLQYTMDMPH";
|
||||
|
||||
public static R sendMail(String title,String content,String receiveAddress){
|
||||
try {
|
||||
//smtp服务器
|
||||
Properties pros=new Properties();
|
||||
pros.put("mail.smtp.host", "smtp.163.com");//主机名
|
||||
pros.put("mail.smtp.port", "465");//主机端口号
|
||||
pros.put("mail.smtp.auth", "true");//是否需要用户认证
|
||||
pros.put("mail.smtp.starttls.enable", "true");//启用TLS加密
|
||||
// SSL加密
|
||||
MailSSLSocketFactory sf = null;
|
||||
sf = new MailSSLSocketFactory();
|
||||
// 设置信任所有的主机 - 解决Linux无法发送邮箱的问题
|
||||
sf.setTrustAllHosts(true);
|
||||
pros.put("mail.smtp.ssl.enable", "true");
|
||||
pros.put("mail.smtp.ssl.socketFactory", sf);
|
||||
//创建会话
|
||||
Session session=Session.getInstance(pros,new Authenticator(){
|
||||
@Override
|
||||
protected javax.mail.PasswordAuthentication getPasswordAuthentication(){
|
||||
return new javax.mail.PasswordAuthentication(mailName, mailToken);
|
||||
}
|
||||
});
|
||||
//设置debug模式便于调试
|
||||
session.setDebug(true);
|
||||
MimeMessage message=new MimeMessage(session);
|
||||
//邮件标题
|
||||
message.setSubject(title);
|
||||
//邮件内容(文本)
|
||||
message.setText(content,"utf-8");
|
||||
//设置发送方地址
|
||||
message.setFrom(new InternetAddress(mailName));
|
||||
//设置收件方地址
|
||||
message.setRecipient(MimeMessage.RecipientType.TO,new InternetAddress(receiveAddress));
|
||||
//发送
|
||||
Transport.send(message);
|
||||
return R.ok();
|
||||
}catch (Exception e) {
|
||||
return R.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -75,6 +75,19 @@ public class R extends HashMap<String, Object> {
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R code(int code){
|
||||
R r = new R();
|
||||
r.put("code",code);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R code(int code,String msg){
|
||||
R r = new R();
|
||||
r.put("code",code);
|
||||
r.put("msg",msg);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static R ok(String msg) {
|
||||
R r = new R();
|
||||
r.put("msg", msg);
|
||||
|
||||
@@ -3,9 +3,9 @@ package com.peanut.common.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.peanut.modules.book.entity.City;
|
||||
import com.peanut.modules.book.entity.County;
|
||||
import com.peanut.modules.book.entity.Province;
|
||||
import com.peanut.modules.common.entity.City;
|
||||
import com.peanut.modules.common.entity.County;
|
||||
import com.peanut.modules.common.entity.Province;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
package com.peanut.common.utils;
|
||||
|
||||
import com.peanut.common.exception.RRException;
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.common.entity.MyUserEntity;
|
||||
import com.peanut.modules.sys.entity.SysUserEntity;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.session.Session;
|
||||
|
||||
@@ -58,6 +58,7 @@ public class ShiroConfig {
|
||||
filterMap.put("book/task/list","anon"); // 网站接口
|
||||
filterMap.put("/pay/aliPay/notify","anon"); // 支付宝回调接口
|
||||
filterMap.put("/pay/payNotify","anon"); // 微信回调接口
|
||||
filterMap.put("/pay/refundNotify","anon"); // 微信退款回调接口
|
||||
filterMap.put("/weChat/**","anon");
|
||||
filterMap.put("/book/baseArea/getAllBaseArea","anon");//登录前获取全部区域
|
||||
// filterMap.put("/book/bookchaptercontent/**","anon");
|
||||
@@ -68,10 +69,13 @@ public class ShiroConfig {
|
||||
filterMap.put("/sys/login", "anon");
|
||||
filterMap.put("/swagger/**", "anon");
|
||||
filterMap.put("/v2/api-docs", "anon");
|
||||
filterMap.put("/sys/agreement/getPrivacyDetail","anon");
|
||||
filterMap.put("/sys/agreement/getUserDetail","anon");
|
||||
filterMap.put("/swagger-ui.html", "anon");
|
||||
filterMap.put("/swagger-resources/**", "anon");
|
||||
filterMap.put("/captcha.jpg", "anon");
|
||||
filterMap.put("/aaa.txt", "anon");
|
||||
filterMap.put("/visitor/**","anon");//游客访问接口
|
||||
filterMap.put("/**", "oauth2");
|
||||
filterMap.put("/cent/**","anon");
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ package com.peanut.modules.app.controller;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.app.annotation.Login;
|
||||
import com.peanut.modules.app.annotation.LoginUser;
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.common.entity.MyUserEntity;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
@@ -10,7 +10,7 @@ package com.peanut.modules.app.resolver;
|
||||
|
||||
import com.peanut.modules.app.annotation.LoginUser;
|
||||
import com.peanut.modules.app.interceptor.AuthorizationInterceptor;
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.common.entity.MyUserEntity;
|
||||
import com.peanut.modules.book.service.MyUserService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.MethodParameter;
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.peanut.modules.book.controller;
|
||||
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.common.entity.ActivityEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -13,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.AuthorEntity;
|
||||
import com.peanut.modules.common.entity.AuthorEntity;
|
||||
import com.peanut.modules.book.service.AuthorService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BaseAreaEntity;
|
||||
import com.peanut.modules.common.entity.BaseAreaEntity;
|
||||
import com.peanut.modules.book.service.BaseAreaService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -4,10 +4,9 @@ import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.entity.BookShelfEntity;
|
||||
import com.peanut.modules.common.entity.BookShelfEntity;
|
||||
import com.peanut.modules.book.service.BookShelfService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -15,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookBrowseRecordsEntity;
|
||||
import com.peanut.modules.common.entity.BookBrowseRecordsEntity;
|
||||
import com.peanut.modules.book.service.BookBrowseRecordsService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookBuyConfigEntity;
|
||||
import com.peanut.modules.common.entity.BookBuyConfigEntity;
|
||||
import com.peanut.modules.book.service.BookBuyConfigService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -5,13 +5,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.BookCategoryService;
|
||||
import com.peanut.modules.common.entity.BookCategoryEntity;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import com.alibaba.druid.util.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.BaiduVoicesUtils;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import com.peanut.modules.oss.service.OssService;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -345,7 +345,7 @@ public class BookChapterContentController {
|
||||
|
||||
UserEbookBuyEntity userEbookBuyEntity = userEbookBuyService.getBaseMapper().selectOne(new LambdaQueryWrapper<UserEbookBuyEntity>().
|
||||
eq(UserEbookBuyEntity::getUserId, userId).eq(UserEbookBuyEntity::getBookId, bookId));
|
||||
if (chapter_info.getNumber() > book_info.getFreeChapterCount() && userEbookBuyEntity == null) {
|
||||
if (book_info.getBookType()==0&&chapter_info.getNumber() > book_info.getFreeChapterCount() && userEbookBuyEntity == null) {
|
||||
Integer productByBookId = shopProductBookService.getProductByBookId(bookId);
|
||||
return R.ok().put("jq", false).put("product", productByBookId);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.Collator;
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -14,11 +12,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookChapterEntity;
|
||||
import com.peanut.modules.common.entity.BookChapterEntity;
|
||||
import com.peanut.modules.book.service.BookChapterService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,11 +5,10 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BookClockEntryEntity;
|
||||
import com.peanut.modules.book.entity.BookClockEntryChat;
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.common.entity.BookClockEntryEntity;
|
||||
import com.peanut.modules.common.entity.BookClockEntryChat;
|
||||
import com.peanut.modules.common.entity.MyUserEntity;
|
||||
import com.peanut.modules.book.service.BookClockEntryChatService;
|
||||
import com.peanut.modules.book.service.BookClockEntryService;
|
||||
import com.peanut.modules.book.service.MyUserService;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.common.entity.BookEntity;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -6,13 +6,18 @@ import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.Query;
|
||||
import com.peanut.common.utils.ReadProvinceUtil;
|
||||
import com.peanut.modules.book.dao.BookDao;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.common.dao.BookDao;
|
||||
import com.peanut.modules.common.dao.BookForumArticlesDao;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.book.vo.BookIndexVo;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -61,6 +66,10 @@ public class BookController {
|
||||
private ShopProductBookService shopProductBookService;
|
||||
@Autowired
|
||||
private ShopProductToLabelService shopProductToLabelService;
|
||||
@Autowired
|
||||
private MedicaldesBookService medicaldesBookService;
|
||||
@Autowired
|
||||
private BookForumArticlesDao bookForumArticlesDao;
|
||||
final ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10);
|
||||
|
||||
/**
|
||||
@@ -108,7 +117,21 @@ public class BookController {
|
||||
// @RequiresPermissions("book:book:info")
|
||||
public R info(@PathVariable("id") Integer id) {
|
||||
BookEntity book = bookService.getById(id);
|
||||
|
||||
//返回结果添加图书类型
|
||||
LambdaQueryWrapper<MedicaldesBook> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(MedicaldesBook::getBookId,id);
|
||||
List<MedicaldesBook> list = medicaldesBookService.list(wrapper);
|
||||
if (list.size() > 0) {
|
||||
String type = "";
|
||||
for (MedicaldesBook mb : list) {
|
||||
if (StringUtils.isEmpty(type)){
|
||||
type += mb.getTypeId();
|
||||
}else {
|
||||
type += "," + mb.getTypeId();
|
||||
}
|
||||
}
|
||||
book.setMedicaldesBookType(type);
|
||||
}
|
||||
return R.ok().put("book", book);
|
||||
}
|
||||
|
||||
@@ -141,26 +164,14 @@ public class BookController {
|
||||
// @RequiresPermissions("book:book:info")
|
||||
public R appinfo(@PathVariable("id") Integer id,
|
||||
@PathVariable("userId") Integer userId) {
|
||||
|
||||
|
||||
BookEntity book = bookService.getById(id);
|
||||
|
||||
book.setIsBuy(true);
|
||||
|
||||
|
||||
boolean b = myUserService.bookAuthen(id, userId);
|
||||
if (!b) {
|
||||
// 无权限
|
||||
book.setIsBuy(false);
|
||||
}
|
||||
//书籍详情返回,购买状态,免费章节数
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
String authorName = "";
|
||||
String publisherName = "";
|
||||
String authorId = book.getAuthorId();
|
||||
@@ -233,7 +244,18 @@ public class BookController {
|
||||
|
||||
public R save(@RequestBody BookEntity book) {
|
||||
bookService.save(book);
|
||||
|
||||
//添加图书类型关系表
|
||||
if (StringUtils.isNotEmpty(book.getMedicaldesBookType())){
|
||||
String[] types = book.getMedicaldesBookType().split(",");
|
||||
if (types.length > 0) {
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
MedicaldesBook medicaldesBook = new MedicaldesBook();
|
||||
medicaldesBook.setBookId(book.getId());
|
||||
medicaldesBook.setTypeId(Integer.parseInt(types[i]));
|
||||
medicaldesBookService.save(medicaldesBook);
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -252,6 +274,7 @@ public class BookController {
|
||||
// Integer start = (page-1)*limit;
|
||||
QueryWrapper<BookEntity> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("can_listen",1);
|
||||
wrapper.eq("book_type",0);
|
||||
if(bids.size()>0){
|
||||
wrapper.notIn("id",bids);
|
||||
}
|
||||
@@ -271,18 +294,47 @@ public class BookController {
|
||||
* 修改
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
|
||||
public R update(@RequestBody BookEntity book) {
|
||||
bookService.updateById(book);
|
||||
|
||||
//修改图书类型关系表
|
||||
//先删除
|
||||
LambdaQueryWrapper<MedicaldesBook> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(MedicaldesBook::getBookId,book.getId());
|
||||
List<MedicaldesBook> list = medicaldesBookService.list(wrapper);
|
||||
if (list.size() > 0) {
|
||||
for (MedicaldesBook b : list) {
|
||||
medicaldesBookService.removeById(b.getId());
|
||||
}
|
||||
}
|
||||
//再添加
|
||||
if (StringUtils.isNotEmpty(book.getMedicaldesBookType())){
|
||||
String[] types = book.getMedicaldesBookType().split(",");
|
||||
if (types.length > 0) {
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
MedicaldesBook medicaldesBook = new MedicaldesBook();
|
||||
medicaldesBook.setBookId(book.getId());
|
||||
medicaldesBook.setTypeId(Integer.parseInt(types[i]));
|
||||
medicaldesBookService.save(medicaldesBook);
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取全部古籍书
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getAncientBooks")
|
||||
public R getAncientBooks(){
|
||||
List<BookEntity> ancientBooks = bookService.getAncientBooks();
|
||||
return R.ok().put("books",ancientBooks);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@RequestMapping("/delete")
|
||||
|
||||
public R delete(@RequestBody Integer[] ids) {
|
||||
bookService.removeByIds(Arrays.asList(ids));
|
||||
|
||||
@@ -318,7 +370,7 @@ public class BookController {
|
||||
/**
|
||||
* 章节拆分 2.0
|
||||
*/
|
||||
@RequestMapping("/getWord")
|
||||
@RequestMapping("/getWord")
|
||||
public R getWord(@RequestParam("id") Integer id) {
|
||||
|
||||
ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
|
||||
@@ -648,7 +700,7 @@ public class BookController {
|
||||
bookIndexVo.setBookid(book.getId());
|
||||
bookIndexVo.setImage(book.getImages());
|
||||
bookIndexVo.setIntroduce(book.getDescription());
|
||||
bookIndexVo.setPublisherName(publisherName);
|
||||
bookIndexVo.setPublisherName(publisherName);
|
||||
bookIndexVo.setIsVip(book.getIsVip());
|
||||
bookIndexVo.setPrice(book.getPrice());
|
||||
bookIndexVo.setSalePrice(book.getSalePrice());
|
||||
@@ -679,18 +731,29 @@ public class BookController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getMyBooks")
|
||||
public R getMyBooks(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
|
||||
public R getMyBooks(Integer userId,Integer limit,Integer page,Integer type){
|
||||
LambdaQueryWrapper<UserEbookBuyEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(UserEbookBuyEntity::getUserId,userId);
|
||||
wrapper.groupBy(UserEbookBuyEntity::getBookId);
|
||||
List<Integer> bookIds = userEbookBuyService.getBaseMapper().selectList(wrapper).stream().map(UserEbookBuyEntity::getBookId).collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<BookEntity> wrapper1 = new LambdaQueryWrapper<>();
|
||||
wrapper1.eq(BookEntity::getDelFlag,0);
|
||||
Page<BookEntity> bookEntityPage = null;
|
||||
if(bookIds.size()>0){
|
||||
MPJLambdaWrapper<BookEntity> wrapper1 = new MPJLambdaWrapper<>();
|
||||
wrapper1.eq(BookEntity::getDelFlag,0);
|
||||
wrapper1.in(BookEntity::getId,bookIds);
|
||||
if (type!=null){
|
||||
wrapper1.selectAll(BookEntity.class);
|
||||
wrapper1.leftJoin(MedicaldesBook.class,MedicaldesBook::getBookId,BookEntity::getId);
|
||||
wrapper1.eq(MedicaldesBook::getTypeId,type);
|
||||
}
|
||||
bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper1);
|
||||
}
|
||||
for (BookEntity b:bookEntityPage.getRecords()){
|
||||
LambdaQueryWrapper<BookForumArticlesEntity> bookForumArticlesEntityLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
bookForumArticlesEntityLambdaQueryWrapper.eq(BookForumArticlesEntity::getBookid,b.getId());
|
||||
Integer integer = bookForumArticlesDao.selectCount(bookForumArticlesEntityLambdaQueryWrapper);
|
||||
b.setForumNum(integer);
|
||||
}
|
||||
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper1);
|
||||
|
||||
return R.ok().put("page",bookEntityPage);
|
||||
}
|
||||
@@ -712,6 +775,7 @@ public class BookController {
|
||||
LambdaQueryWrapper<BookEntity> wrapper1 = new LambdaQueryWrapper<>();
|
||||
wrapper1.eq(BookEntity::getDelFlag,0);
|
||||
wrapper1.eq(BookEntity::getState,1);
|
||||
wrapper1.eq(BookEntity::getBookType,0);
|
||||
if(bookIds.size()>0){
|
||||
wrapper1.notIn(BookEntity::getId,bookIds);
|
||||
}
|
||||
@@ -787,6 +851,16 @@ public class BookController {
|
||||
return null;
|
||||
}
|
||||
|
||||
//中医经典列表
|
||||
@RequestMapping("/getClassicsBookList")
|
||||
public R getClassicsBookList(@RequestBody Map<String,Object> params) {
|
||||
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(BookEntity::getBookType,params.get("bookType"));
|
||||
IPage<BookEntity> page = bookService.page(
|
||||
new Query<BookEntity>().getPage(params),wrapper);
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.dao.BookForumArticlesDao;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.common.dao.BookForumArticlesDao;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.book.vo.BookForumArticlesVO;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -165,7 +165,7 @@ public class BookForumArticlesServiceController {
|
||||
@RequestMapping("/getHasForumsAndBook")
|
||||
public R getHasForumsAndBook(@RequestParam Integer userId,@RequestParam Integer limit,@RequestParam Integer page){
|
||||
String ex_sql = "select 1 from user_ebook_buy where book.id = book_id and user_id = "+userId;
|
||||
String existSql = "select 1 from book_forum_articles where book.id = bookid";
|
||||
String existSql = "select 1 from book_forum_articles where del_flag=0 and book.id = bookid";
|
||||
|
||||
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BookEntity::getDelFlag,0);
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.controller;
|
||||
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BookForumCommentEntity;
|
||||
import com.peanut.modules.common.entity.BookForumCommentEntity;
|
||||
import com.peanut.modules.book.service.BookForumArticlesService;
|
||||
import com.peanut.modules.book.service.BookForumCommenService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -0,0 +1,223 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 商品书和营销标签
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("book/labelAndMarket")
|
||||
public class BookLabelAndMarketController {
|
||||
|
||||
@Autowired
|
||||
private ShopProductBookLabelService labelService;
|
||||
@Autowired
|
||||
private ShopProductBookMarketService marketService;
|
||||
@Autowired
|
||||
private ShopProductToBookLabelService toLabelService;
|
||||
@Autowired
|
||||
private ShopProductToBookMarketService toMarketService;
|
||||
@Autowired
|
||||
private ShopProductService productService;
|
||||
|
||||
/**
|
||||
* 图书标签树
|
||||
*/
|
||||
@RequestMapping(path = "/labelTree")
|
||||
public R labelTree() {
|
||||
List<ShopProductBookLabel> labelsTree = labelService.labelTree();
|
||||
return R.ok().put("result", labelsTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图书标签列表
|
||||
*/
|
||||
@RequestMapping(path = "/getLabelListByPid")
|
||||
public R getLabelListByPid(String pid) {
|
||||
LambdaQueryWrapper<ShopProductBookLabel> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(ShopProductBookLabel::getPid,pid);
|
||||
wrapper.orderByAsc(ShopProductBookLabel::getSort);
|
||||
wrapper.orderByAsc(ShopProductBookLabel::getCreateTime);
|
||||
List<ShopProductBookLabel> labelTopList = labelService.list(wrapper);
|
||||
return R.ok().put("result", labelTopList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 图书营销标签树
|
||||
*/
|
||||
@RequestMapping(path = "/marketTree")
|
||||
public R marketTree() {
|
||||
List<ShopProductBookMarket> marketsTree = marketService.marketTree();
|
||||
return R.ok().put("result", marketsTree);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图书营销标签列表
|
||||
*/
|
||||
@RequestMapping(path = "/getMakertListByPid")
|
||||
public R getMakertListByPid(String pid) {
|
||||
LambdaQueryWrapper<ShopProductBookMarket> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(ShopProductBookMarket::getPid,pid);
|
||||
wrapper.orderByAsc(ShopProductBookMarket::getSort);
|
||||
wrapper.orderByAsc(ShopProductBookMarket::getCreateTime);
|
||||
List<ShopProductBookMarket> marketTopList = marketService.list(wrapper);
|
||||
return R.ok().put("result", marketTopList);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getLabelById")
|
||||
public R getLabelById(String id) {
|
||||
return R.ok().put("result",labelService.getById(id));
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateLabel")
|
||||
public R saveOrUpdateLabel(@RequestBody ShopProductBookLabel label) {
|
||||
labelService.saveOrUpdate(label);
|
||||
return R.ok().put("result",label);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delLabel")
|
||||
public R delLabel(String id) {
|
||||
labelService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getMarketById")
|
||||
public R getMarketById(String id) {
|
||||
return R.ok().put("result",marketService.getById(id));
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateMarket")
|
||||
public R saveOrUpdateMarket(@RequestBody ShopProductBookMarket market) {
|
||||
marketService.saveOrUpdate(market);
|
||||
return R.ok().put("result",market);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delMarket")
|
||||
public R delMarket(String id) {
|
||||
marketService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取书标签列表
|
||||
*/
|
||||
@RequestMapping("/getToLabelList")
|
||||
public R getToLabelList(@RequestBody Map params){
|
||||
MPJLambdaWrapper<ShopProductToBookLabel> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.selectAll(ShopProductToBookLabel.class);
|
||||
wrapper.leftJoin(ShopProduct.class,ShopProduct::getProductId,ShopProductToBookLabel::getProductId);
|
||||
if (params.containsKey("productName")&&!"".equals(params.get("productName").toString())){
|
||||
wrapper.like(ShopProduct::getProductName,params.get("productName").toString());
|
||||
}
|
||||
if (params.containsKey("productId")&&!"".equals(params.get("productId").toString())){
|
||||
wrapper.eq(ShopProductToBookLabel::getProductId,params.get("productId").toString());
|
||||
}
|
||||
if (params.containsKey("bookLabelId")&&!"".equals(params.get("bookLabelId").toString())){
|
||||
wrapper.eq(ShopProductToBookLabel::getBookLabelId,params.get("bookLabelId").toString());
|
||||
}
|
||||
Page<ShopProductToBookLabel> page = toLabelService.page(new Page<>(
|
||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||
List<ShopProductToBookLabel> res = page.getRecords();
|
||||
if (res.size() > 0) {
|
||||
for (ShopProductToBookLabel item : res) {
|
||||
item.setProduct(productService.getById(item.getProductId()));
|
||||
item.setLabel(labelService.getById(item.getBookLabelId()));
|
||||
}
|
||||
}
|
||||
page.setRecords(res);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取营销标签列表
|
||||
*/
|
||||
@RequestMapping("/getToMarketList")
|
||||
public R getToMarketList(@RequestBody Map params){
|
||||
MPJLambdaWrapper<ShopProductToBookMarket> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.selectAll(ShopProductToBookMarket.class);
|
||||
wrapper.leftJoin(ShopProduct.class,ShopProduct::getProductId,ShopProductToBookMarket::getProductId);
|
||||
if (params.containsKey("productName")&&!"".equals(params.get("productName").toString())){
|
||||
wrapper.like(ShopProduct::getProductName,params.get("productName").toString());
|
||||
}
|
||||
if (params.containsKey("productId")&&!"".equals(params.get("productId").toString())){
|
||||
wrapper.eq(ShopProductToBookMarket::getProductId,params.get("productId").toString());
|
||||
}
|
||||
if (params.containsKey("bookMarketId")&&!"".equals(params.get("bookMarketId").toString())){
|
||||
wrapper.eq(ShopProductToBookMarket::getBookMarketId,params.get("bookMarketId").toString());
|
||||
}
|
||||
Page<ShopProductToBookMarket> page = toMarketService.page(new Page<>(
|
||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||
List<ShopProductToBookMarket> res = page.getRecords();
|
||||
if (res.size() > 0) {
|
||||
for (ShopProductToBookMarket item : res) {
|
||||
item.setProduct(productService.getById(item.getProductId()));
|
||||
item.setMarket(marketService.getById(item.getBookMarketId()));
|
||||
}
|
||||
}
|
||||
page.setRecords(res);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveToLabel")
|
||||
public R saveToLabel(@RequestBody Map params) {
|
||||
LambdaQueryWrapper<ShopProductToBookLabel> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ShopProductToBookLabel::getBookLabelId,params.get("bookLabelId").toString());
|
||||
toLabelService.remove(wrapper);
|
||||
if (!StringUtils.isEmpty(params.get("productId").toString())){
|
||||
String[] ids = params.get("productId").toString().split(",");
|
||||
if (ids.length > 0) {
|
||||
for (String id : ids) {
|
||||
ShopProductToBookLabel toLabel = new ShopProductToBookLabel();
|
||||
toLabel.setBookLabelId(Integer.parseInt(params.get("bookLabelId").toString()));
|
||||
toLabel.setProductId(Integer.parseInt(id));
|
||||
toLabelService.save(toLabel);
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveToMarket")
|
||||
public R saveToMarket(@RequestBody Map params) {
|
||||
LambdaQueryWrapper<ShopProductToBookMarket> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ShopProductToBookMarket::getBookMarketId,params.get("bookMarketId").toString());
|
||||
toMarketService.remove(wrapper);
|
||||
if (!StringUtils.isEmpty(params.get("productId").toString())){
|
||||
String[] ids = params.get("productId").toString().split(",");
|
||||
if (ids.length > 0) {
|
||||
for (String id : ids) {
|
||||
ShopProductToBookMarket toMarket = new ShopProductToBookMarket();
|
||||
toMarket.setBookMarketId(Integer.parseInt(params.get("bookLabelId").toString()));
|
||||
toMarket.setProductId(Integer.parseInt(id));
|
||||
toMarketService.save(toMarket);
|
||||
}
|
||||
}
|
||||
}
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.peanut.modules.book.controller;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BookListeningEntity;
|
||||
import com.peanut.modules.common.entity.BookListeningEntity;
|
||||
import com.peanut.modules.book.service.BookListeningService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -1,24 +1,15 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BookBrowseRecordsEntity;
|
||||
import com.peanut.modules.book.entity.BookListeningEntity;
|
||||
import com.peanut.modules.book.entity.BookListeningShelfEntity;
|
||||
import com.peanut.modules.book.entity.BookShelfEntity;
|
||||
import com.peanut.modules.common.entity.BookListeningShelfEntity;
|
||||
import com.peanut.modules.book.service.BookBrowseRecordsService;
|
||||
import com.peanut.modules.book.service.BookListeningService;
|
||||
import com.peanut.modules.book.service.BookListeningShelfService;
|
||||
import com.peanut.modules.book.service.BookShelfService;
|
||||
import com.peanut.modules.book.vo.BookShelfVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
|
||||
@@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.Query;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.book.entity.BookMedicalRecordsEntity;
|
||||
import com.peanut.modules.book.entity.UserEbookBuyEntity;
|
||||
import com.peanut.modules.common.entity.BookEntity;
|
||||
import com.peanut.modules.common.entity.BookMedicalRecordsEntity;
|
||||
import com.peanut.modules.common.entity.UserEbookBuyEntity;
|
||||
import com.peanut.modules.book.service.BookMedicalRecordsService;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookReadRateEntity;
|
||||
import com.peanut.modules.common.entity.BookReadRateEntity;
|
||||
import com.peanut.modules.book.service.BookReadRateService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -5,11 +5,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.entity.BookBrowseRecordsEntity;
|
||||
import com.peanut.modules.common.entity.BookBrowseRecordsEntity;
|
||||
import com.peanut.modules.book.service.BookBrowseRecordsService;
|
||||
import com.peanut.modules.book.vo.BookShelfVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -17,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.BookShelfEntity;
|
||||
import com.peanut.modules.common.entity.BookShelfEntity;
|
||||
import com.peanut.modules.book.service.BookShelfService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.peanut.modules.book.controller;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.book.entity.BookTeachEntity;
|
||||
import com.peanut.modules.common.entity.BookEntity;
|
||||
import com.peanut.modules.common.entity.BookTeachEntity;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import com.peanut.modules.book.service.BookTeachService;
|
||||
import com.peanut.modules.book.service.ShopProductBookService;
|
||||
@@ -96,6 +96,7 @@ public class BookTeachController {
|
||||
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(BookEntity::getTeachIn,1);
|
||||
wrapper.eq(BookEntity::getDelFlag,0);
|
||||
wrapper.eq(BookEntity::getBookType,0);
|
||||
wrapper.notExists(exist_sql);
|
||||
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(pageIdDto.getPage(), pageIdDto.getLimit()), wrapper);
|
||||
return R.ok().put("page",bookEntityPage);
|
||||
|
||||
@@ -1,29 +1,24 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.alibaba.druid.sql.visitor.functions.Instr;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.Query;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.common.utils.ShiroUtils;
|
||||
import com.peanut.modules.book.entity.BookTeachCommentEntity;
|
||||
import com.peanut.modules.book.entity.BookTeachLikeEntity;
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.common.entity.BookTeachCommentEntity;
|
||||
import com.peanut.modules.common.entity.BookTeachLikeEntity;
|
||||
import com.peanut.modules.book.service.BookTeachCommentService;
|
||||
import com.peanut.modules.book.service.BookTeachLikeService;
|
||||
import com.peanut.modules.book.service.MyUserService;
|
||||
import com.peanut.modules.sys.entity.SysSensitiveWords;
|
||||
import com.peanut.modules.sys.service.SysSensitiveWordsService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.config.Constants;
|
||||
import com.peanut.config.DelayQueueConfig;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.book.to.UserOrderDto;
|
||||
import com.peanut.modules.book.vo.UserAddressVo;
|
||||
@@ -17,8 +16,8 @@ import com.peanut.modules.book.vo.request.ModifyOrderAddressRequestVo;
|
||||
import com.peanut.modules.book.vo.request.ProductRequestVo;
|
||||
import com.peanut.modules.book.vo.request.ProductTransportVo;
|
||||
import com.peanut.modules.book.vo.response.BuyOrderResponseVo;
|
||||
import com.peanut.modules.book.vo.response.ExpressQueryResponseVo;
|
||||
import com.peanut.modules.book.vo.response.OrderAddressResponseVo;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import com.peanut.modules.pay.weChatPay.dto.WechatPaymentInfo;
|
||||
import com.peanut.modules.pay.weChatPay.service.WxpayService;
|
||||
import com.peanut.modules.sys.entity.SysConfigEntity;
|
||||
@@ -32,7 +31,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -200,7 +198,7 @@ public class BuyOrderController {
|
||||
// 订单总金额
|
||||
BigDecimal totalPrice = new BigDecimal(0);
|
||||
//是否存在手摸或脚模,修改用户的脉穴权限
|
||||
List<Integer> sjc =Arrays.asList(128,129,130,131);
|
||||
List<Integer> sjc =Arrays.asList(128,129,130,131,136,137);
|
||||
boolean sj_check = false;
|
||||
//是否存在时辰取穴的权限触发商品
|
||||
List<Integer> scqq = Arrays.asList(133,134,135);
|
||||
@@ -208,6 +206,8 @@ public class BuyOrderController {
|
||||
//五运六气权限
|
||||
List<Integer> wylq = Arrays.asList(39,62,123,127);
|
||||
boolean wylq_check = false;
|
||||
List<Integer> prescript_b = Arrays.asList(43,62,124);
|
||||
boolean prescriot_b_check = false;
|
||||
|
||||
|
||||
// 遍历商品总价计算
|
||||
@@ -221,6 +221,9 @@ public class BuyOrderController {
|
||||
if(wylq.contains(buyOrderProduct.getProductId())){
|
||||
wylq_check = true;
|
||||
}
|
||||
if(prescript_b.contains(buyOrderProduct.getProductId())){
|
||||
prescriot_b_check = true;
|
||||
}
|
||||
|
||||
Integer productId = buyOrderProduct.getProductId();
|
||||
int quantity = buyOrderProduct.getQuantity();
|
||||
@@ -245,6 +248,10 @@ public class BuyOrderController {
|
||||
buyOrder.setCity(vo.getCity());
|
||||
buyOrder.setDistrict(vo.getCounty());
|
||||
buyOrder.setAddress(userAddress.getDetailAddress());
|
||||
String str = buyOrder.getShippingUser()+buyOrder.getAddress()+buyOrder.getRemark();
|
||||
if (str.contains("+")||str.contains("&")) {
|
||||
return R.error(500, "信息中不能含有“+”、“&”符号!");
|
||||
}
|
||||
buyOrderService.save(buyOrder);
|
||||
|
||||
//解决购物车相关问题
|
||||
@@ -259,7 +266,7 @@ public class BuyOrderController {
|
||||
if (Constants.PAYMENT_METHOD_VIRTUAL.equals(buyOrder.getPaymentMethod())) {
|
||||
buyOrder.setOrderStatus(Constants.ORDER_STATUS_TO_BE_SHIPPED);
|
||||
MyUserEntity user = this.myUserService.getById(buyOrder.getUserId());
|
||||
if (usePeanutCoin(user, totalPrice,sj_check,scqq_check,wylq_check)) {
|
||||
if (usePeanutCoin(user, totalPrice,sj_check,scqq_check,wylq_check,prescriot_b_check)) {
|
||||
// 更新订单状态
|
||||
buyOrderService.updateOrderStatus(user.getId(), buyOrder.getOrderSn(), "0");
|
||||
recordTransaction(buyOrder, user, totalPrice);
|
||||
@@ -597,6 +604,10 @@ public class BuyOrderController {
|
||||
buyOrder.setShippingUser(addressRequestVo.getConsigneeName());
|
||||
buyOrder.setUserPhone(addressRequestVo.getConsigneeMobile());
|
||||
buyOrder.setAddress(addressRequestVo.getAddress());
|
||||
String str = buyOrder.getShippingUser()+buyOrder.getAddress()+buyOrder.getRemark();
|
||||
if (str.contains("+")||str.contains("&")) {
|
||||
return R.error(500, "信息中不能含有“+”、“&”符号!");
|
||||
}
|
||||
buyOrderService.updateById(buyOrder);
|
||||
return R.ok();
|
||||
}
|
||||
@@ -809,7 +820,7 @@ public class BuyOrderController {
|
||||
* @param totalPrice
|
||||
* @return
|
||||
*/
|
||||
private boolean usePeanutCoin(MyUserEntity user, BigDecimal totalPrice,boolean sj_check,boolean scqq_check,boolean wylq_check) {
|
||||
private boolean usePeanutCoin(MyUserEntity user, BigDecimal totalPrice,boolean sj_check,boolean scqq_check,boolean wylq_check,boolean prescript_b_check) {
|
||||
if (user.getPeanutCoin().compareTo(totalPrice) >= 0) {
|
||||
user.setPeanutCoin(user.getPeanutCoin().subtract(totalPrice));
|
||||
if (sj_check){
|
||||
@@ -821,6 +832,9 @@ public class BuyOrderController {
|
||||
if(wylq_check){
|
||||
user.setWylqPower(1);
|
||||
}
|
||||
if(prescript_b_check){
|
||||
user.setPrescriptBPower(1);
|
||||
}
|
||||
this.myUserService.updateById(user);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.ChineseMedicineResearch;
|
||||
import com.peanut.modules.book.service.ChineseMedicineResearchService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("book/chineseMedicineResearch")
|
||||
public class ChineseMedicineResearchController {
|
||||
|
||||
@Autowired
|
||||
private ChineseMedicineResearchService chineseMedicineResearchService;
|
||||
|
||||
/**
|
||||
* 中医研究列表
|
||||
*/
|
||||
@RequestMapping(path = "/researchByType")
|
||||
public R researchByType(String type) {
|
||||
LambdaQueryWrapper<ChineseMedicineResearch> wrapper = new LambdaQueryWrapper();
|
||||
if (StringUtils.isNotEmpty(type)){
|
||||
wrapper.eq(ChineseMedicineResearch::getType,type);
|
||||
}
|
||||
wrapper.orderByAsc(ChineseMedicineResearch::getSort);
|
||||
List<ChineseMedicineResearch> list = chineseMedicineResearchService.list(wrapper);
|
||||
return R.ok().put("result", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 中医研究列表
|
||||
*/
|
||||
@RequestMapping(path = "/researchByPage")
|
||||
public R researchByPage(@RequestBody Map map) {
|
||||
LambdaQueryWrapper<ChineseMedicineResearch> wrapper = new LambdaQueryWrapper();
|
||||
if (map.containsKey("type")&&StringUtils.isNotEmpty(map.get("type").toString())){
|
||||
wrapper.eq(ChineseMedicineResearch::getType,map.get("type"));
|
||||
}
|
||||
wrapper.orderByAsc(ChineseMedicineResearch::getSort);
|
||||
Page<ChineseMedicineResearch> page = chineseMedicineResearchService.page(new Page<>(
|
||||
Long.parseLong(map.get("current").toString()), Long.parseLong(map.get("limit").toString())),wrapper);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getResearchById")
|
||||
public R getResearchById(String id) {
|
||||
return R.ok().put("result",chineseMedicineResearchService.getById(id));
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateResearch")
|
||||
public R saveOrUpdateResearch(@RequestBody ChineseMedicineResearch research) {
|
||||
chineseMedicineResearchService.saveOrUpdate(research);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delResearch")
|
||||
public R delResearch(String id) {
|
||||
chineseMedicineResearchService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,15 +2,8 @@ package com.peanut.modules.book.controller;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.entity.CouponHistoryEntity;
|
||||
import com.peanut.modules.book.service.CouponHistoryService;
|
||||
import com.peanut.modules.book.service.CouponProductCategoryRelationService;
|
||||
import com.peanut.modules.book.vo.UserCouponVo;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -18,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponEntity;
|
||||
import com.peanut.modules.common.entity.CouponEntity;
|
||||
import com.peanut.modules.book.service.CouponService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -6,12 +6,10 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.Query;
|
||||
import com.peanut.modules.book.entity.CouponEntity;
|
||||
import com.peanut.modules.common.entity.CouponEntity;
|
||||
import com.peanut.modules.book.service.CouponService;
|
||||
import com.peanut.modules.book.vo.UserCouponVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -20,7 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponHistoryEntity;
|
||||
import com.peanut.modules.common.entity.CouponHistoryEntity;
|
||||
import com.peanut.modules.book.service.CouponHistoryService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -13,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponProductCategoryRelationEntity;
|
||||
import com.peanut.modules.common.entity.CouponProductCategoryRelationEntity;
|
||||
import com.peanut.modules.book.service.CouponProductCategoryRelationService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -13,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.CouponProductRelationEntity;
|
||||
import com.peanut.modules.common.entity.CouponProductRelationEntity;
|
||||
import com.peanut.modules.book.service.CouponProductRelationService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -7,14 +7,13 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.HttpsUtil;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.ExpressCompany;
|
||||
import com.peanut.modules.book.entity.ExpressOrder;
|
||||
import com.peanut.modules.common.entity.ExpressCompany;
|
||||
import com.peanut.modules.common.entity.ExpressOrder;
|
||||
import com.peanut.modules.book.service.ExpressCompanyService;
|
||||
import com.peanut.modules.book.service.ExpressOrderService;
|
||||
import com.peanut.modules.book.to.ExpressPrintDto;
|
||||
import com.peanut.modules.book.vo.ExpressCompanyVo;
|
||||
import com.peanut.modules.book.vo.response.PrintTemplateVo;
|
||||
import io.swagger.models.auth.In;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.GeneralArticle;
|
||||
import com.peanut.modules.book.service.GeneralArticleService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("book/generalArticle")
|
||||
public class GeneralArticleController {
|
||||
|
||||
@Autowired
|
||||
private GeneralArticleService generalArticleService;
|
||||
|
||||
/**
|
||||
* 文章列表分页
|
||||
*/
|
||||
@RequestMapping(path = "/articleByPage")
|
||||
public R articleByPage(@RequestBody Map map) {
|
||||
LambdaQueryWrapper<GeneralArticle> wrapper = new LambdaQueryWrapper();
|
||||
if (StringUtils.isNotEmpty(map.get("type").toString())){
|
||||
wrapper.eq(GeneralArticle::getType,map.get("type"));
|
||||
}
|
||||
wrapper.orderByAsc(GeneralArticle::getSort);
|
||||
Page<GeneralArticle> page = generalArticleService.page(new Page<>(
|
||||
Long.parseLong(map.get("current").toString()), Long.parseLong(map.get("limit").toString())),wrapper);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getArticleById")
|
||||
public R getArticleById(String id) {
|
||||
return R.ok().put("result",generalArticleService.getById(id));
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateArticle")
|
||||
public R saveOrUpdateArticle(@RequestBody GeneralArticle article) {
|
||||
generalArticleService.saveOrUpdate(article);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delArticle")
|
||||
public R delArticle(String id) {
|
||||
generalArticleService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,356 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.SysDictDataEntity;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import com.peanut.modules.sys.service.SysDictDataService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("book/medicaldes")
|
||||
public class MedicaldesController {
|
||||
|
||||
@Autowired
|
||||
private MedicaldesLightService lightService;
|
||||
@Autowired
|
||||
private MedicaldesBookService medicaldesBookService;
|
||||
@Autowired
|
||||
private MedicaldesInheritService inheritService;
|
||||
@Autowired
|
||||
private MedicaldesInheritRelationService relationService;
|
||||
@Autowired
|
||||
private SysDictDataService sysDictDataService;
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
@Autowired
|
||||
private StringRedisTemplate redisTemplate;
|
||||
@Autowired
|
||||
private ProvinceService provinceService;
|
||||
@Autowired
|
||||
private CityService cityService;
|
||||
|
||||
|
||||
/**
|
||||
* 类型列表
|
||||
*/
|
||||
@RequestMapping(path = "/typeList")
|
||||
public R typeList(String label) {
|
||||
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(SysDictDataEntity::getDictLabel,label);
|
||||
return R.ok().put("result",sysDictDataService.list(wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 书列表
|
||||
*/
|
||||
@RequestMapping(path = "/bookList")
|
||||
public R bookList() {
|
||||
LambdaQueryWrapper<BookEntity> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(BookEntity::getBookType,0);
|
||||
wrapper.orderByDesc(BookEntity::getCreateTime);
|
||||
return R.ok().put("result",bookService.list(wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 专著出版关系列表
|
||||
*/
|
||||
@RequestMapping(path = "/bookRelationListByType")
|
||||
public R bookRelationListByType(@RequestBody Map map) {
|
||||
MPJLambdaWrapper<MedicaldesBook> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.selectAll(MedicaldesBook.class);
|
||||
wrapper.leftJoin(BookEntity.class,BookEntity::getId,MedicaldesBook::getBookId);
|
||||
wrapper.eq(BookEntity::getBookType,0);
|
||||
if (map.containsKey("dictType")&&StringUtils.isNotEmpty(map.get("dictType").toString())){
|
||||
wrapper.eq(MedicaldesBook::getTypeId,map.get("dictType"));
|
||||
}
|
||||
if (map.containsKey("bookName")&&StringUtils.isNotEmpty(map.get("bookName").toString())){
|
||||
wrapper.like(BookEntity::getName,map.get("bookName"));
|
||||
}
|
||||
wrapper.orderByAsc(MedicaldesBook::getSort);
|
||||
Page<MedicaldesBook> res = medicaldesBookService.page(new Page<MedicaldesBook>(
|
||||
Long.parseLong(map.get("current").toString()), Long.parseLong(map.get("limit").toString())), wrapper);
|
||||
List<MedicaldesBook> list = res.getRecords();
|
||||
if (list.size() > 0) {
|
||||
for (MedicaldesBook b : list) {
|
||||
b.setBook(bookService.getById(b.getBookId()));
|
||||
}
|
||||
res.setRecords(list);
|
||||
}
|
||||
return R.ok().put("result", res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 专著出版列表
|
||||
*/
|
||||
@RequestMapping(path = "/bookListByType")
|
||||
public R bookListByType(String type) {
|
||||
MPJLambdaWrapper<BookEntity> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.selectAll(BookEntity.class);
|
||||
wrapper.leftJoin(MedicaldesBook.class,MedicaldesBook::getBookId,BookEntity::getId);
|
||||
wrapper.eq(MedicaldesBook::getTypeId,type);
|
||||
wrapper.eq(BookEntity::getBookType,0);
|
||||
wrapper.orderByAsc(MedicaldesBook::getSort);
|
||||
List<BookEntity> list = bookService.list(wrapper);
|
||||
return R.ok().put("result", list);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateBookRelation")
|
||||
public R saveOrUpdateBookRelation(@RequestBody MedicaldesBook medicaldesBook) {
|
||||
MPJLambdaWrapper<MedicaldesBook> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.eq(MedicaldesBook::getBookId,medicaldesBook.getBookId());
|
||||
wrapper.eq(MedicaldesBook::getTypeId,medicaldesBook.getTypeId());
|
||||
if (medicaldesBookService.getOne(wrapper)!=null){
|
||||
medicaldesBookService.remove(wrapper);
|
||||
}
|
||||
medicaldesBookService.saveOrUpdate(medicaldesBook);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delBookRelation")
|
||||
public R delBookRelation(String id) {
|
||||
medicaldesBookService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 学术传承列表分页
|
||||
*/
|
||||
@RequestMapping(path = "/inheritListByPage")
|
||||
public R inheritListByPage(@RequestBody Map map) {
|
||||
MPJLambdaWrapper<MedicaldesInherit> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.leftJoin(MedicaldesInheritRelation.class,MedicaldesInheritRelation::getInheritId,MedicaldesInherit::getId);
|
||||
wrapper.leftJoin(City.class,City::getCityId,MedicaldesInherit::getCityId);
|
||||
wrapper.leftJoin(Province.class,Province::getProvId,City::getProvId);
|
||||
wrapper.selectAll(MedicaldesInherit.class);
|
||||
if (map.containsKey("dictType")&&StringUtils.isNotEmpty(map.get("dictType").toString())){
|
||||
wrapper.eq(MedicaldesInheritRelation::getTypeId,map.get("dictType"));
|
||||
}
|
||||
if (map.containsKey("name")&&StringUtils.isNotEmpty(map.get("name").toString())){
|
||||
wrapper.like(MedicaldesInherit::getName,map.get("name"));
|
||||
}
|
||||
wrapper.selectAs(MedicaldesInheritRelation::getTypeId,"type");
|
||||
wrapper.selectAs(MedicaldesInheritRelation::getSort,"sort");
|
||||
wrapper.orderByAsc(MedicaldesInheritRelation::getSort);
|
||||
Page<MedicaldesInherit> page = inheritService.page(new Page<>(
|
||||
Long.parseLong(map.get("current").toString()), Long.parseLong(map.get("limit").toString())),wrapper);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
//国际医师可能来自国外在省市里加入外国
|
||||
public List<SysDictDataEntity> getCounts() {
|
||||
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(SysDictDataEntity::getDictLabel,"inheritPro");
|
||||
List<SysDictDataEntity> dataList = sysDictDataService.list(wrapper);
|
||||
return dataList;
|
||||
}
|
||||
|
||||
public List getCityList(String cityName,int countId) {
|
||||
List<City> cityList = new ArrayList<>();
|
||||
City city = new City();
|
||||
city.setProvId((long)countId);
|
||||
city.setCityName(cityName);
|
||||
city.setCityId((long)countId);
|
||||
cityList.add(city);
|
||||
return cityList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 学术传承列表按类型、地区
|
||||
*/
|
||||
@RequestMapping(path = "/inheritListByTypeProvId")
|
||||
public R inheritListByTypeProvId(String type,String provId) {
|
||||
MPJLambdaWrapper<MedicaldesInherit> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.leftJoin(MedicaldesInheritRelation.class,MedicaldesInheritRelation::getInheritId,MedicaldesInherit::getId);
|
||||
wrapper.eq(MedicaldesInheritRelation::getTypeId,type);
|
||||
wrapper.leftJoin(City.class,City::getCityId,MedicaldesInherit::getCityId);
|
||||
wrapper.leftJoin(Province.class,Province::getProvId,City::getProvId);
|
||||
wrapper.selectAll(MedicaldesInherit.class);
|
||||
if ("0".equals(provId)){
|
||||
int[] val = new int[] {0};
|
||||
//未知地址
|
||||
if (getCounts()!=null&&getCounts().size() > 0){
|
||||
for (int i=1;i<=getCounts().size(); i++){
|
||||
val[i] = i;
|
||||
}
|
||||
}
|
||||
wrapper.in(MedicaldesInherit::getCityId,val);
|
||||
}else {
|
||||
wrapper.eq(Province::getProvId,provId);
|
||||
}
|
||||
wrapper.selectAs(MedicaldesInheritRelation::getSort,"sort");
|
||||
wrapper.orderByAsc(MedicaldesInheritRelation::getSort);
|
||||
List<MedicaldesInherit> list = inheritService.list(wrapper);
|
||||
return R.ok().put("result", list);
|
||||
}
|
||||
|
||||
//获取地址
|
||||
@RequestMapping(path = "/getMedicaldesProList")
|
||||
public R getMedicaldesProList() {
|
||||
String s = redisTemplate.opsForValue().get("Province");
|
||||
List<Province> provinceList = new ArrayList<>();
|
||||
if (getCounts() != null&&getCounts().size() > 0){
|
||||
for (int i=0;i<getCounts().size();i++){
|
||||
Province p = new Province();
|
||||
p.setProvName(getCounts().get(i).getDictValue());
|
||||
p.setProvId(Long.valueOf(getCounts().get(i).getDictType()));
|
||||
p.setCityList(getCityList(getCounts().get(i).getDictValue(),Integer.parseInt(getCounts().get(i).getDictType())));
|
||||
provinceList.add(p);
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(s)) {
|
||||
List<Object> redisData = JSONArray.parseArray(s);
|
||||
for (Object object : redisData) {
|
||||
Province ret = JSONObject.parseObject(object.toString(), Province.class);
|
||||
provinceList.add(ret);
|
||||
}
|
||||
return R.ok().put("provinceEntity", provinceList);
|
||||
}else {
|
||||
provinceList.addAll(provinceService.getCity());
|
||||
}
|
||||
return R.ok().put("provinceEntity", provinceList);
|
||||
}
|
||||
|
||||
//获取市列表
|
||||
@RequestMapping(path = "/getCityByPro")
|
||||
public R getCityByPro(@RequestParam("provId") Integer provId) {
|
||||
List<City> prov = new ArrayList<>();
|
||||
List<SysDictDataEntity> list = getCounts();
|
||||
boolean flag = false;
|
||||
if (list != null && list.size() > 0) {
|
||||
for (SysDictDataEntity data:list) {
|
||||
if (provId==Integer.parseInt(data.getDictType())){
|
||||
prov.addAll(getCityList(data.getDictValue(),Integer.parseInt(data.getDictType())));
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
prov = cityService.getBaseMapper().selectList(new QueryWrapper<City>()
|
||||
.eq("prov_id", provId));
|
||||
}
|
||||
return R.ok().put("prov", prov);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getInheritById")
|
||||
public R getInheritById(String id) {
|
||||
MPJLambdaWrapper<MedicaldesInherit> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.eq(MedicaldesInherit::getId,id);
|
||||
wrapper.leftJoin(MedicaldesInheritRelation.class,MedicaldesInheritRelation::getInheritId,MedicaldesInherit::getId);
|
||||
wrapper.leftJoin(City.class,City::getCityId,MedicaldesInherit::getCityId);
|
||||
wrapper.leftJoin(Province.class,Province::getProvId,City::getProvId);
|
||||
wrapper.leftJoin(" (select dict_type,dict_value from sys_dict_data where dict_label = 'inheritPro') dd on dd.dict_type = t.city_id");
|
||||
wrapper.select("t.*,ifnull(t2.city_name,ifnull(dd.dict_value,'其他')) as city_name,ifnull(t3.prov_name,ifnull(dd.dict_value,'其他')) as prov_name,t1.sort as sort");
|
||||
Map<String,Object> inherit = inheritService.getMap(wrapper);
|
||||
return R.ok().put("result",inherit);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateInherit")
|
||||
public R addInherit(@RequestBody MedicaldesInherit inherit) {
|
||||
MedicaldesInheritRelation relation = null;
|
||||
if (inherit.getId()==null) {
|
||||
relation = new MedicaldesInheritRelation();
|
||||
}else {
|
||||
LambdaQueryWrapper<MedicaldesInheritRelation> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(MedicaldesInheritRelation::getInheritId,inherit.getId());
|
||||
relation = relationService.getOne(wrapper);
|
||||
}
|
||||
inheritService.saveOrUpdate(inherit);
|
||||
relation.setTypeId(inherit.getType());
|
||||
relation.setInheritId(inherit.getId());
|
||||
relation.setSort(inherit.getSort());
|
||||
relationService.saveOrUpdate(relation);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delInherit")
|
||||
public R delInherit(String id) {
|
||||
inheritService.removeById(id);
|
||||
LambdaQueryWrapper<MedicaldesInheritRelation> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.eq(MedicaldesInheritRelation::getInheritId,id);
|
||||
relationService.removeById(relationService.getOne(wrapper));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getList")
|
||||
public List<Map<String,Object>> getList(String type) {
|
||||
MPJLambdaWrapper<MedicaldesInherit> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.select("count(1) count,ifnull(t3.prov_id,ifnull(dd.dict_type,'0')) AS prov_id,ifnull(t3.prov_name,ifnull(dd.dict_value,'其他')) AS prov_name ");
|
||||
wrapper.leftJoin(MedicaldesInheritRelation.class,MedicaldesInheritRelation::getInheritId,MedicaldesInherit::getId);
|
||||
wrapper.eq(MedicaldesInheritRelation::getTypeId,type);
|
||||
wrapper.leftJoin(City.class,City::getCityId,MedicaldesInherit::getCityId);
|
||||
wrapper.leftJoin(Province.class,Province::getProvId,City::getProvId);
|
||||
wrapper.leftJoin(" (select dict_type,dict_value from sys_dict_data where dict_label = 'inheritPro') dd on dd.dict_type = t.city_id");
|
||||
wrapper.groupBy("prov_name","dict_value");
|
||||
wrapper.orderByAsc("t3.region_code","dict_value");
|
||||
List<Map<String,Object>> list = inheritService.listMaps(wrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 吴门之光列表
|
||||
*/
|
||||
@RequestMapping(path = "/lightListByType")
|
||||
public R lightListByType(String type) {
|
||||
LambdaQueryWrapper<MedicaldesLight> wrapper = new LambdaQueryWrapper();
|
||||
if (StringUtils.isNotEmpty(type)){
|
||||
wrapper.eq(MedicaldesLight::getType,type);
|
||||
}
|
||||
wrapper.orderByAsc(MedicaldesLight::getSort);
|
||||
List<MedicaldesLight> list = lightService.list(wrapper);
|
||||
return R.ok().put("result", list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 吴门之光列表
|
||||
*/
|
||||
@RequestMapping(path = "/lightListByPage")
|
||||
public R lightListByPage(@RequestBody Map map) {
|
||||
LambdaQueryWrapper<MedicaldesLight> wrapper = new LambdaQueryWrapper();
|
||||
if (map.containsKey("type")&&StringUtils.isNotEmpty(map.get("type").toString())){
|
||||
wrapper.eq(MedicaldesLight::getType,map.get("type"));
|
||||
}
|
||||
if (map.containsKey("name")&&StringUtils.isNotEmpty(map.get("name").toString())){
|
||||
wrapper.like(MedicaldesLight::getName,map.get("name"));
|
||||
}
|
||||
wrapper.orderByAsc(MedicaldesLight::getSort);
|
||||
Page<MedicaldesLight> page = lightService.page(new Page<>(
|
||||
Long.parseLong(map.get("current").toString()), Long.parseLong(map.get("limit").toString())),wrapper);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getLightById")
|
||||
public R getLightById(String id) {
|
||||
return R.ok().put("result",lightService.getById(id));
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateLight")
|
||||
public R addLight(@RequestBody MedicaldesLight light) {
|
||||
lightService.saveOrUpdate(light);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delLight")
|
||||
public R delLight(String id) {
|
||||
lightService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,196 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.entity.MedicinalDrug;
|
||||
import com.peanut.modules.common.entity.MedicinalMaterials;
|
||||
import com.peanut.modules.book.entity.SysDictDataEntity;
|
||||
import com.peanut.modules.book.service.MedicinalDrugService;
|
||||
import com.peanut.modules.book.service.MedicinalMaterialsService;
|
||||
import com.peanut.modules.sys.service.SysDictDataService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("book/materials")
|
||||
public class MedicinalMaterialsController {
|
||||
|
||||
@Autowired
|
||||
private MedicinalMaterialsService materialsService;
|
||||
|
||||
@Autowired
|
||||
private MedicinalDrugService drugService;
|
||||
|
||||
@Autowired
|
||||
private SysDictDataService sysDictDataService;
|
||||
|
||||
/**
|
||||
* 类型列表
|
||||
*/
|
||||
@RequestMapping(path = "/getTypeList")
|
||||
public R getTypeList(String label) {
|
||||
LambdaQueryWrapper<SysDictDataEntity> wrapper = new LambdaQueryWrapper();
|
||||
wrapper.select(SysDictDataEntity::getDictValue);
|
||||
wrapper.eq(SysDictDataEntity::getDictLabel,label);
|
||||
return R.ok().put("result",sysDictDataService.list(wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取中药材列表
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getMaterialsList")
|
||||
public R getMaterialsList(@RequestBody Map params){
|
||||
MPJLambdaWrapper<MedicinalMaterials> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.select("id,name,img,latinname,othername,effect,taste,property,tropism,type,sort,hits");
|
||||
if (StringUtils.isNotEmpty(params.get("name").toString())){
|
||||
wrapper.and(t->t.like(MedicinalMaterials::getName,params.get("name"))
|
||||
.or().like(MedicinalMaterials::getOthername,params.get("name")));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.get("type").toString())){
|
||||
wrapper.like(MedicinalMaterials::getType,params.get("type"));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.get("effect").toString())){
|
||||
String[] str = params.get("effect").toString().split(",");
|
||||
String effect = "";
|
||||
for (String s : str) {
|
||||
if ("".equals(effect)){
|
||||
effect += " effect like '%" + s +"%'";
|
||||
}else {
|
||||
effect += " or effect like '%" + s +"%'";
|
||||
}
|
||||
}
|
||||
wrapper.apply("("+effect+")");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.get("taste").toString())){
|
||||
String[] str = params.get("taste").toString().split(",");
|
||||
String taste = "";
|
||||
for (String s : str) {
|
||||
if ("".equals(taste)){
|
||||
taste += " taste like '%" + s +"%'";
|
||||
}else {
|
||||
taste += " or taste like '%" + s +"%'";
|
||||
}
|
||||
}
|
||||
wrapper.apply("("+taste+")");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.get("property").toString())){
|
||||
String[] str = params.get("property").toString().split(",");
|
||||
String property = "";
|
||||
for (String s : str) {
|
||||
if ("".equals(property)){
|
||||
property += " property like '%" + s +"%'";
|
||||
}else {
|
||||
property += " or property like '%" + s +"%'";
|
||||
}
|
||||
}
|
||||
wrapper.apply("("+property+")");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.get("tropism").toString())){
|
||||
String[] str = params.get("tropism").toString().split(",");
|
||||
String tropism = "";
|
||||
for (String s : str) {
|
||||
if ("".equals(tropism)){
|
||||
tropism += " tropism like '%" + s +"%'";
|
||||
}else {
|
||||
tropism += " or tropism like '%" + s +"%'";
|
||||
}
|
||||
}
|
||||
wrapper.apply("("+tropism+")");
|
||||
}
|
||||
wrapper.orderByAsc(MedicinalMaterials::getSort);
|
||||
wrapper.orderByDesc(MedicinalMaterials::getHits);
|
||||
wrapper.orderByAsc(MedicinalMaterials::getId);
|
||||
Page<MedicinalMaterials> page = materialsService.page(new Page<>(
|
||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getMaterials")
|
||||
public R getMaterials(String id) {
|
||||
MedicinalMaterials materials = materialsService.getById(id);
|
||||
int hits = materials.getHits() + 1;
|
||||
materials.setHits(hits);
|
||||
materialsService.saveOrUpdate(materials);
|
||||
return R.ok().put("result", materials);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateMaterials")
|
||||
public R saveOrUpdateMaterials(@RequestBody MedicinalMaterials materials) {
|
||||
materialsService.saveOrUpdate(materials);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delMaterials")
|
||||
public R delMaterials(String id) {
|
||||
materialsService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取药品列表
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getDrugList")
|
||||
public R getDrugList(@RequestBody Map params){
|
||||
MPJLambdaWrapper<MedicinalDrug> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.select("id,name,english_name,pinyin_name,kind,prescription_type,insurance_type,type,sort,hits");
|
||||
if (StringUtils.isNotEmpty(params.get("name").toString())){
|
||||
wrapper.and(t->t.like(MedicinalDrug::getName,params.get("name"))
|
||||
.or().like(MedicinalDrug::getEnglishName,params.get("name"))
|
||||
.or().like(MedicinalDrug::getPinyinName,params.get("name")));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.get("kind").toString())){
|
||||
if (params.get("kind").toString().contains("麻醉")){
|
||||
wrapper.like(MedicinalDrug::getKind,params.get("kind").toString().substring(0,2));
|
||||
}else {
|
||||
wrapper.like(MedicinalDrug::getKind,params.get("kind").toString().replace("类",""));
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.get("prescriptionType").toString())){
|
||||
wrapper.like(MedicinalDrug::getPrescriptionType,params.get("prescriptionType"));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.get("insuranceType").toString())){
|
||||
wrapper.like(MedicinalDrug::getInsuranceType,params.get("insuranceType"));
|
||||
}
|
||||
if (StringUtils.isNotEmpty(params.get("type").toString())){
|
||||
wrapper.eq(MedicinalDrug::getType,params.get("type"));
|
||||
}
|
||||
wrapper.orderByAsc(MedicinalDrug::getSort);
|
||||
wrapper.orderByDesc(MedicinalDrug::getHits);
|
||||
Page<MedicinalDrug> page = drugService.page(new Page<>(
|
||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getDrug")
|
||||
public R getDrug(String id) {
|
||||
MedicinalDrug drug = drugService.getById(id);
|
||||
int hits = drug.getHits() + 1;
|
||||
drug.setHits(hits);
|
||||
drugService.saveOrUpdate(drug);
|
||||
return R.ok().put("result", drug);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateDrug")
|
||||
public R saveOrUpdateDrug(@RequestBody MedicinalDrug drug) {
|
||||
drugService.saveOrUpdate(drug);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delDrug")
|
||||
public R delDrug(String id) {
|
||||
drugService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.common.entity.Meridians;
|
||||
import com.peanut.modules.book.service.MeridiansService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("book/meridians")
|
||||
public class MeridiansController {
|
||||
|
||||
@Autowired
|
||||
private MeridiansService meridiansService;
|
||||
|
||||
/**
|
||||
* 获取经络列表
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getMeridiansList")
|
||||
public R getMeridiansList(@RequestBody Map params){
|
||||
MPJLambdaWrapper<Meridians> wrapper = new MPJLambdaWrapper();
|
||||
wrapper.orderByAsc(Meridians::getSort);
|
||||
Page<Meridians> page = meridiansService.page(new Page<>(
|
||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getMeridians")
|
||||
public R getMeridians(String id) {
|
||||
return R.ok().put("result", meridiansService.getById(id));
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateMeridians")
|
||||
public R saveOrUpdateMeridians(@RequestBody Meridians meridians) {
|
||||
meridiansService.saveOrUpdate(meridians);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delMeridians")
|
||||
public R delMeridians(String id) {
|
||||
meridiansService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.peanut.modules.book.controller;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
@@ -13,9 +12,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.MD5Utils;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.common.utils.MailUtil;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.book.to.PageIdDto;
|
||||
import com.peanut.modules.common.entity.BookBuyConfigEntity;
|
||||
import com.peanut.modules.common.entity.BookEntity;
|
||||
import com.peanut.modules.common.entity.MyUserEntity;
|
||||
import com.peanut.modules.common.entity.TransactionDetailsEntity;
|
||||
import com.peanut.modules.sys.service.SysUserTokenService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -26,12 +29,10 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
@@ -79,9 +80,7 @@ public class MyUserController {
|
||||
@RequestMapping("/getUserList")
|
||||
public R getUserList(@RequestBody PageIdDto p){
|
||||
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
if(!p.getKey().equals(null)&&p.getKey()!=""){
|
||||
wrapper.eq(MyUserEntity::getTel,p.getKey()).or().eq(MyUserEntity::getName,p.getKey());
|
||||
}
|
||||
wrapper.and(p.getKey()!="",k->k.like(MyUserEntity::getName,p.getKey()).or().like(MyUserEntity::getTel,p.getKey()).or().like(MyUserEntity::getEmail,p.getKey()));
|
||||
wrapper.orderByDesc(MyUserEntity::getCreateTime);
|
||||
Page<MyUserEntity> myUserEntityPage = userService.getBaseMapper().selectPage(new Page<MyUserEntity>(p.getPage(), p.getLimit()), wrapper);
|
||||
|
||||
@@ -103,7 +102,7 @@ public class MyUserController {
|
||||
*/
|
||||
@RequestMapping("/info/{id}")
|
||||
// @RequiresPermissions("book:user:info")
|
||||
public R info(@PathVariable("id") Integer id){
|
||||
public R info(@PathVariable("id") String id){
|
||||
MyUserEntity user = userService.getById(id);
|
||||
// List<CouponHistoryEntity> list = couponHistoryService.getBaseMapper().selectList(new QueryWrapper<CouponHistoryEntity>().eq("member_id", id)
|
||||
// .eq("use_status", 0));
|
||||
@@ -130,7 +129,10 @@ public class MyUserController {
|
||||
*/
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody MyUserEntity user){
|
||||
System.out.println(user.toString());
|
||||
boolean b = userService.checkUserTelOrEmail(user);
|
||||
if(!b){
|
||||
return R.error("电话或邮箱已存在");
|
||||
}
|
||||
userService.updateById(user);
|
||||
return R.ok();
|
||||
}
|
||||
@@ -220,13 +222,84 @@ public class MyUserController {
|
||||
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 常规注册 发送邮箱验证码
|
||||
*/
|
||||
@RequestMapping("/getMailCaptcha")
|
||||
public R getMailCaptcha(String email) throws Exception {
|
||||
//验证一分钟内是否已经发过
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + email);
|
||||
if (!StringUtils.isEmpty(redisCode)) {
|
||||
long l = Long.parseLong(redisCode.split("_")[1]);
|
||||
if (System.currentTimeMillis() - l < 60000) {
|
||||
//60s 内不能再发
|
||||
return R.error(500,"验证码频率过高,请稍后再试!");
|
||||
}
|
||||
}
|
||||
//生成随机五位数
|
||||
Random random = new Random();
|
||||
String code = random.nextInt(99999) + "";
|
||||
String timeCode = code + "_"+System.currentTimeMillis();
|
||||
//redis 缓存验证码
|
||||
redisTemplate.opsForValue().set("RegistCode"+email,timeCode,5, TimeUnit.MINUTES);
|
||||
//发送
|
||||
return MailUtil.sendMail("疯子读书邮箱验证码",code,email);
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定用户电话号
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateUserTel")
|
||||
public R updateUserTel(@RequestBody Map<String,Object> map){
|
||||
String phone = map.get("phone").toString();
|
||||
String code = map.get("code").toString();
|
||||
Integer id = Integer.valueOf(map.get("id").toString());
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode"+phone);
|
||||
if(StringUtils.isEmpty(redisCode)){
|
||||
return R.error("验证码已过期,请重试");
|
||||
}
|
||||
String lcode = redisCode.split("_")[0];
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error("短信验证码不符!");
|
||||
}
|
||||
MyUserEntity userInfo = userService.getById(id);
|
||||
userInfo.setTel(phone);
|
||||
userService.updateById(userInfo);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定用户邮件
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/updateUserEmail")
|
||||
public R updateUserEmail(@RequestBody Map<String,Object> map){
|
||||
String email = map.get("email").toString();
|
||||
String code = map.get("code").toString();
|
||||
Integer id = Integer.valueOf(map.get("id").toString());
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode"+email);
|
||||
if(StringUtils.isEmpty(redisCode)){
|
||||
return R.error("验证码已过期,请重试");
|
||||
}
|
||||
String lcode = redisCode.split("_")[0];
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error("短信验证码不符!");
|
||||
}
|
||||
MyUserEntity userInfo = userService.getById(id);
|
||||
userInfo.setEmail(email);
|
||||
userService.updateById(userInfo);
|
||||
return R.ok();
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping("/register")
|
||||
public R register(@RequestParam("tel") String tel,
|
||||
@RequestParam("code") String code,
|
||||
@RequestParam("password") String password){
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + tel);
|
||||
|
||||
System.out.println(redisCode);
|
||||
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"短信验证码已过期,请重试");
|
||||
@@ -255,43 +328,41 @@ public class MyUserController {
|
||||
* 常规注册 / 验证码 登录
|
||||
*/
|
||||
@RequestMapping("/registerOrLogin")
|
||||
public R register(@RequestParam("tel") String tel,
|
||||
@RequestParam("code") String code) {
|
||||
|
||||
public R register(String tel, String code) {
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + tel);
|
||||
|
||||
System.out.println(redisCode);
|
||||
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"短信验证码已过期,请重试");
|
||||
return R.error(500,"验证码已过期,请重试");
|
||||
}
|
||||
|
||||
String lcode = redisCode.split("_")[0];
|
||||
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"短信验证码不符!");
|
||||
return R.error(500,"验证码不符!");
|
||||
}
|
||||
|
||||
//查询是否存在当前用户手机号
|
||||
MyUserEntity userEntity = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", tel));
|
||||
|
||||
|
||||
if (userEntity == null) {
|
||||
// 用户不存在则创建用户 注册成功
|
||||
MyUserEntity myUserEntity = new MyUserEntity();
|
||||
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper();
|
||||
if (tel.contains("@")){
|
||||
wrapper.eq(MyUserEntity::getEmail,tel);
|
||||
}else {
|
||||
wrapper.eq(MyUserEntity::getTel,tel);
|
||||
}
|
||||
wrapper.orderByDesc(MyUserEntity::getLastLoginTime);
|
||||
//防止多账号报错
|
||||
List<MyUserEntity> userList = userService.getBaseMapper().selectList(wrapper);
|
||||
if (userList == null || userList.size() == 0) {
|
||||
// 用户不存在则创建用户 注册成功
|
||||
MyUserEntity myUserEntity = new MyUserEntity();
|
||||
if (tel.contains("@")){
|
||||
myUserEntity.setEmail(tel);
|
||||
}else {
|
||||
myUserEntity.setTel(tel);
|
||||
userService.save(myUserEntity);
|
||||
R r = sysUserTokenService.createToken(myUserEntity.getId());
|
||||
return R.ok("注册成功").put("userInfo",myUserEntity).put("token",r);
|
||||
}
|
||||
|
||||
if (userEntity != null) {
|
||||
R r = sysUserTokenService.createToken(userEntity.getId());
|
||||
return R.ok("登录成功!").put("userInfo",userEntity).put("token",r);
|
||||
}
|
||||
|
||||
return R.ok();
|
||||
|
||||
userService.save(myUserEntity);
|
||||
R r = sysUserTokenService.createToken(myUserEntity.getId());
|
||||
return R.ok("注册成功").put("userInfo",myUserEntity).put("token",r);
|
||||
}else {
|
||||
R r = sysUserTokenService.createToken(userList.get(0).getId());
|
||||
return R.ok("登录成功!").put("userInfo",userList.get(0)).put("token",r);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -301,22 +372,33 @@ public class MyUserController {
|
||||
public R login(@RequestParam("phone") String phone,
|
||||
@RequestParam("password") String password) {
|
||||
|
||||
|
||||
MyUserEntity user = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", phone));
|
||||
if (user == null) {
|
||||
return R.error(500,"用户不存在!");
|
||||
}
|
||||
if (user.getPassword() == null) {
|
||||
return R.error(500,"当前未设置密码,请使用验证码登录!");
|
||||
}
|
||||
if (MD5Utils.getSaltverifyMD5(password,user.getPassword())){
|
||||
// if(true){
|
||||
R r = sysUserTokenService.createToken(user.getId());
|
||||
return R.ok("登陆成功!").put("userInfo",user).put("token",r);
|
||||
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper();
|
||||
if (phone.contains("@")) {
|
||||
wrapper.eq(MyUserEntity::getEmail,phone);
|
||||
}else {
|
||||
wrapper.eq(MyUserEntity::getTel,phone);
|
||||
}
|
||||
//防止多账号报错
|
||||
List<MyUserEntity> userList = userService.getBaseMapper().selectList(wrapper);
|
||||
if (userList == null || userList.size() == 0) {
|
||||
return R.error(500,"用户不存在!");
|
||||
}else {
|
||||
int flag = 0;
|
||||
for (MyUserEntity user : userList) {
|
||||
if (user.getPassword() == null|| user.getPassword().equals("")) {
|
||||
flag++;
|
||||
continue;
|
||||
}
|
||||
if (MD5Utils.getSaltverifyMD5(password,user.getPassword())){
|
||||
R r = sysUserTokenService.createToken(user.getId());
|
||||
return R.ok("登陆成功!").put("userInfo",user).put("token",r);
|
||||
}
|
||||
}
|
||||
if (flag>0){
|
||||
return R.error(500,"当前未设置密码,请使用验证码登录!");
|
||||
}
|
||||
return R.error(500,"密码不正确,请重试!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -326,34 +408,29 @@ public class MyUserController {
|
||||
public R setPassword(@RequestParam("phone") String phone,
|
||||
@RequestParam("password") String password,
|
||||
@RequestParam("code") String code) {
|
||||
|
||||
String redisCode = redisTemplate.opsForValue().get("RegistCode" + phone);
|
||||
|
||||
System.out.println(redisCode);
|
||||
|
||||
if (StringUtils.isEmpty(redisCode)){
|
||||
return R.error(500,"短信验证码已过期,请重试");
|
||||
return R.error(500,"验证码已过期,请重试");
|
||||
}
|
||||
|
||||
String lcode = redisCode.split("_")[0];
|
||||
|
||||
if (!lcode.equals(code)) {
|
||||
return R.error(500,"短信验证码不符!");
|
||||
return R.error(500,"验证码不符!");
|
||||
}
|
||||
|
||||
//查询是否存在当前用户手机号
|
||||
MyUserEntity userEntity = userService.getBaseMapper().selectOne(new QueryWrapper<MyUserEntity>().eq("tel", phone));
|
||||
if (userEntity == null) {
|
||||
// 用户不存在则创建用户 注册成功
|
||||
return R.error(500,"当前用户手机号不存在!");
|
||||
LambdaQueryWrapper<MyUserEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
if (phone.contains("@")){
|
||||
wrapper.eq(MyUserEntity::getEmail, phone);
|
||||
}else {
|
||||
wrapper.eq(MyUserEntity::getTel, phone);
|
||||
}
|
||||
MyUserEntity userEntity = userService.getBaseMapper().selectOne(wrapper);
|
||||
if (userEntity == null) {
|
||||
return R.error(500,"当前用户不存在!");
|
||||
}
|
||||
|
||||
String saltMD5 = MD5Utils.getSaltMD5(password);
|
||||
|
||||
userEntity.setPassword(saltMD5);
|
||||
|
||||
userService.updateById(userEntity);
|
||||
|
||||
return R.ok("成功");
|
||||
}
|
||||
|
||||
@@ -619,6 +696,9 @@ public class MyUserController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// /**
|
||||
// * @Description: app微信登陆
|
||||
|
||||
@@ -6,7 +6,6 @@ import java.util.Map;
|
||||
|
||||
import com.peanut.modules.book.vo.ShopCartVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -14,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.OrderCartEntity;
|
||||
import com.peanut.modules.common.entity.OrderCartEntity;
|
||||
import com.peanut.modules.book.service.OrderCartService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -12,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.PayPaymentOrderEntity;
|
||||
import com.peanut.modules.common.entity.PayPaymentOrderEntity;
|
||||
import com.peanut.modules.book.service.PayPaymentOrderService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -12,7 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.PayZfbOrderEntity;
|
||||
import com.peanut.modules.common.entity.PayZfbOrderEntity;
|
||||
import com.peanut.modules.book.service.PayZfbOrderService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -4,8 +4,8 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.PointCategoryEntity;
|
||||
import com.peanut.modules.book.entity.PointEntity;
|
||||
import com.peanut.modules.common.entity.PointCategoryEntity;
|
||||
import com.peanut.modules.common.entity.PointEntity;
|
||||
import com.peanut.modules.book.service.PointCategoryService;
|
||||
import com.peanut.modules.book.service.PointService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.PrescriptCategoryEntity;
|
||||
import com.peanut.modules.common.entity.PrescriptCategoryEntity;
|
||||
import com.peanut.modules.common.entity.PrescriptEntity;
|
||||
import com.peanut.modules.book.service.PrescriptCategoryService;
|
||||
import com.peanut.modules.book.service.PrescriptService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -22,6 +26,137 @@ public class PrescriptController {
|
||||
@Autowired
|
||||
private PrescriptCategoryService prescriptCategoryService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取方剂文章列表
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getPrescriptList")
|
||||
public R getPrescriptList(@RequestBody Map<String,Object> map){
|
||||
return getR(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方剂文章详情
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getPrescriptDetail")
|
||||
public R getPrescriptDetail(@RequestBody Map<String,Object> map){
|
||||
Integer integer = Integer.valueOf(map.get("prescriptId").toString());
|
||||
PrescriptEntity prescript = prescriptService.getById(integer);
|
||||
return R.ok().put("prescript",prescript);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方剂文章详情
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/prescriptDetail")
|
||||
public R prescriptDetail(@RequestBody Map<String,Object> map){
|
||||
Integer integer = Integer.valueOf(map.get("prescriptId").toString());
|
||||
PrescriptEntity prescript = prescriptService.getById(integer);
|
||||
return R.ok().put("prescript",prescript);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加方剂文章
|
||||
* @param p
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/addPrescript")
|
||||
public R addPrescript(@RequestBody PrescriptEntity p){
|
||||
if(p.getImageList()!=null&&p.getImageList().size()>0){
|
||||
p.setImages(JSON.toJSONString(p.getImageList()));
|
||||
}
|
||||
prescriptService.save(p);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找方药文章
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/searchPrescript")
|
||||
public R searchPrescript(@RequestBody Map<String,Object> map){
|
||||
Integer type = Integer.valueOf(map.get("type").toString());
|
||||
String keywords = map.get("keywords").toString();
|
||||
List<PrescriptEntity> prescriptEntities = prescriptService.searchPrescripts(type, keywords);
|
||||
return R.ok().put("list",prescriptEntities);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改方剂文章
|
||||
* @param p
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/editPrescript")
|
||||
public R editPrescript(@RequestBody PrescriptEntity p){
|
||||
if(p.getImageList()!=null&&p.getImageList().size()>0){
|
||||
p.setImages(JSON.toJSONString(p.getImageList()));
|
||||
} else if (StringUtils.isNotBlank(p.getImages()) &&(p.getImageList()==null||p.getImageList().size()==0)) {
|
||||
p.setImages("");
|
||||
}
|
||||
prescriptService.updateById(p);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除方剂文章
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/delPrescript")
|
||||
public R delPrescript(@RequestBody Map<String,Object> map){
|
||||
Integer integer = Integer.valueOf(map.get("prescriptId").toString());
|
||||
prescriptService.removeById(integer);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方剂分类列表
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/prescriptCategoryList")
|
||||
public R prescriptCategoryList(@RequestBody Map<String,Object> map){
|
||||
Integer id = Integer.valueOf(map.get("categoryId").toString());
|
||||
List<PrescriptCategoryEntity> categoryByPid = prescriptCategoryService.getCategoryByPid(id);
|
||||
return R.ok().put("list",categoryByPid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方剂文章列表
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/prescriptList")
|
||||
public R prescriptList(@RequestBody Map<String,Object> map){
|
||||
return getR(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方剂文章列表(经方)
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/prescriptListForJF")
|
||||
public R prescriptListForJF(){
|
||||
List<PrescriptEntity> prescriptListForJF = prescriptService.getPrescriptListForJF();
|
||||
return R.ok().put("list",prescriptListForJF);
|
||||
}
|
||||
|
||||
private R getR(@RequestBody Map<String, Object> map) {
|
||||
Integer limit = Integer.valueOf(map.get("limit").toString());
|
||||
Integer page = Integer.valueOf(map.get("page").toString());
|
||||
Integer id = Integer.valueOf(map.get("prescriptCategoryId").toString());
|
||||
Page<PrescriptEntity> prescriptList = prescriptService.getPrescriptList(id, limit, page);
|
||||
return R.ok().put("page",prescriptList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取方剂分类列表
|
||||
* @return
|
||||
@@ -67,7 +202,7 @@ public class PrescriptController {
|
||||
if(b){
|
||||
return R.ok();
|
||||
}else{
|
||||
return R.error();
|
||||
return R.code(303,"删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.City;
|
||||
import com.peanut.modules.book.entity.County;
|
||||
import com.peanut.modules.book.entity.Province;
|
||||
import com.peanut.modules.common.entity.City;
|
||||
import com.peanut.modules.common.entity.County;
|
||||
import com.peanut.modules.common.entity.Province;
|
||||
import com.peanut.modules.book.service.CityService;
|
||||
import com.peanut.modules.book.service.CountyService;
|
||||
import com.peanut.modules.book.service.ProvinceService;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.peanut.modules.book.controller;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.Publisher;
|
||||
import com.peanut.modules.common.entity.Publisher;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import com.peanut.modules.book.service.PublisherService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.peanut.modules.book.controller;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.SeckillProdRelationEntity;
|
||||
import com.peanut.modules.common.entity.SeckillProdRelationEntity;
|
||||
import com.peanut.modules.book.service.SeckillProdRelationService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -13,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.ShopCategoryEntity;
|
||||
import com.peanut.modules.common.entity.ShopCategoryEntity;
|
||||
import com.peanut.modules.book.service.ShopCategoryService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.controller;
|
||||
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.ShopProductBookEntity;
|
||||
import com.peanut.modules.common.entity.ShopProductBookEntity;
|
||||
import com.peanut.modules.book.service.ShopProductBookService;
|
||||
import com.peanut.modules.book.vo.ProductBookQueryVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -4,9 +4,9 @@ import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.book.vo.ShopProductVo;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -65,6 +65,7 @@ public class ShopProductController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 新项目已重写
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
|
||||
@@ -5,11 +5,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.dao.ShopProductLabelDao;
|
||||
import com.peanut.modules.book.dao.ShopProductToLabelDao;
|
||||
import com.peanut.modules.book.entity.ShopProduct;
|
||||
import com.peanut.modules.book.entity.ShopProductLabelEntity;
|
||||
import com.peanut.modules.book.entity.ShopProductToLabelEntity;
|
||||
import com.peanut.modules.common.dao.ShopProductLabelDao;
|
||||
import com.peanut.modules.common.dao.ShopProductToLabelDao;
|
||||
import com.peanut.modules.common.entity.MedicaldesBook;
|
||||
import com.peanut.modules.common.entity.ShopProduct;
|
||||
import com.peanut.modules.common.entity.ShopProductLabelEntity;
|
||||
import com.peanut.modules.common.entity.ShopProductToLabelEntity;
|
||||
import com.peanut.modules.book.service.ShopProductLabelService;
|
||||
import com.peanut.modules.book.service.ShopProductToLabelService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -103,15 +104,27 @@ public class ShopProductLabelController {
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getProductsByLabel")
|
||||
public R getProductsByLabel(@RequestParam Integer splId,@RequestParam Integer limit,@RequestParam Integer page){
|
||||
MPJLambdaWrapper<ShopProductToLabelEntity> shopProductEntityMPJLambdaWrapper = new MPJLambdaWrapper<ShopProductToLabelEntity>();
|
||||
shopProductEntityMPJLambdaWrapper.selectAll(ShopProduct.class);
|
||||
shopProductEntityMPJLambdaWrapper.leftJoin(ShopProduct.class, ShopProduct::getProductId,ShopProductToLabelEntity::getProductId);
|
||||
shopProductEntityMPJLambdaWrapper.eq(ShopProductToLabelEntity::getSplId,splId);
|
||||
shopProductEntityMPJLambdaWrapper.eq(ShopProductToLabelEntity::getDelFlag,0);
|
||||
shopProductEntityMPJLambdaWrapper.eq(ShopProduct::getDelFlag,0);
|
||||
Page<ShopProduct> shopProductEntityPage = shopProductToLabelDao.selectJoinPage(new Page<ShopProduct>(page, limit), ShopProduct.class, shopProductEntityMPJLambdaWrapper);
|
||||
|
||||
public R getProductsByLabel(Integer splId,Integer limit,Integer page,Integer type){
|
||||
MPJLambdaWrapper<ShopProductToLabelEntity> wrapper = new MPJLambdaWrapper<ShopProductToLabelEntity>();
|
||||
wrapper.selectAll(ShopProduct.class);
|
||||
wrapper.leftJoin(ShopProduct.class, ShopProduct::getProductId,ShopProductToLabelEntity::getProductId);
|
||||
wrapper.eq(ShopProductToLabelEntity::getSplId,splId);
|
||||
wrapper.eq(ShopProductToLabelEntity::getDelFlag,0);
|
||||
wrapper.eq(ShopProduct::getDelFlag,0);
|
||||
wrapper.gt(ShopProduct::getProductStock,0);
|
||||
if (type!=null){
|
||||
wrapper.leftJoin(MedicaldesBook.class, MedicaldesBook::getBookId,ShopProduct::getBookId);
|
||||
wrapper.inSql(ShopProduct::getProductId,"select product_id from shop_product where book_Ids not like \"%,%\"");
|
||||
if(type==0){//0为医学图书全部
|
||||
wrapper.in(MedicaldesBook::getTypeId,1,2,3,4);
|
||||
}else if (type == -1) {//-1为文哲图书全部
|
||||
wrapper.in(MedicaldesBook::getTypeId,5,6);
|
||||
}else {
|
||||
wrapper.eq(MedicaldesBook::getTypeId,type);
|
||||
}
|
||||
}
|
||||
Page<ShopProduct> shopProductEntityPage = shopProductToLabelDao.selectJoinPage(new Page<ShopProduct>(page, limit),
|
||||
ShopProduct.class, wrapper);
|
||||
return R.ok().put("page",shopProductEntityPage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.ShopStore;
|
||||
import com.peanut.modules.book.service.ShopStoreService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("book/shopStore")
|
||||
public class ShopStoreController {
|
||||
|
||||
@Autowired
|
||||
private ShopStoreService shopStoreService;
|
||||
|
||||
/**
|
||||
* 获取小店列表
|
||||
*/
|
||||
@RequestMapping("/getStoreList")
|
||||
public R getStoreList(@RequestBody Map params){
|
||||
MPJLambdaWrapper<ShopStore> wrapper = new MPJLambdaWrapper();
|
||||
if (params.containsKey("name")&&!"".equals(params.get("name").toString())){
|
||||
wrapper.like(ShopStore::getName,params.get("name").toString());
|
||||
}
|
||||
Page<ShopStore> page = shopStoreService.page(new Page<>(
|
||||
Long.parseLong(params.get("current").toString()), Long.parseLong(params.get("limit").toString())),wrapper);
|
||||
return R.ok().put("result", page);
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/getStoreById")
|
||||
public R getStoreById(String id) {
|
||||
return R.ok().put("result",shopStoreService.getById(id));
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/saveOrUpdateStore")
|
||||
public R saveOrUpdateStore(@RequestBody ShopStore store) {
|
||||
shopStoreService.saveOrUpdate(store);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@RequestMapping(path = "/delStore")
|
||||
public R delStore(String id) {
|
||||
shopStoreService.removeById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,8 +3,8 @@ package com.peanut.modules.book.controller;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -12,7 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.peanut.modules.book.entity.TransactionDetailsEntity;
|
||||
import com.peanut.modules.common.entity.TransactionDetailsEntity;
|
||||
import com.peanut.modules.book.service.TransactionDetailsService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
@@ -39,11 +39,25 @@ public class TransactionDetailsController {
|
||||
@RequestMapping("/list")
|
||||
// @RequiresPermissions("book:transactiondetails:list")
|
||||
public R list(@RequestParam Map<String, Object> params){
|
||||
|
||||
|
||||
|
||||
PageUtils page = transactionDetailsService.queryPage(params);
|
||||
|
||||
return R.ok().put("page", page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取充扣明细列表
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/getTransactionList")
|
||||
public R getTransactionList(@RequestBody Map<String,Object> map){
|
||||
Page<TransactionDetailsEntity> transactionList = transactionDetailsService.getTransactionList(map);
|
||||
return R.ok().put("page",transactionList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.peanut.modules.book.controller;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.UserAddress;
|
||||
import com.peanut.modules.common.entity.UserAddress;
|
||||
import com.peanut.modules.book.service.UserAddressService;
|
||||
import com.peanut.modules.book.vo.UserAddressVo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -50,6 +50,10 @@ public class UserAddressController {
|
||||
if(userAddress.getRegionCode()==null||userAddress.getRegionCode().equals("")){
|
||||
return R.error("地址异常添加失败!");
|
||||
}
|
||||
String str = userAddress.getConsigneeName()+userAddress.getConsigneePhone()+userAddress.getDetailAddress();
|
||||
if(str.contains("+")||str.contains("&")){
|
||||
return R.error("信息中不能含有“+”、“&”符号!");
|
||||
}
|
||||
userAddressService.save(userAddress);
|
||||
return R.ok();
|
||||
}
|
||||
@@ -59,6 +63,10 @@ public class UserAddressController {
|
||||
if ((userAddressService.getUserDefaultAddressCount(userAddress.getUserId()) >= 1) && userAddress.getIsDefault() == 1) {
|
||||
return R.error("已经存在默认地址");
|
||||
}
|
||||
String str = userAddress.getConsigneeName()+userAddress.getConsigneePhone()+userAddress.getDetailAddress();
|
||||
if(str.contains("+")||str.contains("&")){
|
||||
return R.error("信息中不能含有“+”、“&”符号!");
|
||||
}
|
||||
userAddressService.updateById(userAddress);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.TypeReference;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.UserBookClockEntity;
|
||||
import com.peanut.modules.common.entity.UserBookClockEntity;
|
||||
import com.peanut.modules.book.service.UserBookClockService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -120,12 +121,21 @@ public class UserBookClockInController {
|
||||
@RequestMapping(value = "/correctClockIn", method = RequestMethod.GET)
|
||||
public R correctClockIn(@RequestParam("bookId") Integer bookId,
|
||||
@RequestParam("userId") Integer userId,
|
||||
@RequestParam("day") Integer day) {
|
||||
@RequestParam("day") Integer day) throws ParseException {
|
||||
QueryWrapper<UserBookClockEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("book_id", bookId);
|
||||
queryWrapper.eq("user_id", userId);
|
||||
UserBookClockEntity userBookClock = userBookClockService.getOne(queryWrapper);
|
||||
String clocksStr = userBookClock.getClocks();
|
||||
|
||||
long time = userBookClock.getBeginDate().getTime();
|
||||
Date date = new Date();
|
||||
long time1 = date.getTime();
|
||||
int c = (int)(time1-time);
|
||||
int c_day = c/86400000;
|
||||
if(day<(c_day-7)){
|
||||
return R.error("不可补卡超过7天");
|
||||
}
|
||||
List<Integer> clockInDaysList = JSON.parseObject(clocksStr, new TypeReference<List<Integer>>() {
|
||||
});
|
||||
clockInDaysList.add(day);
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.peanut.modules.book.controller;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BookClockEntryEntity;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.common.entity.BookClockEntryEntity;
|
||||
import com.peanut.modules.common.entity.BookEntity;
|
||||
import com.peanut.modules.book.service.BookClockEntryService;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import com.peanut.modules.book.to.PageIdDto;
|
||||
|
||||
@@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.dao.BookDao;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.book.entity.UserEbookBuyEntity;
|
||||
import com.peanut.modules.common.dao.BookDao;
|
||||
import com.peanut.modules.common.entity.BookEntity;
|
||||
import com.peanut.modules.common.entity.UserEbookBuyEntity;
|
||||
import com.peanut.modules.book.service.BookService;
|
||||
import com.peanut.modules.book.service.UserEbookBuyService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.peanut.modules.book.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.book.entity.UserFeedbackEntity;
|
||||
import com.peanut.modules.common.entity.MyUserEntity;
|
||||
import com.peanut.modules.common.entity.UserFeedbackEntity;
|
||||
import com.peanut.modules.book.service.MyUserService;
|
||||
import com.peanut.modules.book.service.UserFeedbackSerivce;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@@ -3,10 +3,10 @@ package com.peanut.modules.book.controller;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.BuyOrder;
|
||||
import com.peanut.modules.book.entity.MyUserEntity;
|
||||
import com.peanut.modules.book.entity.UserFollowUpEntity;
|
||||
import com.peanut.modules.book.entity.UserRecord;
|
||||
import com.peanut.modules.common.entity.BuyOrder;
|
||||
import com.peanut.modules.common.entity.MyUserEntity;
|
||||
import com.peanut.modules.common.entity.UserFollowUpEntity;
|
||||
import com.peanut.modules.common.entity.UserRecord;
|
||||
import com.peanut.modules.book.service.BuyOrderService;
|
||||
import com.peanut.modules.book.service.MyUserService;
|
||||
import com.peanut.modules.book.service.UserFollowUpService;
|
||||
|
||||
@@ -4,8 +4,8 @@ import cn.com.marsoft.tool.ToolObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.common.utils.R;
|
||||
import com.peanut.modules.book.entity.*;
|
||||
import com.peanut.modules.book.service.*;
|
||||
import com.peanut.modules.common.entity.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.ActivityEntity;
|
||||
import com.peanut.modules.common.entity.ActivityEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.AuthorEntity;
|
||||
import com.peanut.modules.common.entity.AuthorEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.BaseAreaEntity;
|
||||
import com.peanut.modules.common.entity.BaseAreaEntity;
|
||||
|
||||
|
||||
public interface BaseAreaService extends IService<BaseAreaEntity> {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookBrowseRecordsEntity;
|
||||
import com.peanut.modules.common.entity.BookBrowseRecordsEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookBuyConfigEntity;
|
||||
import com.peanut.modules.common.entity.BookBuyConfigEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookCategoryEntity;
|
||||
import com.peanut.modules.book.entity.ShopCategoryEntity;
|
||||
import com.peanut.modules.common.entity.BookCategoryEntity;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookChapterContentEntity;
|
||||
import com.peanut.modules.common.entity.BookChapterContentEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -2,10 +2,8 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookChapterEntity;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.peanut.modules.common.entity.BookChapterEntity;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.BookClockEntryChat;
|
||||
import com.peanut.modules.common.entity.BookClockEntryChat;
|
||||
|
||||
public interface BookClockEntryChatService extends IService<BookClockEntryChat> {
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.BookClockEntryEntity;
|
||||
import com.peanut.modules.common.entity.BookClockEntryEntity;
|
||||
|
||||
public interface BookClockEntryService extends IService<BookClockEntryEntity> {
|
||||
}
|
||||
|
||||
@@ -2,9 +2,8 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookForumArticlesEntity;
|
||||
import com.peanut.modules.common.entity.BookForumArticlesEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface BookForumArticlesService extends IService<BookForumArticlesEntity> {
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookForumCommentEntity;
|
||||
import com.peanut.modules.common.entity.BookForumCommentEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookListeningEntity;
|
||||
import com.peanut.modules.common.entity.BookListeningEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookListeningShelfEntity;
|
||||
import com.peanut.modules.common.entity.BookListeningShelfEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.book.entity.BookMedicalRecordsEntity;
|
||||
import com.peanut.modules.common.entity.BookEntity;
|
||||
import com.peanut.modules.common.entity.BookMedicalRecordsEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookReadRateEntity;
|
||||
import com.peanut.modules.common.entity.BookReadRateEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.peanut.modules.book.service;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.peanut.modules.book.entity.BookEntity;
|
||||
import com.peanut.modules.common.entity.BookEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -43,7 +43,7 @@ public interface BookService extends IService<BookEntity> {
|
||||
|
||||
Page<BookEntity> getUserClockBooks(Integer userId, Integer limit, Integer page);
|
||||
|
||||
|
||||
List<BookEntity> getAncientBooks();
|
||||
|
||||
Page<BookEntity> getUserClockBestBooks(Integer userId, Integer limit, Integer page);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BookShelfEntity;
|
||||
import com.peanut.modules.common.entity.BookShelfEntity;
|
||||
import com.peanut.modules.book.vo.BookShelfVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.BookTeachCommentEntity;
|
||||
import com.peanut.modules.common.entity.BookTeachCommentEntity;
|
||||
|
||||
public interface BookTeachCommentService extends IService<BookTeachCommentEntity> {
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.BookTeachLikeEntity;
|
||||
import com.peanut.modules.common.entity.BookTeachLikeEntity;
|
||||
|
||||
public interface BookTeachLikeService extends IService<BookTeachLikeEntity> {
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.BookTeachEntity;
|
||||
import com.peanut.modules.common.entity.BookTeachEntity;
|
||||
|
||||
public interface BookTeachService extends IService<BookTeachEntity> {
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BuyOrderDetail;
|
||||
import com.peanut.modules.common.entity.BuyOrderDetail;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.BuyOrderProduct;
|
||||
import com.peanut.modules.common.entity.BuyOrderProduct;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.BuyOrder;
|
||||
import com.peanut.modules.common.entity.BuyOrder;
|
||||
import com.peanut.modules.book.to.UserOrderDto;
|
||||
import com.peanut.modules.book.vo.UserOrderVo;
|
||||
import com.peanut.modules.book.vo.request.BuyOrderListRequestVo;
|
||||
import com.peanut.modules.book.vo.response.BuyOrderResponseVo;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.ChineseMedicineResearch;
|
||||
|
||||
public interface ChineseMedicineResearchService extends IService<ChineseMedicineResearch> {
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.City;
|
||||
import com.peanut.modules.common.entity.City;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.County;
|
||||
import com.peanut.modules.common.entity.County;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.CouponEntity;
|
||||
import com.peanut.modules.book.entity.CouponHistoryEntity;
|
||||
import com.peanut.modules.common.entity.CouponEntity;
|
||||
import com.peanut.modules.common.entity.CouponHistoryEntity;
|
||||
import com.peanut.modules.book.vo.UserCouponVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.CouponProductCategoryRelationEntity;
|
||||
import com.peanut.modules.common.entity.CouponProductCategoryRelationEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.CouponProductRelationEntity;
|
||||
import com.peanut.modules.common.entity.CouponProductRelationEntity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -2,10 +2,8 @@ package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.common.utils.PageUtils;
|
||||
import com.peanut.modules.book.entity.CouponEntity;
|
||||
import com.peanut.modules.book.vo.UserCouponVo;
|
||||
import com.peanut.modules.common.entity.CouponEntity;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.ExpressCompany;
|
||||
import com.peanut.modules.common.entity.ExpressCompany;
|
||||
import com.peanut.modules.book.vo.ExpressCompanyVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.ExpressFee;
|
||||
import com.peanut.modules.common.entity.ExpressFee;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.ExpressOrder;
|
||||
import com.peanut.modules.common.entity.ExpressOrder;
|
||||
import com.peanut.modules.book.vo.ExpressOrderResponseVo;
|
||||
import com.peanut.modules.book.entity.ExpressQueryResponse;
|
||||
import com.peanut.modules.common.entity.ExpressQueryResponse;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.book.entity.GeneralArticle;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public interface GeneralArticleService extends IService<GeneralArticle> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.MedicaldesBook;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public interface MedicaldesBookService extends IService<MedicaldesBook> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.peanut.modules.book.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.peanut.modules.common.entity.MedicaldesInheritRelation;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public interface MedicaldesInheritRelationService extends IService<MedicaldesInheritRelation> {
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user