This commit is contained in:
wuchunlei
2024-06-03 09:29:30 +08:00
8 changed files with 84 additions and 2 deletions

View File

@@ -463,7 +463,7 @@ public class ShopProductController {
}
/**
* 删除
* 删除(废弃)
*/
@RequestMapping("/delete")
public R delete(@RequestBody Integer[] productIds) {

View File

@@ -468,7 +468,7 @@ public class BuyOrderServiceImpl extends ServiceImpl<BuyOrderDao, BuyOrder> impl
}else{
wrapper.eq(BuyOrder::getOrderStatus,userOrderDto.getOrderStatus());
}
wrapper.eq(userOrderDto.getOrderStatus()!=null,BuyOrder::getOrderStatus,userOrderDto.getOrderStatus());
// wrapper.eq(userOrderDto.getOrderStatus()!=null,BuyOrder::getOrderStatus,userOrderDto.getOrderStatus());
wrapper.orderByDesc(BuyOrder::getCreateTime);
Page<BuyOrder> buyOrderPage = this.getBaseMapper().selectPage(new Page<>(userOrderDto.getPage(), userOrderDto.getLimit()), wrapper);
for(BuyOrder b : buyOrderPage.getRecords()){

View File

@@ -0,0 +1,9 @@
package com.peanut.modules.common.dao;
import com.github.yulichang.base.MPJBaseMapper;
import com.peanut.modules.common.entity.VipBuyConfigEntity;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface VipBuyConfigDao extends MPJBaseMapper<VipBuyConfigEntity> {
}

View File

@@ -0,0 +1,37 @@
package com.peanut.modules.common.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@TableName("vip_buy_config")
public class VipBuyConfigEntity {
@TableId
private Integer id;
/**
* 1超级vip2医学vip3国学vip
*/
private Integer type;
private String title;
private Integer year;
private BigDecimal fee;
private Integer dateType;
private Date startTime;
private Date endTime;
@TableLogic
private Integer del_flag;
}

View File

@@ -73,6 +73,12 @@ public class ShopProductController {
return R.ok();
}
@RequestMapping("/delShopProduct")
public R delShopProduct(@RequestBody Map<String,Integer> map){
int productId = map.get("productId");
return shopProductService.delShopProduct(productId);
}
@RequestMapping("/bindProductAndBookMarket")
public R bindProductAndBookMarket(@RequestBody Map<String,String> map){
String[] productIds = map.get("productId").split(",");

View File

@@ -56,4 +56,6 @@ public interface ShopProductService extends IService<ShopProduct> {
R bindProductAndCourse(ShopProductCourseEntity shopProductCourseEntity);
R unbindProductAndCourse(int productId,int catalogueId);
R delShopProduct(int productId);
}

View File

@@ -275,6 +275,21 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
return R.ok();
}
@Override
public R delShopProduct(int productId){
//清除连带绑定关系
shopProductToMedicineLabelDao.delete(new LambdaQueryWrapper<ShopProductToMedicineLabel>().eq(ShopProductToMedicineLabel::getProductId,productId));
shopProductToMedicineMarketDao.delete(new LambdaQueryWrapper<ShopProductToMedicineMarket>().eq(ShopProductToMedicineMarket::getProductId,productId));
shopProductToSociologyLabelDao.delete(new LambdaQueryWrapper<ShopProductToSociologyLabel>().eq(ShopProductToSociologyLabel::getProductId,productId));
shopProductToSociologyMarketDao.delete(new LambdaQueryWrapper<ShopProductToSociologyMarket>().eq(ShopProductToSociologyMarket::getProductId,productId));
shopProductToBookLabelDao.delete(new LambdaQueryWrapper<ShopProductToBookLabel>().eq(ShopProductToBookLabel::getProductId,productId));
shopProductToBookMarketDao.delete(new LambdaQueryWrapper<ShopProductToBookMarket>().eq(ShopProductToBookMarket::getProductId,productId));
shopProductBookDao.delete(new LambdaQueryWrapper<ShopProductBookEntity>().eq(ShopProductBookEntity::getProductId, productId));
shopProductCourseDao.delete(new LambdaQueryWrapper<ShopProductCourseEntity>().eq(ShopProductCourseEntity::getProductId,productId));
this.removeById(productId);
return R.ok();
}
@Override
public Map<String, Object> getProductToLabel(Integer productId) {
HashMap<String, Object> flag = new HashMap<>();

View File

@@ -0,0 +1,13 @@
package com.peanut.modules.sociology.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController("sociologyUser")
@RequestMapping("sociology/user")
public class UserController {
}