修改bug
This commit is contained in:
parent
f640fed356
commit
4c0efb69bf
@ -56,7 +56,8 @@ public class IndexServiceImpl implements IndexService {
|
||||
}
|
||||
|
||||
private void addBasicStatistics(Map<String, Object> result) {
|
||||
result.put("memberCount", memberService.count());
|
||||
result.put("memberCount", memberService.getCount());
|
||||
|
||||
result.put("vlogCount", vlogMapper.countVlog());
|
||||
|
||||
// 待审核举报
|
||||
|
@ -56,7 +56,7 @@ spring:
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
# jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
|
||||
# rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
|
||||
url: jdbc:mysql://82.156.121.2:23306/wzj?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
url: jdbc:mysql://192.168.1.65:13306/loopin?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: wzj
|
||||
password: A085F27A43B0
|
||||
# # 从库数据源
|
||||
|
@ -4,9 +4,16 @@ package com.wzj.soopin.goods.controller;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.goods.convert.ProductConvert;
|
||||
import com.wzj.soopin.goods.domain.bo.BrandBo;
|
||||
import com.wzj.soopin.goods.domain.bo.ProductBo;
|
||||
import com.wzj.soopin.goods.domain.bo.SkuBo;
|
||||
import com.wzj.soopin.goods.domain.dto.ProductDTO;
|
||||
import com.wzj.soopin.goods.domain.entity.Brand;
|
||||
import com.wzj.soopin.goods.domain.entity.Product;
|
||||
import com.wzj.soopin.goods.domain.entity.Sku;
|
||||
import com.wzj.soopin.goods.domain.vo.BrandVO;
|
||||
import com.wzj.soopin.goods.domain.vo.ProductVO;
|
||||
import com.wzj.soopin.goods.domain.vo.SkuVO;
|
||||
import com.wzj.soopin.goods.service.ProductService;
|
||||
import com.wzj.soopin.goods.service.impl.ProductServiceImpl;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@ -35,9 +42,10 @@ public class ProductController extends BaseController {
|
||||
private final ProductConvert convert;
|
||||
private final ProductService productService;
|
||||
|
||||
|
||||
@Tag(name ="查询商品信息列表")
|
||||
@PostMapping("list")
|
||||
public R<IPage<ProductVO>> list(@RequestBody ProductBo query, Page<Product> page) {
|
||||
public R<IPage<ProductVO>> list(@RequestBody ProductBo query, @RequestBody Page<Product> page) {
|
||||
return R.ok(productService.getList(query,page));
|
||||
}
|
||||
|
||||
@ -60,9 +68,8 @@ public class ProductController extends BaseController {
|
||||
@Tag(name ="新增商品信息")
|
||||
@Log(title = "商品信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public R add(@RequestBody Product product) {
|
||||
product.setAuthFlag(1);
|
||||
return R.ok(service.save(product));
|
||||
public R add(@RequestBody ProductDTO productDTO) {
|
||||
return R.ok(service.insert(productDTO));
|
||||
}
|
||||
|
||||
@Tag(name ="修改商品信息")
|
||||
@ -72,11 +79,11 @@ public class ProductController extends BaseController {
|
||||
return R.ok(service.updateById(product));
|
||||
}
|
||||
|
||||
@Tag(name ="删除商品信息")
|
||||
@Tag(name = "删除商品信息")
|
||||
@Log(title = "商品信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{id}")
|
||||
@DeleteMapping("/{id}")
|
||||
public R remove(@PathVariable Long id) {
|
||||
return R.ok(service.removeById(id));
|
||||
return R.ok(service.removeProductWithSkus(id));
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@ import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@ -57,6 +58,8 @@ public class SkuController extends BaseController {
|
||||
@Log(title = "sku信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public R add(@RequestBody Sku sku) {
|
||||
Long tenantId = Long.valueOf(LoginHelper.getTenantId());
|
||||
sku.setTenantId(tenantId);
|
||||
return R.ok(service.save(sku));
|
||||
}
|
||||
|
||||
|
@ -25,54 +25,19 @@ public class ProductBo {
|
||||
@Schema(description = "NAME 模糊匹配")
|
||||
private String nameLike;
|
||||
|
||||
@Schema(description = "主图 精确匹配")
|
||||
private String pic;
|
||||
|
||||
@Schema(description = "画册图片,连产品图片限制为5张,以逗号分割 精确匹配")
|
||||
private String albumPics;
|
||||
|
||||
@Schema(description = "上架状态:0->下架;1->上架 精确匹配")
|
||||
private Integer publishStatus;
|
||||
|
||||
@Schema(description = "排序 精确匹配")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "PRICE 精确匹配")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "单位 精确匹配")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "商品销售属性,json格式")
|
||||
private String productAttr;
|
||||
|
||||
@Schema(description = "商品重量,默认为克 精确匹配")
|
||||
private BigDecimal weight;
|
||||
|
||||
@Schema(description = "产品详情网页内容 精确匹配")
|
||||
private String detailHtml;
|
||||
|
||||
@Schema(description = "移动端网页详情 精确匹配")
|
||||
private String detailMobileHtml;
|
||||
|
||||
@Schema(description = "品牌名称 模糊匹配")
|
||||
private String brandNameLike;
|
||||
|
||||
@Schema(description = "商品分类名称 模糊匹配")
|
||||
private String productCategoryNameLike;
|
||||
|
||||
@Schema(description = "排序字段")
|
||||
private String orderField = "sort";
|
||||
|
||||
@Schema(description = "排序规则")
|
||||
private String orderSort = "desc";
|
||||
|
||||
@Schema(description = "搜索关键字")
|
||||
private String search;
|
||||
|
||||
@Schema(description = "排除的商品ID列表")
|
||||
private List<Long> excludeProductIds;
|
||||
|
||||
@Schema(description = "指定的商品ID列表")
|
||||
private List<Long> ids;
|
||||
|
||||
@ -87,20 +52,11 @@ public class ProductBo {
|
||||
.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);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,102 @@
|
||||
package com.wzj.soopin.goods.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.excel.annotation.Excel;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "商品信息DTO对象")
|
||||
@Data
|
||||
public class ProductDTO {
|
||||
|
||||
@Schema(description = "BRAND_ID")
|
||||
@Excel(name = "BRAND_ID")
|
||||
private Long brandId;
|
||||
|
||||
@Schema(description = "CATEGORY_ID")
|
||||
@Excel(name = "CATEGORY_ID")
|
||||
private Long categoryId;
|
||||
|
||||
@Schema(description = "商品编码")
|
||||
@Excel(name = "商品编码")
|
||||
private String outProductId;
|
||||
|
||||
@Schema(description = "NAME")
|
||||
@Excel(name = "NAME")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "主图")
|
||||
@Excel(name = "主图")
|
||||
private String pic;
|
||||
|
||||
@Schema(description = "画册图片,连产品图片限制为5张,以逗号分割")
|
||||
@Excel(name = "画册图片,连产品图片限制为5张,以逗号分割")
|
||||
private String albumPics;
|
||||
|
||||
@Schema(description = "上架状态:0->下架;1->上架")
|
||||
@Excel(name = "上架状态:0->下架;1->上架")
|
||||
private Integer publishStatus;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@Excel(name = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "PRICE")
|
||||
@Excel(name = "PRICE")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "商品重量,默认为克")
|
||||
@Excel(name = "商品重量,默认为克")
|
||||
private BigDecimal weight;
|
||||
|
||||
@Schema(description = "商品销售属性,json格式")
|
||||
@Excel(name = "商品销售属性,json格式")
|
||||
private String productAttr;
|
||||
|
||||
@Schema(description = "产品详情网页内容")
|
||||
@Excel(name = "产品详情网页内容")
|
||||
private String detailHtml;
|
||||
|
||||
@Schema(description = "移动端网页详情")
|
||||
@Excel(name = "移动端网页详情")
|
||||
private String detailMobileHtml;
|
||||
|
||||
@Schema(description = "品牌名称")
|
||||
@Excel(name = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
@Schema(description = "商品分类名称")
|
||||
@Excel(name = "商品分类名称")
|
||||
private String productCategoryName;
|
||||
|
||||
@Schema(description = "商品类型 1.团购;->2.拼团;3->秒杀")
|
||||
@Excel(name = "商品类型 1.团购;->2.拼团;3->秒杀")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "店铺id")
|
||||
@Excel(name = "店铺id")
|
||||
private Long tenantId;
|
||||
|
||||
@Schema(description = "审核状态 1.待审核;->2.审核通过;3->审核驳回")
|
||||
@Excel(name = "审核状态 1.待审核;->2.审核通过;3->审核驳回")
|
||||
private Integer authFlag;
|
||||
|
||||
@Schema(description = "销量")
|
||||
@Excel(name = "销量")
|
||||
private String sales;
|
||||
|
||||
@Schema(description = "驳回原因")
|
||||
@Excel(name = "驳回原因")
|
||||
private String reasons;
|
||||
|
||||
@Schema(description = "SKU列表")
|
||||
@Excel(name = "SKU列表")
|
||||
private List<SkuDTO> skuList;
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.wzj.soopin.goods.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "SKU信息DTO")
|
||||
public class SkuDTO {
|
||||
|
||||
|
||||
@Schema(description = "SKU编码")
|
||||
private String outSkuId;
|
||||
|
||||
@Schema(description = "价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "图片")
|
||||
private String pic;
|
||||
|
||||
@Schema(description = "规格属性(JSON格式)")
|
||||
private String spData;
|
||||
|
||||
@Schema(description = "库存")
|
||||
private Integer stock;
|
||||
|
||||
}
|
@ -47,4 +47,8 @@ public class Sku extends BaseAudit {
|
||||
@Schema(description = "库存数")
|
||||
@Excel(name = "库存数")
|
||||
private Integer stock;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
@Excel(name = "租户id")
|
||||
private Long tenantId;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public interface ProductMapper extends BaseMapper<Product> {
|
||||
*/
|
||||
List<Product> selectByEntity(Product product);
|
||||
|
||||
IPage<ProductVO> getlist(@Param("page") Page<Product> page, @Param("query") ProductBo query);
|
||||
IPage<ProductVO> getlist(@Param("page") Page<Product> page, @Param("query") ProductBo query,Long tenantId);
|
||||
|
||||
|
||||
|
||||
|
@ -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.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -29,8 +30,16 @@ 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);
|
||||
IPage<SkuVO> getlist(@Param("page") Page<Sku> page,@Param("query") SkuBo query, @Param("tenantId") Long tenantId);
|
||||
|
||||
|
||||
SkuVO selectSkuByid(@Param("id") Long id);
|
||||
|
||||
@Insert("<script>" +
|
||||
"INSERT INTO pms_sku (product_id, out_sku_id, price, pic, sp_data, stock) VALUES " +
|
||||
"<foreach collection='list' item='item' separator=','>" +
|
||||
"(#{item.productId}, #{item.outSkuId}, #{item.price}, #{item.pic}, #{item.spData}, #{item.stock})" +
|
||||
"</foreach>" +
|
||||
"</script>")
|
||||
void batchInsert(List<Sku> skus);
|
||||
}
|
||||
|
@ -1,16 +1,30 @@
|
||||
package com.wzj.soopin.goods.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wzj.soopin.goods.domain.bo.ProductBo;
|
||||
import com.wzj.soopin.goods.domain.dto.ProductDTO;
|
||||
import com.wzj.soopin.goods.domain.dto.SkuDTO;
|
||||
import com.wzj.soopin.goods.domain.entity.Product;
|
||||
import com.wzj.soopin.goods.domain.entity.Sku;
|
||||
import com.wzj.soopin.goods.domain.vo.ProductVO;
|
||||
import com.wzj.soopin.goods.mapper.ProductMapper;
|
||||
import com.wzj.soopin.goods.mapper.SkuMapper;
|
||||
import com.wzj.soopin.goods.service.ProductService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.model.LoginUser;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 商品信息Service业务层处理
|
||||
*
|
||||
@ -19,14 +33,18 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {
|
||||
|
||||
|
||||
private final ProductMapper productMapper;
|
||||
private final SkuMapper skuMapper;
|
||||
|
||||
@Override
|
||||
public IPage<ProductVO> getList(ProductBo query, Page<Product> page) {
|
||||
return productMapper.getlist(page,query);
|
||||
|
||||
Long tenantId = Long.valueOf(LoginHelper.getTenantId());
|
||||
return productMapper.getlist(page,query,tenantId);
|
||||
}
|
||||
|
||||
|
||||
@ -35,7 +53,8 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
|
||||
//推荐商品要根据算法获取
|
||||
|
||||
return productMapper.getlist(page,new ProductBo());
|
||||
Long tenantId = Long.valueOf(LoginHelper.getTenantId());
|
||||
return productMapper.getlist(page,new ProductBo(),tenantId);
|
||||
}
|
||||
|
||||
public Product audit(Long id, Integer authFlag, String reasons) {
|
||||
@ -69,4 +88,77 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
return productMapper.selectProductWithSkus(id);
|
||||
|
||||
}
|
||||
|
||||
public R insert(ProductDTO productDTO) {
|
||||
try {
|
||||
// 1. 保存商品基本信息
|
||||
Product product = convertToProduct(productDTO);
|
||||
productMapper.insert(product);
|
||||
|
||||
// 2. 保存SKU列表
|
||||
if (CollectionUtils.isNotEmpty(productDTO.getSkuList())) {
|
||||
List<Sku> skus = productDTO.getSkuList().stream()
|
||||
.map(skuDTO -> convertToSku(skuDTO, product.getId()))
|
||||
.collect(Collectors.toList());
|
||||
skuMapper.batchInsert(skus);
|
||||
}
|
||||
|
||||
return R.ok("商品添加成功");
|
||||
} catch (Exception e) {
|
||||
log.error("添加商品失败", e);
|
||||
throw new ServiceException("添加商品失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
private Product convertToProduct(ProductDTO dto) {
|
||||
// 获取登录信息
|
||||
LoginUser loginUser = LoginHelper.getLoginUser();
|
||||
|
||||
Product product = new Product();
|
||||
product.setBrandId(dto.getBrandId());
|
||||
product.setCategoryId(dto.getCategoryId());
|
||||
product.setOutProductId(dto.getOutProductId());
|
||||
product.setName(dto.getName());
|
||||
product.setPic(dto.getPic());
|
||||
product.setPrice(dto.getPrice());
|
||||
product.setAlbumPics(dto.getAlbumPics());
|
||||
product.setUnit(dto.getUnit());
|
||||
product.setWeight(dto.getWeight());
|
||||
product.setProductAttr(dto.getProductAttr());
|
||||
product.setDetailHtml(dto.getDetailHtml());
|
||||
product.setDetailMobileHtml(dto.getDetailMobileHtml());
|
||||
if (loginUser != null) {
|
||||
product.setTenantId(Long.valueOf(loginUser.getTenantId()));
|
||||
log.info("登录租户id:{}", loginUser.getTenantId());
|
||||
}
|
||||
product.setAuthFlag(1);
|
||||
product.setPublishStatus(dto.getPublishStatus());
|
||||
product.setBrandName(dto.getBrandName());
|
||||
product.setProductCategoryName(dto.getProductCategoryName());
|
||||
product.setType(1);
|
||||
product.setSales("0");
|
||||
product.setTenantId(dto.getTenantId());
|
||||
return product;
|
||||
}
|
||||
|
||||
private Sku convertToSku(SkuDTO dto, Long productId) {
|
||||
Sku sku = new Sku();
|
||||
sku.setProductId(productId);
|
||||
sku.setOutSkuId(dto.getOutSkuId());
|
||||
sku.setPrice(dto.getPrice());
|
||||
sku.setPic(dto.getPic());
|
||||
sku.setSpData(dto.getSpData());
|
||||
sku.setStock(dto.getStock());
|
||||
return sku;
|
||||
}
|
||||
|
||||
|
||||
public boolean removeProductWithSkus(Long id) {
|
||||
//删除关联的SKU数据
|
||||
LambdaQueryWrapper<Sku> skuQueryWrapper = new LambdaQueryWrapper<>();
|
||||
skuQueryWrapper.eq(Sku::getProductId, id);
|
||||
skuMapper.delete(skuQueryWrapper);
|
||||
|
||||
//删除商品主表数据
|
||||
return productMapper.deleteById(id) > 0;
|
||||
}
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import com.wzj.soopin.goods.domain.entity.Sku;
|
||||
import com.wzj.soopin.goods.mapper.SkuMapper;
|
||||
import com.wzj.soopin.goods.service.SkuService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@ -25,7 +26,8 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements SkuSe
|
||||
private final SkuMapper skuMapper;
|
||||
|
||||
public IPage<SkuVO> getList(SkuBo query, Page<Sku> page) {
|
||||
return skuMapper.getlist(page,query);
|
||||
Long tenantId = Long.valueOf(LoginHelper.getTenantId());
|
||||
return skuMapper.getlist(page,query,tenantId);
|
||||
}
|
||||
|
||||
public SkuVO selectSkuByid(Long id) {
|
||||
|
@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
p.*,
|
||||
b.name AS brandName,
|
||||
b.logo AS brandLogo,
|
||||
t.company_name AS contactUserName,
|
||||
t.store_name AS contactUserName,
|
||||
t.contact_phone AS contactPhone,
|
||||
o.distribution AS distribution,
|
||||
pc.name AS productCategoryName
|
||||
@ -72,22 +72,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
LEFT JOIN oms_order_item oi ON p.id = oi.product_id
|
||||
LEFT JOIN oms_order o ON oi.order_id = o.id
|
||||
LEFT JOIN pms_product_category pc ON p.category_id = pc.id
|
||||
WHERE 1=1
|
||||
<if test="query.contactPhone != null and query.contactPhone != ''">
|
||||
AND t.contact_phone LIKE '%${query.contactPhone}%'
|
||||
</if>
|
||||
WHERE p.tenant_id = #{tenantId}
|
||||
<if test="query.nameLike != null and query.nameLike != ''">
|
||||
AND p.name LIKE CONCAT('%', #{query.nameLike}, '%')
|
||||
</if>
|
||||
<if test="query.outProductId != null">
|
||||
AND p.out_product_id = #{query.outProductId}
|
||||
</if>
|
||||
<if test="query.brandId != null">
|
||||
AND p.brand_id = #{query.brandId}
|
||||
</if>
|
||||
<if test="query.publishStatus != null">
|
||||
AND p.publish_status = #{query.publishStatus}
|
||||
</if>
|
||||
<if test="query.authFlag != null">
|
||||
AND p.auth_flag = #{query.authFlag}
|
||||
</if>
|
||||
<if test="query.categoryId != null">
|
||||
AND p.category_id = #{query.categoryId}
|
||||
</if>
|
||||
ORDER BY
|
||||
p.sales DESC,
|
||||
p.price ASC,
|
||||
|
@ -54,7 +54,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
pms_sku s
|
||||
LEFT JOIN
|
||||
pms_product p ON s.product_id = p.id
|
||||
<where>
|
||||
where 1=1
|
||||
AND s.tenant_id = #{tenantId}
|
||||
<if test="query.productName != null and query.productName != ''">
|
||||
AND p.name LIKE CONCAT('%', #{query.productName}, '%')
|
||||
</if>
|
||||
@ -67,7 +68,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="query.pic != null and query.pic != ''">
|
||||
AND s.pic LIKE CONCAT('%', #{query.pic}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY
|
||||
s.create_time DESC
|
||||
|
||||
|
@ -20,14 +20,17 @@ import java.util.List;
|
||||
public interface MemberAccountMapper extends BaseMapper<MemberAccount> {
|
||||
IPage<MemberAccountVO> selectAccountWithMember(Page<?> page, @Param("bo") MemberAccountBO bo);
|
||||
|
||||
@Select("SELECT money_balance \n" +
|
||||
@Select("SELECT wallet \n" +
|
||||
"FROM ums_account \n" +
|
||||
"WHERE member_id = #{memberId};")
|
||||
BigDecimal getMoneyBalanceByMemberId(Long memberId);
|
||||
|
||||
@Select("UPDATE ums_account \n" +
|
||||
"SET money_balance = #{afterBalance} \n" +
|
||||
"SET wallet = #{afterBalance} \n" +
|
||||
"WHERE member_id = #{senderId};")
|
||||
void updateMoneyBalance(Long senderId, BigDecimal afterBalance);
|
||||
|
||||
@Select("SELECT COUNT(*) FROM ums_member")
|
||||
Object getCount();
|
||||
}
|
||||
|
||||
|
@ -6,10 +6,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.wzj.soopin.member.domain.bo.MemberAccountBO;
|
||||
import com.wzj.soopin.member.domain.po.MemberAccount;
|
||||
import com.wzj.soopin.member.domain.vo.MemberAccountVO;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
public interface IMemberAccountService extends IService<MemberAccount> {
|
||||
|
||||
MemberAccount getMemberAccount(Long memberId);
|
||||
|
||||
IPage<MemberAccountVO> pageWithMember(Page<?> page, MemberAccountBO bo);
|
||||
|
||||
Object getCount();
|
||||
}
|
||||
|
@ -44,5 +44,10 @@ public class MemberAccountServiceImpl extends ServiceImpl<MemberAccountMapper,Me
|
||||
return baseMapper.selectAccountWithMember(page, bo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getCount() {
|
||||
return baseMapper.getCount();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.redis.redis.RedisService;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@ -69,6 +70,8 @@ public class AftersaleController extends BaseController {
|
||||
@Log(title = "订单售后", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public R add(@RequestBody Aftersale aftersale) {
|
||||
Long tenantId = Long.valueOf(LoginHelper.getTenantId());
|
||||
aftersale.setTenantId(tenantId);
|
||||
return R.ok(service.save(aftersale));
|
||||
}
|
||||
|
||||
@ -114,4 +117,15 @@ public class AftersaleController extends BaseController {
|
||||
public R log(@PathVariable Long orderId){
|
||||
return R.ok(service.log(orderId));
|
||||
}
|
||||
|
||||
@Tag(name ="退款审批")
|
||||
@Log(title = "退款审批", businessType = BusinessType.UPDATE)
|
||||
@GetMapping("/audit")
|
||||
public R audit( @RequestParam Long id,
|
||||
@RequestParam Integer authFlag,
|
||||
@RequestParam(required = false) String cause) {
|
||||
return R.ok(service.audit(id,authFlag,cause));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,26 +1,18 @@
|
||||
package com.wzj.soopin.order.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.order.convert.OrderConvert;
|
||||
import com.wzj.soopin.order.domain.bo.OrderBo;
|
||||
import com.wzj.soopin.order.domain.entity.Order;
|
||||
import com.wzj.soopin.order.domain.form.DeliverProductForm;
|
||||
import com.wzj.soopin.order.domain.form.OrderPayForm;
|
||||
import com.wzj.soopin.order.domain.vo.*;
|
||||
import com.wzj.soopin.order.service.OrderService;
|
||||
import com.wzj.soopin.order.service.OrderItemService;
|
||||
import com.wzj.soopin.order.service.impl.OrderServiceImpl;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.event.Constants;
|
||||
import org.dromara.common.core.utils.LocalDataUtil;
|
||||
import org.dromara.common.core.utils.SecurityUtils;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
@ -28,7 +20,6 @@ import org.dromara.common.redis.redis.RedisService;
|
||||
import org.dromara.common.redis.utils.RedisUtils;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@ -117,26 +108,6 @@ public class OrderController extends BaseController {
|
||||
return service.saveMerchantNote(order);
|
||||
}
|
||||
|
||||
@Tag(name ="管理后台订单发货")
|
||||
@PostMapping("/deliverProduct")
|
||||
public ResponseEntity<String> delivery(@RequestBody DeliverProductForm request){
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
String redisKey = "oms_order_deliverProduct" + request.getOrderId();
|
||||
String redisValue = request.getOrderId() + "_" + System.currentTimeMillis();
|
||||
try{
|
||||
redisService.lock(redisKey, redisValue, 60);
|
||||
return ResponseEntity.ok(service.deliverProduct(request, userId));
|
||||
}catch (Exception e){
|
||||
log.error("订单发货接口异常");
|
||||
throw new RuntimeException("发货失败");
|
||||
}finally {
|
||||
try{
|
||||
redisService.unLock(redisKey, redisValue);
|
||||
}catch (Exception e){
|
||||
log.error("", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Tag(name ="订单日志")
|
||||
@GetMapping("/log/{orderId}")
|
||||
|
@ -41,8 +41,6 @@ public class OrderBo {
|
||||
@Schema(description ="应付金额(实际支付金额) 精确匹配")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
@Schema(description ="运费金额 精确匹配")
|
||||
private BigDecimal freightAmount;
|
||||
|
||||
@Schema(description ="支付方式:0->未支付;1->支付宝;2->微信 精确匹配")
|
||||
private Integer payType;
|
||||
@ -53,23 +51,6 @@ public class OrderBo {
|
||||
@Schema(description ="退款状态,枚举值:1:无售后或售后关闭,2:售后处理中,3:退款中,4: 退款成功 精确匹配")
|
||||
private Integer aftersaleStatus;
|
||||
|
||||
@Schema(description ="物流公司 精确匹配")
|
||||
private String deliveryCompany;
|
||||
|
||||
@Schema(description ="物流单号 精确匹配")
|
||||
private String deliverySn;
|
||||
|
||||
@Schema(description ="自动确认时间(天) 精确匹配")
|
||||
private Integer autoConfirmDay;
|
||||
|
||||
@Schema(description ="收货人姓名 精确匹配")
|
||||
private String receiverNameLike;
|
||||
|
||||
@Schema(description ="收货人电话 精确匹配")
|
||||
private String receiverPhone;
|
||||
|
||||
@Schema(description ="收货人邮编 精确匹配")
|
||||
private String receiverPostCode;
|
||||
|
||||
@Schema(description ="省份/直辖市 精确匹配")
|
||||
private String receiverProvince;
|
||||
@ -98,8 +79,6 @@ public class OrderBo {
|
||||
@Schema(description ="商家备注 精确匹配")
|
||||
private String MEMBER_ID;
|
||||
|
||||
@Schema(description ="确认收货状态:0->未确认;1->已确认 精确匹配")
|
||||
private Integer confirmStatus;
|
||||
|
||||
@Schema(description ="删除状态:0->未删除;1->已删除 精确匹配")
|
||||
private Integer deleteStatus;
|
||||
@ -107,11 +86,6 @@ public class OrderBo {
|
||||
@Schema(description ="支付时间 精确匹配")
|
||||
private LocalDateTime paymentTime;
|
||||
|
||||
@Schema(description ="发货时间 精确匹配")
|
||||
private LocalDateTime deliveryTime;
|
||||
|
||||
@Schema(description ="确认收货时间 精确匹配")
|
||||
private LocalDateTime receiveTime;
|
||||
|
||||
@Schema(description ="创建订单开始时间 精确匹配")
|
||||
private LocalDateTime startTime;
|
||||
@ -136,7 +110,6 @@ public class OrderBo {
|
||||
.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)
|
||||
|
@ -81,4 +81,18 @@ public class Aftersale extends BaseAudit {
|
||||
@Schema(description = "退货快递号")
|
||||
@Excel(name = "退货快递号")
|
||||
private String refundWaybillCode;
|
||||
|
||||
@Schema(description = "审核状态 1.待审核;->2.审核通过;3->审核驳回")
|
||||
@Excel(name = "审核状态 1.待审核;->2.审核通过;3->审核驳回")
|
||||
private Integer authFlag;
|
||||
|
||||
@Schema(description = "驳回原因")
|
||||
@Excel(name = "驳回原因")
|
||||
private String cause;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "租户id")
|
||||
@Excel(name = "租户id")
|
||||
private Long tenantId;
|
||||
}
|
||||
|
@ -64,9 +64,6 @@ public class Order extends BaseAudit {
|
||||
@Excel(name = "应付金额", readConverterExp = "实=际支付金额")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
@Schema(description = "运费金额")
|
||||
@Excel(name = "运费金额")
|
||||
private BigDecimal freightAmount;
|
||||
|
||||
@Schema(description = "支付方式:0->未支付;1->支付宝;2->微信")
|
||||
@Excel(name = "支付方式:0->未支付;1->支付宝;2->微信")
|
||||
@ -80,34 +77,12 @@ public class Order extends BaseAudit {
|
||||
@Excel(name = "退款状态,枚举值:1:无售后或售后关闭,2:售后处理中,3:退款中,4: 退款成功")
|
||||
private Integer aftersaleStatus;
|
||||
|
||||
@Schema(description = "物流公司(配送方式)")
|
||||
@Excel(name = "物流公司(配送方式)")
|
||||
private String deliveryCompany;
|
||||
|
||||
@Schema(description = "物流单号")
|
||||
@Excel(name = "物流单号")
|
||||
private String deliverySn;
|
||||
|
||||
@Schema(description = "自动确认时间(天)")
|
||||
@Excel(name = "自动确认时间", readConverterExp = "天=")
|
||||
private Integer autoConfirmDay;
|
||||
|
||||
@Schema(description = "收货人姓名")
|
||||
@Excel(name = "收货人姓名")
|
||||
private String receiverName;
|
||||
|
||||
@Schema(description = "收货人电话")
|
||||
@Excel(name = "收货人电话")
|
||||
private String receiverPhone;
|
||||
|
||||
@Schema(description = "加密的手机号")
|
||||
@Excel(name = "加密的手机号")
|
||||
private String receiverPhoneEncrypted;
|
||||
|
||||
@Schema(description = "收货人邮编")
|
||||
@Excel(name = "收货人邮编")
|
||||
private String receiverPostCode;
|
||||
|
||||
@Schema(description = "省份/直辖市")
|
||||
@Excel(name = "省份/直辖市")
|
||||
private String receiverProvince;
|
||||
@ -140,10 +115,6 @@ public class Order extends BaseAudit {
|
||||
@Excel(name = "订单备注")
|
||||
private String note;
|
||||
|
||||
@Schema(description = "确认收货状态:0->未确认;1->已确认")
|
||||
@Excel(name = "确认收货状态:0->未确认;1->已确认")
|
||||
private Integer confirmStatus;
|
||||
|
||||
@Schema(description = "删除状态:0->未删除;1->已删除")
|
||||
@Excel(name = "删除状态:0->未删除;1->已删除")
|
||||
private Integer deleteStatus;
|
||||
@ -152,13 +123,6 @@ public class Order extends BaseAudit {
|
||||
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime paymentTime;
|
||||
|
||||
@Schema(description = "发货时间")
|
||||
@Excel(name = "发货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime deliveryTime;
|
||||
|
||||
@Schema(description = "确认收货时间")
|
||||
@Excel(name = "确认收货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime receiveTime;
|
||||
|
||||
@Schema(description = "优惠券ID")
|
||||
private Long memberCouponId;
|
||||
@ -185,4 +149,5 @@ public class Order extends BaseAudit {
|
||||
@Schema(description = "核销码")
|
||||
private String code;
|
||||
|
||||
|
||||
}
|
||||
|
@ -87,4 +87,16 @@ public class AftersaleVO extends BaseAudit {
|
||||
@Schema(description = "处理人员")
|
||||
@Excel(name = "处理人员")
|
||||
private String handleMan;
|
||||
|
||||
@Schema(description = "审核状态 1.待审核;->2.审核通过;3->审核驳回")
|
||||
@Excel(name = "审核状态 1.待审核;->2.审核通过;3->审核驳回")
|
||||
private Integer authFlag;
|
||||
|
||||
@Schema(description = "驳回原因")
|
||||
@Excel(name = "驳回原因")
|
||||
private String cause;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
@Excel(name = "租户id")
|
||||
private Long tenantId;
|
||||
}
|
||||
|
@ -135,27 +135,13 @@ public class ManagerOrderVO {
|
||||
if (payType != null) {
|
||||
queryWrapper.eq(Order::getPayType, payType);
|
||||
}
|
||||
if (receiveTime != null) {
|
||||
queryWrapper.eq(Order::getReceiveTime, receiveTime);
|
||||
}
|
||||
|
||||
if (note != null && !note.isEmpty()) {
|
||||
queryWrapper.like(Order::getNote, note);
|
||||
}
|
||||
if (merchantNote != null && !merchantNote.isEmpty()) {
|
||||
queryWrapper.like(Order::getMerchantNote, merchantNote);
|
||||
}
|
||||
if (deliveryTime != null) {
|
||||
queryWrapper.eq(Order::getDeliveryTime, deliveryTime);
|
||||
}
|
||||
if (deliverySn != null && !deliverySn.isEmpty()) {
|
||||
queryWrapper.eq(Order::getDeliverySn, deliverySn);
|
||||
}
|
||||
if (receiverName != null && !receiverName.isEmpty()) {
|
||||
queryWrapper.like(Order::getReceiverName, receiverName);
|
||||
}
|
||||
if (receiverPhone != null && !receiverPhone.isEmpty()) {
|
||||
queryWrapper.eq(Order::getReceiverPhone, receiverPhone);
|
||||
}
|
||||
if (receiverProvince != null && !receiverProvince.isEmpty()) {
|
||||
queryWrapper.eq(Order::getReceiverProvince, receiverProvince);
|
||||
}
|
||||
|
@ -59,9 +59,6 @@ public class OrderVO extends BaseAudit {
|
||||
@Excel(name = "应付金额", readConverterExp = "实=际支付金额")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
@Schema(description ="运费金额")
|
||||
@Excel(name = "运费金额")
|
||||
private BigDecimal freightAmount;
|
||||
|
||||
@Schema(description ="支付方式:0->未支付;1->支付宝;2->微信")
|
||||
@Excel(name = "支付方式:0->未支付;1->支付宝;2->微信")
|
||||
@ -75,28 +72,6 @@ public class OrderVO extends BaseAudit {
|
||||
@Excel(name = "退款状态,枚举值:1:无售后或售后关闭,2:售后处理中,3:退款中,4: 退款成功")
|
||||
private Integer aftersaleStatus;
|
||||
|
||||
@Schema(description ="物流公司(配送方式)")
|
||||
private String deliveryCompany;
|
||||
|
||||
@Schema(description ="物流单号")
|
||||
@Excel(name = "物流单号")
|
||||
private String deliverySn;
|
||||
|
||||
@Schema(description ="自动确认时间")
|
||||
@Excel(name = "自动确认时间", readConverterExp = "天=")
|
||||
private Integer autoConfirmDay;
|
||||
|
||||
@Schema(description ="收货人姓名")
|
||||
@Excel(name = "收货人姓名")
|
||||
private String receiverName;
|
||||
|
||||
@Schema(description ="收货人电话")
|
||||
@Excel(name = "收货人电话")
|
||||
private String receiverPhone;
|
||||
|
||||
@Schema(description ="收货人邮编")
|
||||
@Excel(name = "收货人邮编")
|
||||
private String receiverPostCode;
|
||||
|
||||
@Schema(description ="省份/直辖市")
|
||||
@Excel(name = "省份/直辖市")
|
||||
@ -130,9 +105,6 @@ public class OrderVO extends BaseAudit {
|
||||
@Excel(name = "订单备注")
|
||||
private String note;
|
||||
|
||||
@Schema(description ="确认收货状态:0->未确认;1->已确认")
|
||||
@Excel(name = "确认收货状态:0->未确认;1->已确认")
|
||||
private Integer confirmStatus;
|
||||
|
||||
@Schema(description ="发删除状态:0->未删除;1->已删除")
|
||||
@Excel(name = "删除状态:0->未删除;1->已删除")
|
||||
@ -143,16 +115,6 @@ public class OrderVO extends BaseAudit {
|
||||
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime paymentTime;
|
||||
|
||||
@Schema(description ="发货时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "发货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime deliveryTime;
|
||||
|
||||
@Schema(description ="确认收货时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "确认收货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime receiveTime;
|
||||
|
||||
private List<OrderItem> items;
|
||||
|
||||
@Excel(name = "用户昵称")
|
||||
|
@ -30,5 +30,5 @@ public interface AftersaleMapper extends BaseMapper<Aftersale> {
|
||||
|
||||
List<ManagerRefundOrderVO> selectManagerRefundOrder(ManagerAftersaleOrderForm managerAftersaleOrderPageRequest);
|
||||
|
||||
IPage<AftersaleVO> getlist(@Param("page") Page<Aftersale> page, @Param("query")AftersaleBo query);
|
||||
IPage<AftersaleVO> getlist(@Param("page") Page<Aftersale> page, @Param("query")AftersaleBo query, @Param("tenantId") Long tenantId);
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public interface OrderMapper extends BaseMapper<Order> {
|
||||
List<ManagerOrderVO> selectManagerOrderPage(ManagerOrderQueryForm request);
|
||||
|
||||
|
||||
IPage<OrderVO> getlist(@Param("page") Page<Order> page,@Param("query") OrderBo query);
|
||||
IPage<OrderVO> getlist(@Param("page") Page<Order> page,@Param("query") OrderBo query,@Param("tenantId") Long tenantId);
|
||||
|
||||
@Select("SELECT " +
|
||||
"COUNT(*) AS count1, " +
|
||||
|
@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.wechat.pay.java.service.refund.model.Refund;
|
||||
import com.wechat.pay.java.service.refund.model.RefundNotification;
|
||||
import com.wzj.soopin.goods.domain.entity.Product;
|
||||
import com.wzj.soopin.goods.mapper.SkuMapper;
|
||||
import com.wzj.soopin.member.domain.po.Member;
|
||||
import com.wzj.soopin.member.domain.po.MemberWechat;
|
||||
@ -30,6 +31,7 @@ import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.domain.event.Constants;
|
||||
import org.dromara.common.core.enums.AftersaleStatus;
|
||||
import org.dromara.common.core.enums.OrderRefundStatus;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -81,9 +83,6 @@ public class AftersaleServiceImpl extends ServiceImpl<AftersaleMapper, Aftersale
|
||||
result.setPayType(order.getPayType());
|
||||
result.setPayTime(order.getPaymentTime());
|
||||
result.setStatus(order.getStatus());
|
||||
result.setExpressName(order.getDeliveryCompany());
|
||||
result.setDeliveryTime(order.getDeliveryTime());
|
||||
result.setExpressNo(order.getDeliverySn());
|
||||
result.setTotalAmount(order.getTotalAmount());
|
||||
result.setPayAmount(order.getPayAmount());
|
||||
//用户信息
|
||||
@ -93,8 +92,6 @@ public class AftersaleServiceImpl extends ServiceImpl<AftersaleMapper, Aftersale
|
||||
//收货信息
|
||||
OrderAddressVO orderAddressVO = new OrderAddressVO();
|
||||
orderAddressVO.setAddress(order.getReceiverDetailAddress());
|
||||
orderAddressVO.setName(order.getReceiverName());
|
||||
orderAddressVO.setUserPhone(order.getReceiverPhone());
|
||||
orderAddressVO.setArea(order.getReceiverProvince() + order.getReceiverCity() + order.getReceiverDistrict());
|
||||
result.setAddressInfo(orderAddressVO);
|
||||
//orderItem
|
||||
@ -378,7 +375,18 @@ public class AftersaleServiceImpl extends ServiceImpl<AftersaleMapper, Aftersale
|
||||
}
|
||||
|
||||
public IPage<AftersaleVO> getlist(Page<Aftersale> page, AftersaleBo query) {
|
||||
return aftersaleMapper.getlist(page,query);
|
||||
Long tenantId = Long.valueOf(LoginHelper.getTenantId());
|
||||
return aftersaleMapper.getlist(page,query,tenantId);
|
||||
}
|
||||
|
||||
public Aftersale audit(Long id, Integer authFlag, String cause) {
|
||||
Aftersale aftersale = aftersaleMapper.selectById(id);
|
||||
if (aftersale == null) {
|
||||
throw new RuntimeException("商品不存在");
|
||||
}
|
||||
aftersale.setAuthFlag(authFlag);
|
||||
aftersale.setCause(cause);
|
||||
aftersaleMapper.updateById(aftersale);
|
||||
return aftersale;
|
||||
}
|
||||
}
|
||||
|
@ -25,10 +25,9 @@ import com.wzj.soopin.order.wechat.WechatPayService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.domain.R;
|
||||
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.common.redis.redis.RedisService;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.system.domain.SysTenant;
|
||||
import org.dromara.system.domain.bo.SysMessageBo;
|
||||
import org.dromara.system.domain.vo.SysMessageTemplateVo;
|
||||
@ -40,7 +39,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
@ -93,25 +91,19 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
managerOrderDetailVO.setOrderSn(order.getOrderSn());
|
||||
managerOrderDetailVO.setOrderStatus(order.getStatus());
|
||||
managerOrderDetailVO.setCreateTime(order.getCreateTime());
|
||||
managerOrderDetailVO.setDeliveryTime(order.getDeliveryTime());
|
||||
managerOrderDetailVO.setExpressName(order.getDeliveryCompany());
|
||||
managerOrderDetailVO.setExpressNo(order.getDeliverySn());
|
||||
managerOrderDetailVO.setPayAmount(order.getPayAmount());
|
||||
managerOrderDetailVO.setPayTime(order.getPaymentTime());
|
||||
managerOrderDetailVO.setPayType(order.getPayType());
|
||||
managerOrderDetailVO.setTotalAmount(order.getTotalAmount());
|
||||
managerOrderDetailVO.setPayAmount(order.getPayAmount());
|
||||
managerOrderDetailVO.setReceiveTime(order.getReceiveTime());
|
||||
|
||||
//封装订单地址信息
|
||||
ManagerOrderAddressVo managerOrderAddressVo = new ManagerOrderAddressVo();
|
||||
managerOrderAddressVo.setUserPhone(order.getReceiverPhone());
|
||||
managerOrderAddressVo.setAddress(order.getReceiverDetailAddress());
|
||||
managerOrderAddressVo.setArea(
|
||||
order.getReceiverProvince() +
|
||||
order.getReceiverCity() +
|
||||
order.getReceiverDistrict());
|
||||
managerOrderAddressVo.setName(order.getReceiverName());
|
||||
managerOrderDetailVO.setAddressInfo(managerOrderAddressVo);
|
||||
|
||||
Member member = memberMapper.selectById(order.getMemberId());
|
||||
@ -202,6 +194,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
* @return 结果
|
||||
*/
|
||||
public R<Order> insert(Order order) {
|
||||
Long tenantId = Long.valueOf(LoginHelper.getTenantId());
|
||||
order.setTenantId(tenantId);
|
||||
order.setCreateTime(LocalDateTime.now());
|
||||
order.setWithdrawStatus(1);
|
||||
order.setStatus(0);
|
||||
@ -312,46 +306,46 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
return R.fail("更新失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理后台发货
|
||||
* 目前发货是这样的:待发货、已发货、已完成都能执行发货,每次都会创建一条新的发货记录且修改订单发货信息
|
||||
* @param request 发货请求
|
||||
* @param userId 操作人
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
public String deliverProduct(DeliverProductForm request, Long userId) {
|
||||
//查询订单
|
||||
Order order = orderMapper.selectById(request.getOrderId());
|
||||
QueryWrapper<OrderItem> qw = new QueryWrapper<>();
|
||||
qw.eq("order_id", request.getOrderId());
|
||||
List<OrderItem> orderItemList = orderItemMapper.selectList(qw);
|
||||
if (order == null || CollectionUtil.isEmpty(orderItemList)){
|
||||
throw new RuntimeException("未找到该订单信息");
|
||||
}
|
||||
// 是否为待发货、已发货 、已完成
|
||||
if (!(Constants.OrderStatus.SEND.equals(order.getStatus())
|
||||
|| Constants.OrderStatus.GET.equals(order.getStatus())
|
||||
|| Constants.OrderStatus.CONFIRM.equals(order.getStatus()))){
|
||||
throw new RuntimeException("订单状态错误");
|
||||
}
|
||||
Integer orderStatus =
|
||||
Constants.OrderStatus.SEND.equals(order.getStatus()) ? Constants.OrderStatus.GET : order.getStatus();
|
||||
//更新订单
|
||||
LocalDateTime optDate = LocalDateTime.now();
|
||||
order.setUpdateBy(null);
|
||||
order.setStatus(orderStatus);
|
||||
order.setDeliveryTime(optDate);
|
||||
order.setUpdateTime(optDate);
|
||||
order.setDeliveryCompany(request.getExpressName());
|
||||
order.setDeliverySn(request.getExpressSn());
|
||||
orderMapper.updateById(order);
|
||||
//创建新的发货记录
|
||||
this.createDeliveryHistory(request, userId, optDate);
|
||||
//创建订单操作记录
|
||||
this.createOrderOptHistory(order.getId(), order.getOrderSn(), orderStatus, userId, optDate);
|
||||
return "发货成功";
|
||||
}
|
||||
// /**
|
||||
// * 管理后台发货
|
||||
// * 目前发货是这样的:待发货、已发货、已完成都能执行发货,每次都会创建一条新的发货记录且修改订单发货信息
|
||||
// * @param request 发货请求
|
||||
// * @param userId 操作人
|
||||
// * @return 结果
|
||||
// */
|
||||
// @Transactional
|
||||
// public String deliverProduct(DeliverProductForm request, Long userId) {
|
||||
// //查询订单
|
||||
// Order order = orderMapper.selectById(request.getOrderId());
|
||||
// QueryWrapper<OrderItem> qw = new QueryWrapper<>();
|
||||
// qw.eq("order_id", request.getOrderId());
|
||||
// List<OrderItem> orderItemList = orderItemMapper.selectList(qw);
|
||||
// if (order == null || CollectionUtil.isEmpty(orderItemList)){
|
||||
// throw new RuntimeException("未找到该订单信息");
|
||||
// }
|
||||
// // 是否为待发货、已发货 、已完成
|
||||
// if (!(Constants.OrderStatus.SEND.equals(order.getStatus())
|
||||
// || Constants.OrderStatus.GET.equals(order.getStatus())
|
||||
// || Constants.OrderStatus.CONFIRM.equals(order.getStatus()))){
|
||||
// throw new RuntimeException("订单状态错误");
|
||||
// }
|
||||
// Integer orderStatus =
|
||||
// Constants.OrderStatus.SEND.equals(order.getStatus()) ? Constants.OrderStatus.GET : order.getStatus();
|
||||
// //更新订单
|
||||
// LocalDateTime optDate = LocalDateTime.now();
|
||||
// order.setUpdateBy(null);
|
||||
// order.setStatus(orderStatus);
|
||||
// order.setDeliveryTime(optDate);
|
||||
// order.setUpdateTime(optDate);
|
||||
// order.setDeliveryCompany(request.getExpressName());
|
||||
// order.setDeliverySn(request.getExpressSn());
|
||||
// orderMapper.updateById(order);
|
||||
// //创建新的发货记录
|
||||
// this.createDeliveryHistory(request, userId, optDate);
|
||||
// //创建订单操作记录
|
||||
// this.createOrderOptHistory(order.getId(), order.getOrderSn(), orderStatus, userId, optDate);
|
||||
// return "发货成功";
|
||||
// }
|
||||
|
||||
/**
|
||||
* 创建发货记录
|
||||
@ -438,33 +432,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
||||
}
|
||||
}
|
||||
|
||||
public R<Order> updateReceiver(Order order) {
|
||||
Order dbOrder = orderMapper.selectById(order.getId());
|
||||
if (dbOrder == null) {
|
||||
return R.fail("无该订单信息");
|
||||
}
|
||||
UpdateWrapper<Order> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.set("receiver_name",order.getReceiverName())
|
||||
.set("receiver_phone", PhoneUtils.hidePhone(order.getReceiverPhone()))
|
||||
.set("receiver_city",order.getReceiverCity())
|
||||
.set("receiver_district",order.getReceiverDistrict())
|
||||
.set("receiver_province",order.getReceiverProvince())
|
||||
.set("receiver_detail_address",order.getReceiverDetailAddress())
|
||||
// .set("receiver_phone_encrypted", AesCryptoUtils.encrypt(aesKey, order.getReceiverPhone()))
|
||||
.set("update_time",LocalDateTime.now());
|
||||
updateWrapper.eq("id",order.getId());
|
||||
int update = orderMapper.update(null, updateWrapper);
|
||||
if (update>0){
|
||||
return R.ok(order);
|
||||
}else {
|
||||
return R.fail("修改失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<OrderVO> getlist(Page<Order> page, OrderBo query) {
|
||||
|
||||
IPage<OrderVO> resultPage = orderMapper.getlist(page,query);
|
||||
Long tenantId = Long.valueOf(LoginHelper.getTenantId());
|
||||
IPage<OrderVO> resultPage = orderMapper.getlist(page,query,tenantId);
|
||||
List<OrderVO> orderVOList = resultPage.getRecords();
|
||||
if (orderVOList.isEmpty()) {
|
||||
return resultPage;
|
||||
|
@ -232,10 +232,12 @@ public class VerificationCodeServiceImpl extends ServiceImpl<VerificationCodesM
|
||||
params.put("productName", productName);
|
||||
params.put("verificationTime", formattedTime);
|
||||
SysMessageBo messageBo = new SysMessageBo();
|
||||
messageBo.setTemplateType(org.dromara.system.domain.MessageTemplateType.VERIFY_SUCCESS); // 核销成功类型编号
|
||||
// 核销成功类型编号
|
||||
messageBo.setTemplateType(org.dromara.system.domain.MessageTemplateType.VERIFY_SUCCESS);
|
||||
messageBo.setTemplateParams(params);
|
||||
messageBo.setSenderId(memberId);
|
||||
messageBo.setTitle("核销成功通知"); // 补充:设置消息标题
|
||||
// 补充:设置消息标题
|
||||
messageBo.setTitle("核销成功通知");
|
||||
sysMessageService.sendMessageToUser(messageBo, memberId);
|
||||
}
|
||||
|
||||
@ -252,10 +254,12 @@ public class VerificationCodeServiceImpl extends ServiceImpl<VerificationCodesM
|
||||
params.put("productName", productName);
|
||||
params.put("reason", reason);
|
||||
SysMessageBo messageBo = new SysMessageBo();
|
||||
messageBo.setTemplateType(org.dromara.system.domain.MessageTemplateType.VERIFY_FAIL); // 核销失败类型编号
|
||||
// 核销失败类型编号
|
||||
messageBo.setTemplateType(org.dromara.system.domain.MessageTemplateType.VERIFY_FAIL);
|
||||
messageBo.setTemplateParams(params);
|
||||
messageBo.setSenderId(memberId);
|
||||
messageBo.setTitle("核销失败通知"); // 补充:设置消息标题
|
||||
// 补充:设置消息标题
|
||||
messageBo.setTitle("核销失败通知");
|
||||
sysMessageService.sendMessageToUser(messageBo, memberId);
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
LEFT JOIN
|
||||
ums_member m ON a.member_id = m.id
|
||||
where 1=1
|
||||
|
||||
AND a.tenant_id = #{tenantId}
|
||||
<if test="query.memberId != null and query.memberId != ''">
|
||||
AND a.member_id LIKE CONCAT('%', #{query.memberId}, '%')
|
||||
</if>
|
||||
|
@ -11,7 +11,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="totalAmount" column="total_amount"/>
|
||||
<result property="purchasePrice" column="purchase_price"/>
|
||||
<result property="payAmount" column="pay_amount"/>
|
||||
<result property="freightAmount" column="freight_amount"/>
|
||||
<result property="payType" column="pay_type"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="aftersaleStatus" column="aftersale_status"/>
|
||||
@ -66,7 +65,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
|
||||
<if test="purchasePrice != null "> and purchase_price = #{purchasePrice}</if>
|
||||
<if test="payAmount != null "> and pay_amount = #{payAmount}</if>
|
||||
<if test="freightAmount != null "> and freight_amount = #{freightAmount}</if>
|
||||
<if test="payType != null "> and pay_type = #{payType}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="aftersaleStatus != null "> and aftersale_status = #{aftersaleStatus}</if>
|
||||
@ -289,6 +287,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
LEFT JOIN
|
||||
pms_product pp ON oi.product_id = pp.id AND pp.publish_status = 1
|
||||
WHERE 1=1
|
||||
AND o.tenant_id = #{tenantId}
|
||||
<if test="query.orderSn != null and query.orderSn != ''">
|
||||
AND o.order_sn LIKE CONCAT('%', #{query.orderSn}, '%')
|
||||
</if>
|
||||
@ -298,18 +297,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="query.memberPhoneEncrypted != null and query.memberPhoneEncrypted != ''">
|
||||
AND um.phone_encrypted LIKE CONCAT('%', #{query.memberPhoneEncrypted}, '%')
|
||||
</if>
|
||||
<if test="query.receiverProvince != null and query.receiverProvince != ''">
|
||||
AND o.receiver_province LIKE CONCAT('%', #{query.receiverProvince}, '%')
|
||||
</if>
|
||||
<if test="query.receiverCity != null and query.receiverCity != ''">
|
||||
AND o.receiver_city LIKE CONCAT('%', #{query.receiverCity}, '%')
|
||||
</if>
|
||||
<if test="query.receiverDistrict != null and query.receiverDistrict != ''">
|
||||
AND o.receiver_district LIKE CONCAT('%', #{query.receiverDistrict}, '%')
|
||||
</if>
|
||||
<if test="query.receiverPhone != null and query.receiverPhone != ''">
|
||||
AND o.receiver_phone LIKE CONCAT('%', #{query.receiverPhone}, '%')
|
||||
</if>
|
||||
<if test="query.status != null">
|
||||
AND o.status = #{query.status}
|
||||
</if>
|
||||
|
@ -135,7 +135,7 @@ public class SysAddressController
|
||||
log.error("下载文件失败", e);
|
||||
}
|
||||
}
|
||||
@GetMapping("/area")
|
||||
@GetMapping("/common/area")
|
||||
public AjaxResult getAddressList() {
|
||||
String addresses = redisService.getAddressList();
|
||||
if (org.apache.commons.lang3.StringUtils.isNotEmpty(addresses)) {
|
||||
|
@ -9,6 +9,7 @@ import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.system.domain.SysVersion;
|
||||
import org.dromara.system.domain.bo.SysVersionBo;
|
||||
import org.dromara.system.domain.dto.VersionDTO;
|
||||
import org.dromara.system.domain.vo.SysVersionVo;
|
||||
import org.dromara.system.service.ISysVerisonService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@ -25,6 +26,14 @@ public class SysVersionController {
|
||||
|
||||
private final ISysVerisonService sysVerisonService;
|
||||
|
||||
|
||||
@Tag(name ="查询app版本号")
|
||||
@GetMapping ("page")
|
||||
public R<IPage<VersionDTO>> page(Page<SysVersion> page) {
|
||||
return R.ok(sysVerisonService.getPage(page));
|
||||
}
|
||||
|
||||
|
||||
@Tag(name ="查询app版本管理")
|
||||
@PostMapping("/list")
|
||||
public R<IPage<SysVersionVo>> list(@RequestBody SysVersionBo query, Page<SysVersion> page){
|
||||
|
@ -109,4 +109,26 @@ public class SysTenant extends BaseEntity {
|
||||
* 是否承担手续费
|
||||
*/
|
||||
private Integer bearFeeFlag;
|
||||
|
||||
|
||||
@Schema(description = "代理机构名称")
|
||||
private String agencyName;
|
||||
|
||||
@Schema(description = "所属区县")
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<String> county;
|
||||
|
||||
@Schema(description = "出生年月")
|
||||
private LocalDateTime birthday;
|
||||
|
||||
@Schema(description = "代理人资质")
|
||||
private String qualification;
|
||||
|
||||
@Schema(description = "类型(0.店铺 1.代理 2.推广人)")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "代理商")
|
||||
private Long agencyId;
|
||||
|
||||
|
||||
}
|
||||
|
@ -14,10 +14,6 @@ public class SysTenantAccount extends BaseAudit {
|
||||
private Long id;
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
@Schema(description = "积分余额")
|
||||
private BigDecimal integralBalance;
|
||||
@Schema(description = "累计积分余额")
|
||||
private BigDecimal totalIntegralBalance;
|
||||
@Schema(description = "现金余额")
|
||||
private BigDecimal moneyBalance;
|
||||
@Schema(description = "钱包余额")
|
||||
|
@ -1,12 +1,15 @@
|
||||
package org.dromara.system.domain;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.dromara.common.core.domain.model.BaseAudit;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ -84,4 +87,38 @@ public class SysTenantExtend extends BaseAudit {
|
||||
@Schema(description = "签约状态")
|
||||
private String signStatus;
|
||||
|
||||
@Schema(description = "收款方名称")
|
||||
private String payeeName;
|
||||
|
||||
@Schema(description = "紧急联系人")
|
||||
private String emergencyContact;
|
||||
|
||||
@Schema(description = "紧急联系人电话")
|
||||
private String emergencyContactPhone;
|
||||
|
||||
@Schema(description = "保证金金额")
|
||||
private BigDecimal depositAmount;
|
||||
|
||||
@Schema(description = "代理年限")
|
||||
private String agencyYear;
|
||||
|
||||
@Schema(description = "协议附件路径")
|
||||
private String agreement;
|
||||
|
||||
@Schema(description = "其它附件路径")
|
||||
private String otherAttachment;
|
||||
|
||||
@Schema(description = "入职时间")
|
||||
@TableField("entry_time")
|
||||
private LocalDateTime entryTime;
|
||||
|
||||
@Schema(description = "有效期")
|
||||
@TableField("expiry_date")
|
||||
private String expiryDate;
|
||||
|
||||
@Schema(description = "状态(0、有效 1、无效)")
|
||||
private Integer promoterStatus;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -17,10 +17,6 @@ public class SysTenantAccountBo extends BaseAudit {
|
||||
private Long id;
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
@Schema(description = "积分余额")
|
||||
private BigDecimal integralBalance;
|
||||
@Schema(description = "累计积分余额")
|
||||
private BigDecimal totalIntegralBalance;
|
||||
@Schema(description = "现金余额")
|
||||
private BigDecimal moneyBalance;
|
||||
@Schema(description = "钱包余额")
|
||||
|
@ -1,13 +1,11 @@
|
||||
package org.dromara.system.domain.bo;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ -143,5 +141,63 @@ public class SysTenantExtendBo {
|
||||
@Schema(description = "签约状态")
|
||||
private String signStatus;
|
||||
|
||||
@Schema(description = "签约日期(模糊查询)")
|
||||
private List<LocalDateTime> signTime;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "代理机构名称")
|
||||
private String agencyName;
|
||||
|
||||
@Schema(description = "所属区县")
|
||||
private List<String> county;
|
||||
|
||||
@Schema(description = "出生年月")
|
||||
private LocalDateTime birthday;
|
||||
|
||||
@Schema(description = "代理人资质")
|
||||
private String qualification;
|
||||
|
||||
@Schema(description = "类型(0.店铺 1.代理 2.推广人)")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "推广人姓名")
|
||||
private String promoterName;
|
||||
|
||||
@Schema(description = "推广人手机号")
|
||||
private String promoterPhone;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "收款方名称")
|
||||
private String payeeName;
|
||||
|
||||
@Schema(description = "紧急联系人")
|
||||
private String emergencyContact;
|
||||
|
||||
@Schema(description = "紧急联系人电话")
|
||||
private String emergencyContactPhone;
|
||||
|
||||
@Schema(description = "保证金金额")
|
||||
private BigDecimal depositAmount;
|
||||
|
||||
@Schema(description = "代理年限")
|
||||
private String agencyYear;
|
||||
|
||||
@Schema(description = "协议附件路径")
|
||||
private String agreement;
|
||||
|
||||
@Schema(description = "其它附件路径")
|
||||
private String otherAttachment;
|
||||
|
||||
@Schema(description = "入职时间")
|
||||
private LocalDateTime entryTime;
|
||||
|
||||
@Schema(description = "有效期")
|
||||
private String expiryDate;
|
||||
|
||||
@Schema(description = "状态(0、有效 1、无效)")
|
||||
private Integer promoterStatus;
|
||||
|
||||
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@ -150,4 +151,61 @@ public class TenantDTO {
|
||||
|
||||
@Schema(description = "分配比例模板名称")
|
||||
private String templateName;
|
||||
|
||||
|
||||
@Schema(description = "代理机构名称")
|
||||
private String agencyName;
|
||||
|
||||
@Schema(description = "所属区县")
|
||||
private String county;
|
||||
|
||||
@Schema(description = "出生年月")
|
||||
private LocalDateTime birthday;
|
||||
|
||||
@Schema(description = "代理人资质")
|
||||
private String qualification;
|
||||
|
||||
@Schema(description = "类型(0.店铺 1.代理 2.推广人)")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "推广人姓名")
|
||||
private String promoterName;
|
||||
|
||||
@Schema(description = "推广人手机号")
|
||||
private String promoterPhone;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "收款方名称")
|
||||
private String payeeName;
|
||||
|
||||
@Schema(description = "紧急联系人")
|
||||
private String emergencyContact;
|
||||
|
||||
@Schema(description = "紧急联系人电话")
|
||||
private String emergencyContactPhone;
|
||||
|
||||
@Schema(description = "保证金金额")
|
||||
private BigDecimal depositAmount;
|
||||
|
||||
@Schema(description = "代理年限")
|
||||
private String agencyYear;
|
||||
|
||||
@Schema(description = "协议附件路径")
|
||||
private String agreement;
|
||||
|
||||
@Schema(description = "其它附件路径")
|
||||
private String otherAttachment;
|
||||
|
||||
@Schema(description = "入职时间")
|
||||
private LocalDateTime entryTime;
|
||||
|
||||
@Schema(description = "有效期")
|
||||
private String expiryDate;
|
||||
|
||||
@Schema(description = "状态(0、有效 1、无效)")
|
||||
private Integer promoterStatus;
|
||||
|
||||
@Schema(description = "代理名称")
|
||||
private String agencyContactUserName;
|
||||
}
|
||||
|
@ -0,0 +1,14 @@
|
||||
package org.dromara.system.domain.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class VersionDTO {
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private String versionCode;
|
||||
|
||||
@Schema(description = "下载地址")
|
||||
private String downloadUrl;
|
||||
}
|
@ -12,10 +12,6 @@ public class SysTenantAccountVo {
|
||||
private Long id;
|
||||
@Schema(description = "租户ID")
|
||||
private Long tenantId;
|
||||
@Schema(description = "积分余额")
|
||||
private BigDecimal integralBalance;
|
||||
@Schema(description = "累计积分余额")
|
||||
private BigDecimal totalIntegralBalance;
|
||||
@Schema(description = "更新时间")
|
||||
private Date updateTime;
|
||||
@Schema(description = "创建时间")
|
||||
|
@ -2,10 +2,7 @@ package org.dromara.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.dromara.system.domain.SysTenant;
|
||||
import org.dromara.system.domain.bo.SysTenantBo;
|
||||
import org.dromara.system.domain.bo.SysTenantExtendBo;
|
||||
@ -30,14 +27,15 @@ public interface SysTenantMapper extends BaseMapperPlus<SysTenant, SysTenantVo>
|
||||
@Select("SELECT " +
|
||||
"SUM(CASE WHEN status = 0 THEN 1 ELSE 0 END) AS count1, " +
|
||||
"SUM(CASE WHEN status = 2 THEN 1 ELSE 0 END) AS count2 " +
|
||||
"FROM sys_tenant")
|
||||
"FROM sys_tenant " +
|
||||
"WHERE type = 0")
|
||||
Map<String, Object> countProduct();
|
||||
|
||||
|
||||
|
||||
@Select("SELECT " +
|
||||
"t.company_name, " +
|
||||
"COALESCE(p.sales, 0) AS sales, " +
|
||||
"COALESCE(SUM(p.sales), 0) AS sales, " +
|
||||
"COALESCE(SUM(p.sales * p.price), 0) AS total_amount " +
|
||||
"FROM sys_tenant t " +
|
||||
"LEFT JOIN pms_product p ON t.tenant_id = p.tenant_id " +
|
||||
@ -58,12 +56,16 @@ public interface SysTenantMapper extends BaseMapperPlus<SysTenant, SysTenantVo>
|
||||
List<TenantDTO> getAll(SysTenantBo bo);
|
||||
|
||||
|
||||
@Select("SELECT t.*, e.*, m.nickname AS inviteUserName \n" +
|
||||
"FROM sys_tenant t\n" +
|
||||
"LEFT JOIN sys_tenant_extend e ON t.id = e.store_id\n" +
|
||||
"LEFT JOIN ums_member m ON e.invite_user_id = m.id\n" +
|
||||
"WHERE t.id = #{id}")
|
||||
TenantDTO getById(Long id);
|
||||
@Results({
|
||||
@Result(column = "expire_date", property = "expireDate"),
|
||||
@Result(column = "promoter_status", property = "promoterStatus")
|
||||
})
|
||||
@Select("SELECT t.*, e.*, m.nickname AS inviteUserName " +
|
||||
"FROM sys_tenant t " +
|
||||
"LEFT JOIN sys_tenant_extend e ON t.id = e.store_id " +
|
||||
"LEFT JOIN ums_member m ON e.invite_user_id = m.id " +
|
||||
"WHERE t.id = #{id}")
|
||||
TenantDTO getById(Long id);
|
||||
|
||||
|
||||
|
||||
|
@ -5,12 +5,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.dromara.system.domain.SysVersion;
|
||||
import org.dromara.system.domain.bo.SysVersionBo;
|
||||
import org.dromara.system.domain.dto.VersionDTO;
|
||||
import org.dromara.system.domain.vo.SysVersionVo;
|
||||
|
||||
@Mapper
|
||||
public interface SysVerisonMapper extends BaseMapper<SysVersion> {
|
||||
|
||||
IPage<SysVersionVo> getList(@Param("page") Page<SysVersion> page, @Param("query") SysVersionBo query);
|
||||
|
||||
@Select("SELECT v.version_code,v.download_url FROM sys_version as v")
|
||||
Page<VersionDTO> getPage(Page<SysVersion> page);
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.dromara.system.domain.SysVersion;
|
||||
import org.dromara.system.domain.bo.SysVersionBo;
|
||||
import org.dromara.system.domain.dto.VersionDTO;
|
||||
import org.dromara.system.domain.vo.SysVersionVo;
|
||||
|
||||
public interface ISysVerisonService extends IService<SysVersion> {
|
||||
@ -12,4 +13,6 @@ public interface ISysVerisonService extends IService<SysVersion> {
|
||||
IPage<SysVersionVo> getList(Page<SysVersion> page, SysVersionBo query);
|
||||
|
||||
SysVersion updateStatus(Long id, Integer status);
|
||||
|
||||
Page<VersionDTO> getPage(Page<SysVersion> page);
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.redis.utils.CacheUtils;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import org.dromara.common.tenant.helper.TenantHelper;
|
||||
import org.dromara.system.domain.*;
|
||||
@ -37,6 +38,7 @@ import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
@ -125,6 +127,8 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
// 处理sys_tenant表数据
|
||||
SysTenant tenant = new SysTenant();
|
||||
|
||||
Long belongId = Long.valueOf(LoginHelper.getTenantId());
|
||||
|
||||
// 生成租户ID
|
||||
List<String> tenantIds = baseMapper.selectObjs(
|
||||
new LambdaQueryWrapper<SysTenant>().select(SysTenant::getTenantId),
|
||||
@ -154,6 +158,14 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
tenant.setRelated(bo.getRelated());
|
||||
tenant.setContactUserName(bo.getContactUserName());
|
||||
tenant.setContactPhone(bo.getContactPhone());
|
||||
tenant.setAgencyName(bo.getAgencyName());
|
||||
tenant.setCounty(bo.getCounty());
|
||||
tenant.setBirthday(bo.getBirthday());
|
||||
tenant.setQualification(bo.getQualification());
|
||||
tenant.setType(bo.getType());
|
||||
if (bo.getType() == 2){
|
||||
tenant.setAgencyId(bo.getId());
|
||||
}
|
||||
|
||||
// 插入sys_tenant表
|
||||
boolean tenantInserted = baseMapper.insert(tenant) > 0;
|
||||
@ -178,7 +190,19 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
tenantExtend.setBankCard(bo.getBankCard());
|
||||
tenantExtend.setBankPhone(bo.getBankPhone());
|
||||
tenantExtend.setRemark(bo.getRemark());
|
||||
tenantExtend.setUsername(bo.getUsername());
|
||||
// 检查用户名是否已存在
|
||||
String username = bo.getUsername();
|
||||
if (StringUtils.isNotBlank(username)) {
|
||||
LambdaQueryWrapper<SysTenantExtend> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysTenantExtend::getUsername, username);
|
||||
Long count = tenantExtendMapper.selectCount(queryWrapper);
|
||||
|
||||
if (count > 0) {
|
||||
throw new ServiceException("用户名已存在,请更换其他用户名");
|
||||
}else{
|
||||
tenantExtend.setUsername(username);
|
||||
}
|
||||
}
|
||||
tenantExtend.setPassword(bo.getPassword());
|
||||
tenantExtend.setPackageId(bo.getPackageId());
|
||||
tenantExtend.setInviteUserId(bo.getInviteUserId());
|
||||
@ -188,6 +212,18 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
tenantExtend.setContractYear(bo.getContractYear());
|
||||
tenantExtend.setContractAttachment(bo.getContractAttachment());
|
||||
tenantExtend.setSignStatus(bo.getSignStatus());
|
||||
tenantExtend.setPayeeName(bo.getPayeeName());
|
||||
tenantExtend.setEmergencyContact(bo.getEmergencyContact());
|
||||
tenantExtend.setEmergencyContactPhone(bo.getEmergencyContactPhone());
|
||||
tenantExtend.setDepositAmount(bo.getDepositAmount());
|
||||
tenantExtend.setAgencyYear(bo.getAgencyYear());
|
||||
tenantExtend.setAgreement(bo.getAgreement());
|
||||
tenantExtend.setOtherAttachment(bo.getOtherAttachment());
|
||||
tenantExtend.setEntryTime(bo.getEntryTime());
|
||||
tenantExtend.setExpiryDate(bo.getExpiryDate());
|
||||
tenantExtend.setPromoterStatus(bo.getPromoterStatus());
|
||||
|
||||
|
||||
|
||||
boolean extendInserted = tenantExtendMapper.insert(tenantExtend) > 0;
|
||||
if (!extendInserted) {
|
||||
@ -197,6 +233,15 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
// 创建角色
|
||||
Long roleId = createTenantRole(tenantId, bo.getPackageId());
|
||||
|
||||
// 创建店铺账号
|
||||
SysTenantAccount tenantAccount = new SysTenantAccount();
|
||||
tenantAccount.setTenantId(Long.valueOf(tenantId));
|
||||
tenantAccount.setType(bo.getType());
|
||||
tenantAccount.setMoneyBalance(BigDecimal.ZERO);
|
||||
tenantAccount.setWallet(BigDecimal.ZERO);
|
||||
tenantAccount.setRevenue(BigDecimal.ZERO);
|
||||
|
||||
|
||||
// 创建部门
|
||||
SysDept dept = new SysDept();
|
||||
dept.setTenantId(tenantId);
|
||||
@ -361,7 +406,11 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
existingTenant.setDomain(bo.getDomain());
|
||||
existingTenant.setIntro(bo.getIntro());
|
||||
existingTenant.setPackageId(bo.getPackageId());
|
||||
existingTenant.setAccountCount(bo.getAccountCount());
|
||||
existingTenant.setStatus(bo.getStatus());
|
||||
existingTenant.setDelFlag(bo.getDelFlag());
|
||||
existingTenant.setBusinessLicense(bo.getBusinessLicense());
|
||||
existingTenant.setJoinTime(LocalDateTime.now());
|
||||
existingTenant.setAttachment(bo.getAttachment());
|
||||
existingTenant.setPromoteList(bo.getPromoteList());
|
||||
existingTenant.setExpireTime(bo.getExpireTime());
|
||||
@ -371,6 +420,11 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
existingTenant.setRelated(bo.getRelated());
|
||||
existingTenant.setContactUserName(bo.getContactUserName());
|
||||
existingTenant.setContactPhone(bo.getContactPhone());
|
||||
existingTenant.setAgencyName(bo.getAgencyName());
|
||||
existingTenant.setCounty(bo.getCounty());
|
||||
existingTenant.setBirthday(bo.getBirthday());
|
||||
existingTenant.setQualification(bo.getQualification());
|
||||
existingTenant.setType(bo.getType());
|
||||
|
||||
// 4. 查询扩展表现有数据
|
||||
LambdaQueryWrapper<SysTenantExtend> extendQuery = new LambdaQueryWrapper<>();
|
||||
@ -381,6 +435,7 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
}
|
||||
|
||||
// 5. 更新扩展表
|
||||
existingExtend.setStoreId(bo.getId());
|
||||
existingExtend.setIdCard(bo.getIdCard());
|
||||
existingExtend.setIdCardType(bo.getIdCardType());
|
||||
existingExtend.setCertificate(bo.getCertificate());
|
||||
@ -391,7 +446,25 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
existingExtend.setBankCard(bo.getBankCard());
|
||||
existingExtend.setBankPhone(bo.getBankPhone());
|
||||
existingExtend.setRemark(bo.getRemark());
|
||||
existingExtend.setUsername(bo.getUsername());
|
||||
// 检查用户名是否已存在
|
||||
String username = bo.getUsername();
|
||||
if (StringUtils.isNotBlank(username)) {
|
||||
LambdaQueryWrapper<SysTenantExtend> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(SysTenantExtend::getUsername, username);
|
||||
|
||||
if (existingExtend.getId() != null) {
|
||||
queryWrapper.ne(SysTenantExtend::getId, existingExtend.getId());
|
||||
}
|
||||
|
||||
Long count = tenantExtendMapper.selectCount(queryWrapper);
|
||||
|
||||
if (count > 0) {
|
||||
throw new ServiceException("用户名已存在,请更换其他用户名");
|
||||
} else {
|
||||
existingExtend.setUsername(username);
|
||||
}
|
||||
}
|
||||
|
||||
existingExtend.setPassword(bo.getPassword());
|
||||
existingExtend.setPackageId(bo.getPackageId());
|
||||
existingExtend.setInviteUserId(bo.getInviteUserId());
|
||||
@ -401,6 +474,16 @@ public class SysTenantServiceImpl implements ISysTenantService {
|
||||
existingExtend.setContractYear(bo.getContractYear());
|
||||
existingExtend.setContractAttachment(bo.getContractAttachment());
|
||||
existingExtend.setSignStatus(bo.getSignStatus());
|
||||
existingExtend.setPayeeName(bo.getPayeeName());
|
||||
existingExtend.setEmergencyContact(bo.getEmergencyContact());
|
||||
existingExtend.setEmergencyContactPhone(bo.getEmergencyContactPhone());
|
||||
existingExtend.setDepositAmount(bo.getDepositAmount());
|
||||
existingExtend.setAgencyYear(bo.getAgencyYear());
|
||||
existingExtend.setAgreement(bo.getAgreement());
|
||||
existingExtend.setOtherAttachment(bo.getOtherAttachment());
|
||||
existingExtend.setEntryTime(bo.getEntryTime());
|
||||
existingExtend.setExpiryDate(bo.getExpiryDate());
|
||||
existingExtend.setPromoterStatus(bo.getPromoterStatus());
|
||||
|
||||
// 执行更新
|
||||
boolean success = baseMapper.updateById(existingTenant) > 0
|
||||
|
@ -7,6 +7,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.system.domain.SysVersion;
|
||||
import org.dromara.system.domain.bo.SysVersionBo;
|
||||
import org.dromara.system.domain.dto.VersionDTO;
|
||||
import org.dromara.system.domain.vo.SysVersionVo;
|
||||
import org.dromara.system.mapper.SysVerisonMapper;
|
||||
import org.dromara.system.service.ISysVerisonService;
|
||||
@ -34,4 +35,9 @@ public class SysVerisonServiceImpl extends ServiceImpl<SysVerisonMapper, SysVers
|
||||
sysVerisonMapper.updateById(sysVersion);
|
||||
return sysVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<VersionDTO> getPage(Page<SysVersion> page) {
|
||||
return sysVerisonMapper.getPage(page);
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
t.*,
|
||||
e.*,
|
||||
m.nickname AS inviteUserName,
|
||||
ct.template_name AS templateName
|
||||
ct.template_name AS templateName,
|
||||
agency.contact_user_name AS agencyContactUserName
|
||||
FROM
|
||||
sys_tenant t
|
||||
LEFT JOIN
|
||||
@ -18,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
ums_member m ON e.invite_user_id = m.id
|
||||
LEFT JOIN
|
||||
commission_template ct ON e.split_ratio = ct.id
|
||||
LEFT JOIN
|
||||
sys_tenant agency ON t.agency_id = agency.id
|
||||
<where>
|
||||
<if test="query.tenantId != null and query.tenantId != ''">
|
||||
AND t.tenant_id LIKE CONCAT('%', #{query.tenantId}, '%')
|
||||
@ -34,8 +37,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="query.companyName != null and query.companyName != ''">
|
||||
AND t.company_name LIKE CONCAT('%', #{query.companyName}, '%')
|
||||
</if>
|
||||
<if test="query.contactPhone != null and query.contactPhone != ''">
|
||||
AND t.contact_phone LIKE CONCAT('%', #{query.contactPhone}, '%')
|
||||
</if>
|
||||
<if test="query.entryTime != null and query.entryTime != ''">
|
||||
AND t.entry_time LIKE CONCAT('%', #{query.entryTime}, '%')
|
||||
</if>
|
||||
<if test="query.birthday != null and query.birthday != ''">
|
||||
AND t.birthday LIKE CONCAT('%', #{query.birthday}, '%')
|
||||
</if>
|
||||
<if test="query.address != null and query.address != ''">
|
||||
AND t.address LIKE CONCAT('%', #{query.address}, '%')
|
||||
</if>
|
||||
<if test="query.county != null and query.county != ''">
|
||||
AND t.county LIKE CONCAT('%', #{query.county[0], jdbcType=VARCHAR}, '%')
|
||||
</if>
|
||||
<if test="query.companyType != null and query.companyType != ''">
|
||||
AND t.company_Type LIKE CONCAT('%', #{query.companyType}, '%')
|
||||
AND t.company_type LIKE CONCAT('%', #{query.companyType}, '%')
|
||||
</if>
|
||||
<if test="query.address != null and query.address != ''">
|
||||
AND t.address LIKE CONCAT('%', #{query.address}, '%')
|
||||
@ -43,9 +61,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="query.signStatus != null">
|
||||
AND e.sign_status = #{query.signStatus}
|
||||
</if>
|
||||
<if test="query.promoterStatus != null">
|
||||
AND e.promoter_status = #{query.promoterStatus}
|
||||
</if>
|
||||
<if test="query.type != null">
|
||||
AND t.type = #{query.type}
|
||||
</if>
|
||||
<if test="query.signTime != null and query.signTime.size() == 2">
|
||||
AND e.sign_date BETWEEN #{query.signTime[0]} AND #{query.signTime[1]}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="batchDeleteTenantExtendByStoreIds">
|
||||
DELETE FROM sys_tenant_extend
|
||||
WHERE store_id IN
|
||||
|
Loading…
x
Reference in New Issue
Block a user