Selaa lähdekoodia

设计师接口修改

hcst_sunzhen 5 vuotta sitten
vanhempi
commit
dab86c87d9

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/PerformanceController2.java

@@ -114,7 +114,7 @@ public class PerformanceController2 {
                                                               @RequestParam(name = "quarter", required = true) int quarter) {
         Result<Map<String,Object>> result = new Result<Map<String,Object>>();
         try {
-            performanceService.designerPerformanceTask(1,2);
+            performanceService.designerPerformanceTask(year,quarter);
             result.setSuccess(true);
         } catch (Exception e) {
             log.error(e.getMessage(), e);

+ 21 - 4
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/PerformanceServiceImpl2.java

@@ -73,7 +73,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         String effiCalcStart = DateUtils.formatDate(DateUtils.addDay(friday, -14)); //计算有效视频开始的时间
         log.info("有效视频统计的开始时间为" + effiCalcStart);
         String effiCalcEnd = DateUtils.formatDate(DateUtils.addDay(friday, -1)); //计算有效视频结束的时间
-        log.info("有效视频统计的结束时间为" + effiCalcStart);
+        log.info("有效视频统计的结束时间为" + effiCalcEnd);
         String effiStart = DateUtils.formatDate(DateUtils.addDay(friday, -21)); //有效视频发布开始时间
         log.info("有效视频发布的开始时间为" + effiStart);
         String effiEnd = DateUtils.formatDate(DateUtils.addDay(friday, -15)); //有效视频发布结束时间
@@ -331,6 +331,10 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         int top30 = new BigDecimal(String.valueOf(planLength)).multiply(new BigDecimal("0.3")).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
         int middle50 = new BigDecimal(String.valueOf(planLength)).multiply(new BigDecimal("0.5")).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
 
+        //测试数据
+        // top30 = 1;
+        // middle50 =1;
+
         //循环前30%有绩效的人数并计算其绩效,并入库
         for (int i = 0; i <= top30 - 1; i++) {
             //总消耗--获取这个人的总消耗
@@ -404,6 +408,10 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         int shotTop30 = new BigDecimal(String.valueOf(shotLength)).multiply(new BigDecimal("0.3")).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
         int shotMiddle50 = new BigDecimal(String.valueOf(shotLength)).multiply(new BigDecimal("0.5")).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
 
+        //测试完删除
+        // shotTop30 = 1;
+        // shotMiddle50 = 1;
+
         //循环前30%有绩效的人数并计算其绩效,并入库
         for (int i = 0; i <= shotTop30 - 1; i++) {
             //总消耗--获取这个人所在项目的总消耗
@@ -477,6 +485,10 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
         int clipTop30 = new BigDecimal(String.valueOf(clipLength)).multiply(new BigDecimal("0.3")).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
         int clipMiddle50 = new BigDecimal(String.valueOf(clipLength)).multiply(new BigDecimal("0.5")).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
 
+        //测试完删除
+        //clipTop30 = 1;
+        //clipMiddle50 = 1;
+
         //循环前30%有绩效的人数并计算其绩效,并入库
         for (int i = 0; i <= clipTop30 - 1; i++) {
             //总消耗--获取这个人所在项目的总消耗
@@ -540,6 +552,11 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
 
         //循环project
         for (ProjectDTO projectDTO : projectDTOS) {
+            //测试使用
+            //if(projectDTO.getProjectId() != 42L){
+            //    continue;
+            //}
+
             BigDecimal quarterCost = userEfficientVideoMapMapper.getProjectQuarterCostById(startTime, endTime, projectDTO.getProjectId());
             List<UserDto2> planeList = userEfficientVideoMapMapper.getPlaneByProjectId(projectDTO.getProjectId());
             //此项目当中平面数量
@@ -562,7 +579,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
 
                 if (null == planeMap.get(plane.getUserId())) {
                     plane.setEffiRate(averageQuarterCost);
-                    planeMap.put("plane.getUserId()", plane);
+                    planeMap.put(plane.getUserId(), plane);
                 } else {
                     //将增加的金额增加到
                     planeMap.get(plane.getUserId()).setEffiRate(planeMap.get(plane.getUserId()).getEffiRate().add(plane.getEffiRate()));
@@ -602,7 +619,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
             BigDecimal totalCost = BigDecimal.ZERO; //剪辑总消耗
 
             for (String clipUserId : clipList) {
-                BigDecimal clipCost = userEfficientVideoMapMapper.getClipQuarterCost(2, thisYear, thisQuarter, clipUserId);  //媒体类型 //1头条 2快手
+                BigDecimal clipCost = userEfficientVideoMapMapper.getClipQuarterCost(2, thisQuarter, thisYear, clipUserId);  //媒体类型 //1头条 2快手
                 totalCost = totalCost.add(clipCost);
             }
 
@@ -924,7 +941,7 @@ public class PerformanceServiceImpl2 extends ServiceImpl<PerformanceMapper, Perf
             BigDecimal totalCost = BigDecimal.ZERO; //剪辑总消耗
 
             for (String clipUserId : clipList) {
-                BigDecimal clipCost = userEfficientVideoMapMapper.getClipQuarterCost(1, thisYear, thisQuarter, clipUserId);  //媒体类型 //1头条 2快手
+                BigDecimal clipCost = userEfficientVideoMapMapper.getClipQuarterCost(1, thisQuarter, thisYear, clipUserId);  //媒体类型 //1头条 2快手
                 totalCost = totalCost.add(clipCost);
             }
 

+ 1 - 1
performance-appraisal/src/main/java/cn/com/ctop/planeprojectcost/entity/PlaneProjectCost.java

@@ -29,7 +29,7 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 public class PlaneProjectCost {
 
 	/**id*/
-	@TableId(type = IdType.UUID)
+	@TableId(type = IdType.AUTO)
     @ApiModelProperty(value = "id")
 	private Integer id;
 	/**ctop_project的id*/

+ 1 - 1
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/entity/ProjectDTO.java

@@ -9,5 +9,5 @@ import java.math.BigDecimal;
 @Data
 public class ProjectDTO implements Serializable {
     private Long projectId;
-    private BigDecimal projectName;
+    private String projectName;
 }

+ 1 - 1
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/UserEfficientVideoMapMapper.java

@@ -69,7 +69,7 @@ public interface UserEfficientVideoMapMapper extends BaseMapper<UserEfficientVid
 
     List<String> getClip(@Param("depId")String depId);
 
-    BigDecimal getClipQuarterCost(@Param("appType")Integer appType, @Param("quarter")int quarter, @Param("year")int year, @Param("userId")String userId);
+    BigDecimal getClipQuarterCost(@Param("appType")int appType, @Param("quarter")int quarter, @Param("year")int year, @Param("userId")String userId);
 
     //头条有效视频计算sql
     List<EffiVideoDTO> getToutiaoUserVideoMap(@Param("startDate")String startDate, @Param("endDate")String endDate, @Param("startCalcDate")String startCalcDate, @Param("endCalcDate")String endCalcDate);

+ 7 - 5
performance-appraisal/src/main/java/cn/com/ctop/userefficientvideomap/mapper/xml/UserEfficientVideoMapMapper.xml

@@ -241,7 +241,7 @@
     <!-- 获取这个人所在的所有项目 -->
     <select id="getProjects" resultType="cn.com.ctop.userefficientvideomap.entity.ProjectDTO">
         select
-        project_id as projectId,
+        id as projectId,
         project_name as projectName
         from
         ctop_project
@@ -258,7 +258,7 @@
             left join
             ctop_user_allocation allocation on dailiAccount.account_id = allocation.account_id
         where
-        dailiAccount.project_id = #{projectId}
+        allocation.project_id = #{projectId}
         AND
         dailiAccount.stat_date &gt;= #{startDate}
         AND
@@ -275,7 +275,7 @@
         ctop_project_member a
         left join sys_role b on a.role_code = b.role_code
         where
-        a.project_id = #{projectId}
+        a.project_id = #{projectId} and
         a.role_code in ('planeLeader','plane')
     </select>
 
@@ -362,12 +362,13 @@
     <!-- 根据部门id -->
     <select id="getClip" resultType="string">
         select
-        user_id
+        a.user_id
         from
         sys_user_depart a
         left join sys_user_role b on a.user_id = b.user_id
+        left join sys_role c on b.role_id = c.id
         where a.dep_id = #{depId}
-        and b.role_code = 'clip'
+        and c.role_code = 'clip'
     </select>
 
     <select id="getClipQuarterCost" resultType="java.math.BigDecimal">
@@ -380,6 +381,7 @@
         and quarter = #{quarter}
         and year = #{year}
         and user_id = #{userId}
+        limit 1
     </select>
 
     <!-- 获取toutiao设计师leader的信息 -->