|
@@ -1,16 +1,29 @@
|
|
|
package org.jeecg.modules.system.controller;
|
|
|
|
|
|
-import cn.com.ctop.crawler.modules.account.entity.KuaishouAppAccount;
|
|
|
+import cn.com.ctop.performanceappraisal.entity.Performance;
|
|
|
import cn.com.ctop.userefficientvideomap.entity.DesignMaterialInfo;
|
|
|
+import cn.com.ctop.userefficientvideomap.entity.PerformanceTimeDTO;
|
|
|
+import cn.com.ctop.userefficientvideomap.entity.UserDto2;
|
|
|
+import cn.com.ctop.userefficientvideomap.mapper.UserEfficientVideoMapMapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
+import org.jeecg.common.system.query.QueryGenerator;
|
|
|
+import org.jeecg.common.system.vo.LoginUser;
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
|
import org.jeecg.modules.system.service.IPerformanceService2;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -29,13 +42,15 @@ import java.util.Map;
|
|
|
public class PerformanceController2 {
|
|
|
@Autowired
|
|
|
private IPerformanceService2 performanceService;
|
|
|
+ @Autowired
|
|
|
+ private UserEfficientVideoMapMapper userEfficientVideoMapMapper;
|
|
|
|
|
|
//平台的总有效数量、素材总数、素材有效率、总跑量、当前可获得绩效
|
|
|
@AutoLog(value = "平台的总有效数量、素材总数、素材有效率、总跑量、当前可获得绩效")
|
|
|
@ApiOperation(value = "平台的总有效数量、素材总数、素材有效率、总跑量、当前可获得绩效", notes = "平台的总有效数量、素材总数、素材有效率、总跑量、当前可获得绩效")
|
|
|
@PostMapping(value = "/getPerformanceInfo")
|
|
|
public Result<Map<String,Object>> getPerformanceInfo() {
|
|
|
- Result<Map<String,Object>> result = new Result<Map<String,Object>>();
|
|
|
+ Result<Map<String, Object>> result = new Result<>();
|
|
|
Map<String,Object> resultMap = new HashMap<>();
|
|
|
try {
|
|
|
resultMap = performanceService.getPerformanceInfo();
|
|
@@ -104,4 +119,316 @@ public class PerformanceController2 {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @AutoLog(value = "根据year、quarter计算季度设计师绩效")
|
|
|
+ @ApiOperation(value = "根据year、quarter计算季度设计师绩效", notes = "根据year、quarter计算季度设计师绩效")
|
|
|
+ @PostMapping(value = "/designerPerformance")
|
|
|
+ public Result<Map<String, Object>> designerPerformanceTask(@RequestParam(name = "year", required = true) int year,
|
|
|
+ @RequestParam(name = "quarter", required = true) int quarter) {
|
|
|
+ Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
|
|
+ try {
|
|
|
+ performanceService.designerPerformanceTask(year, quarter);
|
|
|
+ result.setSuccess(true);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ log.error("/ctop/performance2/designerPerformance出错啦" + "year:" + year + " quarter:" + quarter);
|
|
|
+ result.error500("/ctop/performance2/designerPerformance出错啦");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "有效视频定时任务")
|
|
|
+ @ApiOperation(value = "有效视频定时任务", notes = "calcDate传递yyyy-MM-dd格式的日期")
|
|
|
+ @PostMapping(value = "/efficientVideo")
|
|
|
+ public Result<Map<String, Object>> efficientVideo(@RequestParam(name = "calcDate", required = true) String calcDate) {
|
|
|
+ log.info("有效视频任务开始,有效视频所属时间为" + calcDate);
|
|
|
+ Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
|
|
+ if (StringUtils.isBlank(calcDate)) {
|
|
|
+ result.error500("时间不能为空");
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ performanceService.efficientVideoTask(calcDate);
|
|
|
+ result.setSuccess(true);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ log.error("/ctop/performance2/efficientVideo出错啦" + "date:" + calcDate);
|
|
|
+ result.error500("/ctop/performance2/efficientVideo出错啦");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "根据year、quarter计算kuaishou季度设计师绩效")
|
|
|
+ @ApiOperation(value = "根据year、quarter计算kuaishou季度设计师绩效", notes = "根据year、quarter计算kuaishou季度设计师绩效")
|
|
|
+ @PostMapping(value = "/toutiaoDesignerPerformance")
|
|
|
+ public Result<Map<String, Object>> toutiaoDesignerPerformance(@RequestParam(name = "year", required = true) int year,
|
|
|
+ @RequestParam(name = "quarter", required = true) int quarter) {
|
|
|
+ Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
|
|
+ try {
|
|
|
+ performanceService.toutiaoDesigner(year, quarter);
|
|
|
+ result.setSuccess(true);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ log.error("/ctop/performance2/toutiaoDesignerPerformance出错啦" + "year:" + year + " quarter:" + quarter);
|
|
|
+ result.error500("/ctop/performance2/toutiaoDesignerPerformance出错啦");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "根据year、quarter计算toutiao季度设计师绩效")
|
|
|
+ @ApiOperation(value = "根据year、quarter计算toutiao季度设计师绩效", notes = "根据year、quarter计算toutiao季度设计师绩效")
|
|
|
+ @PostMapping(value = "/kuaishouDesignerPerformance")
|
|
|
+ public Result<Map<String, Object>> kuaishouDesignerPerformance(@RequestParam(name = "year", required = true) int year,
|
|
|
+ @RequestParam(name = "quarter", required = true) int quarter) {
|
|
|
+ Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
|
|
+ try {
|
|
|
+ performanceService.kuaishouDesigner(year, quarter);
|
|
|
+ result.setSuccess(true);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ log.error("/ctop/performance2/kuaishouDesignerPerformance出错啦" + "year:" + year + " quarter:" + quarter);
|
|
|
+ result.error500("/ctop/performance2/kuaishouDesignerPerformance出错啦");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "获取设计师组下所有人的绩效")
|
|
|
+ @ApiOperation(value = "获取设计师组下所有人的绩效", notes = "获取设计师组下所有人的绩效")
|
|
|
+ @PostMapping(value = "/designerLastQuarterPerformanceInfo")
|
|
|
+ public Result<Map<String, Object>> designerLastQuarterPerformanceInfo() {
|
|
|
+ Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
|
|
+ try {
|
|
|
+ Map<String, Object> resultMap = performanceService.designerLastQuarterPerformanceInfo();
|
|
|
+ result.setResult(resultMap);
|
|
|
+ result.setSuccess(true);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ log.error("/ctop/performance2/designerLastQuarterPerformanceInfo出错啦");
|
|
|
+ result.error500("/ctop/performance2/designerLastQuarterPerformanceInfo出错啦");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "获取同一媒体类型下上个季度所有人的绩效")
|
|
|
+ @ApiOperation(value = "获取同一媒体类型下上个季度所有人的绩效", notes = "获取同一媒体类型下上个季度所有人的绩效")
|
|
|
+ @PostMapping(value = "/quarterUserPerformanceList")
|
|
|
+ public Result<Map<String, Object>> quarterUserPerformanceList(@RequestParam(name = "appType", required = true) int appType) {
|
|
|
+ Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
|
|
+ try {
|
|
|
+ Map<String, Object> resultMap = performanceService.quarterUserPerformanceList(appType);
|
|
|
+ result.setResult(resultMap);
|
|
|
+ result.setSuccess(true);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ log.error("/ctop/performance2/quarterUserPerformanceList出错啦");
|
|
|
+ result.error500("/ctop/performance2/quarterUserPerformanceList出错啦");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "获取快手上个季度的季度有效数、素材总数、上个季度的绩效")
|
|
|
+ @ApiOperation(value = "获取快手上个季度的季度有效数、素材总数、上个季度的绩效", notes = "获取快手上个季度的季度有效数、素材总数、上个季度的绩效")
|
|
|
+ @PostMapping(value = "/kuaishouDesignerLastQuarterPerformanceInfo")
|
|
|
+ public Result<Map<String, Object>> kuaishouDesignerLastQuarterPerformanceInfo() {
|
|
|
+ Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ try {
|
|
|
+ resultMap = performanceService.kuaishouDesignerLastQuarterPerformanceInfo();
|
|
|
+ result.setResult(resultMap);
|
|
|
+ result.setSuccess(true);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ log.error("/ctop/performance2/kuaishouDesignerLastQuarterPerformanceInfo出错啦");
|
|
|
+ result.error500("/ctop/performance2/kuaishouDesignerLastQuarterPerformanceInfo出错啦");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "获取平面设计师上个季度的绩效")
|
|
|
+ @ApiOperation(value = "获取平面设计师上个季度的绩效", notes = "获取平面设计师上个季度的绩效")
|
|
|
+ @PostMapping(value = "/planeLastQuarterPerformanceInfo")
|
|
|
+ public Result<Map<String, Object>> planeLastQuarterPerformanceInfo(@RequestParam(name = "appType", required = true) int appType) {
|
|
|
+ Result<Map<String, Object>> result = new Result<Map<String, Object>>();
|
|
|
+ try {
|
|
|
+ Map<String, Object> resultMap = performanceService.planeLastQuarterPerformanceInfo(appType);
|
|
|
+ result.setResult(resultMap);
|
|
|
+ result.setSuccess(true);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error(e.getMessage(), e);
|
|
|
+ log.error("/ctop/performance2/planeLastQuarterPerformanceInfo出错啦");
|
|
|
+ result.error500("/ctop/performance2/planeLastQuarterPerformanceInfo出错啦");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页列表查询
|
|
|
+ *
|
|
|
+ * @param performance
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "平面设计师季度绩效表-分页列表查询")
|
|
|
+ @ApiOperation(value = "平面设计师季度绩效表-分页列表查询", notes = "平面设计师季度绩效表-分页列表查询")
|
|
|
+ @GetMapping(value = "/planePerformanceList")
|
|
|
+ public Result<IPage<Performance>> planePerformanceList(Performance performance,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Result<IPage<Performance>> result = new Result<IPage<Performance>>();
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ performance.setUserId(sysUser.getId());
|
|
|
+ QueryWrapper<Performance> queryWrapper = QueryGenerator.initQueryWrapper(performance, req.getParameterMap());
|
|
|
+ Page<Performance> page = new Page<Performance>(pageNo, pageSize);
|
|
|
+ IPage<Performance> pageList = performanceService.page(page, queryWrapper);
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(pageList);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页列表查询
|
|
|
+ *
|
|
|
+ * @param performance
|
|
|
+ * @param pageNo
|
|
|
+ * @param pageSize
|
|
|
+ * @param req
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @AutoLog(value = "平面设计师季度绩效表-分页列表查询")
|
|
|
+ @ApiOperation(value = "平面设计师季度绩效表-分页列表查询", notes = "平面设计师季度绩效表-分页列表查询")
|
|
|
+ @GetMapping(value = "/designerDepartMemberPerformanceList")
|
|
|
+ public Result<IPage<Performance>> designerDepartMemberPerformanceList(Performance performance,
|
|
|
+ @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
|
|
+ @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Result<IPage<Performance>> result = new Result<IPage<Performance>>();
|
|
|
+ LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
|
+ String departId = userEfficientVideoMapMapper.getDepartIdByUserId("e9ca23d68d884d4ebb19d07889727dae");
|
|
|
+ List<String> userIdList = userEfficientVideoMapMapper.getUserIdListByDepId(departId);
|
|
|
+ //
|
|
|
+ QueryWrapper<Performance> queryWrapper = QueryGenerator.initQueryWrapper(performance, req.getParameterMap());
|
|
|
+ queryWrapper.in("user_id", userIdList);
|
|
|
+
|
|
|
+ Page<Performance> page = new Page<Performance>(pageNo, pageSize);
|
|
|
+ IPage<Performance> pageList = performanceService.page(page, queryWrapper);
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(pageList);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "获取快手绩效时时数据接口")
|
|
|
+ @ApiOperation(value = "获取快手绩效时时数据接口", notes = "获取快手绩效时时数据接口")
|
|
|
+ @GetMapping(value = "/kuaishouPerformanceInfoNow")
|
|
|
+ public Result<List<UserDto2>> kuaishouPerformanceInfoNow(HttpServletRequest req) {
|
|
|
+ Result<List<UserDto2>> result = new Result<List<UserDto2>>();
|
|
|
+ List<UserDto2> userDto2List = performanceService.kuaishouPerformanceInfoNow();
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(userDto2List);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "获取头条绩效时时数据接口")
|
|
|
+ @ApiOperation(value = "获取头条绩效时时数据接口", notes = "获取头条绩效时时数据接口")
|
|
|
+ @GetMapping(value = "/toutiaoPererformanceInfoNow")
|
|
|
+ public Result<List<UserDto2>> toutiaoPererformanceInfoNow(HttpServletRequest req) {
|
|
|
+ Result<List<UserDto2>> result = new Result<List<UserDto2>>();
|
|
|
+ List<UserDto2> userDto2List = performanceService.toutiaoPerformanceInfoNow();
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(userDto2List);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "获取快手绩效周报表")
|
|
|
+ @ApiOperation(value = "获取快手绩效周报表", notes = "获取快手绩效周报表")
|
|
|
+ @PostMapping(value = "/kuaishouWeekReport")
|
|
|
+ public Result<List<UserDto2>> kuaishouWeekReport(@RequestBody PerformanceTimeDTO dto,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Result<List<UserDto2>> result = new Result<List<UserDto2>>();
|
|
|
+ String startDate = dto.getStartDate();
|
|
|
+ String endDate = dto.getEndDate();
|
|
|
+ if(StringUtils.isBlank(startDate) || StringUtils.isBlank(endDate)){
|
|
|
+ result.setSuccess(false);
|
|
|
+ result.setMessage("时间不能为空");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ List<UserDto2> userDto2List = performanceService.kuaishouWeekReport(startDate, endDate);
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(userDto2List);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "获取头条绩效周报表")
|
|
|
+ @ApiOperation(value = "获取头条绩效周报表", notes = "获取头条绩效周报表")
|
|
|
+ @PostMapping(value = "/toutiaoWeekReport")
|
|
|
+ public Result<List<UserDto2>> toutiaoWeekReport(@RequestBody PerformanceTimeDTO dto,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Result<List<UserDto2>> result = new Result<List<UserDto2>>();
|
|
|
+ String startDate = dto.getStartDate();
|
|
|
+ String endDate = dto.getEndDate();
|
|
|
+ if(StringUtils.isBlank(startDate) || StringUtils.isBlank(endDate)){
|
|
|
+ result.setSuccess(false);
|
|
|
+ result.setMessage("时间不能为空");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ List<UserDto2> userDto2List = performanceService.toutiaoWeekReport(startDate, endDate);
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(userDto2List);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "获取快手季度绩效报表")
|
|
|
+ @ApiOperation(value = "获取快手季度绩效报表", notes = "获取快手季度绩效报表")
|
|
|
+ @PostMapping(value = "/kuaishouQuarterReport")
|
|
|
+ public Result<List<UserDto2>> kuaishouQuarterReport(@RequestBody PerformanceTimeDTO dto,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Result<List<UserDto2>> result = new Result<List<UserDto2>>();
|
|
|
+ Integer year = dto.getYear();
|
|
|
+ Integer quarter = dto.getQuarter();
|
|
|
+ if(year==null || quarter == null){
|
|
|
+ result.setSuccess(false);
|
|
|
+ result.setMessage("时间不能为空");
|
|
|
+ }
|
|
|
+ List<UserDto2> userDto2List = performanceService.kuaishouQuarterReport(year, quarter);
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(userDto2List);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @AutoLog(value = "获取头条季度绩效报表")
|
|
|
+ @ApiOperation(value = "获取头条季度绩效报表", notes = "获取头条季度绩效报表")
|
|
|
+ @PostMapping(value = "/toutiaoQuarterReport")
|
|
|
+ public Result<List<UserDto2>> toutiaoQuarterReport(@RequestBody PerformanceTimeDTO dto,
|
|
|
+ HttpServletRequest req) {
|
|
|
+ Result<List<UserDto2>> result = new Result<List<UserDto2>>();
|
|
|
+ Integer year = dto.getYear();
|
|
|
+ Integer quarter = dto.getQuarter();
|
|
|
+ if(year==null || quarter == null){
|
|
|
+ result.setSuccess(false);
|
|
|
+ result.setMessage("时间不能为空");
|
|
|
+ }
|
|
|
+ List<UserDto2> userDto2List = performanceService.toutiaoQuarterReport(year, quarter);
|
|
|
+ result.setSuccess(true);
|
|
|
+ result.setResult(userDto2List);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ //@AutoLog(value = "获取相关有效视频列表")
|
|
|
+ //@ApiOperation(value = "获取相关有效视频列表", notes = "获取相关有效视频列表")
|
|
|
+ //@PostMapping(value = "/toutiaoQuarterReport")
|
|
|
+ //public Result<List<UserDto2>> getEffiVideoList(@RequestBody PerformanceTimeDTO dto,
|
|
|
+ // HttpServletRequest req) {
|
|
|
+ // Result<List<UserDto2>> result = new Result<List<UserDto2>>();
|
|
|
+ // Integer year = dto.getYear();
|
|
|
+ // Integer quarter = dto.getQuarter();
|
|
|
+ // if(year==null || quarter == null){
|
|
|
+ // result.setSuccess(false);
|
|
|
+ // result.setMessage("时间不能为空");
|
|
|
+ // }
|
|
|
+ // List<UserDto2> userDto2List = performanceService.toutiaoQuarterReport(year, quarter);
|
|
|
+ // result.setSuccess(true);
|
|
|
+ // result.setResult(userDto2List);
|
|
|
+ // return result;
|
|
|
+ //}
|
|
|
+
|
|
|
}
|