Compare commits
2 Commits
3fb0972dd0
...
02eb7ceeeb
Author | SHA1 | Date | |
---|---|---|---|
![]() |
02eb7ceeeb | ||
![]() |
d71994cdaa |
@ -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 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="query.nameLike != null and query.nameLike != ''">
|
||||
AND p.name LIKE CONCAT('%', #{query.nameLike}, '%')
|
||||
</if>
|
||||
|
@ -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,23 +53,24 @@ 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
|
||||
AND s.tenant_id = #{tenantId}
|
||||
<if test="query.productName != null and query.productName != ''">
|
||||
AND p.name LIKE CONCAT('%', #{query.productName}, '%')
|
||||
</if>
|
||||
<if test="query.outSkuId != null and query.outSkuId != ''">
|
||||
AND s.out_sku_id LIKE CONCAT('%', #{query.outSkuId}, '%')
|
||||
</if>
|
||||
<if test="query.price != null and query.price != ''">
|
||||
AND s.price LIKE CONCAT('%', #{query.price}, '%')
|
||||
</if>
|
||||
<if test="query.pic != null and query.pic != ''">
|
||||
AND s.pic LIKE CONCAT('%', #{query.pic}, '%')
|
||||
</if>
|
||||
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>
|
||||
<if test="query.outSkuId != null and query.outSkuId != ''">
|
||||
AND s.out_sku_id LIKE CONCAT('%', #{query.outSkuId}, '%')
|
||||
</if>
|
||||
<if test="query.price != null and query.price != ''">
|
||||
AND s.price LIKE CONCAT('%', #{query.price}, '%')
|
||||
</if>
|
||||
<if test="query.pic != null and query.pic != ''">
|
||||
AND s.pic LIKE CONCAT('%', #{query.pic}, '%')
|
||||
</if>
|
||||
ORDER BY
|
||||
s.create_time DESC
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
@ -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();
|
||||
// 核销失败类型编号
|
||||
|
@ -108,18 +108,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="getlist" resultType="com.wzj.soopin.order.domain.vo.AftersaleVO">
|
||||
SELECT
|
||||
a.*,
|
||||
o.order_sn AS orderSn,
|
||||
m.nickname AS nickname,
|
||||
m.phone_encrypted AS phone
|
||||
a.*,
|
||||
o.order_sn AS orderSn,
|
||||
m.nickname AS nickname,
|
||||
m.phone_encrypted AS phone
|
||||
FROM
|
||||
oms_aftersale a
|
||||
LEFT JOIN
|
||||
oms_order o ON a.order_id = o.id
|
||||
LEFT JOIN
|
||||
ums_member m ON a.member_id = m.id
|
||||
where 1=1
|
||||
AND a.tenant_id = #{tenantId}
|
||||
oms_aftersale a
|
||||
LEFT JOIN
|
||||
oms_order o ON a.order_id = o.id
|
||||
LEFT JOIN
|
||||
ums_member m ON a.member_id = m.id
|
||||
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>
|
||||
|
@ -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
|
||||
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 != ''">
|
||||
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 <= #{query.endTime, jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
@ -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 = "收款方名称")
|
||||
|
@ -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 = "签约日期(模糊查询)")
|
||||
|
@ -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 = "邀请人名称")
|
||||
|
@ -136,7 +136,7 @@ public class SysTenantExtendVo {
|
||||
@Schema(description = "签约附件")
|
||||
private String contractAttachment;
|
||||
|
||||
@Schema(description = "签约状态")
|
||||
@Schema(description = "签约状态(0.待审核1.有效 2.无效 3.编辑 4.过期)")
|
||||
private String signStatus;
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
|
@ -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() + ")不能删除");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
LEFT JOIN
|
||||
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}, '%')
|
||||
|
Loading…
x
Reference in New Issue
Block a user