change 3 سال پیش
والد
کامیت
88d142bfdc
13فایلهای تغییر یافته به همراه471 افزوده شده و 2 حذف شده
  1. 33 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformRemindBusinessAddBo.java
  2. 37 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformRemindBusinessEditBo.java
  3. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformRemindBusinessQueryBo.java
  4. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformRemindEditBo.java
  5. 39 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/domain/InformRemindBusiness.java
  6. 18 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/mapper/InformRemindBusinessMapper.java
  7. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/mapper/InformRemindMapper.java
  8. 54 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/IInformRemindBusinessService.java
  9. 104 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformRemindBusinessServiceImpl.java
  10. 24 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformRemindServiceImpl.java
  11. 58 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformRemindBusinessVo.java
  12. 6 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformRemindVo.java
  13. 46 0
      zhongzheng-system/src/main/resources/mapper/modules/inform/InformRemindBusinessMapper.xml

+ 33 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformRemindBusinessAddBo.java

@@ -0,0 +1,33 @@
+package com.zhongzheng.modules.inform.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 提醒设置绑定业务添加对象 inform_remind_business
+ *
+ * @author ruoyi
+ * @date 2021-11-30
+ */
+@Data
+@ApiModel("提醒设置绑定业务添加对象")
+public class InformRemindBusinessAddBo {
+
+    /** 业务ID */
+    @ApiModelProperty("业务ID")
+    private Long businessId;
+    /** 提醒设置ID */
+    @ApiModelProperty("提醒设置ID")
+    private Long remindId;
+    /** 添加时间 */
+    @ApiModelProperty("添加时间")
+    private Long createTime;
+    /** 修改时间 */
+    @ApiModelProperty("修改时间")
+    private Long updateTime;
+}

+ 37 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformRemindBusinessEditBo.java

@@ -0,0 +1,37 @@
+package com.zhongzheng.modules.inform.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import java.util.Date;
+
+
+/**
+ * 提醒设置绑定业务编辑对象 inform_remind_business
+ *
+ * @author ruoyi
+ * @date 2021-11-30
+ */
+@Data
+@ApiModel("提醒设置绑定业务编辑对象")
+public class InformRemindBusinessEditBo {
+
+    /** $column.columnComment */
+    @ApiModelProperty("$column.columnComment")
+    private Long id;
+
+    /** 业务ID */
+    @ApiModelProperty("业务ID")
+    private Long businessId;
+
+    /** 提醒设置ID */
+    @ApiModelProperty("提醒设置ID")
+    private Long remindId;
+
+    /** 修改时间 */
+    @ApiModelProperty("修改时间")
+    private Long updateTime;
+
+
+}

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformRemindBusinessQueryBo.java

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.inform.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+import java.util.Map;
+import java.util.HashMap;
+
+import com.zhongzheng.common.core.domain.BaseEntity;
+
+/**
+ * 提醒设置绑定业务分页查询对象 inform_remind_business
+ *
+ * @author ruoyi
+ * @date 2021-11-30
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel("提醒设置绑定业务分页查询对象")
+public class InformRemindBusinessQueryBo extends BaseEntity {
+
+	/** 分页大小 */
+	@ApiModelProperty("分页大小")
+	private Integer pageSize;
+	/** 当前页数 */
+	@ApiModelProperty("当前页数")
+	private Integer pageNum;
+	/** 排序列 */
+	@ApiModelProperty("排序列")
+	private String orderByColumn;
+	/** 排序的方向desc或者asc */
+	@ApiModelProperty(value = "排序的方向", example = "asc,desc")
+	private String isAsc;
+
+
+	/** 业务ID */
+	@ApiModelProperty("业务ID")
+	private Long businessId;
+	/** 提醒设置ID */
+	@ApiModelProperty("提醒设置ID")
+	private Long remindId;
+}

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/bo/InformRemindEditBo.java

@@ -45,5 +45,9 @@ public class InformRemindEditBo {
     @ApiModelProperty("修改时间")
     private Long updateTime;
 
+    /** 业务ID */
+    @ApiModelProperty("业务ID")
+    private Long[] businessId;
+
 
 }

+ 39 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/domain/InformRemindBusiness.java

@@ -0,0 +1,39 @@
+package com.zhongzheng.modules.inform.domain;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import lombok.experimental.Accessors;
+import java.io.Serializable;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.zhongzheng.common.annotation.Excel;
+
+/**
+ * 提醒设置绑定业务对象 inform_remind_business
+ *
+ * @author ruoyi
+ * @date 2021-11-30
+ */
+@Data
+@NoArgsConstructor
+@Accessors(chain = true)
+@TableName("inform_remind_business")
+public class InformRemindBusiness implements Serializable {
+
+private static final long serialVersionUID=1L;
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    private Long id;
+    /** 业务ID */
+    private Long businessId;
+    /** 提醒设置ID */
+    private Long remindId;
+    /** 添加时间 */
+    @TableField(fill = FieldFill.INSERT)
+    private Long createTime;
+    /** 修改时间 */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Long updateTime;
+}

