|
@@ -30,7 +30,6 @@ import org.springframework.stereotype.Service;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
@Service
|
|
|
public class StatisticsServiceImpl implements StatisticsService {
|
|
@@ -68,15 +67,15 @@ public class StatisticsServiceImpl implements StatisticsService {
|
|
|
|
|
|
|
|
|
boolean flag;
|
|
|
- Long companyId = SecurityUtils.getCompanyId();
|
|
|
- if (Objects.equals(companyId, 100L)) {
|
|
|
+ List<Long> companyIds = SecurityUtils.getCompanyIds();
|
|
|
+
|
|
|
+ if (companyIds.contains(100L)) {
|
|
|
|
|
|
- companyId = null;
|
|
|
flag = true;
|
|
|
} else {
|
|
|
flag = false;
|
|
|
}
|
|
|
- Long finalCompanyId = companyId;
|
|
|
+ List<Long> finalCompanyIds = companyIds;
|
|
|
|
|
|
|
|
|
long waitFlowCount = flowExampleService.count(q -> q.in(FlowExample::getStatus, 1, 0).eq(FlowExample::getHandleUserId, userId));
|
|
@@ -84,12 +83,12 @@ public class StatisticsServiceImpl implements StatisticsService {
|
|
|
long waitQuotationCount = saleQuotationService.count(q -> q
|
|
|
.ne(!flag, SaleQuotation::getStatus, FlowStatusEnum1.DRAFT.getKey())
|
|
|
.ne(SaleQuotation::getStatus, FlowStatusEnum1.UPDATE.getKey())
|
|
|
- .eq(!flag, SaleQuotation::getCompanyId, finalCompanyId)
|
|
|
+ .in(!flag, SaleQuotation::getCompanyId, finalCompanyIds)
|
|
|
);
|
|
|
|
|
|
long waitProduceCount = produceOrderService.count(q -> q
|
|
|
.isNull(ProductionOrder::getProduceTime)
|
|
|
- .eq(!flag, ProductionOrder::getCompanyId, finalCompanyId)
|
|
|
+ .in(!flag, ProductionOrder::getCompanyId, finalCompanyIds)
|
|
|
);
|
|
|
|
|
|
StockWaitDetailsSelectDto stockWaitDetailsSelectDto = new StockWaitDetailsSelectDto();
|
|
@@ -103,7 +102,7 @@ public class StatisticsServiceImpl implements StatisticsService {
|
|
|
long waitClaimCount = accountRunningWaterService.count(q -> q
|
|
|
.eq(AccountRunningWater::getReceived, 10)
|
|
|
.eq(AccountRunningWater::getIsClaim, 0)
|
|
|
- .eq(!flag, AccountRunningWater::getCompanyId, finalCompanyId)
|
|
|
+ .in(!flag, AccountRunningWater::getCompanyId, finalCompanyIds)
|
|
|
);
|
|
|
|
|
|
long stockWarnCount = stockService.stockWarningPage(new StockSelectDto()).getTotal();
|
|
@@ -171,11 +170,10 @@ public class StatisticsServiceImpl implements StatisticsService {
|
|
|
public List<ContractVo> getRecentContractShipmentList() {
|
|
|
IWrapper<Object> wrapper = IWrapper.getWrapper();
|
|
|
|
|
|
-
|
|
|
- Long companyId = SecurityUtils.getCompanyId();
|
|
|
- if (!Objects.equals(companyId, 100L)) {
|
|
|
- wrapper.eq("c.company_id", companyId);
|
|
|
- }
|
|
|
+
|
|
|
+ wrapper.in("c.company_id", SecurityUtils.getCompanyIds());
|
|
|
+
|
|
|
+
|
|
|
wrapper.eq("c.status", 30);
|
|
|
wrapper.ge("DATEDIFF(c.delivery_time,NOW())", 0);
|
|
|
wrapper.le("DATEDIFF(c.delivery_time,NOW())", 7);
|
|
@@ -187,11 +185,9 @@ public class StatisticsServiceImpl implements StatisticsService {
|
|
|
public List<EhsdPurchaseVo> getRecentPurchaseArrivalList() {
|
|
|
IWrapper<Object> wrapper = IWrapper.getWrapper();
|
|
|
|
|
|
-
|
|
|
- Long companyId = SecurityUtils.getCompanyId();
|
|
|
- if (!Objects.equals(companyId, 100L)) {
|
|
|
- wrapper.eq("p.company_id", companyId);
|
|
|
- }
|
|
|
+
|
|
|
+ wrapper.in("p.company_id", SecurityUtils.getCompanyIds());
|
|
|
+
|
|
|
|
|
|
wrapper.ge("DATEDIFF(p.delivery_time,NOW())", 0);
|
|
|
wrapper.le("DATEDIFF(p.delivery_time,NOW())", 7);
|