Commit c3faa0d9 by 吴博

1002714 定制服务允许二级分类

parent 84976539
......@@ -257,16 +257,26 @@ public class CustomPlanBizImpl implements CustomPlanBiz {
customPlanModuleMapper.insert(parentPlanModule);
if(PlanModuleTypeEnum.GROUP.value.equals(parentPlanModuleVO.getModuleType())
&& !CollectionUtils.isEmpty(parentPlanModuleVO.getCustomPlanModuleVOList())) {
List<CustomPlanModule> itemList=new ArrayList<>();
for(CustomPlanModuleVO planModuleVO : parentPlanModuleVO.getCustomPlanModuleVOList()) {
CustomPlanModule planModule4Second = new CustomPlanModule();
BeanUtils.copyProperties(planModuleVO, planModule4Second);
planModule4Second.setParentId(parentPlanModule.getId());
planModule4Second.setPlanId(planId);
customPlanModuleMapper.insert(planModule4Second);
if (PlanModuleTypeEnum.GROUP.value.equals(planModuleVO.getModuleType())
&& !CollectionUtils.isEmpty(planModuleVO.getCustomPlanModuleVOList())) {
List<CustomPlanModule> itemList4Second = new ArrayList<>();
for (CustomPlanModuleVO planModuleVO4Second : planModuleVO.getCustomPlanModuleVOList()) {
CustomPlanModule planModule = new CustomPlanModule();
BeanUtils.copyProperties(planModuleVO, planModule);
planModule.setParentId(parentPlanModule.getId());
BeanUtils.copyProperties(planModuleVO4Second, planModule);
planModule.setParentId(planModule4Second.getId());
planModule.setPlanId(planId);
itemList.add(planModule);
itemList4Second.add(planModule);
}
if (!ListUtils.isEmpty(itemList4Second)) {
customPlanModuleMapper.batchInsert(itemList4Second);
}
}
if(!ListUtils.isEmpty(itemList)) {
customPlanModuleMapper.batchInsert(itemList);
}
}
}
......@@ -280,6 +290,14 @@ public class CustomPlanBizImpl implements CustomPlanBiz {
if(PlanModuleTypeEnum.GROUP.value.equals(planModuleVO.getModuleType())) {
List<CustomPlanModuleVO> planModuleVOList = customPlanModuleMapper.getCustomPlanModuleByPlanId(planId, planModuleVO.getId());
if(!CollectionUtils.isEmpty(planModuleVOList)) {
for (CustomPlanModuleVO customPlanModuleVO : planModuleVOList){
if(PlanModuleTypeEnum.GROUP.value.equals(customPlanModuleVO.getModuleType())) {
List<CustomPlanModuleVO> planModuleVOList4Second = customPlanModuleMapper.getCustomPlanModuleByPlanId(planId, customPlanModuleVO.getId());
if (!ListUtils.isEmpty(planModuleVOList4Second)){
customPlanModuleVO.setCustomPlanModuleVOList(planModuleVOList4Second);
}
}
}
planModuleVO.setCustomPlanModuleVOList(planModuleVOList);
}
}
......
......@@ -50,4 +50,7 @@ public class CustomPlanModule {
private String bookName;
private Integer readType;
// 家长是否参与
private Integer parentAttend;
}
\ No newline at end of file
......@@ -48,4 +48,7 @@ public class CustomPlanModuleVO {
private String bookName;
private Integer readType;
// 家长是否参与
private Integer parentAttend;
}
\ No newline at end of file
......@@ -21,11 +21,13 @@
<result column="open_feedback" jdbcType="INTEGER" property="openFeedback" />
<result column="book_name" jdbcType="VARCHAR" property="bookName" />
<result column="read_type" jdbcType="INTEGER" property="readType" />
<result column="parent_attend" jdbcType="INTEGER" property="parentAttend" />
</resultMap>
<sql id="Base_Column_List">
id, plan_id, parent_id, module_type, pic_url, type_name, title, content, skill_id, skill_cover,
app_id, agent_name, product_id, merchant_name, product_unique_number, link_url, create_time, update_time, open_feedback, book_name, read_type
app_id, agent_name, product_id, merchant_name, product_unique_number, link_url, create_time, update_time, open_feedback, book_name,
read_type,parent_attend
</sql>
<insert id="insert" parameterType="CustomPlanModule" useGeneratedKeys="true" keyProperty="id">
......@@ -33,12 +35,12 @@
type_name, title, content,
skill_id, skill_cover, app_id, agent_name,
product_id, merchant_name, product_unique_number, link_url, create_time,
update_time, open_feedback, book_name, read_type)
update_time, open_feedback, book_name, read_type,parent_attend)
values (#{planId,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER}, #{moduleType,jdbcType=INTEGER}, #{picUrl,jdbcType=VARCHAR},
#{typeName,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR},
#{skillId,jdbcType=INTEGER}, #{skillCover,jdbcType=VARCHAR}, #{appId,jdbcType=BIGINT}, #{agentName,jdbcType=VARCHAR},
#{productId,jdbcType=BIGINT}, #{merchantName,jdbcType=VARCHAR}, #{productUniqueNumber,jdbcType=VARCHAR}, #{linkUrl,jdbcType=VARCHAR},
NOW(), NOW(), #{openFeedback}, #{bookName}, #{readType})
NOW(), NOW(), #{openFeedback}, #{bookName}, #{readType},#{parentAttend})
</insert>
<insert id="batchInsert" parameterType="list" useGeneratedKeys="true" keyProperty="id">
......@@ -46,14 +48,14 @@
type_name, title, content,
skill_id, skill_cover, app_id, agent_name,
product_id, merchant_name, product_unique_number, link_url, create_time,
update_time, open_feedback, book_name, read_type)
update_time, open_feedback, book_name, read_type,parent_attend)
values
<foreach collection="list" separator="," item="item">
(#{item.planId,jdbcType=INTEGER}, #{item.parentId,jdbcType=INTEGER}, #{item.moduleType,jdbcType=INTEGER}, #{item.picUrl,jdbcType=VARCHAR},
#{item.typeName,jdbcType=VARCHAR}, #{item.title,jdbcType=VARCHAR}, #{item.content,jdbcType=VARCHAR},
#{item.skillId,jdbcType=INTEGER}, #{item.skillCover,jdbcType=VARCHAR}, #{item.appId,jdbcType=BIGINT}, #{item.agentName,jdbcType=VARCHAR},
#{item.productId,jdbcType=BIGINT}, #{item.merchantName,jdbcType=VARCHAR}, #{item.productUniqueNumber,jdbcType=VARCHAR}, #{item.linkUrl,jdbcType=VARCHAR},
NOW(), NOW(), #{item.openFeedback}, #{item.bookName}, #{item.readType})
NOW(), NOW(), #{item.openFeedback}, #{item.bookName}, #{item.readType},#{item.parentAttend})
</foreach>
</insert>
......@@ -99,6 +101,9 @@
<if test="readType != null">
read_type = #{readType,jdbcType=INTEGER},
</if>
<if test="parentAttend != null">
parent_attend = #{parentAttend,jdbcType=INTEGER},
</if>
update_time = NOW(),
</set>
where id = #{id,jdbcType=INTEGER}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment