ソースを参照

商品更新下架

change 3 年 前
コミット
e29dcdcf8b

+ 1 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/base/UserProfileController.java

@@ -67,6 +67,7 @@ public class UserProfileController extends BaseController {
     @GetMapping("/listRecord")
     public TableDataInfo<UserProfileVo> listRecord(UserProfileQueryBo bo) {
         startPage();
+        //1为资料审核
         bo.setTypeStatus(1L);
         List<UserProfileVo> list = iUserProfileService.listRecord(bo);
         return getDataTable(list);

+ 1 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/base/UserProfileStampController.java

@@ -44,6 +44,7 @@ public class UserProfileStampController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<UserProfileVo> list(UserProfileQueryBo bo) {
         startPage();
+        //2为承诺书审核
         bo.setTypeStatus(2L);
         List<UserProfileVo> list = iUserProfileService.queryList(bo);
         return getDataTable(list);

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

@@ -107,4 +107,15 @@ public class ScheduleController extends BaseController {
         iScheduleService.UpExam(bo);
         return AjaxResult.success();
     }
+
+    /**
+     * 商品下架状态更新
+     * @return
+     */
+    @ApiOperation("更新商品下架状态")
+    @GetMapping("/UpGoods")
+    public AjaxResult UpGoods(UserQueryBo bo){
+        iScheduleService.UpGoods(bo);
+        return AjaxResult.success();
+    }
 }

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/impl/AliSmsServiceImpl.java

@@ -72,6 +72,7 @@ public class AliSmsServiceImpl implements IAliSmsService {
 
     @Override
     public ResultBean sendInformSms(String tel, String param,String code) {
+        //发送带指定短信code带参数发送不同短信内容
         try{
             SendSmsResponse response = SmsUtils.sendSms(tel,SIGNNAME,code,param,ACCESSKEYID,ACCESSKEYSECRET);
             System.out.println(response);

+ 13 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -267,7 +267,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
     public boolean updateAuditByEditBo(UserProfileEditBo bo,LoginUser loginUser) {
         UserProfile update = BeanUtil.toBean(bo,UserProfile.class);
         UserProfileVo userProfileVo1 = this.queryById(bo.getId());
-
+        //查询此人审核资料是否有权限
         if (baseMapper.selectCountProfile(loginUser.getUser().getUserId(),userProfileVo1.getGoodsId()) < 1){
             throw new IllegalArgumentException("您没有审核权限");
         }
@@ -278,9 +278,12 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
         update.setChangeStatus(1);
 
         UserProfileVo userProfileVo = this.queryById(bo.getId());
+        //发送消息分为资料审核发送,和盖章审核发送 1资料 2盖章
         if (userProfileVo.getTypeStatus().equals(1)){
+            //审核资料发送消息
             sendAuidit(update);
         }else if (userProfileVo.getTypeStatus().equals(2)){
+            //审核承诺书发送消息
             sendAuiditSMS(update);
         }
         return this.updateById(update);
@@ -291,6 +294,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
         Long gradeId = baseMapper.selectGrade(userProfileVo.getUserId(),userProfileVo.getGoodsId());
         if (bo.getStatus().equals(1)) {
             InformRemindVo informRemindVo = informRemindService.queryById(23L);
+            //站内信有无启用,启用发送
             if (informRemindVo.getWayStatus().equals(1)) {
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(userProfileVo.getUserId());
@@ -307,6 +311,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
                 informUserAddBo.setText("尊敬的用户:您上传"+goodsVo1.getGoodsName()+"课程的承诺书审核成功");
                 iInformUserService.insertByAddBo(informUserAddBo);
             }
+            //短信有无启用,启用发送
             if (informRemindVo.getNoteStatus().equals(1)){
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(userProfileVo.getUserId());
@@ -328,6 +333,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
             }
         }else {
             InformRemindVo informRemindTwoVo = informRemindService.queryById(24L);
+            //站内信有无启用,启用发送
             if (informRemindTwoVo.getWayStatus().equals(1)) {
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(userProfileVo.getUserId());
@@ -344,6 +350,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
                 informUserAddBo.setText("尊敬的用户:您上传"+goodsVo1.getGoodsName()+"课程的承诺书审核不通过,请重新完善吧");
                 iInformUserService.insertByAddBo(informUserAddBo);
             }
+            //短信有无启用,启用发送
             if (informRemindTwoVo.getNoteStatus().equals(1)){
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(userProfileVo.getUserId());
@@ -368,9 +375,11 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
 
     private void sendAuidit(UserProfile bo) {
         UserProfileVo userProfileVo = this.queryById(bo.getId());
+        //查询所在班级
         Long gradeId = baseMapper.selectGrade(userProfileVo.getUserId(),userProfileVo.getGoodsId());
         if (bo.getStatus().equals(1)) {
             InformRemindVo informRemindVo = informRemindService.queryById(3L);
+            //站内信有无启用,启用发送
             if (informRemindVo.getWayStatus().equals(1)) {
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(userProfileVo.getUserId());
@@ -387,6 +396,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
                 informUserAddBo.setText("尊敬的用户:您填写的"+goodsVo1.getGoodsName()+"课程报名信息审核成功,请尽快去学习吧");
                 iInformUserService.insertByAddBo(informUserAddBo);
             }
+            //短信有无启用,启用发送
             if (informRemindVo.getNoteStatus().equals(1)){
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(userProfileVo.getUserId());
@@ -408,6 +418,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
             }
         }else {
             InformRemindVo informRemindTwoVo = informRemindService.queryById(4L);
+            //站内信有无启用,启用发送
             if (informRemindTwoVo.getWayStatus().equals(1)) {
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(userProfileVo.getUserId());
@@ -424,6 +435,7 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
                 informUserAddBo.setText("尊敬的用户:您填写的"+goodsVo1.getGoodsName()+"课程报名信息审核不通过,请重新完善吧");
                 iInformUserService.insertByAddBo(informUserAddBo);
             }
+            //短信有无启用,启用发送
             if (informRemindTwoVo.getNoteStatus().equals(1)){
                 InformUserAddBo informUserAddBo = new InformUserAddBo();
                 informUserAddBo.setUserId(userProfileVo.getUserId());

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

@@ -84,6 +84,7 @@ public class CourseBusinessServiceImpl extends ServiceImpl<CourseBusinessMapper,
     @Override
     public Boolean updateByEditBo(CourseBusinessEditBo bo) {
         CourseBusiness update = BeanUtil.toBean(bo, CourseBusiness.class);
+        //修改业务进行重名判断 -1直接删除
         if (bo.getStatus() != -1) {
             CourseBusinessQueryBo courseBusinessQueryBo = new CourseBusinessQueryBo();
             courseBusinessQueryBo.setBusinessName(bo.getBusinessName());
@@ -132,6 +133,7 @@ public class CourseBusinessServiceImpl extends ServiceImpl<CourseBusinessMapper,
 
     @Override
     public boolean editModel(CourseBusinessEditBo bo) {
+        //批量添加业务层次模板
         for (Long businessId : bo.getBusinessIds()) {
             CourseBusiness update =new CourseBusiness();
             update.setUpdateTime(DateUtils.getNowTime());
@@ -139,7 +141,6 @@ public class CourseBusinessServiceImpl extends ServiceImpl<CourseBusinessMapper,
             update.setTemplateStatus(bo.getTemplateStatus());
             this.updateById(update);
         }
-
         return true;
     }
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsMapper.java

@@ -26,4 +26,6 @@ public interface GoodsMapper extends BaseMapper<Goods> {
     GoodsVo selectUserDetail(CourseQueryBo bo);
 
     Long getQuestionNum(Long goodsId);
+
+    int queryUpGoods();
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -72,4 +72,6 @@ public interface IGoodsService extends IService<Goods> {
 	List<ExamNumberGoodsVo> listGoods(ExamNumberGoodsQueryBo bo);
 
 	GoodsVo selectUserDetail(CourseQueryBo bo);
+
+	int queryUpGoods();
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -362,4 +362,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         goodsVo.setGradeId(gradeId);
         return goodsVo;
     }
+
+    @Override
+    public int queryUpGoods() {
+        return baseMapper.queryUpGoods();
+    }
 }

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

@@ -36,4 +36,6 @@ public interface IScheduleService extends IService<PolyvVideo> {
     void UpPlan(UserQueryBo bo);
 
     void UpExam(UserQueryBo bo);
+
+    void UpGoods(UserQueryBo bo);
 }

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

@@ -728,6 +728,11 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
         }
     }
 
+    @Override
+    public void UpGoods(UserQueryBo bo) {
+        int goodsVos = iGoodsService.queryUpGoods();
+    }
+
     //获得可用学习天数
     private static int getDutyDays(Date  startDateStr, Date endDateStr,Long[] longs,Long studyDay)  {
         int result = 0;

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -347,4 +347,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                             ',',
                             IFNULL(( SELECT GROUP_CONCAT(  major_id ) FROM goods_attached WHERE goods_id = #{goodsId} AND type = 3 ), '' ))))
     </select>
+
+    <update id="queryUpGoods">
+        update goods g set g.goods_status=0 where unix_timestamp(now()) > g.validity_end_time and g.goods_status = 1
+    </update>
 </mapper>