|
@@ -11,6 +11,7 @@ import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.core.page.PageRequest;
|
|
import com.ydtech.core.page.PageRequest;
|
|
|
import com.ydtech.exception.SystemException;
|
|
import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.admin.dao.SysAmountAuditingMapper;
|
|
import com.ydtech.modules.admin.dao.SysAmountAuditingMapper;
|
|
|
|
|
+import com.ydtech.modules.admin.dao.SysDeptMapper;
|
|
|
import com.ydtech.modules.admin.dao.SysUserMapper;
|
|
import com.ydtech.modules.admin.dao.SysUserMapper;
|
|
|
import com.ydtech.modules.admin.dao.TaskStatisticsMapper;
|
|
import com.ydtech.modules.admin.dao.TaskStatisticsMapper;
|
|
|
import com.ydtech.modules.admin.model.SysDept;
|
|
import com.ydtech.modules.admin.model.SysDept;
|
|
@@ -23,6 +24,7 @@ import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
|
|
|
import com.ydtech.modules.admin.service.SysDeptService;
|
|
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.admin.utils.SliceUpDateUtil;
|
|
import com.ydtech.modules.admin.utils.SliceUpDateUtil;
|
|
|
|
|
+import com.ydtech.modules.base.controller.BaseController;
|
|
|
import com.ydtech.modules.base.model.vo.PageVo;
|
|
import com.ydtech.modules.base.model.vo.PageVo;
|
|
|
import com.ydtech.modules.inv.utils.EasyExcelUtils;
|
|
import com.ydtech.modules.inv.utils.EasyExcelUtils;
|
|
|
import com.ydtech.modules.order.dao.InsAreaCompanyMapper;
|
|
import com.ydtech.modules.order.dao.InsAreaCompanyMapper;
|
|
@@ -70,6 +72,8 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
|
|
|
private SysDeptService sysDeptService;
|
|
private SysDeptService sysDeptService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private SysUserMapper sysUserMapper;
|
|
private SysUserMapper sysUserMapper;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SysDeptMapper sysDeptMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
@Value("${upload.file.path}")
|
|
@Value("${upload.file.path}")
|
|
@@ -373,6 +377,7 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
|
|
|
}else if ("1".equals(taskStatisticsVo.getTreeType())){
|
|
}else if ("1".equals(taskStatisticsVo.getTreeType())){
|
|
|
taskStatisticsVo.setDeptId(taskStatisticsVo.getTreeUserId());
|
|
taskStatisticsVo.setDeptId(taskStatisticsVo.getTreeUserId());
|
|
|
taskStatisticsVo.setTreeUserId(null);
|
|
taskStatisticsVo.setTreeUserId(null);
|
|
|
|
|
+ taskStatisticsVo.setUserIds(new ArrayList<>());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
PageVo<TaskStatisticsVo> pageVo = new PageVo<>();
|
|
PageVo<TaskStatisticsVo> pageVo = new PageVo<>();
|
|
@@ -387,6 +392,10 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
|
|
|
taskStatisticsVo.setCreatetimeEnd(dateMapByType.get("endDate"));
|
|
taskStatisticsVo.setCreatetimeEnd(dateMapByType.get("endDate"));
|
|
|
|
|
|
|
|
IPage<BusinessAgentData> list = this.taskStatisticsMapper.getBusinessAgentData(page,taskStatisticsVo);
|
|
IPage<BusinessAgentData> list = this.taskStatisticsMapper.getBusinessAgentData(page,taskStatisticsVo);
|
|
|
|
|
+ List<BusinessAgentData> records = list.getRecords();
|
|
|
|
|
+ for (BusinessAgentData record : records) {
|
|
|
|
|
+ this.appendName(record);
|
|
|
|
|
+ }
|
|
|
Long total = this.taskStatisticsMapper.getBusinessAgentDataTotal(taskStatisticsVo);
|
|
Long total = this.taskStatisticsMapper.getBusinessAgentDataTotal(taskStatisticsVo);
|
|
|
list.setTotal(total);
|
|
list.setTotal(total);
|
|
|
return list;
|
|
return list;
|
|
@@ -537,10 +546,11 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
|
|
|
}else if ("1".equals(taskStatisticsVo.getTreeType())){
|
|
}else if ("1".equals(taskStatisticsVo.getTreeType())){
|
|
|
taskStatisticsVo.setDeptId(taskStatisticsVo.getTreeUserId());
|
|
taskStatisticsVo.setDeptId(taskStatisticsVo.getTreeUserId());
|
|
|
taskStatisticsVo.setTreeUserId(null);
|
|
taskStatisticsVo.setTreeUserId(null);
|
|
|
|
|
+ taskStatisticsVo.setUserIds(new ArrayList<>());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ String deptId = BaseController.getDeptId();
|
|
|
BusinessAgentData result = this.taskStatisticsMapper.getBusinessAgentDataTotalAdd(taskStatisticsVo);
|
|
BusinessAgentData result = this.taskStatisticsMapper.getBusinessAgentDataTotalAdd(taskStatisticsVo);
|
|
|
Long total = this.taskStatisticsMapper.getBusinessAgentDataTotal(taskStatisticsVo);
|
|
Long total = this.taskStatisticsMapper.getBusinessAgentDataTotal(taskStatisticsVo);
|
|
|
result.setTotalNumber(total.toString());
|
|
result.setTotalNumber(total.toString());
|
|
@@ -629,4 +639,33 @@ public class TaskStatisticsServiceImpl implements TaskStatisticsService {
|
|
|
IPage<TaskStatisticsDto> list = this.taskStatisticsMapper.channelAgentDetails(page,taskStatisticsVo);
|
|
IPage<TaskStatisticsDto> list = this.taskStatisticsMapper.channelAgentDetails(page,taskStatisticsVo);
|
|
|
return list;
|
|
return list;
|
|
|
}
|
|
}
|
|
|
|
|
+ private void appendName(BusinessAgentData user) {
|
|
|
|
|
+ StringBuilder stringBuilder = new StringBuilder();
|
|
|
|
|
+ String deptId = user.getDeptId();
|
|
|
|
|
+ if (com.ydtech.utils.StringUtils.isNotEmpty(deptId)) {
|
|
|
|
|
+ int length = deptId.length();
|
|
|
|
|
+ if (length > 0) {
|
|
|
|
|
+ if (length <= 5) {
|
|
|
|
|
+ String dept = deptId.replaceAll("[^\\d]*(\\d+).*", "$1");
|
|
|
|
|
+ SysDept cityName = sysDeptMapper.selectById(dept);
|
|
|
|
|
+ String name = cityName.getName();
|
|
|
|
|
+ stringBuilder.append("(").append(name).append(")");
|
|
|
|
|
+ } else if (length > 5) {
|
|
|
|
|
+ String dept = deptId.replaceAll("[^\\d]*(\\d+).*", "$1");
|
|
|
|
|
+ if (dept.length() < 5) {
|
|
|
|
|
+ SysDept dept1 = sysDeptMapper.selectById(dept);
|
|
|
|
|
+ SysDept cityName = sysDeptMapper.selectById(deptId);
|
|
|
|
|
+ stringBuilder.append(dept1.getName()).append(cityName.getName());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ String deptIdTwo = dept.substring(0, 4);
|
|
|
|
|
+
|
|
|
|
|
+ SysDept dept1 = sysDeptMapper.selectById(deptIdTwo);
|
|
|
|
|
+ SysDept dept2 = sysDeptMapper.selectById(dept);
|
|
|
|
|
+ stringBuilder.append(dept1.getName()).append(dept2.getName());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ user.setDeptName(stringBuilder.toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|