修改bug

This commit is contained in:
fxh 2025-08-13 17:35:50 +08:00
parent a3e8881ba5
commit d71994cdaa
12 changed files with 89 additions and 53 deletions

View File

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

View File

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

View File

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

View File

@ -108,18 +108,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getlist" resultType="com.wzj.soopin.order.domain.vo.AftersaleVO"> <select id="getlist" resultType="com.wzj.soopin.order.domain.vo.AftersaleVO">
SELECT SELECT
a.*, a.*,
o.order_sn AS orderSn, o.order_sn AS orderSn,
m.nickname AS nickname, m.nickname AS nickname,
m.phone_encrypted AS phone m.phone_encrypted AS phone
FROM FROM
oms_aftersale a oms_aftersale a
LEFT JOIN LEFT JOIN
oms_order o ON a.order_id = o.id oms_order o ON a.order_id = o.id
LEFT JOIN LEFT JOIN
ums_member m ON a.member_id = m.id ums_member m ON a.member_id = m.id
where 1=1 WHERE 1=1
AND a.tenant_id = #{tenantId} <if test="tenantId != '000000'">
AND a.tenant_id = #{tenantId}
</if>
<if test="query.memberId != null and query.memberId != ''"> <if test="query.memberId != null and query.memberId != ''">
AND a.member_id LIKE CONCAT('%', #{query.memberId}, '%') AND a.member_id LIKE CONCAT('%', #{query.memberId}, '%')
</if> </if>
@ -132,7 +134,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.quantity != null"> <if test="query.quantity != null">
AND a.quantity = #{query.quantity} AND a.quantity = #{query.quantity}
</if> </if>
</select> </select>
</mapper> </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 id="getlist" resultType="com.wzj.soopin.order.domain.vo.OrderVO">
SELECT SELECT
o.*, o.*,
um.nickname AS memberNickname, um.nickname AS memberNickname,
@ -287,7 +286,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN LEFT JOIN
pms_product pp ON oi.product_id = pp.id AND pp.publish_status = 1 pms_product pp ON oi.product_id = pp.id AND pp.publish_status = 1
WHERE 1=1 WHERE 1=1
AND o.tenant_id = #{tenantId} <choose>
<when test="tenantId == '000000'">
</when>
<otherwise>
AND o.tenant_id = #{tenantId}
</otherwise>
</choose>
<if test="query.orderSn != null and query.orderSn != ''"> <if test="query.orderSn != null and query.orderSn != ''">
AND o.order_sn LIKE CONCAT('%', #{query.orderSn}, '%') AND o.order_sn LIKE CONCAT('%', #{query.orderSn}, '%')
</if> </if>
@ -315,7 +320,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.endTime != null"> <if test="query.endTime != null">
AND o.create_time &lt;= #{query.endTime, jdbcType=TIMESTAMP} AND o.create_time &lt;= #{query.endTime, jdbcType=TIMESTAMP}
</if> </if>
</select> </select>
</mapper> </mapper>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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