+ 18 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/mapper/InformRemindBusinessMapper.java

@@ -0,0 +1,18 @@
+package com.zhongzheng.modules.inform.mapper;
+
+import com.zhongzheng.modules.inform.domain.InformRemindBusiness;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
+
+import java.util.List;
+
+/**
+ * 提醒设置绑定业务Mapper接口
+ *
+ * @author ruoyi
+ * @date 2021-11-30
+ */
+public interface InformRemindBusinessMapper extends BaseMapper<InformRemindBusiness> {
+
+    List<InformRemindBusinessVo> selectBusiness(Long id);
+}

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/mapper/InformRemindMapper.java

@@ -2,6 +2,9 @@ package com.zhongzheng.modules.inform.mapper;
 
 import com.zhongzheng.modules.inform.domain.InformRemind;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
+
+import java.util.List;
 
 /**
  * 提醒设置Mapper接口

+ 54 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/IInformRemindBusinessService.java

@@ -0,0 +1,54 @@
+package com.zhongzheng.modules.inform.service;
+
+import com.zhongzheng.modules.inform.domain.InformRemindBusiness;
+import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
+import com.zhongzheng.modules.inform.bo.InformRemindBusinessQueryBo;
+import com.zhongzheng.modules.inform.bo.InformRemindBusinessAddBo;
+import com.zhongzheng.modules.inform.bo.InformRemindBusinessEditBo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 提醒设置绑定业务Service接口
+ *
+ * @author ruoyi
+ * @date 2021-11-30
+ */
+public interface IInformRemindBusinessService extends IService<InformRemindBusiness> {
+	/**
+	 * 查询单个
+	 * @return
+	 */
+	InformRemindBusinessVo queryById(Long id);
+
+	/**
+	 * 查询列表
+	 */
+	List<InformRemindBusinessVo> queryList(InformRemindBusinessQueryBo bo);
+
+	/**
+	 * 根据新增业务对象插入提醒设置绑定业务
+	 * @param bo 提醒设置绑定业务新增业务对象
+	 * @return
+	 */
+	Boolean insertByAddBo(InformRemindBusinessAddBo bo);
+
+	/**
+	 * 根据编辑业务对象修改提醒设置绑定业务
+	 * @param bo 提醒设置绑定业务编辑业务对象
+	 * @return
+	 */
+	Boolean updateByEditBo(InformRemindBusinessEditBo bo);
+
+	/**
+	 * 校验并删除数据
+	 * @param ids 主键集合
+	 * @param isValid 是否校验,true-删除前校验,false-不校验
+	 * @return
+	 */
+	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    List<InformRemindBusinessVo> selectBusiness(Long id);
+}

+ 104 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformRemindBusinessServiceImpl.java

