Commit a483822d by huluobin

update

parent c0bc352a
...@@ -52,8 +52,8 @@ public class BaseProduceServiceImpl extends ServiceImpl<BaseProduceMapper, BaseP ...@@ -52,8 +52,8 @@ public class BaseProduceServiceImpl extends ServiceImpl<BaseProduceMapper, BaseP
Integer sort = baseFeatures != null && baseFeatures.getName().equals("热销款") ? 1 : 2; Integer sort = baseFeatures != null && baseFeatures.getName().equals("热销款") ? 1 : 2;
request.setSort(sort); request.setSort(sort);
request.setSourceFrom(SessionUtils.getSourceFrom()); request.setSourceFrom(SessionUtils.getSourceFrom());
Integer departmentId = SessionUtils.getDepartmentId();
request.setDepartmentId(SessionUtils.getCustomerDepartmentId()); request.setDepartmentId(departmentId);
page = baseProduceMapper.queryProducePage(page, request); page = baseProduceMapper.queryProducePage(page, request);
......
...@@ -26,12 +26,13 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe ...@@ -26,12 +26,13 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
@Override @Override
public IPage<BaseServe> listServeForPage(IPage<BaseServe> page, BaseServe param) { public IPage<BaseServe> listServeForPage(IPage<BaseServe> page, BaseServe param) {
param.setDepartmentId(SessionUtils.getCustomerDepartmentId()); Integer departmentId = SessionUtils.getDepartmentId();
param.setDepartmentId(departmentId);
IPage<BaseServe> result = baseServeMapper.listServeForPage(page, param); IPage<BaseServe> result = baseServeMapper.listServeForPage(page, param);
List<Integer> serveIdList = result.getRecords().stream().map(BaseServe::getId).collect(Collectors.toList()); List<Integer> serveIdList = result.getRecords().stream().map(BaseServe::getId).collect(Collectors.toList());
Integer departmentId = SessionUtils.getCustomerDepartmentId();
List<ServiceStorePrice> serviceStorePriceList = serviceStorePriceMapper.selectList(new LambdaQueryWrapper<ServiceStorePrice>() List<ServiceStorePrice> serviceStorePriceList = serviceStorePriceMapper.selectList(new LambdaQueryWrapper<ServiceStorePrice>()
.eq(ServiceStorePrice::getStoreId, departmentId) .eq(ServiceStorePrice::getStoreId, departmentId)
.in(ServiceStorePrice::getServiceId, serveIdList)); .in(ServiceStorePrice::getServiceId, serveIdList));
...@@ -52,7 +53,7 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe ...@@ -52,7 +53,7 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
@Override @Override
public BaseServe getAggregate(Integer id) { public BaseServe getAggregate(Integer id) {
BaseServe baseServe = baseServeMapper.selectById(id); BaseServe baseServe = baseServeMapper.selectById(id);
Integer departmentId = SessionUtils.getCustomerDepartmentId(); Integer departmentId = SessionUtils.getDepartmentId();
ServiceStorePrice serviceStorePrice = serviceStorePriceMapper.selectOne(new LambdaQueryWrapper<ServiceStorePrice>() ServiceStorePrice serviceStorePrice = serviceStorePriceMapper.selectOne(new LambdaQueryWrapper<ServiceStorePrice>()
.eq(ServiceStorePrice::getStoreId, departmentId) .eq(ServiceStorePrice::getStoreId, departmentId)
......
...@@ -156,4 +156,15 @@ public class SessionUtils { ...@@ -156,4 +156,15 @@ public class SessionUtils {
} }
} }
public static Integer getDepartmentId() {
if (StringUtils.isNotEmpty(SessionUtils.getSourceFrom()) && SessionUtils.getSourceFrom().equals(SessionUtils.customer)) {
return SessionUtils.getCustomerDepartmentId();
}
if (StringUtils.isNotEmpty(SessionUtils.getSourceFrom()) && SessionUtils.getSourceFrom().equals(SessionUtils.technician)) {
return SessionUtils.getTechnicianToken().getDepartmentId();
}
return null;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment