瀏覽代碼

fix 题目数量

he2802 3 年之前
父節點
當前提交
41e79cc738
共有 15 個文件被更改,包括 288 次插入28 次删除
  1. 1 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/base/UserProfileController.java
  2. 6 3
      zhongzheng-api/src/main/java/com/zhongzheng/controller/plan/UserPlanController.java
  3. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/UserProfileQueryBo.java
  4. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/mapper/UserProfileMapper.java
  5. 6 12
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java
  6. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserPlanGoodsMapper.java
  7. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserPlanMapper.java
  8. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserPlanGoodsService.java
  9. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserPlanService.java
  10. 31 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserPlanGoodsServiceImpl.java
  11. 46 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserPlanServiceImpl.java
  12. 11 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserPlanVo.java
  13. 39 1
      zhongzheng-system/src/main/resources/mapper/modules/base/UserProfileMapper.xml
  14. 125 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserPlanGoodsMapper.xml
  15. 2 1
      zhongzheng-system/src/main/resources/mapper/modules/user/UserPlanMapper.xml

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

@@ -37,7 +37,7 @@ import io.swagger.annotations.ApiOperation;
 @Api(value = "填写资料审核控制器", tags = {"填写资料审核管理"})
 @RequiredArgsConstructor(onConstructor_ = @Autowired)
 @RestController