@@ -0,0 +1,104 @@
+package com.zhongzheng.modules.inform.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.common.utils.DateUtils;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.github.pagehelper.Page;
+import com.zhongzheng.modules.inform.bo.InformRemindBusinessAddBo;
+import com.zhongzheng.modules.inform.bo.InformRemindBusinessQueryBo;
+import com.zhongzheng.modules.inform.bo.InformRemindBusinessEditBo;
+import com.zhongzheng.modules.inform.domain.InformRemindBusiness;
+import com.zhongzheng.modules.inform.mapper.InformRemindBusinessMapper;
+import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
+import com.zhongzheng.modules.inform.service.IInformRemindBusinessService;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 提醒设置绑定业务Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2021-11-30
+ */
+@Service
+public class InformRemindBusinessServiceImpl extends ServiceImpl<InformRemindBusinessMapper, InformRemindBusiness> implements IInformRemindBusinessService {
+
+    @Override
+    public InformRemindBusinessVo queryById(Long id){
+        InformRemindBusiness db = this.baseMapper.selectById(id);
+        return BeanUtil.toBean(db, InformRemindBusinessVo.class);
+    }
+
+    @Override
+    public List<InformRemindBusinessVo> queryList(InformRemindBusinessQueryBo bo) {
+        LambdaQueryWrapper<InformRemindBusiness> lqw = Wrappers.lambdaQuery();
+        lqw.eq(bo.getRemindId() != null, InformRemindBusiness::getRemindId, bo.getRemindId());
+        return entity2Vo(this.list(lqw));
+    }
+
+    /**
+    * 实体类转化成视图对象
+    *
+    * @param collection 实体类集合
+    * @return
+    */
+    private List<InformRemindBusinessVo> entity2Vo(Collection<InformRemindBusiness> collection) {
+        List<InformRemindBusinessVo> voList = collection.stream()
+                .map(any -> BeanUtil.toBean(any, InformRemindBusinessVo.class))
+                .collect(Collectors.toList());
+        if (collection instanceof Page) {
+            Page<InformRemindBusiness> page = (Page<InformRemindBusiness>)collection;
+            Page<InformRemindBusinessVo> pageVo = new Page<>();
+            BeanUtil.copyProperties(page,pageVo);
+            pageVo.addAll(voList);
+            voList = pageVo;
+        }
+        return voList;
+    }
+
+    @Override
+    public Boolean insertByAddBo(InformRemindBusinessAddBo bo) {
+        InformRemindBusiness add = BeanUtil.toBean(bo, InformRemindBusiness.class);
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        return this.save(add);
+    }
+
+    @Override
+    public Boolean updateByEditBo(InformRemindBusinessEditBo bo) {
+        InformRemindBusiness update = BeanUtil.toBean(bo, InformRemindBusiness.class);
+        validEntityBeforeSave(update);
+        update.setUpdateTime(DateUtils.getNowTime());
+        return this.updateById(update);
+    }
+
+    /**
+     * 保存前的数据校验
+     *
+     * @param entity 实体类数据
+     */
+    private void validEntityBeforeSave(InformRemindBusiness entity){
+        //TODO 做一些数据校验,如唯一约束
+    }
+
+    @Override
+    public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
+        if(isValid){
+            //TODO 做一些业务上的校验,判断是否需要校验
+        }
+        return this.removeByIds(ids);
+    }
+
+    @Override
+    public List<InformRemindBusinessVo> selectBusiness(Long id) {
+        return baseMapper.selectBusiness(id);
+    }
+}

+ 24 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformRemindServiceImpl.java

@@ -18,6 +18,10 @@ import com.zhongzheng.modules.grade.service.IClassGradeGoodsService;
 import com.zhongzheng.modules.grade.service.IClassGradeSysService;
 import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import com.zhongzheng.modules.grade.vo.ClassGradeStudentVo;
+import com.zhongzheng.modules.inform.bo.InformRemindBusinessAddBo;
+import com.zhongzheng.modules.inform.domain.InformRemindBusiness;
+import com.zhongzheng.modules.inform.service.IInformRemindBusinessService;
+import com.zhongzheng.modules.inform.vo.InformRemindBusinessVo;
 import com.zhongzheng.modules.user.service.IUserStudyRecordService;
 import com.zhongzheng.modules.user.service.IUserUpdateService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -76,6 +80,9 @@ public class InformRemindServiceImpl extends ServiceImpl<InformRemindMapper, Inf
     @Autowired
     private IUserUpdateService iUserUpdateService;
 
