|
|
@@ -5,15 +5,19 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.modules.admin.model.dto.TaskStatisticsDto;
|
|
|
import com.ydtech.modules.admin.model.vo.BusinessAgentData;
|
|
|
+import com.ydtech.modules.admin.model.vo.KztGetDeptUtilsDto;
|
|
|
import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
|
|
|
import com.ydtech.modules.admin.service.TaskStatisticsService;
|
|
|
+import com.ydtech.modules.admin.utils.KztGetDeptUtils;
|
|
|
import io.swagger.annotations.*;
|
|
|
+import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -35,8 +39,17 @@ public class TaskStatisticsController {
|
|
|
**/
|
|
|
@PostMapping("queryPage")
|
|
|
@ApiOperation(value = "控制台-渠道任务统计查询")
|
|
|
- public HttpResult<IPage<TaskStatisticsDto>> queryPage(@RequestBody TaskStatisticsVo taskStatisticsVo) {
|
|
|
+ public HttpResult<IPage<TaskStatisticsDto>> queryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
|
|
|
try{
|
|
|
+ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
|
|
|
+ KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
|
|
|
+ if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
|
|
|
+ if("1".equals(kztGetDeptUtilsDto.getType())){
|
|
|
+ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
|
|
|
+ taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ }
|
|
|
+ }
|
|
|
IPage<TaskStatisticsDto> result = taskStatisticsService.queryPage(taskStatisticsVo);
|
|
|
return HttpResult.ok("查询数据成功", result);
|
|
|
}catch (Exception e){
|
|
|
@@ -51,8 +64,17 @@ public class TaskStatisticsController {
|
|
|
**/
|
|
|
@PostMapping("insuranceCompanyQueryPage")
|
|
|
@ApiOperation(value = "控制台-保险公司统计查询")
|
|
|
- public HttpResult<IPage<TaskStatisticsDto>> insuranceCompanyQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo) {
|
|
|
+ public HttpResult<IPage<TaskStatisticsDto>> insuranceCompanyQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
|
|
|
try{
|
|
|
+ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
|
|
|
+ KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
|
|
|
+ if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
|
|
|
+ if("1".equals(kztGetDeptUtilsDto.getType())){
|
|
|
+ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
|
|
|
+ taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ }
|
|
|
+ }
|
|
|
IPage<TaskStatisticsDto> result = taskStatisticsService.insuranceCompanyQueryPage(taskStatisticsVo);
|
|
|
return HttpResult.ok("查询数据成功", result);
|
|
|
}catch (Exception e){
|
|
|
@@ -67,8 +89,17 @@ public class TaskStatisticsController {
|
|
|
**/
|
|
|
@PostMapping("agentStatisticsQueryPage")
|
|
|
@ApiOperation(value = "控制台-代理人统计查询")
|
|
|
- public HttpResult<IPage<TaskStatisticsDto>> agentStatisticsQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo) {
|
|
|
+ public HttpResult<IPage<TaskStatisticsDto>> agentStatisticsQueryPage(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
|
|
|
try{
|
|
|
+ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
|
|
|
+ KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
|
|
|
+ if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
|
|
|
+ if("1".equals(kztGetDeptUtilsDto.getType())){
|
|
|
+ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
|
|
|
+ taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ }
|
|
|
+ }
|
|
|
IPage<TaskStatisticsDto> result = taskStatisticsService.agentStatisticsQueryPage(taskStatisticsVo);
|
|
|
return HttpResult.ok("查询数据成功", result);
|
|
|
}catch (Exception e){
|
|
|
@@ -95,8 +126,17 @@ public class TaskStatisticsController {
|
|
|
**/
|
|
|
@PostMapping("costCenter")
|
|
|
@ApiOperation(value = "控制台-财务中心-费用校验")
|
|
|
- public HttpResult<IPage<TaskStatisticsDto>> costCenter(@RequestBody TaskStatisticsVo taskStatisticsVo) {
|
|
|
+ public HttpResult<IPage<TaskStatisticsDto>> costCenter(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
|
|
|
try{
|
|
|
+ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
|
|
|
+ KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
|
|
|
+ if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
|
|
|
+ if("1".equals(kztGetDeptUtilsDto.getType())){
|
|
|
+ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
|
|
|
+ taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ }
|
|
|
+ }
|
|
|
IPage<TaskStatisticsDto> result = taskStatisticsService.costCenter(taskStatisticsVo);
|
|
|
return HttpResult.ok("查询数据成功", result);
|
|
|
}catch (Exception e){
|
|
|
@@ -139,8 +179,17 @@ public class TaskStatisticsController {
|
|
|
**/
|
|
|
@PostMapping("getBusinessData")
|
|
|
@ApiOperation(value = "控制台-业务数据")
|
|
|
- public HttpResult<IPage<TaskStatisticsDto>> getBusinessData(@RequestBody TaskStatisticsVo taskStatisticsVo) {
|
|
|
+ public HttpResult<IPage<TaskStatisticsDto>> getBusinessData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
|
|
|
try{
|
|
|
+ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
|
|
|
+ KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
|
|
|
+ if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
|
|
|
+ if("1".equals(kztGetDeptUtilsDto.getType())){
|
|
|
+ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
|
|
|
+ taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ }
|
|
|
+ }
|
|
|
IPage<TaskStatisticsDto> result = taskStatisticsService.getBusinessData(taskStatisticsVo);
|
|
|
return HttpResult.ok("查询数据成功", result);
|
|
|
}catch (Exception e){
|
|
|
@@ -155,8 +204,17 @@ public class TaskStatisticsController {
|
|
|
**/
|
|
|
@PostMapping("getDistribution")
|
|
|
@ApiOperation(value = "控制台-业务数据-保险分布")
|
|
|
- public HttpResult<List<TaskStatisticsDto>> getDistribution(@RequestBody TaskStatisticsVo taskStatisticsVo) {
|
|
|
+ public HttpResult<List<TaskStatisticsDto>> getDistribution(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
|
|
|
try{
|
|
|
+ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
|
|
|
+ KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
|
|
|
+ if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
|
|
|
+ if("1".equals(kztGetDeptUtilsDto.getType())){
|
|
|
+ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
|
|
|
+ taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ }
|
|
|
+ }
|
|
|
List<TaskStatisticsDto> result = taskStatisticsService.getDistribution(taskStatisticsVo);
|
|
|
return HttpResult.ok("查询数据成功", result);
|
|
|
}catch (Exception e){
|
|
|
@@ -181,8 +239,17 @@ public class TaskStatisticsController {
|
|
|
**/
|
|
|
@PostMapping("getBusinessAgentData")
|
|
|
@ApiOperation(value = "控制台-业务数据-代理人")
|
|
|
- public HttpResult<IPage<BusinessAgentData>> getBusinessAgentData(@RequestBody TaskStatisticsVo taskStatisticsVo) {
|
|
|
+ public HttpResult<IPage<BusinessAgentData>> getBusinessAgentData(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
|
|
|
try{
|
|
|
+ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
|
|
|
+ KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
|
|
|
+ if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
|
|
|
+ if("1".equals(kztGetDeptUtilsDto.getType())){
|
|
|
+ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
|
|
|
+ taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ }
|
|
|
+ }
|
|
|
IPage<BusinessAgentData> result = taskStatisticsService.getBusinessAgentData(taskStatisticsVo);
|
|
|
return HttpResult.ok("查询数据成功", result);
|
|
|
}catch (Exception e){
|
|
|
@@ -197,8 +264,17 @@ public class TaskStatisticsController {
|
|
|
**/
|
|
|
@PostMapping("getBusinessAgentDataTotal")
|
|
|
@ApiOperation(value = "控制台-业务数据-代理人-合计")
|
|
|
- public HttpResult<BusinessAgentData> getBusinessAgentDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo) {
|
|
|
+ public HttpResult<BusinessAgentData> getBusinessAgentDataTotal(@RequestBody TaskStatisticsVo taskStatisticsVo, HttpServletRequest httpServerRequest) {
|
|
|
try{
|
|
|
+ KztGetDeptUtils kztGetDeptUtils = new KztGetDeptUtils();
|
|
|
+ KztGetDeptUtilsDto kztGetDeptUtilsDto = kztGetDeptUtils.KztGetDeptIds(httpServerRequest.getRequestURL().toString());
|
|
|
+ if(ObjectUtils.isNotEmpty(kztGetDeptUtilsDto)){
|
|
|
+ if("1".equals(kztGetDeptUtilsDto.getType())){
|
|
|
+ taskStatisticsVo.setDeptIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ } else if ("2".equals(kztGetDeptUtilsDto.getType())) {
|
|
|
+ taskStatisticsVo.setUserIds(kztGetDeptUtilsDto.getIds());
|
|
|
+ }
|
|
|
+ }
|
|
|
BusinessAgentData result = taskStatisticsService.getBusinessAgentDataTotal(taskStatisticsVo);
|
|
|
return HttpResult.ok("查询数据成功", result);
|
|
|
}catch (Exception e){
|