change před 4 roky
rodič
revize
4d6d73d249

+ 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;

+ 4 - 2
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);
     }
@@ -99,8 +101,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);

+ 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);
 }

+ 2 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -38,16 +38,8 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
 
     @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);
     }
 
     /**

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

@@ -1,8 +1,11 @@
 package com.zhongzheng.modules.user.mapper;
 
+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 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface UserPlanGoodsMapper extends BaseMapper<UserPlanGoods> {
 
+    List<GoodsVo> selectGoods(Long planId);
 }

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

@@ -1,5 +1,6 @@
 package com.zhongzheng.modules.user.service;
 
+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 +50,6 @@ public interface IUserPlanGoodsService extends IService<UserPlanGoods> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    List<GoodsVo> selectGoods(Long planId);
 }

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

@@ -3,6 +3,7 @@ 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.GoodsVo;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -97,4 +98,9 @@ public class UserPlanGoodsServiceImpl extends ServiceImpl<UserPlanGoodsMapper, U
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public List<GoodsVo> selectGoods(Long planId) {
+        return baseMapper.selectGoods(planId);
+    }
 }

+ 24 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserPlanServiceImpl.java

@@ -49,6 +49,8 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
     @Autowired
     private IUserPlanGoodsService userPlanGoodsService;
 
+
+
     @Override
     public UserPlanVo queryById(Long planId){
         UserPlan userPlan = this.baseMapper.selectById(planId);
@@ -63,7 +65,17 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
         userPlanVo.setPitchNum(userPlan.getPitchNum());
         userPlanVo.setStudyNum(userPlan.getStudyNum());
         userPlanVo.setPlanId(userPlan.getPlanId());
-
+        List<GoodsVo> goodsVos = userPlanGoodsService.selectGoods(planId);
+        userPlanVo.setGoodsVos(goodsVos);
+        // List转成数组
+        Long[] array = new Long[goodsVos.size()];
+        // 输出数组
+        List<Long> arrys = new ArrayList<>();
+        for (GoodsVo goodsVo : goodsVos) {
+            arrys.add(goodsVo.getGoodsId());
+        }
+        arrys.toArray(array);
+        userPlanVo.setGoodsId(array);
         //得到日历日期
         List<CalendarStudyVo> calendarStudyVos = JSONObject.parseArray(userPlan.getSchedule(), CalendarStudyVo.class);
         //得到学习的周
@@ -103,7 +115,17 @@ public class UserPlanServiceImpl extends ServiceImpl<UserPlanMapper, UserPlan> i
             userPlanVo.setPitchNum(userPlan.getPitchNum());
             userPlanVo.setStudyNum(userPlan.getStudyNum());
             userPlanVo.setPlanId(userPlan.getPlanId());
-
+            List<GoodsVo> goodsVos = userPlanGoodsService.selectGoods(userPlan.getPlanId());
+            userPlanVo.setGoodsVos(goodsVos);
+            // List转成数组
+            Long[] array = new Long[goodsVos.size()];
+            // 输出数组
+            List<Long> arrys = new ArrayList<>();
+            for (GoodsVo goodsVo : goodsVos) {
+                arrys.add(goodsVo.getGoodsId());
+            }
+            arrys.toArray(array);
+            userPlanVo.setGoodsId(array);
             //得到日历日期
             List<CalendarStudyVo> calendarStudyVos = JSONObject.parseArray(userPlan.getSchedule(), CalendarStudyVo.class);
             //得到学习的周

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

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

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

@@ -14,10 +14,45 @@ 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>
 
+        order by up.create_time desc
+    </select>
 </mapper>

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

@@ -12,5 +12,68 @@ 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>
 
+    <select id="selectGoods" parameterType="long"  resultMap="GoodsResultVo">
+        SELECT
+            g.*
+        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>