1.更新员工主播和大哥时同时更新员工名下所有同 ID数据
2.增加排序规则,防止出现时间排序错误
This commit is contained in:
@@ -80,4 +80,6 @@ public class EmployeeBigBrotherDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private Integer operationStatus;
|
private Integer operationStatus;
|
||||||
|
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -80,4 +80,6 @@ public class EmployeeHostsDO extends BaseDO {
|
|||||||
private String remake;
|
private String remake;
|
||||||
|
|
||||||
private String uid;
|
private String uid;
|
||||||
|
|
||||||
|
private Long tenantId;
|
||||||
}
|
}
|
||||||
@@ -8,8 +8,10 @@ import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.Emp
|
|||||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherSaveReqVO;
|
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.bigbrother.BigBrotherDO;
|
import cn.iocoder.yudao.module.tkdata.dal.dataobject.bigbrother.BigBrotherDO;
|
||||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO;
|
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO;
|
||||||
|
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO;
|
||||||
import cn.iocoder.yudao.module.tkdata.dal.mysql.bigbrother.BigBrotherMapper;
|
import cn.iocoder.yudao.module.tkdata.dal.mysql.bigbrother.BigBrotherMapper;
|
||||||
import cn.iocoder.yudao.module.tkdata.dal.mysql.employeebigbrother.EmployeeBigBrotherMapper;
|
import cn.iocoder.yudao.module.tkdata.dal.mysql.employeebigbrother.EmployeeBigBrotherMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.generator.IFill;
|
import com.baomidou.mybatisplus.generator.IFill;
|
||||||
@@ -59,8 +61,14 @@ public class EmployeeBigBrotherServiceImpl implements EmployeeBigBrotherService
|
|||||||
// 校验存在
|
// 校验存在
|
||||||
validateEmployeeBigBrotherExists(updateReqVO.getId());
|
validateEmployeeBigBrotherExists(updateReqVO.getId());
|
||||||
// 更新
|
// 更新
|
||||||
|
Long tenantId = TenantContextHolder.getTenantId();
|
||||||
EmployeeBigBrotherDO updateObj = BeanUtils.toBean(updateReqVO, EmployeeBigBrotherDO.class);
|
EmployeeBigBrotherDO updateObj = BeanUtils.toBean(updateReqVO, EmployeeBigBrotherDO.class);
|
||||||
employeeBigBrotherMapper.updateById(updateObj);
|
LambdaUpdateWrapper<EmployeeBigBrotherDO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.set(EmployeeBigBrotherDO::getOperationStatus, updateReqVO.getOperationStatus());
|
||||||
|
updateWrapper.eq(EmployeeBigBrotherDO::getUserId, updateReqVO.getUserId());
|
||||||
|
updateWrapper.eq(EmployeeBigBrotherDO::getDisplayId,updateObj.getDisplayId());
|
||||||
|
updateWrapper.eq(EmployeeBigBrotherDO::getTenantId, tenantId);
|
||||||
|
employeeBigBrotherMapper.update(updateObj,updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
|||||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO;
|
import cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO;
|
||||||
import cn.iocoder.yudao.module.tkdata.dal.mysql.newhosts.NewHostsMapper;
|
import cn.iocoder.yudao.module.tkdata.dal.mysql.newhosts.NewHostsMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -57,8 +59,16 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
|||||||
// 校验存在
|
// 校验存在
|
||||||
validateEmployeeHostsExists(updateReqVO.getId());
|
validateEmployeeHostsExists(updateReqVO.getId());
|
||||||
// 更新
|
// 更新
|
||||||
|
Long tenantId = TenantContextHolder.getTenantId();
|
||||||
EmployeeHostsDO updateObj = BeanUtils.toBean(updateReqVO, EmployeeHostsDO.class);
|
EmployeeHostsDO updateObj = BeanUtils.toBean(updateReqVO, EmployeeHostsDO.class);
|
||||||
employeeHostsMapper.updateById(updateObj);
|
LambdaUpdateWrapper<EmployeeHostsDO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.set(EmployeeHostsDO::getOperationStatus, updateReqVO.getOperationStatus());
|
||||||
|
updateWrapper.eq(EmployeeHostsDO::getUserId, updateReqVO.getUserId());
|
||||||
|
updateWrapper.eq(EmployeeHostsDO::getHostsId,updateObj.getHostsId());
|
||||||
|
updateWrapper.eq(EmployeeHostsDO::getTenantId, tenantId);
|
||||||
|
employeeHostsMapper.update(updateObj, updateWrapper);
|
||||||
|
|
||||||
|
// employeeHostsMapper.updateById(updateObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
<choose>
|
<choose>
|
||||||
<!-- 传空和默认的情况下按照时间降序排序 -->
|
<!-- 传空和默认的情况下按照时间降序排序 -->
|
||||||
<when test="dto.sortName == '' or dto.sortName == null">
|
<when test="dto.sortName == '' or dto.sortName == null">
|
||||||
sbr.create_time desc,sbr.id
|
sbr.create_time desc,sbr.id desc
|
||||||
</when>
|
</when>
|
||||||
<!-- sortNmae 有值的情况下排序 -->
|
<!-- sortNmae 有值的情况下排序 -->
|
||||||
<when test="dto.sortName != null and dto.sort != null ">
|
<when test="dto.sortName != null and dto.sort != null ">
|
||||||
@@ -117,6 +117,5 @@
|
|||||||
</if>
|
</if>
|
||||||
</when>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
<choose>
|
<choose>
|
||||||
<!-- 传空和默认的情况下按照时间降序排序 -->
|
<!-- 传空和默认的情况下按照时间降序排序 -->
|
||||||
<when test="dto.sortName == '' or dto.sortName == null">
|
<when test="dto.sortName == '' or dto.sortName == null">
|
||||||
sbr.create_time desc,sbr.id
|
sbr.create_time desc,sbr.id desc
|
||||||
</when>
|
</when>
|
||||||
<!-- sortNmae 有值的情况下排序 -->
|
<!-- sortNmae 有值的情况下排序 -->
|
||||||
<when test="dto.sortName != null and dto.sort != null ">
|
<when test="dto.sortName != null and dto.sort != null ">
|
||||||
@@ -185,7 +185,7 @@
|
|||||||
<choose>
|
<choose>
|
||||||
<!-- 传空和默认的情况下按照时间降序排序 -->
|
<!-- 传空和默认的情况下按照时间降序排序 -->
|
||||||
<when test="dto.sortName == '' or dto.sortName == null">
|
<when test="dto.sortName == '' or dto.sortName == null">
|
||||||
sbr.create_time desc,sbr.id
|
sbr.create_time desc,sbr.id desc
|
||||||
</when>
|
</when>
|
||||||
<!-- sortNmae 有值的情况下排序 -->
|
<!-- sortNmae 有值的情况下排序 -->
|
||||||
<when test="dto.sortName != null and dto.sort != null ">
|
<when test="dto.sortName != null and dto.sort != null ">
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
<choose>
|
<choose>
|
||||||
<!-- 传空和默认的情况下按照时间降序排序 -->
|
<!-- 传空和默认的情况下按照时间降序排序 -->
|
||||||
<when test="req.sortName == '' or req.sortName == null">
|
<when test="req.sortName == '' or req.sortName == null">
|
||||||
ns.create_time desc,ns.id
|
ns.create_time desc,ns.id desc
|
||||||
</when>
|
</when>
|
||||||
<!-- sortNmae 有值的情况下排序 -->
|
<!-- sortNmae 有值的情况下排序 -->
|
||||||
<when test="req.sortName != null and req.sort != null ">
|
<when test="req.sortName != null and req.sort != null ">
|
||||||
@@ -269,7 +269,7 @@
|
|||||||
<choose>
|
<choose>
|
||||||
<!-- 传空和默认的情况下按照时间降序排序 -->
|
<!-- 传空和默认的情况下按照时间降序排序 -->
|
||||||
<when test="req.sortName == '' or req.sortName == null">
|
<when test="req.sortName == '' or req.sortName == null">
|
||||||
ns.create_time desc,ns.id
|
ns.create_time desc,ns.id desc
|
||||||
</when>
|
</when>
|
||||||
<!-- sortNmae 有值的情况下排序 -->
|
<!-- sortNmae 有值的情况下排序 -->
|
||||||
<when test="req.sortName != null and req.sort != null ">
|
<when test="req.sortName != null and req.sort != null ">
|
||||||
|
|||||||
@@ -100,7 +100,7 @@
|
|||||||
<choose>
|
<choose>
|
||||||
<!-- 传空和默认的情况下按照时间降序排序 -->
|
<!-- 传空和默认的情况下按照时间降序排序 -->
|
||||||
<when test="req.sortName == null or req.sortName == ''">
|
<when test="req.sortName == null or req.sortName == ''">
|
||||||
ns.create_time desc,ns.id
|
ns.create_time desc,ns.id desc
|
||||||
</when>
|
</when>
|
||||||
<!-- sortName 有值的情况下排序 -->
|
<!-- sortName 有值的情况下排序 -->
|
||||||
<when test="req.sortName != null and req.sort != null">
|
<when test="req.sortName != null and req.sort != null">
|
||||||
|
|||||||
Reference in New Issue
Block a user