This commit is contained in:
wangjinlei
2023-09-28 16:28:34 +08:00
parent 4849defaef
commit fb7016d471
5 changed files with 30 additions and 35 deletions

View File

@@ -139,10 +139,10 @@ public class BookChapterController {
@RequestMapping("/updateBookChapter") @RequestMapping("/updateBookChapter")
public R updateBookChapter(@RequestBody BookChapterEntity bookChapter){ public R updateBookChapter(@RequestBody BookChapterEntity bookChapter){
BookChapterEntity old_info = bookChapterService.getById(bookChapter.getId()); // BookChapterEntity old_info = bookChapterService.getById(bookChapter.getId());
if(!old_info.getContent().equals(bookChapter.getContent())){ // if(!old_info.getContent().equals(bookChapter.getContent())){
bookChapter.setVoices(""); // 设置voices字段为空 // bookChapter.setVoices(""); // 设置voices字段为空
} // }
bookChapterService.updateById(bookChapter); bookChapterService.updateById(bookChapter);
return R.ok(); return R.ok();
} }

View File

@@ -692,7 +692,10 @@ public class BookController {
LambdaQueryWrapper<BookEntity> wrapper1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BookEntity> wrapper1 = new LambdaQueryWrapper<>();
wrapper1.eq(BookEntity::getDelFlag,0); wrapper1.eq(BookEntity::getDelFlag,0);
wrapper1.notIn(BookEntity::getId,bookIds); wrapper1.eq(BookEntity::getState,1);
if(bookIds.size()>0){
wrapper1.notIn(BookEntity::getId,bookIds);
}
Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper1); Page<BookEntity> bookEntityPage = bookService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper1);
for (BookEntity b : bookEntityPage.getRecords()){ for (BookEntity b : bookEntityPage.getRecords()){
b.setProductId(shopProudictBookService.getProductByBookId(b.getId())); b.setProductId(shopProudictBookService.getProductByBookId(b.getId()));

View File

@@ -198,7 +198,7 @@ public class BookForumArticlesServiceController {
wrapper.eq(BookForumCommentEntity::getDelflag,0); wrapper.eq(BookForumCommentEntity::getDelflag,0);
wrapper.eq(BookForumCommentEntity::getPid,0); wrapper.eq(BookForumCommentEntity::getPid,0);
wrapper.eq(BookForumCommentEntity::getBfaid,forumId); wrapper.eq(BookForumCommentEntity::getBfaid,forumId);
wrapper.orderByAsc(BookForumCommentEntity::getCreateTime); wrapper.orderByDesc(BookForumCommentEntity::getCreateTime);
Page<BookForumCommentEntity> bookForumCommentEntityPage = bookForumCommenService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper); Page<BookForumCommentEntity> bookForumCommentEntityPage = bookForumCommenService.getBaseMapper().selectPage(new Page<>(page, limit), wrapper);
for (BookForumCommentEntity b : bookForumCommentEntityPage.getRecords()){ for (BookForumCommentEntity b : bookForumCommentEntityPage.getRecords()){
b.setComments(bookForumCommenService.getChildComments(b.getId())); b.setComments(bookForumCommenService.getChildComments(b.getId()));
@@ -256,7 +256,7 @@ public class BookForumArticlesServiceController {
bookForumCommentEntity.setPid(pid); bookForumCommentEntity.setPid(pid);
bookForumCommentEntity.setPuserid(puserId); bookForumCommentEntity.setPuserid(puserId);
bookForumCommenService.save(bookForumCommentEntity); bookForumCommenService.save(bookForumCommentEntity);
return R.ok(); return R.ok().put("comment",bookForumCommentEntity);
} }

View File

@@ -126,10 +126,10 @@ public class BuyOrderController {
/** /**
* 保存 * 保存
*/ */
@RequestMapping("/save") @RequestMapping("/buysave")
@Transactional @Transactional
// @RequiresPermissions("book:buyorder:save") // @RequiresPermissions("book:buyorder:save")
public R save(@RequestBody BuyOrderEntity buyOrder){ public R buysave(@RequestBody BuyOrderEntity buyOrder){
BigDecimal realMoney = new BigDecimal(0); BigDecimal realMoney = new BigDecimal(0);
@@ -151,14 +151,13 @@ public class BuyOrderController {
BigDecimal activityPrice = product.getActivityPrice(); BigDecimal activityPrice = product.getActivityPrice();
BigDecimal big = new BigDecimal(0); BigDecimal big = new BigDecimal(0);
BigDecimal price=null; BigDecimal price=null;
//activityPrice等于0则原价
if (activityPrice == big) {
price = product.getPrice();
//activityPrice等于0则原价
if (activityPrice.equals(big)||activityPrice==null) {
price = product.getPrice();
}else { }else {
price = product.getActivityPrice(); price = product.getActivityPrice();
} }
Integer quantity = buyOrderDetail.getQuantity(); Integer quantity = buyOrderDetail.getQuantity();
BigDecimal bigDecimal = new BigDecimal(price.doubleValue() * quantity); BigDecimal bigDecimal = new BigDecimal(price.doubleValue() * quantity);
System.out.println("bigDecimal=================bigDecimal======================"+bigDecimal); System.out.println("bigDecimal=================bigDecimal======================"+bigDecimal);
@@ -176,13 +175,8 @@ public class BuyOrderController {
buyOrderDetailEntity.setProductPrice(product.getPrice()); buyOrderDetailEntity.setProductPrice(product.getPrice());
buyOrderDetailEntity.setAddressId(buyOrder.getAddressId()); buyOrderDetailEntity.setAddressId(buyOrder.getAddressId());
buyOrderDetailEntity.setProductUrl(product.getProductImages()); buyOrderDetailEntity.setProductUrl(product.getProductImages());
System.out.println(buyOrder.getAddressId());
buyOrderDetailEntity.setOrderStatus("0"); buyOrderDetailEntity.setOrderStatus("0");
list.add(buyOrderDetailEntity); list.add(buyOrderDetailEntity);
} }
Integer couponId = buyOrder.getCouponId(); Integer couponId = buyOrder.getCouponId();
@@ -201,15 +195,12 @@ public class BuyOrderController {
// 减去优惠券金额 // 减去优惠券金额
realMoney = buyOrder.getRealMoney(); realMoney = buyOrder.getRealMoney();
if (bigDecimal1.compareTo(realMoney) == 0) { if (bigDecimal1.compareTo(realMoney) == 0) {
//特定格式的时间ID
//特定格式的时间ID
String timeId = IdWorker.getTimeId().substring(0,32); String timeId = IdWorker.getTimeId().substring(0,32);
buyOrder.setOrderSn(timeId); buyOrder.setOrderSn(timeId);
if("4".equals(buyOrder.getPaymentMethod())){ if("4".equals(buyOrder.getPaymentMethod())){
buyOrder.setOrderStatus("1"); buyOrder.setOrderStatus("1");
} }
//todo 增加结束时间 //todo 增加结束时间
buyOrder.setPaymentDate(new Date()); buyOrder.setPaymentDate(new Date());
@@ -284,9 +275,9 @@ public class BuyOrderController {
* @param buyOrder 订单表 * @param buyOrder 订单表
* @return * @return
*/ */
@RequestMapping("/buysave") @RequestMapping("/buysave1")
@Transactional @Transactional
public R buysave(@RequestBody BuyOrderEntity buyOrder) { public R buysave1(@RequestBody BuyOrderEntity buyOrder) {
BigDecimal realMoney = new BigDecimal(0); BigDecimal realMoney = new BigDecimal(0);

View File

@@ -37,10 +37,10 @@ spring:
initSQL: SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci initSQL: SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci
rabbitmq: rabbitmq:
host: 127.0.0.1 host: 59.110.212.44
port: 15672 port: 5672
username: guest username: admin
password: guest password: 751019
virtualHost: / virtualHost: /
@@ -53,14 +53,15 @@ aliyun:
oss: oss:
file: file:
endpoint: oss-cn-beijing.aliyuncs.com endpoint: oss-cn-beijing.aliyuncs.com
keyid: LTAI5tRDbidmtFSoxQ2rgFd2 keyid: LTAIiSMeo8ztauV5
keysecret: 08XmfSoaC980DiAK4swQEvb6MwKedG keysecret: pVIYAOIFSUGg61lYfE8cjg2ZNpnLJA
bucketname: peanut9377 bucketname: ehh-private-01
sms: sms:
accessKeyId: LTAI5tRDbidmtFSoxQ2rgFd2 accessKeyId: LTAI5tJbbw5fY97pnw635yq3
accessKeySecret: 08XmfSoaC980DiAK4swQEvb6MwKedG accessKeySecret: LTXQ9v3OYVwNVbDWWfVpbbcVDKErKi
singName: 水晶球 singName: 疯子读书
templateCode: SMS_216832090
templateCode: SMS_248840040
##多数据源的配置 ##多数据源的配置