|
@@ -7,8 +7,10 @@ import com.github.pagehelper.PageInfo;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.core.page.PageRequest;
|
|
import com.ydtech.core.page.PageRequest;
|
|
|
import com.ydtech.modules.admin.dao.SysAmountAuditingMapper;
|
|
import com.ydtech.modules.admin.dao.SysAmountAuditingMapper;
|
|
|
|
|
+import com.ydtech.modules.admin.model.SysDept;
|
|
|
import com.ydtech.modules.admin.model.dto.TaskStatisticsDto;
|
|
import com.ydtech.modules.admin.model.dto.TaskStatisticsDto;
|
|
|
import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
|
|
import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
|
|
|
|
|
+import com.ydtech.modules.admin.service.SysDeptService;
|
|
|
import com.ydtech.modules.admin.service.TaskStatisticsService;
|
|
import com.ydtech.modules.admin.service.TaskStatisticsService;
|
|
|
import com.ydtech.modules.base.model.vo.PageVo;
|
|
import com.ydtech.modules.base.model.vo.PageVo;
|
|
|
import com.ydtech.modules.fnc.entity.InsPlyIncome;
|
|
import com.ydtech.modules.fnc.entity.InsPlyIncome;
|
|
@@ -17,11 +19,13 @@ import com.ydtech.modules.order.dao.InsOrdersMapper;
|
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
import com.ydtech.modules.order.entity.BasePageResult;
|
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
import com.ydtech.modules.order.entity.InsAreaCompany;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -40,6 +44,9 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private InsOrdersMapper insOrdersMapper;
|
|
private InsOrdersMapper insOrdersMapper;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SysDeptService sysDeptService;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @description: 渠道任务统计查询
|
|
* @description: 渠道任务统计查询
|
|
@@ -54,6 +61,29 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
|
|
|
pageVo.setPageNum(taskStatisticsVo.getPageNum());
|
|
pageVo.setPageNum(taskStatisticsVo.getPageNum());
|
|
|
pageVo.setPageSize(taskStatisticsVo.getPageSize());
|
|
pageVo.setPageSize(taskStatisticsVo.getPageSize());
|
|
|
IPage<TaskStatisticsDto> list = this.insAreaCompanyMapper.queryPageTaskStatistics(page,taskStatisticsVo);
|
|
IPage<TaskStatisticsDto> list = this.insAreaCompanyMapper.queryPageTaskStatistics(page,taskStatisticsVo);
|
|
|
|
|
+ if (list != null && !list.getRecords().isEmpty()) {
|
|
|
|
|
+ List<TaskStatisticsDto> records = list.getRecords();
|
|
|
|
|
+ for (TaskStatisticsDto record : records) {
|
|
|
|
|
+ String deptId = record.getDeptId();
|
|
|
|
|
+ if (StringUtils.isNotEmpty(deptId)) {
|
|
|
|
|
+ int length = deptId.length();
|
|
|
|
|
+ if (length > 0) {
|
|
|
|
|
+ if (length > 10) {
|
|
|
|
|
+ String substring = deptId.substring(0, 6);
|
|
|
|
|
+ String substring1 = deptId.substring(0, 8);
|
|
|
|
|
+ SysDept cityName = sysDeptService.getById(substring);
|
|
|
|
|
+ SysDept districtName = sysDeptService.getById(substring1);
|
|
|
|
|
+ record.setCityName(cityName.getName());
|
|
|
|
|
+ record.setDistrictName(districtName.getName());
|
|
|
|
|
+ } else if (length > 6) {
|
|
|
|
|
+ String substring = deptId.substring(0, 6);
|
|
|
|
|
+ SysDept cityName = sysDeptService.getById(substring);
|
|
|
|
|
+ record.setCityName(cityName.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
Long total = this.insAreaCompanyMapper.queryPageTaskStatisticsTotal(taskStatisticsVo);
|
|
Long total = this.insAreaCompanyMapper.queryPageTaskStatisticsTotal(taskStatisticsVo);
|
|
|
list.setTotal(total);
|
|
list.setTotal(total);
|
|
|
return list;
|
|
return list;
|
|
@@ -82,6 +112,7 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
|
|
|
**/
|
|
**/
|
|
|
@Override
|
|
@Override
|
|
|
public IPage<TaskStatisticsDto> agentStatisticsQueryPage(TaskStatisticsVo taskStatisticsVo) {
|
|
public IPage<TaskStatisticsDto> agentStatisticsQueryPage(TaskStatisticsVo taskStatisticsVo) {
|
|
|
|
|
+
|
|
|
PageVo<TaskStatisticsVo> pageVo = new PageVo<>();
|
|
PageVo<TaskStatisticsVo> pageVo = new PageVo<>();
|
|
|
Page page = new Page(taskStatisticsVo.getPageNum(), taskStatisticsVo.getPageSize());
|
|
Page page = new Page(taskStatisticsVo.getPageNum(), taskStatisticsVo.getPageSize());
|
|
|
pageVo.setPageNum(taskStatisticsVo.getPageNum());
|
|
pageVo.setPageNum(taskStatisticsVo.getPageNum());
|
|
@@ -90,6 +121,29 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
|
|
|
|
|
|
|
|
IPage<TaskStatisticsDto> list = this.insAreaCompanyMapper.agentStatisticsQueryPage(page,taskStatisticsVo);
|
|
IPage<TaskStatisticsDto> list = this.insAreaCompanyMapper.agentStatisticsQueryPage(page,taskStatisticsVo);
|
|
|
Long total = this.insAreaCompanyMapper.agentStatisticsQueryPageTotal(taskStatisticsVo);
|
|
Long total = this.insAreaCompanyMapper.agentStatisticsQueryPageTotal(taskStatisticsVo);
|
|
|
|
|
+ if (list != null && !list.getRecords().isEmpty()) {
|
|
|
|
|
+ List<TaskStatisticsDto> records = list.getRecords();
|
|
|
|
|
+ for (TaskStatisticsDto record : records) {
|
|
|
|
|
+ String deptId = record.getDeptId();
|
|
|
|
|
+ if (StringUtils.isNotEmpty(deptId)) {
|
|
|
|
|
+ int length = deptId.length();
|
|
|
|
|
+ if (length > 0) {
|
|
|
|
|
+ if (length > 10) {
|
|
|
|
|
+ String substring = deptId.substring(0, 6);
|
|
|
|
|
+ String substring1 = deptId.substring(0, 8);
|
|
|
|
|
+ SysDept cityName = sysDeptService.getById(substring);
|
|
|
|
|
+ SysDept districtName = sysDeptService.getById(substring1);
|
|
|
|
|
+ record.setCityName(cityName.getName());
|
|
|
|
|
+ record.setDistrictName(districtName.getName());
|
|
|
|
|
+ } else if (length > 6) {
|
|
|
|
|
+ String substring = deptId.substring(0, 6);
|
|
|
|
|
+ SysDept cityName = sysDeptService.getById(substring);
|
|
|
|
|
+ record.setCityName(cityName.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
list.setTotal(total);
|
|
list.setTotal(total);
|
|
|
return list;
|
|
return list;
|
|
|
}
|
|
}
|