|
@@ -10,10 +10,8 @@ import com.qmth.sop.business.bean.result.UserArchivesAllocationSubTotalResult;
|
|
import com.qmth.sop.business.entity.SysUser;
|
|
import com.qmth.sop.business.entity.SysUser;
|
|
import com.qmth.sop.business.entity.TBService;
|
|
import com.qmth.sop.business.entity.TBService;
|
|
import com.qmth.sop.business.mapper.ServiceAnalyseMapper;
|
|
import com.qmth.sop.business.mapper.ServiceAnalyseMapper;
|
|
-import com.qmth.sop.business.service.ServiceAnalyseService;
|
|
|
|
-import com.qmth.sop.business.service.SysUserService;
|
|
|
|
-import com.qmth.sop.business.service.TBSopInfoService;
|
|
|
|
-import com.qmth.sop.business.service.TBUserArchivesSupplierService;
|
|
|
|
|
|
+import com.qmth.sop.business.service.*;
|
|
|
|
+import com.qmth.sop.common.contant.SystemConstant;
|
|
import com.qmth.sop.common.enums.CrmStatusEnum;
|
|
import com.qmth.sop.common.enums.CrmStatusEnum;
|
|
import com.qmth.sop.common.util.ServletUtil;
|
|
import com.qmth.sop.common.util.ServletUtil;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -35,6 +33,9 @@ public class ServiceAnalyseServiceImpl extends ServiceImpl<ServiceAnalyseMapper,
|
|
@Resource
|
|
@Resource
|
|
private SysUserService sysUserService;
|
|
private SysUserService sysUserService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ TBUserArchivesAllocationService tbUserArchivesAllocationService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<TBService> list(Long startTime, Long endTime) {
|
|
public List<TBService> list(Long startTime, Long endTime) {
|
|
SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
|
|
SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
|
|
@@ -148,19 +149,21 @@ public class ServiceAnalyseServiceImpl extends ServiceImpl<ServiceAnalyseMapper,
|
|
@Override
|
|
@Override
|
|
public UserArchivesAllocationSubTotalResult findCrmAllocationSubTotal(Long serviceUnitId, Long regionId, Long supplierId) {
|
|
public UserArchivesAllocationSubTotalResult findCrmAllocationSubTotal(Long serviceUnitId, Long regionId, Long supplierId) {
|
|
|
|
|
|
- List<UserArchivesAllocationResult> list = this.baseMapper.findCrmAllocation(serviceUnitId, regionId, supplierId);
|
|
|
|
- Integer publishedCrmCount = Math.toIntExact(list.stream().filter(e -> CrmStatusEnum.PUBLISH.equals(e.getCrmStatus())).count());
|
|
|
|
- Integer totalCrmCount = list.size();
|
|
|
|
-
|
|
|
|
- Integer coordinatorQuota = list.stream().mapToInt(UserArchivesAllocationResult::getCoordinatorQuota).sum();
|
|
|
|
- Integer coordinatorDistributed = list.stream().mapToInt(UserArchivesAllocationResult::getCoordinatorDistributed).sum();
|
|
|
|
-
|
|
|
|
- Integer effectQuota = list.stream().mapToInt(UserArchivesAllocationResult::getEffectQuota).sum();
|
|
|
|
- Integer effectDistributed = list.stream().mapToInt(UserArchivesAllocationResult::getEffectDistributed).sum();
|
|
|
|
-
|
|
|
|
- Integer assistantQuota = list.stream().mapToInt(UserArchivesAllocationResult::getAssistantQuota).sum();
|
|
|
|
- Integer assistantDistributed = list.stream().mapToInt(UserArchivesAllocationResult::getAssistantDistributed).sum();
|
|
|
|
-
|
|
|
|
|
|
+// List<UserArchivesAllocationResult> list = this.baseMapper.findCrmAllocation(serviceUnitId, regionId, supplierId);
|
|
|
|
+ IPage<UserArchivesAllocationResult> userArchivesAllocationResultIPage = tbUserArchivesAllocationService.findCrmAllocationPage(serviceUnitId, null, null, null, null, null, regionId, SystemConstant.PAGE_NUMBER_MIN, SystemConstant.PAGE_SIZE_MAX_SELECT);
|
|
|
|
+ Integer publishedCrmCount = 0, totalCrmCount = 0, coordinatorQuota = 0, coordinatorDistributed = 0, effectQuota = 0,
|
|
|
|
+ effectDistributed = 0, assistantQuota = 0, assistantDistributed = 0;
|
|
|
|
+ if (Objects.nonNull(userArchivesAllocationResultIPage)) {
|
|
|
|
+ List<UserArchivesAllocationResult> list = userArchivesAllocationResultIPage.getRecords();
|
|
|
|
+ publishedCrmCount = Math.toIntExact(list.stream().filter(e -> CrmStatusEnum.PUBLISH.equals(e.getCrmStatus())).count());
|
|
|
|
+ totalCrmCount = list.size();
|
|
|
|
+ coordinatorQuota = list.stream().mapToInt(UserArchivesAllocationResult::getCoordinatorQuota).sum();
|
|
|
|
+ coordinatorDistributed = list.stream().mapToInt(UserArchivesAllocationResult::getCoordinatorDistributed).sum();
|
|
|
|
+ effectQuota = list.stream().mapToInt(UserArchivesAllocationResult::getEffectQuota).sum();
|
|
|
|
+ effectDistributed = list.stream().mapToInt(UserArchivesAllocationResult::getEffectDistributed).sum();
|
|
|
|
+ assistantQuota = list.stream().mapToInt(UserArchivesAllocationResult::getAssistantQuota).sum();
|
|
|
|
+ assistantDistributed = list.stream().mapToInt(UserArchivesAllocationResult::getAssistantDistributed).sum();
|
|
|
|
+ }
|
|
UserArchivesAllocationSubTotalResult result = new UserArchivesAllocationSubTotalResult();
|
|
UserArchivesAllocationSubTotalResult result = new UserArchivesAllocationSubTotalResult();
|
|
result.setPublishedCrmCount(publishedCrmCount);
|
|
result.setPublishedCrmCount(publishedCrmCount);
|
|
result.setTotalCrmCount(totalCrmCount);
|
|
result.setTotalCrmCount(totalCrmCount);
|
|
@@ -177,4 +180,15 @@ public class ServiceAnalyseServiceImpl extends ServiceImpl<ServiceAnalyseMapper,
|
|
public List<UserArchivesAllocationResult> findCrmAllocation(Long serviceUnitId, Long regionId, Long supplierId) {
|
|
public List<UserArchivesAllocationResult> findCrmAllocation(Long serviceUnitId, Long regionId, Long supplierId) {
|
|
return this.baseMapper.findCrmAllocation(serviceUnitId, regionId, supplierId);
|
|
return this.baseMapper.findCrmAllocation(serviceUnitId, regionId, supplierId);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 查找当前大区待划定派单数量
|
|
|
|
+ *
|
|
|
|
+ * @param regionId
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public int findWaitZone(Long regionId) {
|
|
|
|
+ return this.baseMapper.findWaitZone(regionId);
|
|
|
|
+ }
|
|
}
|
|
}
|