Browse Source

搜索条件新增

change 3 years ago
parent
commit
0324e67379

+ 11 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java

@@ -85,4 +85,15 @@ public class ScheduleController extends BaseController {
         iScheduleService.updateIssue(bo);
         iScheduleService.updateIssue(bo);
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }
+
+    /**
+     * 计划更新每晚0点更新
+     * @return
+     */
+    @ApiOperation("计划更新每晚0点更新")
+    @GetMapping("/UpPlan")
+    public AjaxResult UpPlan(UserQueryBo bo) throws ParseException {
+        iScheduleService.UpPlan(bo);
+        return AjaxResult.success();
+    }
 }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/IScheduleService.java

@@ -32,4 +32,6 @@ public interface IScheduleService extends IService<PolyvVideo> {
     void closeTimeOutOrder();
     void closeTimeOutOrder();
 
 
     void updateIssue(UserQueryBo bo) throws ParseException;
     void updateIssue(UserQueryBo bo) throws ParseException;
+
+    void UpPlan(UserQueryBo bo);
 }
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -544,6 +544,11 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         updateApply();
         updateApply();
     }
     }
 
 
+    @Override
+    public void UpPlan(UserQueryBo bo) {
+
+    }
+
     private void updateApply() throws ParseException {
     private void updateApply() throws ParseException {
         UserSubscribeQueryBo userSubscribeQueryBo = new UserSubscribeQueryBo();
         UserSubscribeQueryBo userSubscribeQueryBo = new UserSubscribeQueryBo();
         userSubscribeQueryBo.setExceed(1L);
         userSubscribeQueryBo.setExceed(1L);

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysDictDataServiceImpl.java

@@ -107,6 +107,10 @@ public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDi
      */
      */
     @Override
     @Override
     public int updateDictData(SysDictData dictData) {
     public int updateDictData(SysDictData dictData) {
+        if (dictData.getStatus().equals(-1)){
+            int row = baseMapper.updateById(dictData);
+            return row;
+        }
         validEntityBeforeSave(dictData);
         validEntityBeforeSave(dictData);
         int row = baseMapper.updateById(dictData);
         int row = baseMapper.updateById(dictData);
         if (row > 0) {
         if (row > 0) {

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserStudyRecordMapper.java

@@ -61,4 +61,6 @@ public interface UserStudyRecordMapper extends BaseMapper<UserStudyRecord> {
     Long selectStudyExamRecordOr(UserBankRecordVo userBankRecordVo);
     Long selectStudyExamRecordOr(UserBankRecordVo userBankRecordVo);
 
 
     UserPeriodStatus selectStudyExamRecordCount(UserBankRecordVo userBankRecordVo);
     UserPeriodStatus selectStudyExamRecordCount(UserBankRecordVo userBankRecordVo);
+
+    Long selectCountPlan(Long planId);
 }
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -350,6 +350,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             Long planId = baseMapper.userPlanSaveId(entity.getGoodsId());
             Long planId = baseMapper.userPlanSaveId(entity.getGoodsId());
             entity.setPlanId(planId);
             entity.setPlanId(planId);
             if (baseMapper.selectPland(entity) < 1) {
             if (baseMapper.selectPland(entity) < 1) {
+                entity.setUpdateTime(DateUtils.getNowTime());
                 this.updateById(entity);
                 this.updateById(entity);
                 List<Long> goodsIds = baseMapper.getPlanGoods(planId);
                 List<Long> goodsIds = baseMapper.getPlanGoods(planId);
                 //更新计划
                 //更新计划
@@ -393,6 +394,8 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                         UserPlan userPlan = new UserPlan();
                         UserPlan userPlan = new UserPlan();
                         userPlan.setSchedule(JSON.toJSONString(calendarStudyUp));
                         userPlan.setSchedule(JSON.toJSONString(calendarStudyUp));
                         userPlan.setPlanId(userPlanVo.getPlanId());
                         userPlan.setPlanId(userPlanVo.getPlanId());
+                        userPlan.setUpdateTime(DateUtils.getNowTime());
+                        userPlan.setStudyNum(baseMapper.selectCountPlan(planId));
                         userPlanService.updateById(userPlan);
                         userPlanService.updateById(userPlan);
                     }
                     }
                 }
                 }

+ 5 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -773,7 +773,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND usr.goods_id = 0
                 AND usr.goods_id = 0
             </otherwise>
             </otherwise>
         </choose>
         </choose>
-          AND usr.plan_id =1
+          AND usr.plan_id =#{planId}
     </select>
     </select>
 
 
     <select id="getPlanGoods" parameterType="Long" resultType="Long">
     <select id="getPlanGoods" parameterType="Long" resultType="Long">
@@ -933,4 +933,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         AND up.user_id = #{userId}
         AND up.user_id = #{userId}
         AND ups.period_status = 1
         AND ups.period_status = 1
     </select>
     </select>
+
+    <select id="selectCountPlan" parameterType="Long" resultType="Long">
+        SELECT COUNT(1) FROM user_study_record usr where usr.plan_id =#{planId}
+    </select>
 </mapper>
 </mapper>