浏览代码

评价管理

周箭河 5 年之前
父节点
当前提交
88fcdd9720

+ 20 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/PracticeGroupQueryInfo.java

@@ -18,6 +18,10 @@ public class PracticeGroupQueryInfo extends QueryInfo {
 
     private Integer isFree;
 
+    private Integer isOver;
+
+    private Integer hasReport;
+
     private boolean isExport = false;
 
     public boolean getIsExport() {
@@ -67,4 +71,20 @@ public class PracticeGroupQueryInfo extends QueryInfo {
     public void setIsFree(Integer isFree) {
         this.isFree = isFree;
     }
+
+    public Integer getIsOver() {
+        return isOver;
+    }
+
+    public void setIsOver(Integer isOver) {
+        this.isOver = isOver;
+    }
+
+    public Integer getHasReport() {
+        return hasReport;
+    }
+
+    public void setHasReport(Integer hasReport) {
+        this.hasReport = hasReport;
+    }
 }

+ 14 - 0
mec-biz/src/main/resources/config/mybatis/PracticeGroupMapper.xml

@@ -242,6 +242,20 @@
 			<if test='isFree !=null and isFree=="1"'>
 				AND pg.buy_months_ IS NULL
 			</if>
+			<if test='isOver !=null and isOver=="0"'>
+				<![CDATA[AND pg.courses_expire_date_ > NOW()
+			]]>
+			</if>
+			<if test='isOver !=null and isOver=="1"'>
+				<![CDATA[ AND pg.courses_expire_date_ <= NOW()
+			]]></if>
+			<if test='hasReport !=null and hasReport=="0"'>
+				<![CDATA[AND cse.id_ IS NULL
+			]]>
+			</if>
+			<if test='hasReport !=null and hasReport=="1"'>
+				<![CDATA[ AND cse.id_ > 0
+			]]></if>
 		</where>
 	</sql>
 

+ 1 - 1
mec-web/src/main/java/com/ym/mec/web/config/ResourceServerConfig.java

@@ -26,7 +26,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
 	public void configure(HttpSecurity http) throws Exception {
 		http.csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler).authenticationEntryPoint(baseAuthenticationEntryPoint).and()
 				.authorizeRequests().antMatchers("/task/**").hasIpAddress("0.0.0.0/0")
-				.antMatchers("/v2/api-docs", "/classGroup/highClassGroups", "/code/*", "/api/*", "/appVersionInfo/queryByPlatform","/practiceGroupManage/getReviews").permitAll().anyRequest()
+				.antMatchers("/v2/api-docs", "/classGroup/highClassGroups", "/code/*", "/api/*", "/appVersionInfo/queryByPlatform").permitAll().anyRequest()
 				.authenticated().and().httpBasic();
 	}
 

+ 18 - 18
mec-web/src/main/java/com/ym/mec/web/controller/PracticeGroupManageController.java

@@ -90,25 +90,25 @@ public class PracticeGroupManageController extends BaseController {
 
     @ApiOperation(value = "评论管理")
     @GetMapping("getReviews")
-   // @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/getReviews')")
+    @PreAuthorize("@pcs.hasPermissions('practiceGroupManage/getReviews')")
     public Object getReviews(PracticeGroupQueryInfo queryInfo) {
-//        SysUser sysUser = sysUserFeignService.queryUserInfo();
-//        if (sysUser == null) {
-//            return failed("用户信息获取失败");
-//        }
-//        if (!sysUser.getIsSuperAdmin()) {
-//            Employee employee = employeeDao.get(sysUser.getId());
-//            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
-//                queryInfo.setOrganId(employee.getOrganIdList());
-//            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
-//                return failed("用户所在分部异常");
-//            } else {
-//                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
-//                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
-//                    return failed("非法请求");
-//                }
-//            }
-//        }
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        if (!sysUser.getIsSuperAdmin()) {
+            Employee employee = employeeDao.get(sysUser.getId());
+            if (StringUtils.isEmpty(queryInfo.getOrganId())) {
+                queryInfo.setOrganId(employee.getOrganIdList());
+            } else if (StringUtils.isEmpty(employee.getOrganIdList())) {
+                return failed("用户所在分部异常");
+            } else {
+                List<String> list = Arrays.asList(employee.getOrganIdList().split(","));
+                if (!list.containsAll(Arrays.asList(queryInfo.getOrganId().split(",")))) {
+                    return failed("非法请求");
+                }
+            }
+        }
         return succeed(practiceGroupService.findPracticeGroupReviews(queryInfo));
     }
 }