Compare commits

..

No commits in common. "02eb7ceeeb4263ea59b474d2f51a306f9f9f9cae" and "3fb0972dd01f1118b2d3fcfc59a585481e4639df" have entirely different histories.

12 changed files with 53 additions and 89 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 1=1 WHERE p.tenant_id = #{tenantId}
<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,6 +46,7 @@ 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
@ -53,10 +54,8 @@ 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
<if test="tenantId != '000000'">
AND s.tenant_id = #{tenantId} AND s.tenant_id = #{tenantId}
</if>
<if test="query.productName != null and query.productName != ''"> <if test="query.productName != null and query.productName != ''">
AND p.name LIKE CONCAT('%', #{query.productName}, '%') AND p.name LIKE CONCAT('%', #{query.productName}, '%')
</if> </if>
@ -71,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </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

@ -118,10 +118,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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
<if test="tenantId != '000000'">
AND a.tenant_id = #{tenantId} 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>
@ -134,6 +132,7 @@ 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,6 +264,7 @@ 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,
@ -286,13 +287,7 @@ 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
<choose>
<when test="tenantId == '000000'">
</when>
<otherwise>
AND o.tenant_id = #{tenantId} 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>
@ -320,6 +315,7 @@ 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 = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)") @Schema(description = "签约状态")
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 = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)") @Schema(description = "签约状态")
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 = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)") @Schema(description = "签约状态")
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 = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)") @Schema(description = "签约状态")
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 = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)") @Schema(description = "签约状态")
private String signStatus; private String signStatus;
/** /**

View File

@ -8,7 +8,6 @@ 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;
@ -55,7 +54,6 @@ 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;
@ -127,37 +125,26 @@ 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 && type != 3) { if (type != 1) {
throw new RuntimeException("只有代理能添加推广人"); throw new RuntimeException("只有代理能添加推广人");
} }
} else { } else {
throw new RuntimeException("未查询到对应的租户信息"); throw new RuntimeException("未查询到对应 belongId 的租户信息");
}
}
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("未查询到对应的租户信息");
} }
} }
@ -247,9 +234,7 @@ 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());
if (bo.getSignStatus() == null) { tenantExtend.setSignStatus(bo.getSignStatus());
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());
@ -278,7 +263,6 @@ 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);
// 创建部门 // 创建部门
@ -303,7 +287,6 @@ 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);
// 设置部门负责人 // 设置部门负责人
@ -763,23 +746,9 @@ 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) {
if (CollectionUtils.isEmpty(ids)) { for (Long id : ids) {
throw new ServiceException("删除ID列表不能为空"); if (TenantConstants.SUPER_ADMIN_ROLE_KEY.equals(id.toString())) {
} 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_tenant_id = agency.tenant_id sys_tenant agency ON t.agency_id = agency.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}, '%')