BUGFIX: 查询affiliate时,不显示已删除的记录,删除affiliate时,状态也修改

This commit is contained in:
2025-11-22 00:41:35 +08:00
parent 97c5be7b22
commit 059d6edc12
2 changed files with 7 additions and 4 deletions

View File

@@ -212,10 +212,7 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
// operationType Active -> 激活 | Inactive -> 关闭 | Delete -> 删除 // operationType Active -> 激活 | Inactive -> 关闭 | Delete -> 删除
if (!StringUtil.isNullOrEmpty(operationType)) { if (!StringUtil.isNullOrEmpty(operationType)) {
if (operationType.equals("Delete")) { if (operationType.equals("Delete") || operationType.equals("Active") || operationType.equals("Inactive")) {
baseMapper.deleteById(id);
return;
} else if (operationType.equals("Active") || operationType.equals("Inactive")) {
affiliate.setStatus(operationType); affiliate.setStatus(operationType);
} else { } else {
throw new BusinessException("unknown.operationType"); throw new BusinessException("unknown.operationType");
@@ -223,6 +220,10 @@ public class AffiliateServiceImpl extends ServiceImpl<AffiliateMapper, Affiliate
} }
affiliate.setUpdateTime(LocalDateTime.now()); affiliate.setUpdateTime(LocalDateTime.now());
baseMapper.updateById(affiliate); baseMapper.updateById(affiliate);
if (operationType.equals("Delete")) {
baseMapper.deleteById(id);
}
} }
// 定时计算佣金 // 定时计算佣金

View File

@@ -37,6 +37,7 @@
<if test="affiliateId != null"> <if test="affiliateId != null">
AND f.id = #{affiliateId} AND f.id = #{affiliateId}
</if> </if>
AND f.is_deleted = 0
</where> </where>
<choose> <choose>
<when test="sortField != null and sortField != ''"> <when test="sortField != null and sortField != ''">
@@ -83,6 +84,7 @@
AND f.id = #{affiliateId} AND f.id = #{affiliateId}
</if> </if>
</where> </where>
AND f.is_deleted = 0
</select> </select>
<select id="selectAllAffiliateUsername" resultType="java.util.Map"> <select id="selectAllAffiliateUsername" resultType="java.util.Map">