+    @Autowired
+    private IInformRemindBusinessService iInformRemindBusinessService;
+
     @Override
     public InformRemindVo queryById(Long id){
         InformRemind db = this.baseMapper.selectById(id);
@@ -90,7 +97,12 @@ public class InformRemindServiceImpl extends ServiceImpl<InformRemindMapper, Inf
         lqw.eq(StrUtil.isNotBlank(bo.getLogic()), InformRemind::getLogic, bo.getLogic());
         lqw.eq(bo.getNoteStatus() != null, InformRemind::getNoteStatus, bo.getNoteStatus());
         lqw.eq(bo.getWayStatus() != null, InformRemind::getWayStatus, bo.getWayStatus());
-        return entity2Vo(this.list(lqw));
+        List<InformRemindVo> informRemindVos = entity2Vo(this.list(lqw));
+        for (InformRemindVo informRemindVo : informRemindVos) {
+            List<InformRemindBusinessVo> informRemindBusinessVos = iInformRemindBusinessService.selectBusiness(informRemindVo.getId());
+            informRemindVo.setInformRemindBusiness(informRemindBusinessVos);
+        }
+        return informRemindVos;
     }
 
     /**
@@ -127,6 +139,17 @@ public class InformRemindServiceImpl extends ServiceImpl<InformRemindMapper, Inf
         InformRemind update = BeanUtil.toBean(bo, InformRemind.class);
         validEntityBeforeSave(update);
         update.setUpdateTime(DateUtils.getNowTime());
+        LambdaQueryWrapper<InformRemindBusiness> lqw = Wrappers.lambdaQuery();
+        lqw.eq( InformRemindBusiness::getRemindId, bo.getId());
+        iInformRemindBusinessService.remove(lqw);
+        for (Long aLong : bo.getBusinessId()) {
+            InformRemindBusinessAddBo informRemindBusinessAddBo = new InformRemindBusinessAddBo();
+            informRemindBusinessAddBo.setRemindId(bo.getId());
+            informRemindBusinessAddBo.setBusinessId(aLong);
+            informRemindBusinessAddBo.setCreateTime(DateUtils.getNowTime());
+            informRemindBusinessAddBo.setUpdateTime(DateUtils.getNowTime());
+            iInformRemindBusinessService.insertByAddBo(informRemindBusinessAddBo);
+        }
         return this.updateById(update);
     }
 

+ 58 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformRemindBusinessVo.java

@@ -0,0 +1,58 @@
+package com.zhongzheng.modules.inform.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import java.util.Date;
+
+
+
+/**
+ * 提醒设置绑定业务视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2021-11-30
+ */
+@Data
+@ApiModel("提醒设置绑定业务视图对象")
+public class InformRemindBusinessVo {
+	private static final long serialVersionUID = 1L;
+
+	/** $pkColumn.columnComment */
+	@ApiModelProperty("$pkColumn.columnComment")
+	private Long id;
+
+	/** 业务ID */
+	@Excel(name = "业务ID")
+	@ApiModelProperty("业务ID")
+	private Long businessId;
+	/** 提醒设置ID */
+	@Excel(name = "提醒设置ID")
+	@ApiModelProperty("提醒设置ID")
+	private Long remindId;
+
+	/** 业务名称 */
+	@Excel(name = "业务名称")
+	@ApiModelProperty("业务名称")
+	private String businessName;
+
+	/** 教育类型id */
+	@Excel(name = "教育类型id")
+	@ApiModelProperty("教育类型id")
+	private Integer educationId;
+	/** 教育类型名称 */
+	@Excel(name = "教育类型名称")
+	@ApiModelProperty("教育类型名称")
+	private String educationName;
+
+	/** 项目名称 */
+	@Excel(name = "项目名称")
+	@ApiModelProperty("项目名称")
+	private String projectName;
+	/** 项目名称 */
+	@Excel(name = "项目ID")
+	@ApiModelProperty("项目ID")
+	private Integer projectId;
+}

+ 6 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformRemindVo.java

@@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import java.util.Date;
-
+import java.util.List;
 
 
 /**
@@ -44,4 +44,9 @@ public class InformRemindVo {
 	@Excel(name = "站内信 1启用 0未启用")
 	@ApiModelProperty("站内信 1启用 0未启用")
 	private Integer wayStatus;
+
+	/** 绑定业务*/
+	@Excel(name = "绑定业务")
+	@ApiModelProperty("绑定业务")
+	private List<InformRemindBusinessVo> informRemindBusiness;
 }

+ 46 - 0
zhongzheng-system/src/main/resources/mapper/modules/inform/InformRemindBusinessMapper.xml

@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zhongzheng.modules.inform.mapper.InformRemindBusinessMapper">
+
+    <resultMap type="com.zhongzheng.modules.inform.domain.InformRemindBusiness" id="InformRemindBusinessResult">
+        <result property="id" column="id"/>
+        <result property="businessId" column="business_id"/>
+        <result property="remindId" column="remind_id"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+    <resultMap type="com.zhongzheng.modules.inform.vo.InformRemindBusinessVo" id="InformRemindBusinessVo">
+        <result property="id" column="id"/>
+        <result property="businessId" column="business_id"/>
+        <result property="remindId" column="remind_id"/>
+        <result property="businessName" column="business_name"/>
+        <result property="educationId" column="education_id"/>
+        <result property="educationName" column="education_name"/>
+        <result property="projectName" column="project_name"/>
+        <result property="projectId" column="project_id"/>
+    </resultMap>
+
+    <select id="selectBusiness" parameterType="long"  resultMap="InformRemindBusinessVo">
+        SELECT
+            p.*,
+            b.business_name,
+            t.project_name,
+            t.id as project_id,
+            e.id as education_id,
+            e.education_name
+        FROM
+            inform_remind_business p
+                LEFT JOIN course_business b on b.id =p.business_id
+                LEFT JOIN course_project_type t on b.project_id=t.id
+                LEFT JOIN course_education_type e on t.education_id = e.id
+        WHERE
+            1 =1
+        and b.status = 1
+        <if test="id != null and id!=0 ">
+            AND p.remind_id = #{id}
+        </if>
+    </select>
+</mapper>