he2802 há 1 ano atrás
pai
commit
81ea6df4ee

+ 7 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -396,6 +396,13 @@ public class CommonController extends BaseController {
         return AjaxResult.success(base);
     }
 
+    @ApiOperation("学员学时图片修改")
+    @PostMapping("common/student/image/spin")
+    public AjaxResult updateStudentImageSpin(@RequestBody UpdateStudentImageBo bo) {
+        iUserSubscribeService.updateStudentImageSpin(bo);
+        return AjaxResult.success();
+    }
+
     @ApiOperation("获取外部题库商品(山东题库)")
     @PostMapping("common/external/question")
     public AjaxResult getExternalQuestion(@RequestBody ExternalQuestionBo bo) {

+ 1 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java

@@ -146,6 +146,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/common/external/question").anonymous()
                 .antMatchers("/common/replenish/exam").anonymous()
                 .antMatchers("/common/student/image/update").anonymous()
+                .antMatchers("/common/student/image/spin").anonymous()
                 .antMatchers("/common/platform/pay").anonymous()
                 .antMatchers("/common/platform/pay/handle").anonymous()
                 .antMatchers("/common/alike/goods").anonymous()

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -1014,7 +1014,8 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             goodsUserVo.setOfficialStatus(classGradeVo.getOfficialStatus());
 
             String businessName = iGoodsService.getGoodsBusinessName(goodsUserVo.getGoodsId());
-            if (businessName.contains("继续教育")){
+            if (businessName.contains("继续教育") &&
+                    (businessName.contains("二级建造师") || businessName.contains("二级造价师") || businessName.contains("施工现场专业人员"))){
                 goodsUserVo.setClassStatus(classGradeVo.getClassStatus());
                 goodsUserVo.setClassStartTime(classGradeVo.getClassStartTime());
                 goodsUserVo.setClassEndTime(classGradeVo.getClassEndTime());

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserSubscribeService.java

@@ -129,4 +129,6 @@ public interface IUserSubscribeService extends IService<UserSubscribe> {
 	List<UserApplyRecordVo> listUserApply(UserApplyRecordBo bo);
 
 	List<UserPromiseRecordVo> listPromise(UserPromiseRecordBo bo);
+
+	void updateStudentImageSpin(UpdateStudentImageBo bo);
 }

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java

@@ -3005,6 +3005,16 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         return recordVos;
     }
 
+    @Override
+    public void updateStudentImageSpin(UpdateStudentImageBo bo) {
+        try {
+            ossService.processObject(bo.getImageUrl(),bo.getImageUrl(),String.format("image/rotate,%s",180));
+        }catch (Exception e){
+            e.printStackTrace();
+            throw new CustomException("修改图片错误!");
+        }
+    }
+
     private String applyTimeTransition(String time){
         List<String> collect = Arrays.stream(time.split(":")).collect(Collectors.toList());
         StringBuffer result = new StringBuffer();

+ 7 - 7
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -1090,14 +1090,14 @@
         SELECT
             COUNT( DISTINCT course_id, module_id, chapter_id, section_id )
         FROM
-            user_study_record c
+            user_study_record
         WHERE
-          AND c.current_status = 1
-          AND c.grade_id = #{gradeId}
-          AND c.order_goods_id = #{orderGoodsId}
-          AND c.user_id = #{userId}
-          and c.status = 1
-          and c.goods_id = #{goodsId}
+            current_status = 1
+          AND grade_id = #{gradeId}
+          AND order_goods_id = #{orderGoodsId}
+          AND user_id = #{userId}
+          AND status = 1
+          AND goods_id = #{goodsId}
     </select>
 
     <select id="getOrderGoodsIds" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo" resultType="java.lang.Long">