订单和商品数据隔离查询

This commit is contained in:
liang.chao 2024-12-01 15:12:50 +08:00
parent 883601d520
commit 77e577c22d
5 changed files with 12 additions and 2 deletions

View File

@ -236,4 +236,7 @@ public class DevInfo extends BaseEntity {
@ApiModelProperty(value = "管理方式(0编号 1计数)")
private String manageType;
@ApiModelProperty(value = "上传人id")
private Long ownId;
}

View File

@ -287,9 +287,9 @@ public class DevInfoServiceImpl implements DevInfoService {
}
//获取用户信息
Long userId = SecurityUtils.getUserId();
Long userId = SecurityUtils.getLoginUser().getUserid();
//保存用户信息
devInfo.setCreator(userId).setMaStatus(ON_HIRE.getCode());
devInfo.setCreator(userId).setMaStatus(ON_HIRE.getCode()).setOwnId(userId);
int saveSuccessNum = devInfoMapper.insertDevInfo(devInfo);
if (saveSuccessNum == 0) {
return AjaxResult.error("设备信息SQL保存失败请修改后重试");
@ -478,6 +478,7 @@ public class DevInfoServiceImpl implements DevInfoService {
*/
@Override
public List<DevInfoVo> selectDevInfoLists(DevInfoVo devInfo) {
devInfo.setOwnId(SecurityUtils.getLoginUser().getUserid());
return devInfoMapper.selectDevInfoLists(devInfo);
}
@ -567,6 +568,7 @@ public class DevInfoServiceImpl implements DevInfoService {
Long userId = SecurityUtils.getUserId();
//保存用户信息
devInfo1.setCreator(userId);
devInfo1.setOwnId(userId);
devInfo1.setCode(String.valueOf(UUID.randomUUID()));
devInfo1.setTypeId(typeInfo.getTypeId());
devInfo1.setJsDayPrice(Float.valueOf(leasePrice));

View File

@ -65,6 +65,7 @@ public class OrderServiceImpl implements OrderService {
@Override
public List<OrderInfoDto> getOrderDetails(OrderInfoDto orderInfoDto) throws Exception {
orderInfoDto.setOrderUser(SecurityUtils.getLoginUser().getUserid());
List<OrderInfoDto> orderInfoDtos = orderMapper.getOrderDetails(orderInfoDto);
for (OrderInfoDto dto : orderInfoDtos) {
List<OrderDetailDto> list = new ArrayList();

View File

@ -300,6 +300,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isOperator != null and isOperator != ''">is_operator,</if>
<if test="isActive != null and isActive != ''">is_active,</if>
<if test="updateBy != null and updateBy != ''">update_by,</if>
<if test="ownId != null">own_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
@ -337,6 +338,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isOperator != null and isOperator != ''">#{isOperator},</if>
<if test="isActive != null and isActive != ''">#{isActive},</if>
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
<if test="ownId != null">#{ownId},</if>
</trim>
</insert>
@ -516,6 +518,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
or locate(#{keyWord},d.description) > 0
)
</if>
and d.own_id = #{ownId}
and d.is_active = '1'
</where>
ORDER BY d.create_time desc

View File

@ -91,6 +91,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
) dept ON dept.deptId = su.dept_id
WHERE
mt.del_flag = '0'
and order_user = #{orderUser}
<if test="deviceName != null and deviceName != ''">
AND mdi.device_name like concat('%',#{deviceName},'%')
</if>