增加处置场筛选权限

dev
ljw 2026-04-28 16:23:56 +08:00
parent 1c74181821
commit 719134447d
4 changed files with 35 additions and 6 deletions

View File

@ -19,13 +19,13 @@ public interface MoneyBillMapper extends BaseMapper<MoneyBillEntity> {
/**
*
*/
IPage<MoneyBillEntity> selectMoneyBillWithNames(Page<MoneyBillEntity> page, @Param("entity") MoneyBillEntity entity);
IPage<MoneyBillEntity> selectMoneyBillWithNames(Page<MoneyBillEntity> page, @Param("entity") MoneyBillEntity entity, @Param("stationIds") List<Long> stationIds);
/**
*
*/
List<MoneyBillResult> selectMoneyBillList(@Param("entity") MoneyBillResult entity);
List<MoneyBillEntity> selectMoneyBillWithNames(@Param("entity") MoneyBillEntity entity);
List<MoneyBillEntity> selectMoneyBillWithNames(@Param("entity") MoneyBillEntity entity, @Param("stationIds") List<Long> stationIds);
}

View File

@ -10,6 +10,7 @@ import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
import com.njzscloud.supervisory.money.mapper.MoneyBillMapper;
import com.njzscloud.supervisory.money.pojo.entity.MoneyBillEntity;
import com.njzscloud.supervisory.money.pojo.result.MoneyBillResult;
import com.njzscloud.supervisory.order.service.OrderInfoService;
import com.njzscloud.supervisory.order.utils.FileUtil;
import com.njzscloud.supervisory.sys.auth.mapper.AuthMapper;
import lombok.RequiredArgsConstructor;
@ -39,6 +40,8 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
private final AuthMapper authMapper;
private final OrderInfoService orderInfoService;
/**
*
*/
@ -73,7 +76,11 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
*/
public PageResult<MoneyBillEntity> paging(PageParam pageParam, MoneyBillEntity moneyBillEntity) {
Page<MoneyBillEntity> page = new Page<>(pageParam.getCurrent(), pageParam.getSize());
IPage<MoneyBillEntity> result = baseMapper.selectMoneyBillWithNames(page, moneyBillEntity);
List<Long> stationIds = orderInfoService.getStationIds();
if (!stationIds.isEmpty()) {
moneyBillEntity.setStationId(null);
}
IPage<MoneyBillEntity> result = baseMapper.selectMoneyBillWithNames(page, moneyBillEntity, stationIds);
return PageResult.of(result);
}
@ -87,7 +94,7 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
IPage<MoneyBillEntity> result = new Page<>();
if (null != company) {
moneyBillEntity.setStationId(company.getId());
result = baseMapper.selectMoneyBillWithNames(page, moneyBillEntity);
result = baseMapper.selectMoneyBillWithNames(page, moneyBillEntity, null);
}
return PageResult.of(result);
}
@ -143,7 +150,7 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
}
public void export(HttpServletResponse response, MoneyBillEntity entity) throws IOException {
List<MoneyBillEntity> list = baseMapper.selectMoneyBillWithNames(entity);
List<MoneyBillEntity> list = baseMapper.selectMoneyBillWithNames(entity, null);
List<Map<String, Object>> downList = new ArrayList<>();
int i = 1;
for (MoneyBillEntity result : list) {

View File

@ -120,7 +120,6 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
private final RoleService roleService;
private final UserRoleService userRoleService;
private final UserService userService;
private final BizTruckService bizTruckService;
private final DiscountManageService discountManageService;
private final HsoaService hsoaService;
private final DictItemService dictItemService;
@ -241,6 +240,10 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
Long goodsId = orderPagingSearchParam.getGoodsId();
Page<OrderPagingResult> page = pageParam.toPage();
Long stationId = orderPagingSearchParam.getStationId();
List<Long> stationIds = this.getStationIds();
if (!stationIds.isEmpty()) {
stationId = null;
}
String area = orderPagingSearchParam.getArea();
OrderCategory orderCategory = orderPagingSearchParam.getOrderCategory();
String transCompanyName = orderPagingSearchParam.getTransCompanyName();
@ -251,6 +254,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
LocalDateTime endOutTime = orderPagingSearchParam.getEndOutTime();
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
.in(!stationIds.isEmpty(), "a.station_id", stationIds)
.like(StrUtil.isNotBlank(sn), "a.sn", sn)
.like(StrUtil.isNotBlank(licensePlate), "e.license_plate", licensePlate)
.like(StrUtil.isNotBlank(nickname), "a.contacts", nickname)
@ -2531,4 +2535,16 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
.eq("a.order_status", OrderStatus.YiWanCheng);
return PageResult.of(baseMapper.paging(page, ew));
}
public List<Long> getStationIds() {
MyResult userDetail = SecurityUtil.loginUser();
List<StationManageEntity> stationManageEntityList = stationManageService.list(Wrappers.lambdaQuery(StationManageEntity.class)
.eq(StationManageEntity::getUserId, userDetail.getUserId()));
if (CollUtil.isEmpty(stationManageEntityList)) {
throw Exceptions.clierr("当前用户不是站点管理员");
}
return stationManageEntityList.stream()
.map(StationManageEntity::getStationId)
.collect(Collectors.toList());
}
}

View File

@ -33,6 +33,12 @@
LEFT JOIN sys_user u ON mb.user_id = u.id
LEFT JOIN biz_company bc ON mb.station_id = bc.id
<where>
<if test="stationIds != null and stationIds.size() > 0">
AND mb.station_id IN
<foreach collection="stationIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="entity.userId != null">
AND mb.user_id = #{entity.userId}
</if>