-@RequestMapping("/system/profile")
+@RequestMapping("/base/profile")
 public class UserProfileController extends BaseController {
 
     private final IUserProfileService iUserProfileService;

+ 6 - 3
zhongzheng-api/src/main/java/com/zhongzheng/controller/plan/UserPlanController.java

@@ -58,6 +58,8 @@ public class UserPlanController extends BaseController {
     @GetMapping("/list")
     public TableDataInfo<UserPlanVo> list(UserPlanQueryBo bo) {
         startPage();
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
         List<UserPlanVo> list = iUserPlanService.queryList(bo);
         return getDataTable(list);
     }
@@ -69,7 +71,8 @@ public class UserPlanController extends BaseController {
     @ApiOperation("获取学习计划详细信息")
     @GetMapping("/{planId}")
     public AjaxResult<UserPlanVo> getInfo(@PathVariable("planId" ) Long planId) {
-        return AjaxResult.success(iUserPlanService.queryById(planId));
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        return AjaxResult.success(iUserPlanService.queryById(planId,loginUser.getUser().getUserId()));
     }
 
     /**
@@ -99,8 +102,8 @@ public class UserPlanController extends BaseController {
      * 查询学习计划列表
      */
     @ApiOperation("获得展示的日历学习计划,不添加到数据库")
-    @GetMapping("/listPlan")
-    public AjaxResult<UserPlanVo> listPlan(UserPlanEditBo bo) throws ParseException {
+    @PostMapping("/listPlan")
+    public AjaxResult<UserPlanVo> listPlan(@RequestBody UserPlanEditBo bo) throws ParseException {
         ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
         bo.setUserId(loginUser.getUser().getUserId());
         UserPlanVo list = iUserPlanService.listPlan(bo);

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/bo/UserProfileQueryBo.java

@@ -39,6 +39,10 @@ public class UserProfileQueryBo extends BaseEntity {
 	/** 用户ID */
 	@ApiModelProperty("用户ID")
 	private Long userId;
+
+	/** 用户ID */
+	@ApiModelProperty("id")
+	private Long id;
 	/** 商品ID */
 	@ApiModelProperty("商品ID")
 	private Long goodsId;

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/mapper/UserProfileMapper.java

@@ -1,7 +1,11 @@
 package com.zhongzheng.modules.base.mapper;
 
+import com.zhongzheng.modules.base.bo.UserProfileQueryBo;
 import com.zhongzheng.modules.base.domain.UserProfile;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.base.vo.UserProfileVo;
+
+import java.util.List;
 
 /**
  * 填写资料审核Mapper接口
@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface UserProfileMapper extends BaseMapper<UserProfile> {
 
+    List<UserProfileVo> selectUserProfile(UserProfileQueryBo bo);
 }

+ 6 - 12
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -32,22 +32,16 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
 
     @Override
     public UserProfileVo queryById(Long id){
-        UserProfile db = this.baseMapper.selectById(id);
-        return BeanUtil.toBean(db, UserProfileVo.class);
+        UserProfileQueryBo userProfileQueryBo = new UserProfileQueryBo();
+        userProfileQueryBo.setId(id);
+        UserProfileVo userProfileVo = baseMapper.selectUserProfile(userProfileQueryBo).get(0);
+        return userProfileVo;
     }
 
     @Override
     public List<UserProfileVo> queryList(UserProfileQueryBo bo) {
-        LambdaQueryWrapper<UserProfile> lqw = Wrappers.lambdaQuery();
-        lqw.eq(bo.getUserId() != null, UserProfile::getUserId, bo.getUserId());
-        lqw.eq(bo.getGoodsId() != null, UserProfile::getGoodsId, bo.getGoodsId());
-        lqw.eq(bo.getStatus() != null, UserProfile::getStatus, bo.getStatus());
-        lqw.eq(bo.getOneTime() != null, UserProfile::getOneTime, bo.getOneTime());
-        lqw.eq(bo.getLastTime() != null, UserProfile::getLastTime, bo.getLastTime());
-        lqw.eq(StrUtil.isNotBlank(bo.getKeyValue()), UserProfile::getKeyValue, bo.getKeyValue());
-        lqw.eq(bo.getCurrentStatus() != null, UserProfile::getCurrentStatus, bo.getCurrentStatus());
-        lqw.eq(bo.getChangeStatus() != null, UserProfile::getChangeStatus, bo.getChangeStatus());
-        return entity2Vo(this.list(lqw));
+
+        return baseMapper.selectUserProfile(bo);
     }
 
     /**

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserPlanGoodsMapper.java

@@ -1,8 +1,12 @@
 package com.zhongzheng.modules.user.mapper;
 
+import com.zhongzheng.modules.goods.vo.GoodsUserVo;
+import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.user.domain.UserPlanGoods;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
+import java.util.List;
+
 /**
  * 学习计划绑定课程Mapper接口
  *
@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface UserPlanGoodsMapper extends BaseMapper<UserPlanGoods> {
 
+    List<GoodsUserVo> selectGoods(Long planId);
 }

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserPlanMapper.java

@@ -2,6 +2,7 @@ package com.zhongzheng.modules.user.mapper;
 
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
+import com.zhongzheng.modules.user.bo.UserPlanAddBo;
 import com.zhongzheng.modules.user.bo.UserPlanEditBo;
 import com.zhongzheng.modules.user.bo.UserPlanQueryBo;
 import com.zhongzheng.modules.user.domain.UserPlan;
@@ -19,7 +20,7 @@ public interface UserPlanMapper extends BaseMapper<UserPlan> {
 
     List<GoodsVo> listGoods(UserPlanQueryBo bo);
 
-    Integer selectCountGoods(UserPlanEditBo bo);
+    Integer selectCountGoods(UserPlanAddBo bo);
 
     List<Long> selectGoods(Long goodsId);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserPlanGoodsService.java

@@ -1,5 +1,7 @@
 package com.zhongzheng.modules.user.service;
 
+import com.zhongzheng.modules.goods.vo.GoodsUserVo;
+import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.user.domain.UserPlanGoods;
 import com.zhongzheng.modules.user.vo.UserPlanGoodsVo;
 import com.zhongzheng.modules.user.bo.UserPlanGoodsQueryBo;
@@ -49,4 +51,6 @@ public interface IUserPlanGoodsService extends IService<UserPlanGoods> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    List<GoodsUserVo> selectGoods(Long planId,Long userId);
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserPlanService.java

@@ -24,7 +24,7 @@ public interface IUserPlanService extends IService<UserPlan> {
 	 * 查询单个
 	 * @return
 	 */
-	UserPlanVo queryById(Long planId);
+	UserPlanVo queryById(Long planId,Long UserId);
 
 	/**
 	 * 查询列表

+ 31 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserPlanGoodsServiceImpl.java

@@ -3,6 +3,12 @@ package com.zhongzheng.modules.user.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.goods.vo.GoodsUserVo;
+import com.zhongzheng.modules.goods.vo.GoodsVo;
+import com.zhongzheng.modules.user.bo.SubjectStudyRecordQueryBo;
+import com.zhongzheng.modules.user.service.IUserStudyRecordService;
+import com.zhongzheng.modules.user.vo.SubjectStudyRecordVo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -16,6 +22,7 @@ import com.zhongzheng.modules.user.mapper.UserPlanGoodsMapper;
 import com.zhongzheng.modules.user.vo.UserPlanGoodsVo;
 import com.zhongzheng.modules.user.service.IUserPlanGoodsService;
 
+import java.math.BigDecimal;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -30,6 +37,9 @@ import java.util.stream.Collectors;
 @Service
 public class UserPlanGoodsServiceImpl extends ServiceImpl<UserPlanGoodsMapper, UserPlanGoods> implements IUserPlanGoodsService {
 
+    @Autowired
+    private IUserStudyRecordService iUserStudyRecordService;
+
     @Override
     public UserPlanGoodsVo queryById(Long id){
         UserPlanGoods db = this.baseMapper.selectById(id);
@@ -97,4 +107,25 @@ public class UserPlanGoodsServiceImpl extends ServiceImpl<UserPlanGoodsMapper, U
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public List<GoodsUserVo> selectGoods(Long planId,Long UserId) {
+        List<GoodsUserVo> goodsVos = baseMapper.selectGoods(planId);
+        for (GoodsUserVo goodsUserVo : goodsVos) {
+            Long secLong = 0L;
+            Long studyLong = 0L;
+            SubjectStudyRecordQueryBo subjectStudyRecordQueryBo = new SubjectStudyRecordQueryBo();
+            subjectStudyRecordQueryBo.setGoodsId(goodsUserVo.getGoodsId());
+            subjectStudyRecordQueryBo.setUserId(UserId);
+            subjectStudyRecordQueryBo.setGradeId(goodsUserVo.getGradeId());
+            List<SubjectStudyRecordVo> subjectStudyRecordVos = iUserStudyRecordService.listSubject(subjectStudyRecordQueryBo);
+            for (SubjectStudyRecordVo subjectStudyRecordVo : subjectStudyRecordVos) {
+                secLong = new BigDecimal(secLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getSectionNum().toString())).longValue();
+                studyLong = new BigDecimal(studyLong.toString()).add(new BigDecimal(subjectStudyRecordVo.getRecordNum().toString())).longValue();
+            }
+            goodsUserVo.setSecAllNum(secLong);
+            goodsUserVo.setStuAllNum(studyLong);
+        }
+        return goodsVos;
+    }
 }

+ 46 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserPlanServiceImpl.java

@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.goods.vo.GoodsUserVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.user.bo.UserPlanGoodsAddBo;
 import com.zhongzheng.modules.user.domain.UserPlanGoods;
@@ -49,8 +50,10 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
     @Autowired
     private IUserPlanGoodsService userPlanGoodsService;
 
+
+
     @Override
-    public UserPlanVo queryById(Long planId){
+    public UserPlanVo queryById(Long planId,Long UserId){
         UserPlan userPlan = this.baseMapper.selectById(planId);
         //得到日历日期
         UserPlanVo userPlanVo = new UserPlanVo();
@@ -63,7 +66,17 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
         userPlanVo.setPitchNum(userPlan.getPitchNum());
         userPlanVo.setStudyNum(userPlan.getStudyNum());
         userPlanVo.setPlanId(userPlan.getPlanId());
-
+        List<GoodsUserVo> goodsVos = userPlanGoodsService.selectGoods(planId,UserId);
+        userPlanVo.setGoodsVos(goodsVos);
+        // List转成数组
+        Long[] array = new Long[goodsVos.size()];
+        // 输出数组
+        List<Long> arrys = new ArrayList<>();
+        for (GoodsUserVo goodsVo : goodsVos) {
+            arrys.add(goodsVo.getGoodsId());
+        }
+        arrys.toArray(array);
+        userPlanVo.setGoodsId(array);
         //得到日历日期
         List<CalendarStudyVo> calendarStudyVos = JSONObject.parseArray(userPlan.getSchedule(), CalendarStudyVo.class);
         //得到学习的周
@@ -103,7 +116,17 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             userPlanVo.setPitchNum(userPlan.getPitchNum());
             userPlanVo.setStudyNum(userPlan.getStudyNum());
             userPlanVo.setPlanId(userPlan.getPlanId());
-
+            List<GoodsUserVo> goodsVos = userPlanGoodsService.selectGoods(userPlanVo.getPlanId(),userPlanVo.getUserId());
+            userPlanVo.setGoodsVos(goodsVos);
+            // List转成数组
+            Long[] array = new Long[goodsVos.size()];
+            // 输出数组
+            List<Long> arrys = new ArrayList<>();
+            for (GoodsUserVo goodsVo : goodsVos) {
+                arrys.add(goodsVo.getGoodsId());
+            }
+            arrys.toArray(array);
+            userPlanVo.setGoodsId(array);
             //得到日历日期
             List<CalendarStudyVo> calendarStudyVos = JSONObject.parseArray(userPlan.getSchedule(), CalendarStudyVo.class);
             //得到学习的周
@@ -141,6 +164,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
 
     @Override
     public Boolean insertByAddBo(UserPlanAddBo bo) throws ParseException {
+        validEntityPlanBeforeSave(bo);
         UserPlan userPlan = new UserPlan();
         List<CalendarStudyVo> clCalendarStudyVos = findDates(bo.getStartTime(),bo.getEndTime());
         Long sumUp=0L;
@@ -161,6 +185,10 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
                 for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
                     if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
+                        if (allNum.equals(0)){
+                            break;
+                        }
+                        allNum -= Sec;
                         if (dayStudyVo.getStudyCourseKnob() != null) {
                             dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
                         }else {
@@ -232,6 +260,10 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
                 for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
                     if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
+                        if (allNum.equals(0)){
+                            break;
+                        }
+                        allNum -= Sec;
                         if (dayStudyVo.getStudyCourseKnob() != null) {
                             dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
                         }else {
@@ -304,15 +336,17 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
 
     @Override
     public UserPlanVo listPlan(UserPlanEditBo bo) throws ParseException {
-        validEntityPlanBeforeSave(bo);
         UserPlanVo userPlanVo = new UserPlanVo();
         List<CalendarStudyVo> clCalendarStudyVos = findDates(bo.getStartTime(),bo.getEndTime());
+        Long secAll = 0L;
         for (Long aLong : bo.getGoodsId()) {
             //最近考试时间七天前到现在的天数,学习视频时长
             Date date1 = new Date(bo.getEndTime() * 1000L);
             //获得相隔天数
             int dutyDays = getDutyDays(new Date(), date1, bo.getStudyCount(), bo.getStudyDay());
-
+            if (dutyDays < 1){
+                throw new IllegalArgumentException("没有学习天数,请认真填写开始结束时间");
+            }
             List<Long> seLongs = baseMapper.selectGoods(aLong);
             Long allNum = 0L;
             for (Long seLong : seLongs) {
@@ -320,9 +354,14 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             }
             //计算每天需要学习多少节课
             int Sec = (int) Math.ceil((double) allNum / dutyDays);
+            secAll+=Sec;
             for (CalendarStudyVo clCalendarStudyVo : clCalendarStudyVos) {
                 for (DayStudyVo dayStudyVo : clCalendarStudyVo.getDayStudyList()) {
                     if (Arrays.asList(bo.getStudyCount()).contains(dayStudyVo.getStudyDay())){
+                        if (allNum.equals(0)){
+                            break;
+                        }
+                        allNum -= Sec;
                         if (dayStudyVo.getStudyCourseKnob() != null) {
                             dayStudyVo.setStudyCourseKnob(dayStudyVo.getStudyCourseKnob() + Sec);
                         }else {
@@ -345,7 +384,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             }
         }
         userPlanVo.setCalendarStudyVo(clCalendarStudyVos);
-        userPlanVo.setStudyCourseKnob(clCalendarStudyVos.get(0).getDayStudyList().get(0).getStudyCourseKnob());
+        userPlanVo.setStudyCourseKnob(secAll);
         return userPlanVo;
     }
 
@@ -433,7 +472,7 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
      *
      * @param bo 实体类数据
      */
-    private void validEntityPlanBeforeSave(UserPlanEditBo bo){
+    private void validEntityPlanBeforeSave(UserPlanAddBo bo){
         //判断是否商品已被生成过课程
         Integer rank = baseMapper.selectCountGoods(bo);
         if (rank > 0){

+ 11 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserPlanVo.java

@@ -2,6 +2,8 @@ package com.zhongzheng.modules.user.vo;
 
 import com.zhongzheng.common.annotation.Excel;
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.zhongzheng.modules.goods.vo.GoodsUserVo;
+import com.zhongzheng.modules.goods.vo.GoodsVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -28,6 +30,14 @@ public class UserPlanVo {
 	@ApiModelProperty("用户id")
 	private Long userId;
 
+	/** 商品ID */
+	@ApiModelProperty("商品ID")
+	private Long[] goodsId;
+
+	/** 商品ID */
+	@ApiModelProperty("商品ID")
+	private List<GoodsUserVo> goodsVos;
+
 	/** 计划json格式 */
 	@Excel(name = "计划json格式")
 	@ApiModelProperty("计划json格式")
@@ -60,7 +70,7 @@ public class UserPlanVo {
 	@Excel(name = "0 失效 1启用")
 	@ApiModelProperty("0 失效 1启用")
 	private Integer status;
-	@ApiModelProperty("天学习节数")
+	@ApiModelProperty("天学习节数")
 	private Long studyCourseKnob;
 
 	/** 总结数 */

+ 39 - 1
zhongzheng-system/src/main/resources/mapper/modules/base/UserProfileMapper.xml

@@ -14,10 +14,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="oneTime" column="one_time"/>
         <result property="lastTime" column="last_time"/>
         <result property="keyValue" column="key_value"/>
-        <result property="createBy" column="create_by"/>
+        <result property="createByName" column="create_by_name"/>
         <result property="currentStatus" column="current_status"/>
         <result property="changeStatus" column="change_status"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.base.vo.UserProfileVo" id="UserProfileVo">
+        <result property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="goodsId" column="goods_id"/>
+        <result property="status" column="status"/>
+        <result property="oneTime" column="one_time"/>
+        <result property="lastTime" column="last_time"/>
+        <result property="keyValue" column="key_value"/>
+        <result property="currentStatus" column="current_status"/>
+        <result property="changeStatus" column="change_status"/>
+    </resultMap>
+
+    <select id="selectUserProfile" parameterType="com.zhongzheng.modules.base.bo.UserProfileQueryBo" resultMap="UserProfileVo">
+        SELECT
+        up.*,
+        (SELECT u.realname FROM `user` u where u.user_id = up.user_id) as realname,
+        (SELECT u.user_account FROM `user` u where u.user_id = up.user_id) as user_account,
+        (SELECT u.telphone FROM `user` u where u.user_id = up.user_id) as telphone,
+        (SELECT u.id_card FROM `user` u where u.user_id = up.user_id) as id_card,
+        (SELECT g.goods_name FROM goods g where up.goods_id = g.goods_id) as goods_name,
+        (SELECT g.`code` FROM goods g where up.goods_id = g.goods_id) as goods_code,
+        (SELECT cet.education_name FROM goods g LEFT JOIN course_education_type cet on g.education_type_id = cet.id where up.goods_id = g.goods_id) as education_name,
+        (SELECT cet.project_name FROM goods g LEFT JOIN course_project_type cet on g.project_id = cet.id where up.goods_id = g.goods_id) as project_name,
+        (SELECT cet.business_name FROM goods g LEFT JOIN course_business cet on g.business_id = cet.id where up.goods_id = g.goods_id) as business_name
+        FROM
+        user_profile up
+        where 1=1
+        <if test="status != null and status.size()!=0 ">
+            AND up.status in
+            <foreach collection="status" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        <if test="id != null and id!='' ">
+            AND up.status =
 
+        </if>
+        order by up.create_time desc
+    </select>
 </mapper>

+ 125 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserPlanGoodsMapper.xml

@@ -12,5 +12,130 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id" column="id"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.goods.vo.GoodsVo" id="GoodsResultVo">
+        <result property="goodsId" column="goods_id"/>
+        <result property="year" column="year"/>
+        <result property="supplyId" column="supply_id"/>
+        <result property="goodsType" column="goods_type"/>
+        <result property="educationTypeId" column="education_type_id"/>
+        <result property="businessId" column="business_id"/>
+        <result property="schoolId" column="school_id"/>
+        <result property="majorId" column="major_id"/>
+        <result property="goodsName" column="goods_name"/>
+        <result property="standPrice" column="stand_price"/>
+        <result property="lowestPrice" column="lowest_price"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="status" column="status"/>
+        <result property="validityStartTime" column="validity_start_time"/>
+        <result property="validityEndTime" column="validity_end_time"/>
+        <result property="studyStartTime" column="study_start_time"/>
+        <result property="studyEndTime" column="study_end_time"/>
+        <result property="certificateIds" column="certificate_ids"/>
+        <result property="introduce" column="introduce"/>
+        <result property="suitableObject" column="suitable_object"/>
+        <result property="buyNote" column="buy_note"/>
+        <result property="pcDetailHtml" column="pc_detail_html"/>
+        <result property="mobileDetailHtml" column="mobile_detail_html"/>
+        <result property="goodsStatus" column="goods_status"/>
+        <result property="coverUrl" column="cover_url"/>
+        <result property="classHours" column="class_hours"/>
+        <result property="standPriceJson" column="stand_price_json"/>
+        <result property="code" column="code"/>
+        <result property="projectId" column="project_id"/>
+        <result property="goodsAuditionConfig" column="goods_audition_config"/>
+        <result property="goodsPhotographConfig" column="goods_photograph_config"/>
+        <result property="goodsAuditionExamConfig" column="goods_audition_exam_config"/>
+        <result property="goodsPlayConfig" column="goods_play_config"/>
+        <result property="goodsExamConfig" column="goods_exam_config"/>
+
+        <result property="supplyName" column="supply_name"/>
+        <result property="educationName" column="education_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="businessName" column="business_name"/>
+        <result property="schoolName" column="school_name"/>
+        <result property="categoryName" column="category_name"/>
+        <result property="handoutsId" column="handouts_id"/>
+        <result property="templateType" column="template_type"/>
+        <result property="period" column="period"/>
+        <result property="makeStartTime" column="make_start_time"/>
+        <result property="makeEndTime" column="make_end_time"/>
+        <result property="studyCount" column="study_count"/>
+        <result property="makeGoodsName" column="make_goods_name"/>
+        <result property="makeGoodsCode" column="make_goods_code"/>
+    </resultMap>
+
+    <resultMap type="com.zhongzheng.modules.goods.vo.GoodsUserVo" id="GoodsUserVo">
+        <result property="goodsId" column="goods_id"/>
+        <result property="year" column="year"/>
+        <result property="supplyId" column="supply_id"/>
+        <result property="userId" column="user_id"/>
+        <result property="goodsType" column="goods_type"/>
+        <result property="educationTypeId" column="education_type_id"/>
+        <result property="businessId" column="business_id"/>
+        <result property="schoolId" column="school_id"/>
+        <result property="majorId" column="major_id"/>
+        <result property="goodsName" column="goods_name"/>
+        <result property="standPrice" column="stand_price"/>
+        <result property="lowestPrice" column="lowest_price"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="status" column="status"/>
+        <result property="validityStartTime" column="validity_start_time"/>
+        <result property="validityEndTime" column="validity_end_time"/>
+        <result property="studyStartTime" column="study_start_time"/>
+        <result property="studyEndTime" column="study_end_time"/>
+        <result property="certificateIds" column="certificate_ids"/>
+        <result property="introduce" column="introduce"/>
+        <result property="suitableObject" column="suitable_object"/>
+        <result property="buyNote" column="buy_note"/>
+        <result property="pcDetailHtml" column="pc_detail_html"/>
+        <result property="mobileDetailHtml" column="mobile_detail_html"/>
+        <result property="goodsStatus" column="goods_status"/>
+        <result property="coverUrl" column="cover_url"/>
+        <result property="classHours" column="class_hours"/>
+        <result property="standPriceJson" column="stand_price_json"/>
+        <result property="code" column="code"/>
+        <result property="projectId" column="project_id"/>
+        <result property="goodsAuditionConfig" column="goods_audition_config"/>
+        <result property="goodsPhotographConfig" column="goods_photograph_config"/>
+        <result property="goodsPlayConfig" column="goods_play_config"/>
+        <result property="goodsExamConfig" column="goods_exam_config"/>
+        <result property="gradeId" column="grade_id"/>
+
+        <result property="supplyName" column="supply_name"/>
+        <result property="educationName" column="education_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="businessName" column="business_name"/>
+        <result property="schoolName" column="school_name"/>
+        <result property="categoryName" column="category_name"/>
+        <result property="handoutsId" column="handouts_id"/>
+        <result property="templateType" column="template_type"/>
+        <result property="period" column="period"/>
+        <result property="makeStartTime" column="make_start_time"/>
+        <result property="makeEndTime" column="make_end_time"/>
+        <result property="studyCount" column="study_count"/>
+        <result property="makeGoodsName" column="make_goods_name"/>
+        <result property="makeGoodsCode" column="make_goods_code"/>
+        <result property="applyStatus" column="apply_status"/>
+        <result property="beforeStatus" column="before_status"/>
+        <result property="applyName" column="apply_name"/>
+        <result property="beforeName" column="before_name"/>
+        <result property="courseNum" column="course_num"/>
+    </resultMap>
 
+    <select id="selectGoods" parameterType="long"  resultMap="GoodsUserVo">
+        SELECT
+            g.*,
+            (SELECT cet.education_name FROM  course_education_type cet  where cet.id = g.education_type_id) as education_name,
+            (SELECT cet.project_name FROM  course_project_type cet where cet.id = g.project_id) as project_name,
+            (SELECT cet.business_name FROM  course_business cet  where cet.id = g.business_id) as business_name
+        FROM
+            goods g
+                LEFT JOIN user_plan_goods upg on g.goods_id = upg.source_id
+        WHERE
+            1=1
+        and upg.plan_id=#{planId}
+          and g.goods_type =1
+    </select>
 </mapper>

+ 2 - 1
zhongzheng-system/src/main/resources/mapper/modules/user/UserPlanMapper.xml

@@ -95,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         COUNT(up.plan_id)
         FROM
         user_plan up
-        LEFT JOIN user_plan_goods upg ON up.plan_id = upg.plan_id
+        LEFT JOIN user_plan_goods upg ON up.plan_id = upg.plan_id where 1=1
         <if test="goodsId != null and goodsId !=''">
             and upg.source_id in
             <foreach collection="goodsId" open="(" separator="," close=")" item="goodsId">
@@ -105,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="userId != null and userId !=''">
             and up.user_id = #{userId}
         </if>
+        and `status` =1
     </select>
 
     <select id="selectGoods" parameterType="long"  resultType="Long">