增加处置场筛选权限
parent
1c74181821
commit
719134447d
|
|
@ -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<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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||||
import com.njzscloud.supervisory.money.mapper.MoneyBillMapper;
|
import com.njzscloud.supervisory.money.mapper.MoneyBillMapper;
|
||||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyBillEntity;
|
import com.njzscloud.supervisory.money.pojo.entity.MoneyBillEntity;
|
||||||
import com.njzscloud.supervisory.money.pojo.result.MoneyBillResult;
|
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.order.utils.FileUtil;
|
||||||
import com.njzscloud.supervisory.sys.auth.mapper.AuthMapper;
|
import com.njzscloud.supervisory.sys.auth.mapper.AuthMapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
@ -39,6 +40,8 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
|
||||||
|
|
||||||
private final AuthMapper authMapper;
|
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) {
|
public PageResult<MoneyBillEntity> paging(PageParam pageParam, MoneyBillEntity moneyBillEntity) {
|
||||||
Page<MoneyBillEntity> page = new Page<>(pageParam.getCurrent(), pageParam.getSize());
|
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);
|
return PageResult.of(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -87,7 +94,7 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
|
||||||
IPage<MoneyBillEntity> result = new Page<>();
|
IPage<MoneyBillEntity> result = new Page<>();
|
||||||
if (null != company) {
|
if (null != company) {
|
||||||
moneyBillEntity.setStationId(company.getId());
|
moneyBillEntity.setStationId(company.getId());
|
||||||
result = baseMapper.selectMoneyBillWithNames(page, moneyBillEntity);
|
result = baseMapper.selectMoneyBillWithNames(page, moneyBillEntity, null);
|
||||||
}
|
}
|
||||||
return PageResult.of(result);
|
return PageResult.of(result);
|
||||||
}
|
}
|
||||||
|
|
@ -143,7 +150,7 @@ public class MoneyBillService extends ServiceImpl<MoneyBillMapper, MoneyBillEnti
|
||||||
}
|
}
|
||||||
|
|
||||||
public void export(HttpServletResponse response, MoneyBillEntity entity) throws IOException {
|
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<>();
|
List<Map<String, Object>> downList = new ArrayList<>();
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (MoneyBillEntity result : list) {
|
for (MoneyBillEntity result : list) {
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,6 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
private final RoleService roleService;
|
private final RoleService roleService;
|
||||||
private final UserRoleService userRoleService;
|
private final UserRoleService userRoleService;
|
||||||
private final UserService userService;
|
private final UserService userService;
|
||||||
private final BizTruckService bizTruckService;
|
|
||||||
private final DiscountManageService discountManageService;
|
private final DiscountManageService discountManageService;
|
||||||
private final HsoaService hsoaService;
|
private final HsoaService hsoaService;
|
||||||
private final DictItemService dictItemService;
|
private final DictItemService dictItemService;
|
||||||
|
|
@ -241,6 +240,10 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
Long goodsId = orderPagingSearchParam.getGoodsId();
|
Long goodsId = orderPagingSearchParam.getGoodsId();
|
||||||
Page<OrderPagingResult> page = pageParam.toPage();
|
Page<OrderPagingResult> page = pageParam.toPage();
|
||||||
Long stationId = orderPagingSearchParam.getStationId();
|
Long stationId = orderPagingSearchParam.getStationId();
|
||||||
|
List<Long> stationIds = this.getStationIds();
|
||||||
|
if (!stationIds.isEmpty()) {
|
||||||
|
stationId = null;
|
||||||
|
}
|
||||||
String area = orderPagingSearchParam.getArea();
|
String area = orderPagingSearchParam.getArea();
|
||||||
OrderCategory orderCategory = orderPagingSearchParam.getOrderCategory();
|
OrderCategory orderCategory = orderPagingSearchParam.getOrderCategory();
|
||||||
String transCompanyName = orderPagingSearchParam.getTransCompanyName();
|
String transCompanyName = orderPagingSearchParam.getTransCompanyName();
|
||||||
|
|
@ -251,6 +254,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
LocalDateTime endOutTime = orderPagingSearchParam.getEndOutTime();
|
LocalDateTime endOutTime = orderPagingSearchParam.getEndOutTime();
|
||||||
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
|
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
|
||||||
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
.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(sn), "a.sn", sn)
|
||||||
.like(StrUtil.isNotBlank(licensePlate), "e.license_plate", licensePlate)
|
.like(StrUtil.isNotBlank(licensePlate), "e.license_plate", licensePlate)
|
||||||
.like(StrUtil.isNotBlank(nickname), "a.contacts", nickname)
|
.like(StrUtil.isNotBlank(nickname), "a.contacts", nickname)
|
||||||
|
|
@ -2531,4 +2535,16 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
.eq("a.order_status", OrderStatus.YiWanCheng);
|
.eq("a.order_status", OrderStatus.YiWanCheng);
|
||||||
return PageResult.of(baseMapper.paging(page, ew));
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,12 @@
|
||||||
LEFT JOIN sys_user u ON mb.user_id = u.id
|
LEFT JOIN sys_user u ON mb.user_id = u.id
|
||||||
LEFT JOIN biz_company bc ON mb.station_id = bc.id
|
LEFT JOIN biz_company bc ON mb.station_id = bc.id
|
||||||
<where>
|
<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">
|
<if test="entity.userId != null">
|
||||||
AND mb.user_id = #{entity.userId}
|
AND mb.user_id = #{entity.userId}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue