Merge remote-tracking branch 'origin/wzj-main' into wzj-main

# Conflicts:
#	ruoyi-admin/src/main/resources/application.yml
This commit is contained in:
曹佳豪 2025-08-14 15:48:51 +08:00
commit cc68b15b40
21 changed files with 124 additions and 61 deletions

View File

@ -181,10 +181,10 @@ tenant:
- sys_version
- ums_member_wechat
- sys_tenant_extend
- red_packet
- red_packet_receive
- sys_commission_template
- sys_commission_rate_range
- oms_red_packet
- oms_red_packet_receive

View File

@ -4,8 +4,11 @@ package com.wzj.soopin.goods.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wzj.soopin.goods.convert.BrandConvert;
import com.wzj.soopin.goods.domain.bo.BrandBo;
import com.wzj.soopin.goods.domain.bo.ProductCategoryBo;
import com.wzj.soopin.goods.domain.entity.Brand;
import com.wzj.soopin.goods.domain.entity.ProductCategory;
import com.wzj.soopin.goods.domain.vo.BrandVO;
import com.wzj.soopin.goods.domain.vo.ProductCategoryVO;
import com.wzj.soopin.goods.service.impl.BrandServiceImpl;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
@ -40,6 +43,14 @@ public class BrandController extends BaseController {
return R.ok(convert.toVO(brandPage));
}
@Tag(name ="所有品牌管理列表")
@PostMapping("page")
public R<List<BrandVO>> list(@RequestBody BrandBo query) {
List<Brand> productCategoryList = service.list(query.toWrapper());
return R.ok(convert.toVO(productCategoryList));
}
@Tag(name ="导出品牌管理列表")
@Log(title = "品牌管理", businessType = BusinessType.EXPORT)
@PostMapping("export")

View File

