Merge remote-tracking branch 'origin/wzj-main' into wzj-main
# Conflicts: # ruoyi-modules/ruoyi-order/src/main/java/com/wzj/soopin/order/service/impl/OrderServiceImpl.java
This commit is contained in:
commit
b14a8ecfae
@ -6,6 +6,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.web.service.IndexService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
@ -25,6 +26,9 @@ public class IndexController {
|
||||
@Autowired
|
||||
private OrderService orderService;
|
||||
|
||||
@Autowired
|
||||
private IndexService indexService;
|
||||
|
||||
/**
|
||||
* 访问首页,提示语
|
||||
*/
|
||||
@ -40,7 +44,7 @@ public class IndexController {
|
||||
|
||||
@GetMapping("/count")
|
||||
public R getCount() {
|
||||
return R.ok(orderService.getCount());
|
||||
return R.ok(indexService.getCount());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,9 @@
|
||||
package org.dromara.web.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface IndexService {
|
||||
|
||||
Map<String, Object> getCount();
|
||||
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
package org.dromara.web.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wzj.soopin.content.mapper.VlogMapper;
|
||||
import com.wzj.soopin.goods.mapper.ProductMapper;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.po.Withdraw;
|
||||
import com.wzj.soopin.member.service.impl.FeedbackServiceImpl;
|
||||
import com.wzj.soopin.member.service.impl.MemberServiceImpl;
|
||||
import com.wzj.soopin.member.service.impl.WithdrawServiceImpl;
|
||||
import com.wzj.soopin.order.mapper.OrderMapper;
|
||||
import org.dromara.system.mapper.SysIntegralHistoryMapper;
|
||||
import org.dromara.system.mapper.SysTenantMapper;
|
||||
import org.dromara.system.mapper.SystemStatisticsMapper;
|
||||
import org.dromara.web.service.IndexService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class IndexServiceImpl implements IndexService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private SysTenantMapper sysTenantMapper;
|
||||
|
||||
@Autowired
|
||||
private VlogMapper vlogMapper;
|
||||
|
||||
@Autowired
|
||||
private MemberServiceImpl memberService;
|
||||
|
||||
@Autowired
|
||||
private FeedbackServiceImpl feedbackService;
|
||||
|
||||
@Autowired
|
||||
private WithdrawServiceImpl withdrawService;
|
||||
|
||||
@Autowired
|
||||
private SystemStatisticsMapper systemStatisticsMapper;
|
||||
|
||||
@Autowired
|
||||
private SysIntegralHistoryMapper sysIntegralHistoryMapper;
|
||||
|
||||
@Autowired
|
||||
private ProductMapper productMapper;
|
||||
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCount() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("memberCount", memberService.count()); //用户数量
|
||||
result.put("vlogCount", vlogMapper.countVlog()); //待审核视频
|
||||
|
||||
// 待审核举报统计
|
||||
QueryWrapper<Feedback> FeedbackWrapper = new QueryWrapper<>();
|
||||
FeedbackWrapper.eq("status", 0);
|
||||
result.put("feedbackCount", feedbackService.count(FeedbackWrapper));
|
||||
// 待审核提现统计
|
||||
QueryWrapper<Withdraw> withdrawQueryWrapper = new QueryWrapper<>();
|
||||
withdrawQueryWrapper.eq("audit_status", 0);
|
||||
result.put("WithdrawCount", withdrawService.count(withdrawQueryWrapper));
|
||||
|
||||
// 商品统计、待审核商品统计
|
||||
Map<String, Object> productCounts = productMapper.countProduct();
|
||||
result.put("productCount", productCounts.get("count1"));
|
||||
result.put("productAudit", productCounts.get("count2"));
|
||||
|
||||
// 店铺统计、待审核店铺统计
|
||||
Map<String, Object> StoreCounts = sysTenantMapper.countProduct();
|
||||
result.put("storeCount", StoreCounts.get("count1"));
|
||||
result.put("StoreAudit", StoreCounts.get("count2"));
|
||||
|
||||
// 订单统计、待审核退款统计
|
||||
Map<String, Object> OrderCounts = orderMapper.countOrder();
|
||||
result.put("orderCount", OrderCounts.get("count1"));
|
||||
result.put("orderAudit", OrderCounts.get("count2"));
|
||||
|
||||
// 店铺TOP20
|
||||
List<Map<String, Object>> top20Stores = sysTenantMapper.getTop20Stores();
|
||||
result.put("top20Stores", top20Stores);
|
||||
|
||||
// 商品TOP20
|
||||
List<Map<String, Object>> top20Product = productMapper.getTop20Product();
|
||||
result.put("top20Product", top20Product);
|
||||
|
||||
// 分月用户量统计
|
||||
List<Map<String, Object>> monthlyUserVolume = systemStatisticsMapper.getMonthlyUserVolume();
|
||||
result.put("monthlyUserVolume", monthlyUserVolume);
|
||||
|
||||
// 分月短视频统计
|
||||
List<Map<String, Object>> monthlyVlog = vlogMapper.getMonthlyVlog();
|
||||
result.put("monthlyVlog", monthlyVlog);
|
||||
|
||||
// 分月收入支出统计
|
||||
List<Map<String, Object>> monthlyIncomeExpense = sysIntegralHistoryMapper.getIncomeExpense();
|
||||
result.put("monthlyIncomeExpense", monthlyIncomeExpense);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -37,7 +37,7 @@ import java.util.List;
|
||||
*/
|
||||
@Tag(name ="商品信息接口列表")
|
||||
@RestController
|
||||
@RequestMapping("/pms/product")
|
||||
@RequestMapping("/pms/product")
|
||||
public class ProductController extends BaseController {
|
||||
@Autowired
|
||||
private ProductServiceImpl service;
|
||||
@ -66,7 +66,7 @@ public class ProductController extends BaseController {
|
||||
@Tag(name ="获取商品信息详细信息")
|
||||
@GetMapping(value = "/{id}")
|
||||
public R getInfo(@PathVariable("id") Long id) {
|
||||
return R.ok(service.getById(id));
|
||||
return R.ok(service.selectById(id));
|
||||
}
|
||||
|
||||
@Tag(name ="新增商品信息")
|
||||
@ -90,4 +90,20 @@ public class ProductController extends BaseController {
|
||||
public R remove(@PathVariable Long id) {
|
||||
return R.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
|
||||
@Tag(name ="审核商品")
|
||||
@Log(title = "审核商品", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/audit")
|
||||
public R audit( @RequestParam Long id, @RequestParam Integer authFlag,@RequestParam(required = false) String reasons) {
|
||||
return R.ok(service.audit(id,authFlag,reasons));
|
||||
}
|
||||
|
||||
@Tag(name ="上下架商品")
|
||||
@Log(title = "上下架商品", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/publish")
|
||||
public R publish( @RequestParam Long id, @RequestParam Integer publishStatus) {
|
||||
return R.ok(service.publish(id,publishStatus));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,23 +23,10 @@ public class BrandBo {
|
||||
private String logo;
|
||||
|
||||
public Wrapper<Brand> toWrapper() {
|
||||
LambdaQueryWrapper<Brand> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (nameLike != null && !nameLike.isEmpty()) {
|
||||
queryWrapper.like(Brand::getName, nameLike);
|
||||
}
|
||||
|
||||
// 精确匹配字段
|
||||
if (sort != null) {
|
||||
queryWrapper.eq(Brand::getSort, sort);
|
||||
}
|
||||
if (showStatus != null) {
|
||||
queryWrapper.eq(Brand::getShowStatus, showStatus);
|
||||
}
|
||||
if (logo != null && !logo.isEmpty()) {
|
||||
queryWrapper.eq(Brand::getLogo, logo);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<Brand>()
|
||||
.like(nameLike!= null &&!nameLike.isEmpty(), Brand::getName, nameLike)
|
||||
.eq(sort!= null, Brand::getSort, sort)
|
||||
.eq(showStatus!= null, Brand::getShowStatus, showStatus)
|
||||
.eq(logo!= null &&!logo.isEmpty(), Brand::getLogo, logo);
|
||||
}
|
||||
}
|
||||
|
@ -85,70 +85,24 @@ public class ProductBo {
|
||||
private String contactPhone;
|
||||
|
||||
public Wrapper<Product> toWrapper() {
|
||||
LambdaQueryWrapper<Product> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 精确匹配字段
|
||||
if (brandId != null) {
|
||||
queryWrapper.eq(Product::getBrandId, brandId);
|
||||
}
|
||||
if (categoryId != null) {
|
||||
queryWrapper.eq(Product::getCategoryId, categoryId);
|
||||
}
|
||||
if (outProductId != null && !outProductId.isEmpty()) {
|
||||
queryWrapper.eq(Product::getOutProductId, outProductId);
|
||||
}
|
||||
if (pic != null && !pic.isEmpty()) {
|
||||
queryWrapper.eq(Product::getPic, pic);
|
||||
}
|
||||
if (albumPics != null && !albumPics.isEmpty()) {
|
||||
queryWrapper.eq(Product::getAlbumPics, albumPics);
|
||||
}
|
||||
if (publishStatus != null) {
|
||||
queryWrapper.eq(Product::getPublishStatus, publishStatus);
|
||||
}
|
||||
if (sort != null) {
|
||||
queryWrapper.eq(Product::getSort, sort);
|
||||
}
|
||||
if (price != null) {
|
||||
queryWrapper.eq(Product::getPrice, price);
|
||||
}
|
||||
if (unit != null && !unit.isEmpty()) {
|
||||
queryWrapper.eq(Product::getUnit, unit);
|
||||
}
|
||||
if (productAttr != null && !productAttr.isEmpty()) {
|
||||
queryWrapper.eq(Product::getProductAttr, productAttr);
|
||||
}
|
||||
if (weight != null) {
|
||||
queryWrapper.eq(Product::getWeight, weight);
|
||||
}
|
||||
if (detailHtml != null && !detailHtml.isEmpty()) {
|
||||
queryWrapper.eq(Product::getDetailHtml, detailHtml);
|
||||
}
|
||||
if (detailMobileHtml != null && !detailMobileHtml.isEmpty()) {
|
||||
queryWrapper.eq(Product::getDetailMobileHtml, detailMobileHtml);
|
||||
}
|
||||
|
||||
// 模糊匹配字段
|
||||
if (nameLike != null && !nameLike.isEmpty()) {
|
||||
queryWrapper.like(Product::getName, nameLike);
|
||||
}
|
||||
if (brandNameLike != null && !brandNameLike.isEmpty()) {
|
||||
queryWrapper.like(Product::getBrandName, brandNameLike);
|
||||
}
|
||||
if (productCategoryNameLike != null && !productCategoryNameLike.isEmpty()) {
|
||||
queryWrapper.like(Product::getProductCategoryName, productCategoryNameLike);
|
||||
}
|
||||
|
||||
// 排除ID列表
|
||||
if (excludeProductIds != null && !excludeProductIds.isEmpty()) {
|
||||
queryWrapper.notIn(Product::getId, excludeProductIds);
|
||||
}
|
||||
|
||||
// 指定ID列表
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
queryWrapper.in(Product::getId, ids);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<Product>()
|
||||
.eq(brandId != null, Product::getBrandId, brandId)
|
||||
.eq(categoryId != null, Product::getCategoryId, categoryId)
|
||||
.eq(outProductId != null && !outProductId.isEmpty(), Product::getOutProductId, outProductId)
|
||||
.eq(pic != null && !pic.isEmpty(), Product::getPic, pic)
|
||||
.eq(albumPics != null && !albumPics.isEmpty(), Product::getAlbumPics, albumPics)
|
||||
.eq(publishStatus != null, Product::getPublishStatus, publishStatus)
|
||||
.eq(sort != null, Product::getSort, sort)
|
||||
.eq(price != null, Product::getPrice, price)
|
||||
.eq(unit != null && !unit.isEmpty(), Product::getUnit, unit)
|
||||
.eq(productAttr != null && !productAttr.isEmpty(), Product::getProductAttr, productAttr)
|
||||
.eq(weight != null, Product::getWeight, weight)
|
||||
.eq(detailHtml != null && !detailHtml.isEmpty(), Product::getDetailHtml, detailHtml)
|
||||
.eq(detailMobileHtml != null && !detailMobileHtml.isEmpty(), Product::getDetailMobileHtml, detailMobileHtml)
|
||||
.like(nameLike != null && !nameLike.isEmpty(), Product::getName, nameLike)
|
||||
.like(brandNameLike != null && !brandNameLike.isEmpty(), Product::getBrandName, brandNameLike)
|
||||
.like(productCategoryNameLike != null && !productCategoryNameLike.isEmpty(), Product::getProductCategoryName, productCategoryNameLike)
|
||||
.notIn(excludeProductIds != null && !excludeProductIds.isEmpty(), Product::getId, excludeProductIds)
|
||||
.in(ids != null && !ids.isEmpty(), Product::getId, ids);
|
||||
}
|
||||
}
|
||||
|
@ -32,30 +32,12 @@ public class ProductCategoryBo {
|
||||
private String icon;
|
||||
|
||||
public Wrapper<ProductCategory> toWrapper() {
|
||||
LambdaQueryWrapper<ProductCategory> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 精确匹配字段
|
||||
if (parentId != null) {
|
||||
queryWrapper.eq(ProductCategory::getParentId, parentId);
|
||||
}
|
||||
if (level != null) {
|
||||
queryWrapper.eq(ProductCategory::getLevel, level);
|
||||
}
|
||||
if (showStatus != null) {
|
||||
queryWrapper.eq(ProductCategory::getShowStatus, showStatus);
|
||||
}
|
||||
if (sort != null) {
|
||||
queryWrapper.eq(ProductCategory::getSort, sort);
|
||||
}
|
||||
if (icon != null && !icon.isEmpty()) {
|
||||
queryWrapper.eq(ProductCategory::getIcon, icon);
|
||||
}
|
||||
|
||||
// 模糊匹配字段
|
||||
if (nameLike != null && !nameLike.isEmpty()) {
|
||||
queryWrapper.like(ProductCategory::getName, nameLike);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<ProductCategory>()
|
||||
.eq(parentId != null, ProductCategory::getParentId, parentId)
|
||||
.eq(level != null, ProductCategory::getLevel, level)
|
||||
.eq(showStatus != null, ProductCategory::getShowStatus, showStatus)
|
||||
.eq(sort != null, ProductCategory::getSort, sort)
|
||||
.eq(icon != null && !icon.isEmpty(), ProductCategory::getIcon, icon)
|
||||
.like(nameLike != null && !nameLike.isEmpty(), ProductCategory::getName, nameLike);
|
||||
}
|
||||
}
|
||||
|
@ -32,25 +32,11 @@ public class SkuBo {
|
||||
private String productName;
|
||||
|
||||
public Wrapper<Sku> toWrapper() {
|
||||
LambdaQueryWrapper<Sku> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 精确匹配字段
|
||||
if (productId != null) {
|
||||
queryWrapper.eq(Sku::getProductId, productId);
|
||||
}
|
||||
if (outSkuId != null && !outSkuId.isEmpty()) {
|
||||
queryWrapper.eq(Sku::getOutSkuId, outSkuId);
|
||||
}
|
||||
if (price != null) {
|
||||
queryWrapper.eq(Sku::getPrice, price);
|
||||
}
|
||||
if (pic != null && !pic.isEmpty()) {
|
||||
queryWrapper.eq(Sku::getPic, pic);
|
||||
}
|
||||
if (spData != null && !spData.isEmpty()) {
|
||||
queryWrapper.eq(Sku::getSpData, spData);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<Sku>()
|
||||
.eq(productId != null, Sku::getProductId, productId)
|
||||
.eq(outSkuId != null && !outSkuId.isEmpty(), Sku::getOutSkuId, outSkuId)
|
||||
.eq(price != null, Sku::getPrice, price)
|
||||
.eq(pic != null && !pic.isEmpty(), Sku::getPic, pic)
|
||||
.eq(spData != null && !spData.isEmpty(), Sku::getSpData, spData);
|
||||
}
|
||||
}
|
||||
|
@ -101,4 +101,8 @@ public class Product extends BaseAudit {
|
||||
@Schema(description = "销量")
|
||||
@Excel(name = "销量")
|
||||
private String sales;
|
||||
|
||||
@Schema(description = "驳回原因")
|
||||
@Excel(name = "驳回原因")
|
||||
private String reasons;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.goods.domain.bo.ProductBo;
|
||||
import com.wzj.soopin.goods.domain.entity.Product;
|
||||
import com.wzj.soopin.goods.domain.vo.ProductVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@ -17,6 +18,7 @@ import java.util.Map;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProductMapper extends BaseMapper<Product> {
|
||||
/**
|
||||
* 查询商品信息列表
|
||||
@ -45,6 +47,6 @@ public interface ProductMapper extends BaseMapper<Product> {
|
||||
"LIMIT 20")
|
||||
List<Map<String, Object>> getTop20Product();
|
||||
|
||||
// @Select("SELECT COUNT(*) FROM pms_product WHERE auth_flag = 1")
|
||||
// Object AuditProduct();
|
||||
|
||||
ProductVO selectProductWithSkus(@Param("id") Long id);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.goods.domain.bo.SkuBo;
|
||||
import com.wzj.soopin.goods.domain.entity.Sku;
|
||||
import com.wzj.soopin.goods.domain.vo.SkuVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
@ -16,6 +17,7 @@ import java.util.List;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper
|
||||
public interface SkuMapper extends BaseMapper<Sku> {
|
||||
/**
|
||||
* 查询sku信息列表
|
||||
@ -28,4 +30,7 @@ public interface SkuMapper extends BaseMapper<Sku> {
|
||||
int updateStockById(@Param("skuId")Long skuId, @Param("optDate")LocalDateTime optDate, @Param("quantity")Integer quantity);
|
||||
|
||||
IPage<SkuVO> getlist(@Param("page") Page<Sku> page,@Param("query") SkuBo query);
|
||||
|
||||
|
||||
SkuVO selectSkuByid(@Param("id") Long id);
|
||||
}
|
||||
|
@ -23,79 +23,5 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand> implements BrandService {
|
||||
@Autowired
|
||||
private BrandMapper brandMapper;
|
||||
|
||||
/**
|
||||
* 查询品牌管理
|
||||
*
|
||||
* @param id 品牌管理主键
|
||||
* @return 品牌管理
|
||||
*/
|
||||
public Brand selectById(Long id) {
|
||||
return brandMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询品牌管理列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 品牌管理
|
||||
*/
|
||||
public List<Brand> selectList(BrandQuery query, Pageable page) {
|
||||
// if (page != null) {
|
||||
// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
// }
|
||||
QueryWrapper<Brand> qw = new QueryWrapper<>();
|
||||
String nameLike = query.getNameLike();
|
||||
if (!StringUtils.isEmpty(nameLike)) {
|
||||
qw.like("name", nameLike);
|
||||
}
|
||||
Integer sort = query.getSort();
|
||||
if (sort != null) {
|
||||
qw.eq("sort", sort);
|
||||
}
|
||||
Integer showStatus = query.getShowStatus();
|
||||
if (showStatus != null) {
|
||||
qw.eq("show_status", showStatus);
|
||||
}
|
||||
String logo = query.getLogo();
|
||||
if (!StringUtils.isEmpty(logo)) {
|
||||
qw.eq("logo", logo);
|
||||
}
|
||||
qw.orderByAsc("sort");
|
||||
return brandMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增品牌管理
|
||||
*
|
||||
* @param brand 品牌管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(Brand brand) {
|
||||
brand.setCreateTime(LocalDateTime.now());
|
||||
return brandMapper.insert(brand);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改品牌管理
|
||||
*
|
||||
* @param brand 品牌管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(Brand brand) {
|
||||
return brandMapper.updateById(brand);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除品牌管理信息
|
||||
*
|
||||
* @param id 品牌管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return brandMapper.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
@ -36,213 +36,5 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
public class ProductCategoryServiceImpl extends ServiceImpl<ProductCategoryMapper, ProductCategory> implements ProductCategoryService {
|
||||
@Autowired
|
||||
private ProductCategoryMapper productCategoryMapper;
|
||||
@Autowired
|
||||
private ProductMapper productMapper;
|
||||
@Autowired
|
||||
private ProductCategoryConvert convert;
|
||||
@Autowired
|
||||
private ProductConvert productConvert;
|
||||
|
||||
/**
|
||||
* 查询商品分类
|
||||
*
|
||||
* @param id 商品分类主键
|
||||
* @return 商品分类
|
||||
*/
|
||||
public ProductCategory selectById(Long id) {
|
||||
return productCategoryMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品分类列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 商品分类
|
||||
*/
|
||||
// public List<ProductCategoryVO> selectList(ProductCategoryQuery query, Pageable page) {
|
||||
//// if (page != null) {
|
||||
//// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
//// }
|
||||
// QueryWrapper<ProductCategory> qw = new QueryWrapper<>();
|
||||
// Long parentId = query.getParentId();
|
||||
// if (parentId != null) {
|
||||
// qw.eq("parent_id", parentId);
|
||||
// }
|
||||
// String nameLike = query.getNameLike();
|
||||
// if (!StringUtils.isEmpty(nameLike)) {
|
||||
// qw.like("name", nameLike);
|
||||
// }
|
||||
// Integer level = query.getLevel();
|
||||
// if (level != null) {
|
||||
// qw.eq("level", level);
|
||||
// }
|
||||
// Integer showStatus = query.getShowStatus();
|
||||
// if (showStatus != null) {
|
||||
// qw.eq("show_status", showStatus);
|
||||
// }
|
||||
// Integer sort = query.getSort();
|
||||
// if (sort != null) {
|
||||
// qw.eq("sort", sort);
|
||||
// }
|
||||
// String icon = query.getIcon();
|
||||
// if (!StringUtils.isEmpty(icon)) {
|
||||
// qw.eq("icon", icon);
|
||||
// }
|
||||
// qw.orderByAsc("sort");
|
||||
//
|
||||
// List<ProductCategory> productCategories = productCategoryMapper.selectList(qw);
|
||||
// List<ProductCategoryVO> productCategoryVOS = convert.dos2vos(productCategories);
|
||||
// return formatTree(productCategoryVOS);
|
||||
//
|
||||
// }
|
||||
|
||||
private List<ProductCategoryVO> formatTree(List<ProductCategoryVO> nodes) {
|
||||
List<ProductCategoryVO> tree = new ArrayList<>();
|
||||
List<ProductCategoryVO> children = new ArrayList<>();
|
||||
// 1)先获取到所有根节点
|
||||
for (ProductCategoryVO node : nodes) {
|
||||
if (node.getParentId() == null || node.getParentId() == 0) {
|
||||
tree.add(node);
|
||||
} else {
|
||||
children.add(node);
|
||||
}
|
||||
}
|
||||
// 2)把所有除根结点外的节点作为子节点,然后遍历每一个根节点
|
||||
for (ProductCategoryVO node : tree) {
|
||||
// 3)递归构建此根的子节点
|
||||
recur(node, children);
|
||||
}
|
||||
return tree;
|
||||
}
|
||||
|
||||
private void recur(ProductCategoryVO rootNode, List<ProductCategoryVO> children) {
|
||||
// 1)遍历剩余子节点,找出当前根的子节点
|
||||
for (ProductCategoryVO node : children) {
|
||||
// 2)如果子节点的父id等于根节点的id,那么就将这个节点加到根节点的children列表中
|
||||
if (rootNode.getId() == node.getParentId()) {
|
||||
if (rootNode.getChildren() == null) {
|
||||
rootNode.setChildren(new ArrayList<>());
|
||||
}
|
||||
rootNode.getChildren().add(node);
|
||||
// 3)以当前节点作为根节点进行递归,检查是否还有子节点。
|
||||
recur(node, children);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增商品分类
|
||||
*
|
||||
* @param productCategory 商品分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(ProductCategory productCategory) {
|
||||
productCategory.setCreateTime(LocalDateTime.now());
|
||||
return productCategoryMapper.insert(productCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品分类
|
||||
*
|
||||
* @param productCategory 商品分类
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(ProductCategory productCategory) {
|
||||
return productCategoryMapper.updateById(productCategory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品分类信息
|
||||
*
|
||||
* @param id 商品分类主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return productCategoryMapper.deleteById(id);
|
||||
}
|
||||
//
|
||||
// public List<CategoryDTO> queryCategoryWithProductsForH5() {
|
||||
// QueryWrapper<ProductCategory> qw1 = new QueryWrapper<>();
|
||||
//// qw1.eq("level", 0);
|
||||
// qw1.eq("show_status", 1);
|
||||
// Page<ProductCategory> pageReq = new Page<>();
|
||||
// pageReq.setCurrent(1L)
|
||||
// .setSize(10)
|
||||
// .setOrders(Collections.singletonList(OrderItem.desc("sort")));
|
||||
// List<ProductCategory> categories = productCategoryMapper.selectPage(pageReq, qw1).getRecords();
|
||||
// if (CollUtil.isEmpty(categories)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// ;
|
||||
// return categories.stream().map(it -> {
|
||||
// CategoryDTO dto = convert.do2dto(it);
|
||||
// // 寻找该分类下的所有子类
|
||||
// List<Long> allChildCate = queryAllChildCate(Collections.singletonList(it.getId()), 0);
|
||||
// QueryWrapper<Product> qw = new QueryWrapper<>();
|
||||
// qw.select("id", "pic", "name", "price", "category_id");
|
||||
// qw.in("category_id", allChildCate);
|
||||
// qw.le("sort", 100);
|
||||
// List<Product> categoryId2List = productMapper.selectList(qw);
|
||||
// dto.setProductList(productConvert.dos2dtos(categoryId2List));
|
||||
// return dto;
|
||||
// }).collect(Collectors.toList());
|
||||
// }
|
||||
|
||||
private List<Long> queryAllChildCate(List<Long> categoryIds, int level) {
|
||||
List<Long> res = new ArrayList<>();
|
||||
QueryWrapper<ProductCategory> qw = new QueryWrapper<>();
|
||||
qw.select("id");
|
||||
List<Long> ids = categoryIds;
|
||||
while (true) {
|
||||
qw.clear();
|
||||
qw.in("parent_id", ids);
|
||||
qw.eq("level", level + 1);
|
||||
qw.eq("show_status", 1);
|
||||
ids = productCategoryMapper.selectList(qw).stream().map(ProductCategory::getId).collect(Collectors.toList());
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
break;
|
||||
}
|
||||
res.addAll(ids);
|
||||
level++;
|
||||
}
|
||||
res.addAll(categoryIds);
|
||||
return res;
|
||||
}
|
||||
|
||||
public List<ProductCategory> h5Categories() {
|
||||
QueryWrapper<ProductCategory> qw = new QueryWrapper<>();
|
||||
qw.select("id", "parent_id", "name", "level", "sort", "icon");
|
||||
qw.eq("show_status", 1);
|
||||
// qw.le("level", 2);
|
||||
return productCategoryMapper.selectList(qw);
|
||||
}
|
||||
|
||||
public List<ProductCategory> getBrotherAndChild(Long id, boolean withChild) {
|
||||
ProductCategory category = productCategoryMapper.selectById(id);
|
||||
if (category == null) {
|
||||
throw new BaseException("参数错误");
|
||||
}
|
||||
LambdaQueryWrapper<ProductCategory> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(ProductCategory::getParentId, category.getParentId());
|
||||
qw.eq(ProductCategory::getLevel, category.getLevel());
|
||||
qw.eq(ProductCategory::getShowStatus, 1);
|
||||
qw.select(ProductCategory::getId, ProductCategory::getParentId, ProductCategory::getName, ProductCategory::getLevel, ProductCategory::getSort, ProductCategory::getIcon);
|
||||
List<ProductCategory> res = productCategoryMapper.selectList(qw);
|
||||
if (withChild) {
|
||||
qw.clear();
|
||||
qw.eq(ProductCategory::getParentId, category.getId());
|
||||
qw.eq(ProductCategory::getLevel, category.getLevel() + 1);
|
||||
qw.eq(ProductCategory::getShowStatus, 1);
|
||||
List<ProductCategory> childs = productCategoryMapper.selectList(qw);
|
||||
res.addAll(childs);
|
||||
}
|
||||
if (category.getParentId() != null && category.getParentId() != -1) {
|
||||
res.add(productCategoryMapper.selectById(category.getParentId()));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
@ -43,12 +43,27 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
@Autowired
|
||||
private ProductMapper productMapper;
|
||||
|
||||
@Autowired
|
||||
private SkuMapper skuMapper;
|
||||
@Autowired
|
||||
private BrandMapper brandMapper;
|
||||
@Autowired
|
||||
private ProductConvert convert;
|
||||
@Override
|
||||
public IPage<ProductVO> getList(ProductBo query, Page<Product> page) {
|
||||
IPage<ProductVO> resultPage = productMapper.getlist(page,query);
|
||||
return resultPage;
|
||||
}
|
||||
public Product audit(Long id, Integer authFlag,String reasons) {
|
||||
Product productToUpdate = new Product();
|
||||
productToUpdate.setId(id);
|
||||
productToUpdate.setAuthFlag(authFlag);
|
||||
productToUpdate.setReasons(reasons);
|
||||
productMapper.updateById(productToUpdate);
|
||||
return productToUpdate;
|
||||
}
|
||||
|
||||
public Product publish(Long id, Integer publishStatus) {
|
||||
Product product = new Product();
|
||||
product.setId(id);
|
||||
product.setPublishStatus(publishStatus);
|
||||
productMapper.updateById(product);
|
||||
return product;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品信息
|
||||
@ -56,166 +71,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
* @param id 商品信息主键
|
||||
* @return 商品信息
|
||||
*/
|
||||
// public ProductVO selectById(Long id) {
|
||||
// Product product = productMapper.selectById(id);
|
||||
// ProductVO productVO = convert.do2vo(product);
|
||||
// QueryWrapper<Sku> qw = new QueryWrapper<>();
|
||||
// qw.eq("product_id", product.getId());
|
||||
// List<Sku> skus = skuMapper.selectList(qw);
|
||||
// productVO.setSkuList(skus);
|
||||
// return productVO;
|
||||
// }
|
||||
public ProductVO selectById(Long id) {
|
||||
return productMapper.selectProductWithSkus(id);
|
||||
|
||||
/**
|
||||
* 查询商品信息列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 商品信息
|
||||
*/
|
||||
public List<Product> selectList(ProductQuery query, Pageable page) {
|
||||
// if (page != null) {
|
||||
// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
// }
|
||||
QueryWrapper<Product> qw = new QueryWrapper<>();
|
||||
if (StringUtils.isNoneEmpty(query.getOrderField())){
|
||||
if (StringUtils.isNotEmpty(query.getOrderSort()) && "desc".equalsIgnoreCase(query.getOrderSort())) {
|
||||
qw.orderByDesc(query.getOrderField());
|
||||
} else {
|
||||
qw.orderByAsc(query.getOrderField());
|
||||
}
|
||||
}else {
|
||||
qw.orderByDesc("publish_status");
|
||||
qw.orderByAsc("sort");
|
||||
}
|
||||
Long categoryId = query.getCategoryId();
|
||||
if (categoryId != null) {
|
||||
qw.eq("category_id", categoryId);
|
||||
}
|
||||
Integer publishStatus = query.getPublishStatus();
|
||||
if (publishStatus != null) {
|
||||
qw.eq("publish_status", publishStatus);
|
||||
}
|
||||
String search = query.getSearch();
|
||||
if (StringUtils.isNoneEmpty(search)){
|
||||
qw.like("name", "%".concat(query.getSearch().trim()).concat("%"));
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(query.getExcludeProductIds())) {
|
||||
qw.notIn("id",query.getExcludeProductIds());
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(query.getIds())) {
|
||||
qw.in("id",query.getIds());
|
||||
}
|
||||
return productMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品信息
|
||||
*
|
||||
* @param productVO 商品信息
|
||||
* @return 结果
|
||||
*/
|
||||
// @Transactional
|
||||
// public int insert(ProductVO productVO) {
|
||||
//
|
||||
// Product product = convert.vo2do(productVO);
|
||||
// product.setCreateTime(LocalDateTime.now());
|
||||
// List<Sku> skuList = productVO.getSkuList();
|
||||
// productMapper.insert(product);
|
||||
// if(skuList!=null){
|
||||
// skuList.forEach(sku -> {
|
||||
// sku.setProductId(product.getId());
|
||||
// sku.setCreateTime(LocalDateTime.now());
|
||||
// skuMapper.insert(sku);
|
||||
// });
|
||||
// }
|
||||
// return 1;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 修改商品信息
|
||||
*
|
||||
* @param productVO 商品信息
|
||||
* @return 结果
|
||||
*/
|
||||
// @Transactional
|
||||
// public int update(ProductVO productVO) {
|
||||
// Product dbProduct = productMapper.selectById(productVO.getId());
|
||||
// List<Long> idList = productVO.getSkuList().stream().filter(it -> it.getId() != null).map(it -> it.getId()).collect(Collectors.toList());
|
||||
// if (dbProduct == null) {
|
||||
// return 0;
|
||||
// }
|
||||
//// Long userId = SecurityUtils.getUserId();
|
||||
// Product product = convert.vo2do(productVO);
|
||||
// List<Sku> skuList = productVO.getSkuList();
|
||||
//// product.setUpdateBy(userId);
|
||||
// product.setUpdateTime(LocalDateTime.now());
|
||||
// productMapper.updateById(product);
|
||||
// //查找库中所有的sku
|
||||
// Map<String,Object> map = new HashMap<>();
|
||||
// map.put("product_id", product.getId());
|
||||
// Map<Long, Sku> skuMap = skuMapper.selectByMap(map).stream().collect(Collectors.toMap(it -> it.getId(), it -> it));
|
||||
// //针对已有的进行编辑
|
||||
// List<Sku> updateList = productVO.getSkuList().stream().filter(it -> it.getId() != null).collect(Collectors.toList());
|
||||
// if (!CollectionUtil.isEmpty(updateList)) {
|
||||
// log.info("共有{}个sku需要修改,{},productId:{}",updateList.size(), JSONUtil.toJsonStr(updateList),productVO.getId());
|
||||
// updateList.forEach(it->{
|
||||
// Sku sku = skuMap.get(it.getId());
|
||||
//// sku.setUpdateBy(SecurityUtils.getUserId());
|
||||
// sku.setUpdateTime(LocalDateTime.now());
|
||||
// sku.setPrice(it.getPrice());
|
||||
// sku.setSpData(it.getSpData());
|
||||
// sku.setPic(it.getPic());
|
||||
// sku.setOutSkuId(it.getOutSkuId());
|
||||
// sku.setStock(it.getStock());
|
||||
// skuMapper.updateById(sku);
|
||||
// });
|
||||
// }
|
||||
// //针对没有的进行新增
|
||||
// List<Sku> addList = productVO.getSkuList().stream().filter(it -> it.getId() == null).collect(Collectors.toList());
|
||||
// if (!CollectionUtil.isEmpty(addList)) {
|
||||
// log.info("共有{}个sku需要新增,{},productId:{}",addList.size(), JSONUtil.toJsonStr(addList),productVO.getId());
|
||||
// addList.forEach(sku -> {
|
||||
// sku.setProductId(product.getId());
|
||||
// sku.setCreateTime(LocalDateTime.now());
|
||||
// skuMapper.insert(sku);
|
||||
// });
|
||||
// }
|
||||
// //删除
|
||||
// List<Long> deleteIds = skuMap.keySet().stream().filter(it -> !idList.contains(it)).collect(Collectors.toList());
|
||||
// if (!CollectionUtil.isEmpty(deleteIds)) {
|
||||
// log.info("共有{}个sku需要删除,{},productId:{}",deleteIds.size(), JSONUtil.toJsonStr(deleteIds),productVO.getId());
|
||||
// skuMapper.deleteBatchIds(deleteIds);
|
||||
// }
|
||||
// return 1;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除商品信息信息
|
||||
*
|
||||
* @param id 商品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return productMapper.deleteById(id);
|
||||
}
|
||||
|
||||
public ProductDetailVO queryDetail(Long id) {
|
||||
ProductDetailVO res = new ProductDetailVO();
|
||||
Product d = productMapper.selectById(id);
|
||||
res.setProduct(d);
|
||||
LambdaQueryWrapper<Sku> qw = new LambdaQueryWrapper<>();
|
||||
qw.eq(Sku::getProductId, id);
|
||||
res.setSkus(skuMapper.selectList(qw));
|
||||
if (d.getBrandId() != null) {
|
||||
res.setBrand(brandMapper.selectById(d.getBrandId()));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<ProductVO> getList(ProductBo query, Page<Product> page) {
|
||||
IPage<ProductVO> resultPage = productMapper.getlist(page,query);
|
||||
return resultPage;
|
||||
}
|
||||
}
|
||||
|
@ -28,84 +28,7 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuService {
|
||||
@Autowired
|
||||
private SkuMapper skuMapper;
|
||||
|
||||
/**
|
||||
* 查询sku信息
|
||||
*
|
||||
* @param id sku信息主键
|
||||
* @return sku信息
|
||||
*/
|
||||
public Sku selectById(Long id) {
|
||||
return skuMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询sku信息列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return sku信息
|
||||
*/
|
||||
public List<Sku> selectList(SkuQuery query, Pageable page) {
|
||||
// if (page != null) {
|
||||
// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
// }
|
||||
QueryWrapper<Sku> qw = new QueryWrapper<>();
|
||||
Long productId = query.getProductId();
|
||||
if (productId != null) {
|
||||
qw.eq("product_id", productId);
|
||||
}
|
||||
String outSkuId = query.getOutSkuId();
|
||||
if (!StringUtils.isEmpty(outSkuId)) {
|
||||
qw.eq("out_sku_id", outSkuId);
|
||||
}
|
||||
BigDecimal price = query.getPrice();
|
||||
if (price != null) {
|
||||
qw.eq("price", price);
|
||||
}
|
||||
String pic = query.getPic();
|
||||
if (!StringUtils.isEmpty(pic)) {
|
||||
qw.eq("pic", pic);
|
||||
}
|
||||
String spData = query.getSpData();
|
||||
if (!StringUtils.isEmpty(spData)) {
|
||||
qw.eq("sp_data", spData);
|
||||
}
|
||||
return skuMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增sku信息
|
||||
*
|
||||
* @param sku sku信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(Sku sku) {
|
||||
sku.setCreateTime(LocalDateTime.now());
|
||||
return skuMapper.insert(sku);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改sku信息
|
||||
*
|
||||
* @param sku sku信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(Sku sku) {
|
||||
return skuMapper.updateById(sku);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除sku信息信息
|
||||
*
|
||||
* @param id sku信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return skuMapper.deleteById(id);
|
||||
}
|
||||
@Autowired private SkuMapper skuMapper;
|
||||
|
||||
public IPage<SkuVO> getList(SkuBo query, Page<Sku> page) {
|
||||
IPage<SkuVO> resultPage = skuMapper.getlist(page,query);
|
||||
|
@ -99,4 +99,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
END
|
||||
</select>
|
||||
|
||||
<select id="selectProductWithSkus" resultMap="ProductWithSkusResultMap">
|
||||
SELECT
|
||||
p.*,
|
||||
s.id AS sku_id,
|
||||
s.out_sku_id,
|
||||
s.price,
|
||||
s.pic,
|
||||
s.stock,
|
||||
s.sp_data
|
||||
FROM
|
||||
pms_product p
|
||||
LEFT JOIN
|
||||
pms_sku s ON p.id = s.product_id
|
||||
WHERE
|
||||
p.id = #{id}
|
||||
</select>
|
||||
|
||||
<resultMap id="ProductWithSkusResultMap" type="ProductVO">
|
||||
<id property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="status" column="status"/>
|
||||
|
||||
<collection property="skuList" ofType="SkuVO">
|
||||
<id property="id" column="sku_id"/>
|
||||
<result property="outSkuId" column="out_sku_id"/>
|
||||
<result property="price" column="price"/>
|
||||
<result property="pic" column="pic"/>
|
||||
<result property="stock" column="stock"/>
|
||||
<result property="spData" column="sp_data"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
|
@ -71,4 +71,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
s.create_time DESC
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSkuByid" resultType="SkuVO">
|
||||
SELECT
|
||||
s.*,
|
||||
p.name AS productName
|
||||
FROM
|
||||
pms_sku s
|
||||
LEFT JOIN
|
||||
pms_product p ON s.product_id = p.id
|
||||
WHERE
|
||||
s.id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.order.convert.AftersaleConvert;
|
||||
import com.wzj.soopin.order.domain.bo.AftersaleBo;
|
||||
import com.wzj.soopin.order.service.AftersaleService;
|
||||
import com.wzj.soopin.order.domain.entity.Aftersale;
|
||||
import com.wzj.soopin.order.domain.form.DealWithAftersaleForm;
|
||||
import com.wzj.soopin.order.domain.vo.*;
|
||||
@ -37,14 +36,16 @@ import java.util.List;
|
||||
@RequestMapping("/oms/aftersale")
|
||||
@Slf4j
|
||||
public class AftersaleController extends BaseController {
|
||||
@Autowired
|
||||
private AftersaleServiceImpl service;
|
||||
@Autowired
|
||||
private AftersaleConvert convert;
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
@Autowired
|
||||
private AftersaleService aftersaleService;
|
||||
|
||||
private final AftersaleServiceImpl service;
|
||||
private final AftersaleConvert convert;
|
||||
private final RedisService redisService;
|
||||
|
||||
public AftersaleController(AftersaleServiceImpl service, AftersaleConvert convert, RedisService redisService) {
|
||||
this.service = service;
|
||||
this.convert = convert;
|
||||
this.redisService = redisService;
|
||||
}
|
||||
|
||||
|
||||
@Tag(name ="查询订单售后列表")
|
||||
|
@ -49,13 +49,6 @@ public class AftersaleItemController extends BaseController {
|
||||
@Autowired
|
||||
private AftersaleItemService aftersaleItemService;
|
||||
|
||||
// @ApiOperation("查询订单售后列表")
|
||||
// @PostMapping("/list")
|
||||
// public ResponseEntity<Page<AftersaleItem>> list(@RequestBody AftersaleItemQuery query, Pageable page) {
|
||||
// List<AftersaleItem> list = service.selectList(query, page);
|
||||
// return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
// }
|
||||
|
||||
@Tag(name ="查询订单售后列表")
|
||||
@PostMapping("/list")
|
||||
public R<Page<AftersaleItemVO>> list(@RequestBody AftersaleItemBo query, Page<AftersaleItem> page) {
|
||||
|
@ -45,30 +45,12 @@ public class OrderController extends BaseController {
|
||||
private OrderService orderService;
|
||||
|
||||
|
||||
|
||||
|
||||
// @ApiOperation("查询订单列表")
|
||||
// @PostMapping("/list")
|
||||
// public R<Page<OrderVO>> list(@RequestBody OrderBo query, Page<Order> page) {
|
||||
// Page<Order> list = service.page(page,query.toWrapper() );
|
||||
// return R.ok(convert.toVO(list));
|
||||
// }
|
||||
|
||||
@Tag(name ="查询订单列表")
|
||||
@PostMapping("/list")
|
||||
public R<IPage<OrderVO>> list(@RequestBody OrderBo query, Page<Order> page){
|
||||
return R.ok(orderService.getlist(page,query));
|
||||
}
|
||||
|
||||
// @ApiOperation("查询订单表列表")
|
||||
// @PostMapping("/list")
|
||||
// public R<IPage<ManagerOrderVO>> list(@RequestBody ManagerOrderQueryForm query, IPage page) {
|
||||
// Page<Order> list = (Page<Order>) orderService.page(page,query.toWrapper() );
|
||||
// return R.ok(convert.toVO(list));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
@Tag(name ="修改收件人信息")
|
||||
@PostMapping("/receiver/update")
|
||||
public R updateReceiver(@RequestBody Order order) {
|
||||
|
@ -46,13 +46,6 @@ public class OrderDeliveryHistoryController extends BaseController {
|
||||
@Autowired
|
||||
private OrderDeliveryHistoryService historyService;
|
||||
|
||||
// @ApiOperation("查询订单发货记录列表")
|
||||
// @PostMapping("/list")
|
||||
// public ResponseEntity<Page<OrderDeliveryHistory>> list(@RequestBody OrderDeliveryHistoryQuery query, Pageable page) {
|
||||
// List<OrderDeliveryHistory> list = service.selectList(query, page);
|
||||
// return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
// }
|
||||
|
||||
@Tag(name ="查询订单发货列表")
|
||||
@PostMapping("/list")
|
||||
public R<IPage<OrderDeliveryHistoryVO>> list(@RequestBody OrderDeliveryHistoryBo query, Page<OrderDeliveryHistory> page) {
|
||||
|
@ -52,13 +52,6 @@ public class OrderItemController extends BaseController {
|
||||
@Autowired
|
||||
private OrderItemService orderItemService;
|
||||
|
||||
// @ApiOperation("查询订单中所包含的商品列表")
|
||||
// @PostMapping("/list")
|
||||
// public ResponseEntity<Page<OrderItem>> list(@RequestBody OrderItemQuery query, Pageable page) {
|
||||
// List<OrderItem> list = service.selectList(query, page);
|
||||
// return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
// }
|
||||
|
||||
@Tag(name = "查询订单中所包含的商品列表")
|
||||
@PostMapping("/list")
|
||||
public R<IPage<OrderItemVO>> list(@RequestBody OrderItemBo query, Page<OrderItem> page) {
|
||||
|
@ -42,15 +42,6 @@ public class OrderOperateHistoryController extends BaseController {
|
||||
private OrderOperateHistoryServiceImpl service;
|
||||
@Autowired
|
||||
private OrderOperateHistoryConvert convert;
|
||||
@Autowired
|
||||
private OrderOperateHistoryService orderOperateHistoryService;
|
||||
|
||||
// @ApiOperation("查询订单操作历史记录列表")
|
||||
// @PostMapping("/list")
|
||||
// public ResponseEntity<Page<OrderOperateHistory>> list(@RequestBody OrderOperateHistoryQuery query, Pageable page) {
|
||||
// List<OrderOperateHistory> list = service.selectList(query, page);
|
||||
// return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
// }
|
||||
|
||||
@Tag(name ="查询订单操作历史记录列表")
|
||||
@PostMapping("/list")
|
||||
|
@ -43,14 +43,6 @@ public class WechatPaymentHistoryController extends BaseController {
|
||||
private WechatPaymentHistoryConvert convert;
|
||||
@Autowired
|
||||
private WechatPaymentHistoryService wechatPaymentHistoryService;
|
||||
|
||||
// @ApiOperation("查询微信订单表列表")
|
||||
// @PostMapping("/list")
|
||||
// public ResponseEntity<Page<WechatPaymentHistory>> list(@RequestBody WechatPaymentHistoryQuery query, Pageable page) {
|
||||
// List<WechatPaymentHistory> list = service.selectList(query, page);
|
||||
// return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
|
||||
// }
|
||||
|
||||
@Tag(name ="查询微信订单表列表")
|
||||
@PostMapping("/list")
|
||||
public R<IPage<WechatPaymentHistoryVO>> list(@RequestBody WechatPaymentHistoryBo query, Page<WechatPaymentHistory> page) {
|
||||
|
@ -62,64 +62,21 @@ public class AftersaleBo {
|
||||
private LocalDateTime endTime;
|
||||
|
||||
public Wrapper<Aftersale> toWrapper() {
|
||||
LambdaQueryWrapper<Aftersale> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (memberId != null) {
|
||||
queryWrapper.eq(Aftersale::getMemberId, memberId);
|
||||
}
|
||||
|
||||
if (orderId != null) {
|
||||
queryWrapper.eq(Aftersale::getOrderId, orderId);
|
||||
}
|
||||
|
||||
if (returnAmount != null) {
|
||||
queryWrapper.eq(Aftersale::getReturnAmount, returnAmount);
|
||||
}
|
||||
|
||||
if (type != null) {
|
||||
queryWrapper.eq(Aftersale::getType, type);
|
||||
}
|
||||
|
||||
if (status != null) {
|
||||
queryWrapper.eq(Aftersale::getStatus, status);
|
||||
}
|
||||
|
||||
if (handleTime != null) {
|
||||
queryWrapper.eq(Aftersale::getHandleTime, handleTime);
|
||||
}
|
||||
|
||||
if (quantity != null) {
|
||||
queryWrapper.eq(Aftersale::getQuantity, quantity);
|
||||
}
|
||||
|
||||
if (reason != null && !reason.isEmpty()) {
|
||||
queryWrapper.eq(Aftersale::getReason, reason);
|
||||
}
|
||||
|
||||
if (description != null && !description.isEmpty()) {
|
||||
queryWrapper.eq(Aftersale::getDescription, description);
|
||||
}
|
||||
|
||||
if (proofPics != null && !proofPics.isEmpty()) {
|
||||
queryWrapper.eq(Aftersale::getProofPics, proofPics);
|
||||
}
|
||||
|
||||
if (handleNote != null && !handleNote.isEmpty()) {
|
||||
queryWrapper.eq(Aftersale::getHandleNote, handleNote);
|
||||
}
|
||||
|
||||
if (handleMan != null && !handleMan.isEmpty()) {
|
||||
queryWrapper.eq(Aftersale::getHandleMan, handleMan);
|
||||
}
|
||||
|
||||
if (startTime != null && endTime != null) {
|
||||
queryWrapper.between(Aftersale::getCreateTime, startTime, endTime);
|
||||
} else if (startTime != null) {
|
||||
queryWrapper.ge(Aftersale::getCreateTime, startTime);
|
||||
} else if (endTime != null) {
|
||||
queryWrapper.le(Aftersale::getCreateTime, endTime);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<Aftersale>()
|
||||
.eq(memberId != null, Aftersale::getMemberId, memberId)
|
||||
.eq(orderId != null, Aftersale::getOrderId, orderId)
|
||||
.eq(returnAmount != null, Aftersale::getReturnAmount, returnAmount)
|
||||
.eq(type != null, Aftersale::getType, type)
|
||||
.eq(status != null, Aftersale::getStatus, status)
|
||||
.eq(handleTime != null, Aftersale::getHandleTime, handleTime)
|
||||
.eq(quantity != null, Aftersale::getQuantity, quantity)
|
||||
.eq(reason != null && !reason.isEmpty(), Aftersale::getReason, reason)
|
||||
.eq(description != null && !description.isEmpty(), Aftersale::getDescription, description)
|
||||
.eq(proofPics != null && !proofPics.isEmpty(), Aftersale::getProofPics, proofPics)
|
||||
.eq(handleNote != null && !handleNote.isEmpty(), Aftersale::getHandleNote, handleNote)
|
||||
.eq(handleMan != null && !handleMan.isEmpty(), Aftersale::getHandleMan, handleMan)
|
||||
.between(startTime != null && endTime != null, Aftersale::getCreateTime, startTime, endTime)
|
||||
.ge(startTime != null && endTime == null, Aftersale::getCreateTime, startTime)
|
||||
.le(endTime != null && startTime == null, Aftersale::getCreateTime, endTime);
|
||||
}
|
||||
}
|
||||
|
@ -34,32 +34,12 @@ public class AftersaleItemBo {
|
||||
private Long aftersaleId;
|
||||
|
||||
public Wrapper<AftersaleItem> toWrapper() {
|
||||
LambdaQueryWrapper<AftersaleItem> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (memberId != null) {
|
||||
queryWrapper.eq(AftersaleItem::getMemberId, memberId);
|
||||
}
|
||||
|
||||
if (orderId != null) {
|
||||
queryWrapper.eq(AftersaleItem::getOrderId, orderId);
|
||||
}
|
||||
|
||||
if (orderItemId != null) {
|
||||
queryWrapper.eq(AftersaleItem::getOrderItemId, orderItemId);
|
||||
}
|
||||
|
||||
if (returnAmount != null) {
|
||||
queryWrapper.eq(AftersaleItem::getReturnAmount, returnAmount);
|
||||
}
|
||||
|
||||
if (quantity != null) {
|
||||
queryWrapper.eq(AftersaleItem::getQuantity, quantity);
|
||||
}
|
||||
|
||||
if (aftersaleId != null) {
|
||||
queryWrapper.eq(AftersaleItem::getAftersaleId, aftersaleId);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<AftersaleItem>()
|
||||
.eq(memberId != null, AftersaleItem::getMemberId, memberId)
|
||||
.eq(orderId != null, AftersaleItem::getOrderId, orderId)
|
||||
.eq(orderItemId != null, AftersaleItem::getOrderItemId, orderItemId)
|
||||
.eq(returnAmount != null, AftersaleItem::getReturnAmount, returnAmount)
|
||||
.eq(quantity != null, AftersaleItem::getQuantity, quantity)
|
||||
.eq(aftersaleId != null, AftersaleItem::getAftersaleId, aftersaleId);
|
||||
}
|
||||
}
|
||||
|
@ -129,44 +129,18 @@ public class OrderBo {
|
||||
private String memberPhoneEncrypted;
|
||||
|
||||
public Wrapper<Order> toWrapper() {
|
||||
LambdaQueryWrapper<Order> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 精确匹配字段
|
||||
if (memberId != null) {
|
||||
queryWrapper.eq(Order::getMemberId, memberId);
|
||||
}
|
||||
if (orderSn != null) {
|
||||
queryWrapper.eq(Order::getOrderSn, orderSn);
|
||||
}
|
||||
if (tenantId != null) {
|
||||
queryWrapper.eq(Order::getTenantId, tenantId);
|
||||
}
|
||||
if (payType != null) {
|
||||
queryWrapper.eq(Order::getPayType, payType);
|
||||
}
|
||||
if (status != null) {
|
||||
queryWrapper.eq(Order::getStatus, status);
|
||||
}
|
||||
if (aftersaleStatus != null) {
|
||||
queryWrapper.eq(Order::getAftersaleStatus, aftersaleStatus);
|
||||
}
|
||||
if (receiverPhone != null &&!receiverPhone.isEmpty()) {
|
||||
queryWrapper.eq(Order::getReceiverPhone, receiverPhone);
|
||||
}
|
||||
if (deleteStatus != null) {
|
||||
queryWrapper.eq(Order::getDeleteStatus, deleteStatus);
|
||||
}
|
||||
|
||||
// 时间范围查询
|
||||
if (startTime != null && endTime != null) {
|
||||
queryWrapper.between(Order::getCreateTime, startTime, endTime);
|
||||
} else if (startTime != null) {
|
||||
queryWrapper.ge(Order::getCreateTime, startTime);
|
||||
} else if (endTime != null) {
|
||||
queryWrapper.le(Order::getCreateTime, endTime);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<Order>()
|
||||
.eq(memberId != null, Order::getMemberId, memberId)
|
||||
.eq(orderSn != null, Order::getOrderSn, orderSn)
|
||||
.eq(tenantId != null, Order::getTenantId, tenantId)
|
||||
.eq(payType != null, Order::getPayType, payType)
|
||||
.eq(status != null, Order::getStatus, status)
|
||||
.eq(aftersaleStatus != null, Order::getAftersaleStatus, aftersaleStatus)
|
||||
.eq(receiverPhone != null && !receiverPhone.isEmpty(), Order::getReceiverPhone, receiverPhone)
|
||||
.eq(deleteStatus != null, Order::getDeleteStatus, deleteStatus)
|
||||
.between(startTime != null && endTime != null, Order::getCreateTime, startTime, endTime)
|
||||
.ge(startTime != null && endTime == null, Order::getCreateTime, startTime)
|
||||
.le(endTime != null && startTime == null, Order::getCreateTime, endTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -22,20 +22,11 @@ public class OrderDeliveryHistoryBo {
|
||||
private String deliverySn;
|
||||
|
||||
public Wrapper<OrderDeliveryHistory> toWrapper() {
|
||||
LambdaQueryWrapper<OrderDeliveryHistory> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (orderId != null) {
|
||||
queryWrapper.eq(OrderDeliveryHistory::getOrderId, orderId);
|
||||
}
|
||||
|
||||
if (deliveryCompany != null && !deliveryCompany.isEmpty()) {
|
||||
queryWrapper.eq(OrderDeliveryHistory::getDeliveryCompany, deliveryCompany);
|
||||
}
|
||||
|
||||
if (deliverySn != null && !deliverySn.isEmpty()) {
|
||||
queryWrapper.eq(OrderDeliveryHistory::getDeliverySn, deliverySn);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<OrderDeliveryHistory>()
|
||||
.eq(orderId != null, OrderDeliveryHistory::getOrderId, orderId)
|
||||
.eq(deliveryCompany != null && !deliveryCompany.isEmpty(),
|
||||
OrderDeliveryHistory::getDeliveryCompany, deliveryCompany)
|
||||
.eq(deliverySn != null && !deliverySn.isEmpty(),
|
||||
OrderDeliveryHistory::getDeliverySn, deliverySn);
|
||||
}
|
||||
}
|
||||
|
@ -54,64 +54,20 @@ public class OrderItemBo {
|
||||
private String spData;
|
||||
|
||||
public Wrapper<OrderItem> toWrapper() {
|
||||
LambdaQueryWrapper<OrderItem> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (orderId != null) {
|
||||
queryWrapper.eq(OrderItem::getOrderId, orderId);
|
||||
}
|
||||
|
||||
if (productId != null) {
|
||||
queryWrapper.eq(OrderItem::getProductId, productId);
|
||||
}
|
||||
|
||||
if (outProductId != null && !outProductId.isEmpty()) {
|
||||
queryWrapper.eq(OrderItem::getOutProductId, outProductId);
|
||||
}
|
||||
|
||||
if (skuId != null) {
|
||||
queryWrapper.eq(OrderItem::getSkuId, skuId);
|
||||
}
|
||||
|
||||
if (outSkuId != null && !outSkuId.isEmpty()) {
|
||||
queryWrapper.eq(OrderItem::getOutSkuId, outSkuId);
|
||||
}
|
||||
|
||||
if (productSnapshotId != null) {
|
||||
queryWrapper.eq(OrderItem::getProductSnapshotId, productSnapshotId);
|
||||
}
|
||||
|
||||
if (skuSnapshotId != null) {
|
||||
queryWrapper.eq(OrderItem::getSkuSnapshotId, skuSnapshotId);
|
||||
}
|
||||
|
||||
if (pic != null && !pic.isEmpty()) {
|
||||
queryWrapper.eq(OrderItem::getPic, pic);
|
||||
}
|
||||
|
||||
if (productNameLike != null && !productNameLike.isEmpty()) {
|
||||
queryWrapper.like(OrderItem::getProductName, productNameLike);
|
||||
}
|
||||
|
||||
if (salePrice != null) {
|
||||
queryWrapper.eq(OrderItem::getSalePrice, salePrice);
|
||||
}
|
||||
|
||||
if (purchasePrice != null) {
|
||||
queryWrapper.eq(OrderItem::getPurchasePrice, purchasePrice);
|
||||
}
|
||||
|
||||
if (quantity != null) {
|
||||
queryWrapper.eq(OrderItem::getQuantity, quantity);
|
||||
}
|
||||
|
||||
if (productCategoryId != null) {
|
||||
queryWrapper.eq(OrderItem::getProductCategoryId, productCategoryId);
|
||||
}
|
||||
|
||||
if (spData != null && !spData.isEmpty()) {
|
||||
queryWrapper.eq(OrderItem::getSpData, spData);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<OrderItem>()
|
||||
.eq(orderId != null, OrderItem::getOrderId, orderId)
|
||||
.eq(productId != null, OrderItem::getProductId, productId)
|
||||
.eq(outProductId != null && !outProductId.isEmpty(), OrderItem::getOutProductId, outProductId)
|
||||
.eq(skuId != null, OrderItem::getSkuId, skuId)
|
||||
.eq(outSkuId != null && !outSkuId.isEmpty(), OrderItem::getOutSkuId, outSkuId)
|
||||
.eq(productSnapshotId != null, OrderItem::getProductSnapshotId, productSnapshotId)
|
||||
.eq(skuSnapshotId != null, OrderItem::getSkuSnapshotId, skuSnapshotId)
|
||||
.eq(pic != null && !pic.isEmpty(), OrderItem::getPic, pic)
|
||||
.like(productNameLike != null && !productNameLike.isEmpty(), OrderItem::getProductName, productNameLike)
|
||||
.eq(salePrice != null, OrderItem::getSalePrice, salePrice)
|
||||
.eq(purchasePrice != null, OrderItem::getPurchasePrice, purchasePrice)
|
||||
.eq(quantity != null, OrderItem::getQuantity, quantity)
|
||||
.eq(productCategoryId != null, OrderItem::getProductCategoryId, productCategoryId)
|
||||
.eq(spData != null && !spData.isEmpty(), OrderItem::getSpData, spData);
|
||||
}
|
||||
}
|
||||
|
@ -25,25 +25,11 @@ public class OrderOperateHistoryBo {
|
||||
private String note;
|
||||
|
||||
public Wrapper<OrderOperateHistory> toWrapper() {
|
||||
LambdaQueryWrapper<OrderOperateHistory> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (orderSn != null && !orderSn.isEmpty()) {
|
||||
queryWrapper.eq(OrderOperateHistory::getOrderSn, orderSn);
|
||||
}
|
||||
|
||||
if (operateMan != null && !operateMan.isEmpty()) {
|
||||
queryWrapper.eq(OrderOperateHistory::getOperateMan, operateMan);
|
||||
}
|
||||
|
||||
if (orderStatus != null) {
|
||||
queryWrapper.eq(OrderOperateHistory::getOrderStatus, orderStatus);
|
||||
}
|
||||
|
||||
if (note != null && !note.isEmpty()) {
|
||||
queryWrapper.eq(OrderOperateHistory::getNote, note);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<OrderOperateHistory>()
|
||||
.eq(orderSn != null && !orderSn.isEmpty(), OrderOperateHistory::getOrderSn, orderSn)
|
||||
.eq(operateMan != null && !operateMan.isEmpty(), OrderOperateHistory::getOperateMan, operateMan)
|
||||
.eq(orderStatus != null, OrderOperateHistory::getOrderStatus, orderStatus)
|
||||
.eq(note != null && !note.isEmpty(), OrderOperateHistory::getNote, note);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -45,53 +45,17 @@ public class WechatPaymentHistoryBo {
|
||||
private String responseBody;
|
||||
|
||||
public Wrapper<WechatPaymentHistory> toWrapper() {
|
||||
LambdaQueryWrapper<WechatPaymentHistory> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (paymentId != null && !paymentId.isEmpty()) {
|
||||
queryWrapper.eq(WechatPaymentHistory::getPaymentId, paymentId);
|
||||
}
|
||||
|
||||
if (memberId != null) {
|
||||
queryWrapper.eq(WechatPaymentHistory::getMemberId, memberId);
|
||||
}
|
||||
|
||||
if (openid != null && !openid.isEmpty()) {
|
||||
queryWrapper.eq(WechatPaymentHistory::getOpenid, openid);
|
||||
}
|
||||
|
||||
if (realNameLike != null && !realNameLike.isEmpty()) {
|
||||
// 注意:字段名若为 real_name 需对应实体类属性
|
||||
queryWrapper.like(WechatPaymentHistory::getRealName, realNameLike);
|
||||
}
|
||||
|
||||
if (title != null && !title.isEmpty()) {
|
||||
queryWrapper.eq(WechatPaymentHistory::getTitle, title);
|
||||
}
|
||||
|
||||
if (orderId != null) {
|
||||
queryWrapper.eq(WechatPaymentHistory::getOrderId, orderId);
|
||||
}
|
||||
|
||||
if (money != null) {
|
||||
queryWrapper.eq(WechatPaymentHistory::getMoney, money);
|
||||
}
|
||||
|
||||
if (opType != null) {
|
||||
queryWrapper.eq(WechatPaymentHistory::getOpType, opType);
|
||||
}
|
||||
|
||||
if (paymentStatus != null) {
|
||||
queryWrapper.eq(WechatPaymentHistory::getPaymentStatus, paymentStatus);
|
||||
}
|
||||
|
||||
if (attach != null && !attach.isEmpty()) {
|
||||
queryWrapper.eq(WechatPaymentHistory::getAttach, attach);
|
||||
}
|
||||
|
||||
if (responseBody != null && !responseBody.isEmpty()) {
|
||||
queryWrapper.eq(WechatPaymentHistory::getResponseBody, responseBody);
|
||||
}
|
||||
|
||||
return queryWrapper;
|
||||
return new LambdaQueryWrapper<WechatPaymentHistory>()
|
||||
.eq(paymentId != null && !paymentId.isEmpty(), WechatPaymentHistory::getPaymentId, paymentId)
|
||||
.eq(memberId != null, WechatPaymentHistory::getMemberId, memberId)
|
||||
.eq(openid != null && !openid.isEmpty(), WechatPaymentHistory::getOpenid, openid)
|
||||
.like(realNameLike != null && !realNameLike.isEmpty(), WechatPaymentHistory::getRealName, realNameLike)
|
||||
.eq(title != null && !title.isEmpty(), WechatPaymentHistory::getTitle, title)
|
||||
.eq(orderId != null, WechatPaymentHistory::getOrderId, orderId)
|
||||
.eq(money != null, WechatPaymentHistory::getMoney, money)
|
||||
.eq(opType != null, WechatPaymentHistory::getOpType, opType)
|
||||
.eq(paymentStatus != null, WechatPaymentHistory::getPaymentStatus, paymentStatus)
|
||||
.eq(attach != null && !attach.isEmpty(), WechatPaymentHistory::getAttach, attach)
|
||||
.eq(responseBody != null && !responseBody.isEmpty(), WechatPaymentHistory::getResponseBody, responseBody);
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wzj.soopin.order.domain.entity.AftersaleItem;
|
||||
import com.wzj.soopin.order.domain.query.AftersaleItemQuery;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -14,6 +15,7 @@ import java.util.List;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper
|
||||
public interface AftersaleItemMapper extends BaseMapper<AftersaleItem> {
|
||||
/**
|
||||
* 查询订单售后列表
|
||||
@ -23,7 +25,5 @@ public interface AftersaleItemMapper extends BaseMapper<AftersaleItem> {
|
||||
*/
|
||||
List<AftersaleItem> selectByEntity(AftersaleItem aftersaleItem);
|
||||
|
||||
Integer insertBatch(@Param("list") List<AftersaleItem> list);
|
||||
|
||||
IPage<AftersaleItem> selectAftersale(@Param("query") AftersaleItemQuery query, IPage<AftersaleItem> pageParam);
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.wzj.soopin.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@ -11,6 +10,7 @@ import com.wzj.soopin.order.domain.vo.AftersaleVO;
|
||||
import com.wzj.soopin.order.domain.vo.ManagerRefundOrderVO;
|
||||
import com.wzj.soopin.order.domain.vo.OrderAndAftersaleStatisticsVO;
|
||||
import com.wzj.soopin.order.domain.vo.OrderVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,6 +20,7 @@ import java.util.List;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper
|
||||
public interface AftersaleMapper extends BaseMapper<Aftersale> {
|
||||
/**
|
||||
* 查询订单售后列表
|
||||
@ -31,9 +32,5 @@ public interface AftersaleMapper extends BaseMapper<Aftersale> {
|
||||
|
||||
List<ManagerRefundOrderVO> selectManagerRefundOrder(ManagerAftersaleOrderForm managerAftersaleOrderPageRequest);
|
||||
|
||||
int countByMemberId(Long memberId);
|
||||
|
||||
OrderAndAftersaleStatisticsVO statPendingAndProcessing();
|
||||
|
||||
IPage<AftersaleVO> getlist(@Param("page") Page<Aftersale> page, @Param("query")AftersaleBo query);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.order.domain.entity.OrderDeliveryHistory;
|
||||
import com.wzj.soopin.order.domain.query.OrderDeliveryHistoryQuery;
|
||||
import com.wzj.soopin.order.domain.vo.OrderDeliveryHistoryVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@ -19,11 +20,9 @@ import java.util.List;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderDeliveryHistoryMapper extends BaseMapper<OrderDeliveryHistory> {
|
||||
|
||||
|
||||
IPage<OrderDeliveryHistoryVO> selectOderDeliveryHistory(@Param("query")OrderDeliveryHistoryQuery query, IPage<OrderDeliveryHistoryVO> pageParam);
|
||||
|
||||
/**
|
||||
* 查询订单发货记录列表
|
||||
*
|
||||
@ -31,6 +30,4 @@ public interface OrderDeliveryHistoryMapper extends BaseMapper<OrderDeliveryHist
|
||||
* @return 订单发货记录集合
|
||||
*/
|
||||
List<OrderDeliveryHistory> selectByEntity(OrderDeliveryHistory orderDeliveryHistory);
|
||||
|
||||
// IPage<OrderDeliveryHistoryVO> selectByEntity(OrderDeliveryHistoryQuery query ,Page<Object> objectPage);
|
||||
}
|
||||
|
@ -1,11 +1,8 @@
|
||||
package com.wzj.soopin.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wzj.soopin.order.domain.entity.OrderItem;
|
||||
import com.wzj.soopin.order.domain.query.OrderItemQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -14,9 +11,8 @@ import java.util.List;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderItemMapper extends BaseMapper<OrderItem> {
|
||||
|
||||
// IPage<OrderItem> selectOrderItem(@Param("query") OrderItemQuery query, IPage<OrderItem> pageParam);
|
||||
/**
|
||||
* 查询订单中所包含的商品列表
|
||||
*
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.order.domain.bo.OrderBo;
|
||||
import com.wzj.soopin.order.domain.entity.Order;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.dromara.system.domain.SystemStatistics;
|
||||
import com.wzj.soopin.order.domain.form.ManagerOrderQueryForm;
|
||||
import com.wzj.soopin.order.domain.vo.*;
|
||||
@ -21,6 +22,7 @@ import java.util.Map;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderMapper extends BaseMapper<Order> {
|
||||
/**
|
||||
* 查询订单表列表
|
||||
@ -33,25 +35,6 @@ public interface OrderMapper extends BaseMapper<Order> {
|
||||
|
||||
List<ManagerOrderVO> selectManagerOrderPage(ManagerOrderQueryForm request);
|
||||
|
||||
List<H5OrderVO> orderPage(@Param("status") Integer status, @Param("memberId")Long memberId);
|
||||
|
||||
H5OrderVO selectOrderDetail(Long orderId);
|
||||
|
||||
CountOrderVO countByStatusAndMemberId(Long memberId);
|
||||
|
||||
Integer cancelBatch(@Param("list") List<Order> orderList);
|
||||
|
||||
MemberDataStatisticsVO statOrderCountAndAmount(Long memberId);
|
||||
|
||||
|
||||
Integer statWaitDelivered();
|
||||
|
||||
OrderAndAftersaleStatisticsVO statTodayData(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||
|
||||
SystemStatistics statNewAndDeal(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
|
||||
|
||||
int statDealMember(@Param("startTime") LocalDateTime startTime,@Param("endTime") LocalDateTime endTime);
|
||||
|
||||
|
||||
IPage<OrderVO> getlist(@Param("page") Page<Order> page,@Param("query") OrderBo query);
|
||||
|
||||
@ -62,6 +45,4 @@ public interface OrderMapper extends BaseMapper<Order> {
|
||||
Map<String, Object> countOrder();
|
||||
|
||||
|
||||
|
||||
// IPage<OrderVO> getlist(@Param("page") Page<Object> objectPage, @Param("query") OrderBo query);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wzj.soopin.order.domain.entity.OrderItem;
|
||||
import com.wzj.soopin.order.domain.entity.OrderOperateHistory;
|
||||
import com.wzj.soopin.order.domain.query.OrderOperateHistoryQuery;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -15,6 +16,7 @@ import java.util.List;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrderOperateHistoryMapper extends BaseMapper<OrderOperateHistory> {
|
||||
|
||||
/**
|
||||
@ -24,6 +26,4 @@ public interface OrderOperateHistoryMapper extends BaseMapper<OrderOperateHistor
|
||||
* @return 订单操作历史记录集合
|
||||
*/
|
||||
List<OrderOperateHistory> selectByEntity(OrderOperateHistory orderOperateHistory);
|
||||
|
||||
IPage<OrderOperateHistory> selectOrderOperateHistory(@Param("query") OrderOperateHistoryQuery query, IPage<OrderItem> pageParam);
|
||||
}
|
||||
|
@ -2,11 +2,13 @@ package com.wzj.soopin.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wzj.soopin.order.domain.entity.VerificationCodes;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface VerificationCodesMapper extends BaseMapper<VerificationCodes> {
|
||||
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ package com.wzj.soopin.order.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.wzj.soopin.order.domain.entity.VerificationLogs;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface VerificationLogsMapper extends BaseMapper<VerificationLogs> {
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.wzj.soopin.order.domain.entity.WechatPaymentHistory;
|
||||
import com.wzj.soopin.order.domain.query.WechatPaymentHistoryQuery;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
@ -14,10 +15,9 @@ import java.util.List;
|
||||
*
|
||||
* @author zcc
|
||||
*/
|
||||
@Mapper
|
||||
public interface WechatPaymentHistoryMapper extends BaseMapper<WechatPaymentHistory> {
|
||||
|
||||
|
||||
IPage<WechatPaymentHistory> selectWechatPaymentHistory(@Param("query") WechatPaymentHistoryQuery query, IPage<WechatPaymentHistory> pageParam);
|
||||
/**
|
||||
* 查询微信订单表列表
|
||||
*
|
||||
|
@ -13,7 +13,5 @@ import java.util.Map;
|
||||
|
||||
public interface OrderService extends IService<Order> {
|
||||
|
||||
Map<String, Object> getCount();
|
||||
|
||||
IPage<OrderVO> getlist(Page<Order> page, OrderBo query);
|
||||
}
|
||||
|
@ -25,87 +25,5 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class AftersaleItemServiceImpl extends ServiceImpl<AftersaleItemMapper, AftersaleItem> implements AftersaleItemService {
|
||||
@Autowired
|
||||
private AftersaleItemMapper aftersaleItemMapper;
|
||||
|
||||
/**
|
||||
* 查询订单售后
|
||||
*
|
||||
* @param id 订单售后主键
|
||||
* @return 订单售后
|
||||
*/
|
||||
public AftersaleItem selectById(Long id) {
|
||||
return aftersaleItemMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单售后列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 订单售后
|
||||
*/
|
||||
public List<AftersaleItem> selectList(AftersaleItemQuery query, Pageable page) {
|
||||
// if (page != null) {
|
||||
// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
// }
|
||||
QueryWrapper<AftersaleItem> qw = new QueryWrapper<>();
|
||||
Long memberId = query.getMemberId();
|
||||
if (memberId != null) {
|
||||
qw.eq("member_id", memberId);
|
||||
}
|
||||
Long orderId = query.getOrderId();
|
||||
if (orderId != null) {
|
||||
qw.eq("order_id", orderId);
|
||||
}
|
||||
Long orderItemId = query.getOrderItemId();
|
||||
if (orderItemId != null) {
|
||||
qw.eq("order_item_id", orderItemId);
|
||||
}
|
||||
BigDecimal returnAmount = query.getReturnAmount();
|
||||
if (returnAmount != null) {
|
||||
qw.eq("return_amount", returnAmount);
|
||||
}
|
||||
Integer quantity = query.getQuantity();
|
||||
if (quantity != null) {
|
||||
qw.eq("quantity", quantity);
|
||||
}
|
||||
return aftersaleItemMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单售后
|
||||
*
|
||||
* @param aftersaleItem 订单售后
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(AftersaleItem aftersaleItem) {
|
||||
aftersaleItem.setCreateTime(LocalDateTime.now());
|
||||
return aftersaleItemMapper.insert(aftersaleItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单售后
|
||||
*
|
||||
* @param aftersaleItem 订单售后
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(AftersaleItem aftersaleItem) {
|
||||
return aftersaleItemMapper.updateById(aftersaleItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单售后信息
|
||||
*
|
||||
* @param id 订单售后主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return aftersaleItemMapper.deleteById(id);
|
||||
}
|
||||
|
||||
public IPage<AftersaleItem> pagelist(AftersaleItemQuery query, PageVO page) {
|
||||
IPage<AftersaleItem> pageParam = PageUtil.initPage(page);
|
||||
return aftersaleItemMapper.selectAftersale(query, pageParam);
|
||||
}
|
||||
}
|
||||
|
@ -64,13 +64,8 @@ public class AftersaleServiceImpl extends ServiceImpl<AftersaleMapper, Aftersale
|
||||
|
||||
@Autowired
|
||||
private MemberMapper memberMapper;
|
||||
|
||||
@Autowired
|
||||
private OrderOperateHistoryConvert historyConvert;
|
||||
@Autowired
|
||||
private SkuMapper skuMapper;
|
||||
// @Autowired
|
||||
// private MemberCouponService memberCouponService;
|
||||
@Autowired
|
||||
private WechatPaymentHistoryMapper wechatPaymentHistoryMapper;
|
||||
@Autowired
|
||||
@ -157,83 +152,6 @@ public class AftersaleServiceImpl extends ServiceImpl<AftersaleMapper, Aftersale
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单售后列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 订单售后
|
||||
*/
|
||||
public List<ManagerRefundOrderVO> selectList(ManagerAftersaleOrderForm query, Pageable page) {
|
||||
if (page != null) {
|
||||
// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
if (StrUtil.isNotBlank(query.getOrderSn()) && query.getOrderSn().length() > 7) {
|
||||
query.setOrderSn(query.getOrderSn().substring(7));
|
||||
}
|
||||
List<ManagerRefundOrderVO> managerRefundOrderVOS = aftersaleMapper.selectManagerRefundOrder(query);
|
||||
if (CollectionUtil.isEmpty(managerRefundOrderVOS)) {
|
||||
return managerRefundOrderVOS;
|
||||
}
|
||||
Set<Long> idSet = managerRefundOrderVOS.stream().map(ManagerRefundOrderVO::getOrderId).collect(Collectors.toSet());
|
||||
//查一下orderSn集合
|
||||
QueryWrapper<Order> orderQw = new QueryWrapper<>();
|
||||
orderQw.in("id", idSet);
|
||||
Map<Long, Order> orderMap = orderMapper.selectList(orderQw).stream().collect(Collectors.toMap(Order::getId, it -> it));
|
||||
//封装售后单商品数据
|
||||
QueryWrapper<OrderItem> orderItemQw = new QueryWrapper<>();
|
||||
orderItemQw.in("order_id", idSet);
|
||||
Map<Long, List<OrderItem>> orderItemMap = orderItemMapper.selectList(orderItemQw).stream().collect(Collectors.groupingBy(OrderItem::getOrderId));
|
||||
managerRefundOrderVOS.forEach(vo -> {
|
||||
Order order = orderMap.get(vo.getOrderId());
|
||||
vo.setOrderSn(order.getOrderSn());
|
||||
List<OrderItem> orderItemList = orderItemMap.get(vo.getOrderId());
|
||||
List<ManagerOrderProductVO> productList = new ArrayList<>();
|
||||
orderItemList.forEach(item -> {
|
||||
ManagerOrderProductVO productVO = new ManagerOrderProductVO();
|
||||
productVO.setProductName(item.getProductName());
|
||||
productVO.setSalePrice(item.getSalePrice());
|
||||
productVO.setPic(item.getPic());
|
||||
productVO.setBuyNum(item.getQuantity());
|
||||
productVO.setProductId(item.getProductId());
|
||||
productVO.setSpData(item.getSpData());
|
||||
productList.add(productVO);
|
||||
});
|
||||
vo.setProductList(productList);
|
||||
});
|
||||
return managerRefundOrderVOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单售后
|
||||
*
|
||||
* @param aftersale 订单售后
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(Aftersale aftersale) {
|
||||
aftersale.setCreateTime(LocalDateTime.now());
|
||||
return aftersaleMapper.insert(aftersale);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单售后
|
||||
*
|
||||
* @param aftersale 订单售后
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(Aftersale aftersale) {
|
||||
return aftersaleMapper.updateById(aftersale);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单售后信息
|
||||
*
|
||||
* @param id 订单售后主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return aftersaleMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 售后处理
|
||||
@ -478,8 +396,4 @@ public class AftersaleServiceImpl extends ServiceImpl<AftersaleMapper, Aftersale
|
||||
return resultPage;
|
||||
}
|
||||
|
||||
// public Page<AftersaleVO> getlist(Page<Aftersale> page, AftersaleBo query) {
|
||||
// IPage<OrderVO> resultPage = aftersaleMapper.getlist(page,query);
|
||||
// return resultPage;
|
||||
// }
|
||||
}
|
||||
|
@ -26,79 +26,5 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class OrderDeliveryHistoryServiceImpl extends ServiceImpl<OrderDeliveryHistoryMapper, OrderDeliveryHistory> implements OrderDeliveryHistoryService {
|
||||
@Autowired
|
||||
private OrderDeliveryHistoryMapper orderDeliveryHistoryMapper;
|
||||
|
||||
/**
|
||||
* 查询订单发货记录
|
||||
*
|
||||
* @param id 订单发货记录主键
|
||||
* @return 订单发货记录
|
||||
*/
|
||||
public OrderDeliveryHistory selectById(Long id) {
|
||||
return orderDeliveryHistoryMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单发货记录列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 订单发货记录
|
||||
*/
|
||||
public List<OrderDeliveryHistory> selectList(OrderDeliveryHistoryQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
QueryWrapper<OrderDeliveryHistory> qw = new QueryWrapper<>();
|
||||
Long orderId = query.getOrderId();
|
||||
if (orderId != null) {
|
||||
qw.eq("order_id", orderId);
|
||||
}
|
||||
String deliveryCompany = query.getDeliveryCompany();
|
||||
if (!StringUtils.isEmpty(deliveryCompany)) {
|
||||
qw.eq("delivery_company", deliveryCompany);
|
||||
}
|
||||
String deliverySn = query.getDeliverySn();
|
||||
if (!StringUtils.isEmpty(deliverySn)) {
|
||||
qw.eq("delivery_sn", deliverySn);
|
||||
}
|
||||
return orderDeliveryHistoryMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单发货记录
|
||||
*
|
||||
* @param orderDeliveryHistory 订单发货记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(OrderDeliveryHistory orderDeliveryHistory) {
|
||||
orderDeliveryHistory.setCreateTime(LocalDateTime.now());
|
||||
return orderDeliveryHistoryMapper.insert(orderDeliveryHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单发货记录
|
||||
*
|
||||
* @param orderDeliveryHistory 订单发货记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(OrderDeliveryHistory orderDeliveryHistory) {
|
||||
return orderDeliveryHistoryMapper.updateById(orderDeliveryHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单发货记录信息
|
||||
*
|
||||
* @param id 订单发货记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return orderDeliveryHistoryMapper.deleteById(id);
|
||||
}
|
||||
|
||||
public IPage<OrderDeliveryHistoryVO> pagelist(OrderDeliveryHistoryQuery query, PageVO page) {
|
||||
IPage<OrderDeliveryHistoryVO> pageParam = PageUtil.initPage(page);
|
||||
return orderDeliveryHistoryMapper.selectOderDeliveryHistory(query, pageParam);
|
||||
}
|
||||
}
|
||||
|
@ -31,151 +31,5 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class OrderItemServiceImpl extends ServiceImpl<OrderItemMapper, OrderItem> implements OrderItemService {
|
||||
@Autowired
|
||||
private OrderItemMapper orderItemMapper;
|
||||
|
||||
/**
|
||||
* 查询订单中所包含的商品
|
||||
*
|
||||
* @param id 订单中所包含的商品主键
|
||||
* @return 订单中所包含的商品
|
||||
*/
|
||||
public OrderItem selectById(Long id) {
|
||||
return orderItemMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单中所包含的商品列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 订单中所包含的商品
|
||||
*/
|
||||
public List<OrderItem> selectList(OrderItemQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
QueryWrapper<OrderItem> qw = new QueryWrapper<>();
|
||||
Long orderId = query.getOrderId();
|
||||
if (orderId != null) {
|
||||
qw.eq("order_id", orderId);
|
||||
}
|
||||
Long productId = query.getProductId();
|
||||
if (productId != null) {
|
||||
qw.eq("product_id", productId);
|
||||
}
|
||||
String outProductId = query.getOutProductId();
|
||||
if (!StringUtils.isEmpty(outProductId)) {
|
||||
qw.eq("out_product_id", outProductId);
|
||||
}
|
||||
Long skuId = query.getSkuId();
|
||||
if (skuId != null) {
|
||||
qw.eq("sku_id", skuId);
|
||||
}
|
||||
String outSkuId = query.getOutSkuId();
|
||||
if (!StringUtils.isEmpty(outSkuId)) {
|
||||
qw.eq("out_sku_id", outSkuId);
|
||||
}
|
||||
Long productSnapshotId = query.getProductSnapshotId();
|
||||
if (productSnapshotId != null) {
|
||||
qw.eq("product_snapshot_id", productSnapshotId);
|
||||
}
|
||||
Long skuSnapshotId = query.getSkuSnapshotId();
|
||||
if (skuSnapshotId != null) {
|
||||
qw.eq("sku_snapshot_id", skuSnapshotId);
|
||||
}
|
||||
String pic = query.getPic();
|
||||
if (!StringUtils.isEmpty(pic)) {
|
||||
qw.eq("pic", pic);
|
||||
}
|
||||
String productNameLike = query.getProductNameLike();
|
||||
if (!StringUtils.isEmpty(productNameLike)) {
|
||||
qw.like("product_name", productNameLike);
|
||||
}
|
||||
BigDecimal salePrice = query.getSalePrice();
|
||||
if (salePrice != null) {
|
||||
qw.eq("sale_price", salePrice);
|
||||
}
|
||||
BigDecimal purchasePrice = query.getPurchasePrice();
|
||||
if (purchasePrice != null) {
|
||||
qw.eq("purchase_price", purchasePrice);
|
||||
}
|
||||
Integer quantity = query.getQuantity();
|
||||
if (quantity != null) {
|
||||
qw.eq("quantity", quantity);
|
||||
}
|
||||
Long productCategoryId = query.getProductCategoryId();
|
||||
if (productCategoryId != null) {
|
||||
qw.eq("product_category_id", productCategoryId);
|
||||
}
|
||||
String spData = query.getSpData();
|
||||
if (!StringUtils.isEmpty(spData)) {
|
||||
qw.eq("sp_data", spData);
|
||||
}
|
||||
return orderItemMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单中所包含的商品
|
||||
*
|
||||
* @param orderItem 订单中所包含的商品
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(OrderItem orderItem) {
|
||||
orderItem.setCreateTime(LocalDateTime.now());
|
||||
return orderItemMapper.insert(orderItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单中所包含的商品
|
||||
*
|
||||
* @param orderItem 订单中所包含的商品
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(OrderItem orderItem) {
|
||||
return orderItemMapper.updateById(orderItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单中所包含的商品信息
|
||||
*
|
||||
* @param id 订单中所包含的商品主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return orderItemMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void saveOrderItem(Member member, LocalDateTime optTime,
|
||||
Long orderId, List<OrderProductListDTO> list){
|
||||
List<OrderItem> addOrderItemList = new ArrayList<>();
|
||||
list.forEach(item -> {
|
||||
OrderItem orderItem = new OrderItem();
|
||||
orderItem.setId(IDGenerator.generateId());
|
||||
orderItem.setOrderId(orderId);
|
||||
orderItem.setProductId(item.getProduct().getId());
|
||||
orderItem.setOutProductId(item.getProduct().getOutProductId());
|
||||
orderItem.setSkuId(item.getSku().getId());
|
||||
orderItem.setOutSkuId(item.getSku().getOutSkuId());
|
||||
orderItem.setPic(item.getSku().getPic());
|
||||
orderItem.setProductName(item.getProduct().getName());
|
||||
orderItem.setSalePrice(item.getSku().getPrice());
|
||||
orderItem.setQuantity(item.getQuantity());
|
||||
orderItem.setProductCategoryId(item.getProduct().getCategoryId());
|
||||
orderItem.setSpData(item.getSku().getSpData());
|
||||
orderItem.setCreateBy(member.getId());
|
||||
orderItem.setCreateTime(optTime);
|
||||
addOrderItemList.add(orderItem);
|
||||
});
|
||||
boolean flag = saveBatch(addOrderItemList);
|
||||
if (!flag){
|
||||
throw new RuntimeException("新增订单item失败");
|
||||
}
|
||||
}
|
||||
|
||||
// public IPage<OrderItem> pagelist(OrderItemQuery query, PageVO page) {
|
||||
// IPage<OrderItem> pageParam = PageUtil.initPage(page);
|
||||
// return orderItemMapper.selectOrderItem(query, pageParam);
|
||||
// }
|
||||
}
|
||||
|
@ -27,84 +27,5 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class OrderOperateHistoryServiceImpl extends ServiceImpl<OrderOperateHistoryMapper, OrderOperateHistory> implements OrderOperateHistoryService {
|
||||
@Autowired
|
||||
private OrderOperateHistoryMapper orderOperateHistoryMapper;
|
||||
|
||||
/**
|
||||
* 查询订单操作历史记录
|
||||
*
|
||||
* @param id 订单操作历史记录主键
|
||||
* @return 订单操作历史记录
|
||||
*/
|
||||
public OrderOperateHistory selectById(Long id) {
|
||||
return orderOperateHistoryMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单操作历史记录列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 订单操作历史记录
|
||||
*/
|
||||
public List<OrderOperateHistory> selectList(OrderOperateHistoryQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
QueryWrapper<OrderOperateHistory> qw = new QueryWrapper<>();
|
||||
String orderSn = query.getOrderSn();
|
||||
if (StrUtil.isNotBlank(orderSn)) {
|
||||
qw.eq("order_sn", orderSn);
|
||||
}
|
||||
String operateMan = query.getOperateMan();
|
||||
if (!StringUtils.isEmpty(operateMan)) {
|
||||
qw.eq("operate_man", operateMan);
|
||||
}
|
||||
Integer orderStatus = query.getOrderStatus();
|
||||
if (orderStatus != null) {
|
||||
qw.eq("order_status", orderStatus);
|
||||
}
|
||||
String note = query.getNote();
|
||||
if (!StringUtils.isEmpty(note)) {
|
||||
qw.eq("note", note);
|
||||
}
|
||||
qw.orderByDesc("create_time");
|
||||
return orderOperateHistoryMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单操作历史记录
|
||||
*
|
||||
* @param orderOperateHistory 订单操作历史记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(OrderOperateHistory orderOperateHistory) {
|
||||
orderOperateHistory.setCreateTime(LocalDateTime.now());
|
||||
return orderOperateHistoryMapper.insert(orderOperateHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单操作历史记录
|
||||
*
|
||||
* @param orderOperateHistory 订单操作历史记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(OrderOperateHistory orderOperateHistory) {
|
||||
return orderOperateHistoryMapper.updateById(orderOperateHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单操作历史记录信息
|
||||
*
|
||||
* @param id 订单操作历史记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return orderOperateHistoryMapper.deleteById(id);
|
||||
}
|
||||
|
||||
public IPage<OrderOperateHistory> pagelist(OrderOperateHistoryQuery query, PageVO page) {
|
||||
IPage<OrderItem> pageParam = PageUtil.initPage(page);
|
||||
return orderOperateHistoryMapper.selectOrderOperateHistory(query, pageParam);
|
||||
}
|
||||
}
|
||||
|
@ -8,18 +8,12 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.content.domain.po.Vlog;
|
||||
import com.wzj.soopin.content.mapper.VlogMapper;
|
||||
import com.wzj.soopin.content.service.impl.VlogServiceImpl;
|
||||
import com.wzj.soopin.goods.convert.SkuConvert;
|
||||
import com.wzj.soopin.goods.domain.entity.Sku;
|
||||
import com.wzj.soopin.goods.mapper.ProductMapper;
|
||||
import com.wzj.soopin.goods.mapper.SkuMapper;
|
||||
import com.wzj.soopin.member.domain.po.Feedback;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.mapper.*;
|
||||
import com.wzj.soopin.member.service.impl.FeedbackServiceImpl;
|
||||
import com.wzj.soopin.member.service.impl.MemberServiceImpl;
|
||||
import com.wzj.soopin.order.convert.OrderConvert;
|
||||
import com.wzj.soopin.order.convert.OrderOperateHistoryConvert;
|
||||
import com.wzj.soopin.order.domain.bo.OrderBo;
|
||||
@ -42,10 +36,8 @@ import org.dromara.common.core.domain.event.Constants;
|
||||
import org.dromara.common.core.utils.PhoneUtils;
|
||||
import org.dromara.common.core.utils.SecurityUtils;
|
||||
import org.dromara.system.domain.SysTenant;
|
||||
import org.dromara.system.mapper.SysIntegralHistoryMapper;
|
||||
import org.dromara.system.mapper.SysOperLogMapper;
|
||||
import org.dromara.system.mapper.SysTenantMapper;
|
||||
import org.dromara.system.mapper.SystemStatisticsMapper;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
@ -65,67 +57,25 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
@Autowired
|
||||
private OrderConvert orderConvert;
|
||||
@Autowired
|
||||
private OrderItemMapper orderItemMapper;
|
||||
@Autowired
|
||||
private MemberAddressMapper memberAddressMapper;
|
||||
@Autowired
|
||||
private SkuMapper skuMapper;
|
||||
@Autowired
|
||||
private ProductMapper productMapper;
|
||||
@Autowired
|
||||
private SkuConvert skuConvert;
|
||||
@Autowired
|
||||
private OrderItemServiceImpl orderItemService;
|
||||
@Autowired
|
||||
private OrderOperateHistoryMapper orderOperateHistoryMapper;
|
||||
@Autowired
|
||||
private MemberCartMapper memberCartMapper;
|
||||
@Autowired
|
||||
private MemberMapper memberMapper;
|
||||
|
||||
@Autowired
|
||||
private OrderDeliveryHistoryMapper orderDeliveryHistoryMapper;
|
||||
@Autowired
|
||||
private OrderOperateHistoryConvert historyConvert;
|
||||
|
||||
@Autowired
|
||||
private SysOperLogMapper sysOperLogMapper;
|
||||
|
||||
@Autowired
|
||||
private VerificationCodeService verificationCodeService;
|
||||
|
||||
@Autowired
|
||||
private SysTenantMapper sysTenantMapper;
|
||||
|
||||
@Autowired
|
||||
private VlogMapper vlogMapper;
|
||||
|
||||
@Autowired
|
||||
private FeedbackMapper feedbackMapper;
|
||||
|
||||
// @Autowired
|
||||
// private WithdrawMapper withdrawMapper;
|
||||
|
||||
@Autowired
|
||||
private MemberServiceImpl memberService;
|
||||
|
||||
@Autowired
|
||||
private FeedbackServiceImpl feedbackService;
|
||||
|
||||
// @Autowired
|
||||
// private WithdrawServiceImpl withdrawService;
|
||||
|
||||
@Autowired
|
||||
private SystemStatisticsMapper systemStatisticsMapper;
|
||||
|
||||
@Autowired
|
||||
private SysIntegralHistoryMapper sysIntegralHistoryMapper;
|
||||
private final OrderMapper orderMapper;
|
||||
private final OrderItemMapper orderItemMapper;
|
||||
private final SkuMapper skuMapper;
|
||||
private final OrderOperateHistoryMapper orderOperateHistoryMapper;
|
||||
private final MemberMapper memberMapper;
|
||||
private final OrderDeliveryHistoryMapper orderDeliveryHistoryMapper;
|
||||
private final VerificationCodeService verificationCodeService;
|
||||
private final SysTenantMapper sysTenantMapper;
|
||||
|
||||
public OrderServiceImpl(OrderMapper orderMapper, OrderItemMapper orderItemMapper, SkuMapper skuMapper, OrderOperateHistoryMapper orderOperateHistoryMapper, MemberMapper memberMapper, OrderDeliveryHistoryMapper orderDeliveryHistoryMapper, VerificationCodeService verificationCodeService, SysTenantMapper sysTenantMapper) {
|
||||
this.orderMapper = orderMapper;
|
||||
this.orderItemMapper = orderItemMapper;
|
||||
this.skuMapper = skuMapper;
|
||||
this.orderOperateHistoryMapper = orderOperateHistoryMapper;
|
||||
this.memberMapper = memberMapper;
|
||||
this.orderDeliveryHistoryMapper = orderDeliveryHistoryMapper;
|
||||
this.verificationCodeService = verificationCodeService;
|
||||
this.sysTenantMapper = sysTenantMapper;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@ -592,61 +542,5 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
// return result;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCount() {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("memberCount", memberService.count()); //用户数量
|
||||
result.put("vlogCount", vlogMapper.countVlog()); //待审核视频
|
||||
|
||||
// 待审核举报统计
|
||||
QueryWrapper<Feedback> FeedbackWrapper = new QueryWrapper<>();
|
||||
FeedbackWrapper.eq("status", 0);
|
||||
result.put("feedbackCount", feedbackService.count(FeedbackWrapper));
|
||||
// 待审核提现统计
|
||||
// QueryWrapper<Withdraw> withdrawQueryWrapper = new QueryWrapper<>();
|
||||
// withdrawQueryWrapper.eq("audit_status", 0);
|
||||
// result.put("WithdrawCount", withdrawService.count(withdrawQueryWrapper));
|
||||
|
||||
// 商品统计、待审核商品统计
|
||||
Map<String, Object> productCounts = productMapper.countProduct();
|
||||
result.put("productCount", productCounts.get("count1"));
|
||||
result.put("productAudit", productCounts.get("count2"));
|
||||
|
||||
// 店铺统计、待审核店铺统计
|
||||
Map<String, Object> StoreCounts = sysTenantMapper.countProduct();
|
||||
result.put("storeCount", StoreCounts.get("count1"));
|
||||
result.put("StoreAudit", StoreCounts.get("count2"));
|
||||
|
||||
// 订单统计、待审核退款统计
|
||||
Map<String, Object> OrderCounts = orderMapper.countOrder();
|
||||
result.put("orderCount", OrderCounts.get("count1"));
|
||||
result.put("orderAudit", OrderCounts.get("count2"));
|
||||
|
||||
// 店铺TOP20
|
||||
List<Map<String, Object>> top20Stores = sysTenantMapper.getTop20Stores();
|
||||
result.put("top20Stores", top20Stores);
|
||||
|
||||
// 商品TOP20
|
||||
List<Map<String, Object>> top20Product = productMapper.getTop20Product();
|
||||
result.put("top20Product", top20Product);
|
||||
|
||||
// 分月用户量统计
|
||||
List<Map<String, Object>> monthlyUserVolume = systemStatisticsMapper.getMonthlyUserVolume();
|
||||
result.put("monthlyUserVolume", monthlyUserVolume);
|
||||
|
||||
// 分月短视频统计
|
||||
List<Map<String, Object>> monthlyVlog = vlogMapper.getMonthlyVlog();
|
||||
result.put("monthlyVlog", monthlyVlog);
|
||||
|
||||
// 分月收入支出统计
|
||||
List<Map<String, Object>> monthlyIncomeExpense = sysIntegralHistoryMapper.getIncomeExpense();
|
||||
result.put("monthlyIncomeExpense", monthlyIncomeExpense);
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -28,15 +28,17 @@ public class VerificationCodeServiceImpl extends ServiceImpl<VerificationCodesM
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private VerificationCodesMapper codeMapper;
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
@Autowired
|
||||
private QrCodeGenerator qrCodeGenerator;
|
||||
private final VerificationCodesMapper codeMapper;
|
||||
private final OrderMapper orderMapper;
|
||||
private final QrCodeGenerator qrCodeGenerator;
|
||||
private final VerificationLogsMapper logMapper;
|
||||
|
||||
@Autowired
|
||||
private VerificationLogsMapper logMapper;
|
||||
public VerificationCodeServiceImpl(VerificationCodesMapper codeMapper, OrderMapper orderMapper, QrCodeGenerator qrCodeGenerator, VerificationLogsMapper logMapper) {
|
||||
this.codeMapper = codeMapper;
|
||||
this.orderMapper = orderMapper;
|
||||
this.qrCodeGenerator = qrCodeGenerator;
|
||||
this.logMapper = logMapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成核销码并关联订单
|
||||
|
@ -26,111 +26,5 @@ import java.util.List;
|
||||
*/
|
||||
@Service
|
||||
public class WechatPaymentHistoryServiceImpl extends ServiceImpl<WechatPaymentHistoryMapper, WechatPaymentHistory> implements WechatPaymentHistoryService {
|
||||
@Autowired
|
||||
private WechatPaymentHistoryMapper wechatPaymentHistoryMapper;
|
||||
|
||||
/**
|
||||
* 查询微信订单表
|
||||
*
|
||||
* @param id 微信订单表主键
|
||||
* @return 微信订单表
|
||||
*/
|
||||
public WechatPaymentHistory selectById(Long id) {
|
||||
return wechatPaymentHistoryMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询微信订单表列表
|
||||
*
|
||||
* @param query 查询条件
|
||||
* @param page 分页条件
|
||||
* @return 微信订单表
|
||||
*/
|
||||
public List<WechatPaymentHistory> selectList(WechatPaymentHistoryQuery query, Pageable page) {
|
||||
if (page != null) {
|
||||
// PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
|
||||
}
|
||||
QueryWrapper<WechatPaymentHistory> qw = new QueryWrapper<>();
|
||||
String paymentId = query.getPaymentId();
|
||||
if (!StringUtils.isEmpty(paymentId)) {
|
||||
qw.eq("payment_id", paymentId);
|
||||
}
|
||||
Long memberId = query.getMemberId();
|
||||
if (memberId != null) {
|
||||
qw.eq("member_id", memberId);
|
||||
}
|
||||
String openid = query.getOpenid();
|
||||
if (!StringUtils.isEmpty(openid)) {
|
||||
qw.eq("openid", openid);
|
||||
}
|
||||
String realNameLike = query.getRealNameLike();
|
||||
if (!StringUtils.isEmpty(realNameLike)) {
|
||||
qw.like("real_name", realNameLike);
|
||||
}
|
||||
String title = query.getTitle();
|
||||
if (!StringUtils.isEmpty(title)) {
|
||||
qw.eq("title", title);
|
||||
}
|
||||
Long orderId = query.getOrderId();
|
||||
if (orderId != null) {
|
||||
qw.eq("order_id", orderId);
|
||||
}
|
||||
BigDecimal money = query.getMoney();
|
||||
if (money != null) {
|
||||
qw.eq("money", money);
|
||||
}
|
||||
Integer opType = query.getOpType();
|
||||
if (opType != null) {
|
||||
qw.eq("op_type", opType);
|
||||
}
|
||||
Integer paymentStatus = query.getPaymentStatus();
|
||||
if (paymentStatus != null) {
|
||||
qw.eq("payment_status", paymentStatus);
|
||||
}
|
||||
String attach = query.getAttach();
|
||||
if (!StringUtils.isEmpty(attach)) {
|
||||
qw.eq("attach", attach);
|
||||
}
|
||||
String responseBody = query.getResponseBody();
|
||||
if (!StringUtils.isEmpty(responseBody)) {
|
||||
qw.eq("response_body", responseBody);
|
||||
}
|
||||
return wechatPaymentHistoryMapper.selectList(qw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增微信订单表
|
||||
*
|
||||
* @param wechatPaymentHistory 微信订单表
|
||||
* @return 结果
|
||||
*/
|
||||
public int insert(WechatPaymentHistory wechatPaymentHistory) {
|
||||
wechatPaymentHistory.setCreateTime(LocalDateTime.now());
|
||||
return wechatPaymentHistoryMapper.insert(wechatPaymentHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改微信订单表
|
||||
*
|
||||
* @param wechatPaymentHistory 微信订单表
|
||||
* @return 结果
|
||||
*/
|
||||
public int update(WechatPaymentHistory wechatPaymentHistory) {
|
||||
return wechatPaymentHistoryMapper.updateById(wechatPaymentHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除微信订单表信息
|
||||
*
|
||||
* @param id 微信订单表主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteById(Long id) {
|
||||
return wechatPaymentHistoryMapper.deleteById(id);
|
||||
}
|
||||
|
||||
public IPage<WechatPaymentHistory> pagelist(WechatPaymentHistoryQuery query, PageVO page) {
|
||||
IPage<WechatPaymentHistory> pageParam = PageUtil.initPage(page);
|
||||
return wechatPaymentHistoryMapper.selectWechatPaymentHistory(query, pageParam);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package org.dromara.system.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.dromara.system.domain.SysTenant;
|
||||
import org.dromara.system.domain.vo.SysTenantVo;
|
||||
@ -13,6 +14,7 @@ import java.util.Map;
|
||||
*
|
||||
* @author Michelle.Chung
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysTenantMapper extends BaseMapperPlus<SysTenant, SysTenantVo> {
|
||||
|
||||
@Select("SELECT COUNT(*) FROM sys_tenant WHERE status = 0")
|
||||
|
Loading…
x
Reference in New Issue
Block a user