@ -6,12 +6,15 @@ 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.ProductCategoryBo;
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.ProductCategory;
import com.wzj.soopin.goods.domain.entity.Sku;
import com.wzj.soopin.goods.domain.vo.BrandVO;
import com.wzj.soopin.goods.domain.vo.ProductCategoryVO;
import com.wzj.soopin.goods.domain.vo.ProductVO;
import com.wzj.soopin.goods.domain.vo.SkuVO;
import com.wzj.soopin.goods.service.ProductService;
@ -43,6 +46,13 @@ public class ProductController extends BaseController {
private final ProductService productService;
@Tag(name ="查询商品信息列表app")
@PostMapping("page")
public R<Page<ProductVO>> page(@RequestBody ProductBo query, Page<Product> page) {
Page<Product> productCategoryPage = service.page(page,query.toWrapper());
return R.ok(convert.toVO(productCategoryPage));
}
@Tag(name ="查询商品信息列表")
@PostMapping("list")
public R<IPage<ProductVO>> list(@RequestBody ProductBo query, @RequestBody Page<Product> page) {

View File

@ -28,7 +28,6 @@ public class ProductBo {
@Schema(description = "上架状态0->下架1->上架 精确匹配")
private Integer publishStatus;
@Schema(description = "PRICE 精确匹配")
private BigDecimal price;

View File

@ -80,7 +80,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN oms_order o ON oi.order_id = o.id
LEFT JOIN pms_product_category pc ON p.category_id = pc.id
LEFT JOIN pms_sku s ON p.id = s.product_id
WHERE p.tenant_id = #{tenantId}
WHERE 1=1
<if test="tenantId != '000000'">
AND s.tenant_id = #{tenantId}
</if>
<if test="query.nameLike != null and query.nameLike != ''">
AND p.name LIKE CONCAT('%', #{query.nameLike}, '%')
</if>

View File

@ -46,7 +46,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getlist" resultType="com.wzj.soopin.goods.domain.vo.SkuVO">
SELECT
s.*,
p.name AS productName
@ -54,8 +53,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
pms_sku s
LEFT JOIN
pms_product p ON s.product_id = p.id
where 1=1
WHERE 1=1
<if test="tenantId != '000000'">
AND s.tenant_id = #{tenantId}
</if>
<if test="query.productName != null and query.productName != ''">
AND p.name LIKE CONCAT('%', #{query.productName}, '%')
</if>
@ -70,7 +71,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if>
ORDER BY
s.create_time DESC
</select>

View File

@ -7,12 +7,14 @@ import com.baomidou.mybatisplus.annotation.TableField;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
import org.dromara.common.core.domain.model.BaseAudit;
@Data
@Schema(description = "红包实体")
@TableName("oms_red_packet")
public class RedPacket extends BaseAudit {
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "红包id")

View File

@ -5,11 +5,14 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;
@Data
@Schema(description = "红包领取记录实体")
@TableName("oms_red_packet_receive")
public class RedPacketReceive {
@TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键ID")

View File

@ -1,10 +1,9 @@
package com.wzj.soopin.order.domain.query;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.DecimalMin;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

View File

@ -10,6 +10,6 @@ import java.util.List;
@Mapper
public interface RedPacketMapper extends BaseMapper<RedPacket> {
@Select("SELECT * FROM red_packet WHERE expire_time < NOW() AND status IN (0, 1)")
@Select("SELECT * FROM oms_red_packet WHERE expire_time < NOW() AND status IN (0, 1)")
List<RedPacket> selectExpiredRedPackets();
}

View File

@ -6,7 +6,7 @@ import org.apache.ibatis.annotations.Select;
public interface RedPacketReceiveMapper extends BaseMapper<RedPacketReceive> {
@Select("SELECT COUNT(1) FROM red_packet_receive " +
@Select("SELECT COUNT(1) FROM oms_red_packet_receive " +
"WHERE packet_id = #{packetId} " +
"AND receiver_id = #{memberId} ")
Integer checkReceived(Long packetId, Long memberId);

View File

@ -222,14 +222,14 @@ public class VerificationCodeServiceImpl extends ServiceImpl<VerificationCodesM
public void sendMessage(CodeVerificationDto codeVerificationDto) {
String code = codeVerificationDto.getCodeValue();
Map<String, Object> resultMap = codeMapper.getProduvtNameAndMemberId(code);
String productName = (String) resultMap.get("productName");
// String productName = (String) resultMap.get("productName");
Long memberId = (Long) resultMap.get("memberId");
LocalDateTime verificationTime = codeMapper.verificationTime(code);
String formattedTime = verificationTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
// 核销成功模板ID
// 改为新版模板类型调用
Map<String, Object> params = new HashMap<>();
params.put("productName", productName);
// params.put("productName", productName);
params.put("verificationTime", formattedTime);
SysMessageBo messageBo = new SysMessageBo();
// 核销成功类型编号
@ -245,13 +245,13 @@ public class VerificationCodeServiceImpl extends ServiceImpl<VerificationCodesM
public void sendMessageNo(CodeVerificationDto codeVerificationDto) {
String code = codeVerificationDto.getCodeValue();
Map<String, Object> resultMap = codeMapper.getProduvtNameAndMemberId(code);
String productName = (String) resultMap.get("productName");
// String productName = (String) resultMap.get("productName");
Long memberId = (Long) resultMap.get("memberId");
String reason = codeMapper.getReason(code);
// 核销失败模板ID
// 改为新版模板类型调用
Map<String, Object> params = new HashMap<>();
params.put("productName", productName);
// params.put("productName", productName);
params.put("reason", reason);
SysMessageBo messageBo = new SysMessageBo();
// 核销失败类型编号

View File

@ -118,8 +118,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
oms_order o ON a.order_id = o.id
LEFT JOIN
ums_member m ON a.member_id = m.id
where 1=1
WHERE 1=1
<if test="tenantId != '000000'">
AND a.tenant_id = #{tenantId}
</if>
<if test="query.memberId != null and query.memberId != ''">
AND a.member_id LIKE CONCAT('%', #{query.memberId}, '%')
</if>
@ -132,7 +134,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.quantity != null">
AND a.quantity = #{query.quantity}
</if>
</select>
</mapper>

View File

@ -264,7 +264,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getlist" resultType="com.wzj.soopin.order.domain.vo.OrderVO">
SELECT
o.*,
um.nickname AS memberNickname,
@ -287,7 +286,13 @@ 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
<choose>
<when test="tenantId == '000000'">
</when>
<otherwise>
AND o.tenant_id = #{tenantId}
</otherwise>
</choose>
<if test="query.orderSn != null and query.orderSn != ''">
AND o.order_sn LIKE CONCAT('%', #{query.orderSn}, '%')
</if>
@ -315,7 +320,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.endTime != null">
AND o.create_time &lt;= #{query.endTime, jdbcType=TIMESTAMP}
</if>
</select>
</mapper>

View File

@ -84,7 +84,7 @@ public class SysTenantExtend extends BaseAudit {
@Schema(description = "签约附件")
private String contractAttachment;
@Schema(description = "签约状态")
@Schema(description = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)")
private String signStatus;
@Schema(description = "收款方名称")

View File

@ -138,7 +138,7 @@ public class SysTenantExtendBo {
@Schema(description = "签约附件")
private String contractAttachment;
@Schema(description = "签约状态")
@Schema(description = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)")
private String signStatus;
@Schema(description = "签约日期(模糊查询)")

View File

@ -143,7 +143,7 @@ public class TenantDTO {
@Schema(description = "签约附件")
private String contractAttachment;
@Schema(description = "签约状态")
@Schema(description = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)")
private String signStatus;
@Schema(description = "邀请人名称")

View File

@ -136,7 +136,7 @@ public class SysTenantExtendVo {
@Schema(description = "签约附件")
private String contractAttachment;
@Schema(description = "签约状态")
@Schema(description = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)")
private String signStatus;
}

View File

@ -154,7 +154,7 @@ public class SysTenantVo implements Serializable {
@Schema(description = "签约附件")
private String contractAttachment;
@Schema(description = "签约状态")
@Schema(description = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)")
private String signStatus;
/**

View File

@ -8,6 +8,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
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.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
@ -54,6 +55,7 @@ public class SysTenantServiceImpl implements ISysTenantService {
private final SysTenantMapper baseMapper;
private final SysTenantExtendMapper tenantExtendMapper;
private final SysTenantPackageMapper tenantPackageMapper;
private final SysTenantAccountMapper tenantAccountMapper;;
private final SysUserMapper userMapper;
private final SysDeptMapper deptMapper;
private final SysRoleMapper roleMapper;
@ -125,26 +127,37 @@ public class SysTenantServiceImpl implements ISysTenantService {
@Transactional(rollbackFor = Exception.class)
public Boolean insertByBo(SysTenantExtendBo bo) {
if (bo.getType() == null){
throw new ServiceException("租户类型不能为空");
}
// 处理sys_tenant表数据
SysTenant tenant = new SysTenant();
Long belongId = Long.valueOf(LoginHelper.getTenantId());
SysTenant sysTenant = baseMapper.selectByBelongId(belongId);
if (bo.getExpiryDate() != null && sysTenant.getType() != 1){
}
if (bo.getExpiryDate() != null) {
SysTenant sysTenant = baseMapper.selectByBelongId(belongId);
if (sysTenant != null) {
Integer type = sysTenant.getType();
if (type != 1) {
if (type != 1 && type != 3) {
throw new RuntimeException("只有代理能添加推广人");
}
} else {
throw new RuntimeException("未查询到对应 belongId 的租户信息");
throw new RuntimeException("未查询到对应的租户信息");
}
}
if (bo.getStoreName() != null) {
SysTenant sysTenant = baseMapper.selectByBelongId(belongId);
if (sysTenant != null) {
Integer type = sysTenant.getType();
if (type != 2 && type != 3) {
throw new RuntimeException("只有推广人能添加店铺");
}
} else {
throw new RuntimeException("未查询到对应的租户信息");
}
}
@ -234,7 +247,9 @@ public class SysTenantServiceImpl implements ISysTenantService {
tenantExtend.setSigner(bo.getSigner());
tenantExtend.setContractYear(bo.getContractYear());
tenantExtend.setContractAttachment(bo.getContractAttachment());
tenantExtend.setSignStatus(bo.getSignStatus());
if (bo.getSignStatus() == null) {
tenantExtend.setSignStatus("0");
}
tenantExtend.setPayeeName(bo.getPayeeName());
tenantExtend.setEmergencyContact(bo.getEmergencyContact());
tenantExtend.setEmergencyContactPhone(bo.getEmergencyContactPhone());
@ -263,6 +278,7 @@ public class SysTenantServiceImpl implements ISysTenantService {
tenantAccount.setMoneyBalance(BigDecimal.ZERO);
tenantAccount.setWallet(BigDecimal.ZERO);
tenantAccount.setRevenue(BigDecimal.ZERO);
tenantAccountMapper.insert(tenantAccount);
// 创建部门
@ -287,6 +303,7 @@ public class SysTenantServiceImpl implements ISysTenantService {
user.setNickName(bo.getUsername());
user.setPassword(BCrypt.hashpw(bo.getPassword()));
user.setDeptId(deptId);
user.setPhonenumber(bo.getContactPhone());
userMapper.insert(user);
// 设置部门负责人
@ -746,9 +763,23 @@ public class SysTenantServiceImpl implements ISysTenantService {
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean batchRemoveByIds(List<Long> ids) {
for (Long id : ids) {
if (TenantConstants.SUPER_ADMIN_ROLE_KEY.equals(id.toString())) {
throw new ServiceException("超级管理员租户不能删除");
if (CollectionUtils.isEmpty(ids)) {
throw new ServiceException("删除ID列表不能为空");
}
// 查询所有待删除租户的tenant_id
List<SysTenant> tenants = baseMapper.selectBatchIds(ids);
if (CollectionUtils.isEmpty(tenants)) {
throw new ServiceException("未找到对应的租户信息");
}
// 检查是否存在不允许删除的租户
for (SysTenant tenant : tenants) {
if (TenantConstants.DEFAULT_TENANT_ID.equals(tenant.getTenantId())) {
throw new ServiceException("超级管理员租户(" + tenant.getTenantId() + ")不能删除");
}
if (TenantConstants.SUPER_ADMIN_ROLE_KEY.equals(tenant.getId().toString())) {
throw new ServiceException("超级管理员租户(" + tenant.getId() + ")不能删除");
}
}

View File

@ -18,9 +18,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN
ums_member m ON e.invite_user_id = m.id
LEFT JOIN
commission_template ct ON e.split_ratio = ct.id
sys_commission_template ct ON e.split_ratio = ct.id
LEFT JOIN
sys_tenant agency ON t.agency_id = agency.id
sys_tenant agency ON t.agency_tenant_id = agency.tenant_id
<where>
<if test="query.tenantId != null and query.tenantId != ''">
AND t.tenant_id LIKE CONCAT('%', #{query.tenantId}, '%')