change 3 vuotta sitten
vanhempi
commit
2694f24be8

+ 11 - 11
zhongzheng-admin/src/main/java/com/zhongzheng/controller/inform/InformClassifyController.java

@@ -34,7 +34,7 @@ import io.swagger.annotations.ApiOperation;
  * @author ruoyi
  * @date 2021-11-23
  */
-@Api(value = "【请填写功能名称】控制器", tags = {"【请填写功能名称】管理"})
+@Api(value = "【通知分类】控制器", tags = {"【请填写功能名称】管理"})
 @RequiredArgsConstructor(onConstructor_ = @Autowired)
 @RestController
 @RequestMapping("/system/classify")
@@ -43,9 +43,9 @@ public class InformClassifyController extends BaseController {
     private final IInformClassifyService iInformClassifyService;
 
     /**
-     * 查询【请填写功能名称】列表
+     * 查询【通知分类】列表
      */
-    @ApiOperation("查询【请填写功能名称】列表")
+    @ApiOperation("查询【通知分类】列表")
     @PreAuthorize("@ss.hasPermi('system:classify:list')")
     @GetMapping("/list")
     public TableDataInfo<InformClassifyVo> list(InformClassifyQueryBo bo) {
@@ -56,9 +56,9 @@ public class InformClassifyController extends BaseController {
 
 
     /**
-     * 获取【请填写功能名称】详细信息
+     * 获取【通知分类】详细信息
      */
-    @ApiOperation("获取【请填写功能名称】详细信息")
+    @ApiOperation("获取【通知分类】详细信息")
     @PreAuthorize("@ss.hasPermi('system:classify:query')")
     @GetMapping("/{classifyId}")
     public AjaxResult<InformClassifyVo> getInfo(@PathVariable("classifyId" ) Long classifyId) {
@@ -66,22 +66,22 @@ public class InformClassifyController extends BaseController {
     }
 
     /**
-     * 新增【请填写功能名称
+     * 新增【通知分类
      */
-    @ApiOperation("新增【请填写功能名称】")
+    @ApiOperation("新增【通知分类】")
     @PreAuthorize("@ss.hasPermi('system:classify:add')")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @Log(title = "【通知分类】", businessType = BusinessType.INSERT)
     @PostMapping()
     public AjaxResult<Void> add(@RequestBody InformClassifyAddBo bo) {
         return toAjax(iInformClassifyService.insertByAddBo(bo) ? 1 : 0);
     }
 
     /**
-     * 修改【请填写功能名称
+     * 修改【通知分类
      */
-    @ApiOperation("修改【请填写功能名称】")
+    @ApiOperation("修改【通知分类】")
     @PreAuthorize("@ss.hasPermi('system:classify:edit')")
-    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @Log(title = "【通知分类】", businessType = BusinessType.UPDATE)
     @PostMapping("/edit")
     public AjaxResult<Void> edit(@RequestBody InformClassifyEditBo bo) {
         return toAjax(iInformClassifyService.updateByEditBo(bo) ? 1 : 0);

+ 17 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/inform/InformController.java

@@ -3,6 +3,9 @@ package com.zhongzheng.controller.inform;
 import java.util.List;
 import java.util.Arrays;
 
+import com.zhongzheng.modules.inform.bo.InformUserQueryBo;
+import com.zhongzheng.modules.inform.service.IInformUserService;
+import com.zhongzheng.modules.inform.vo.InformUserVo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,6 +45,8 @@ public class InformController extends BaseController {
 
     private final IInformService iInformService;
 
+    private final IInformUserService iInformUserService;
+
     /**
      * 查询【通知】列表
      */
@@ -54,6 +59,18 @@ public class InformController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询通知绑定学员列表
+     */
+    @ApiOperation("查询通知绑定学员列表")
+    @PreAuthorize("@ss.hasPermi('system:user:list')")
+    @GetMapping("/listInformUser")
+    public TableDataInfo<InformUserVo> list(InformUserQueryBo bo) {
+        startPage();
+        List<InformUserVo> list = iInformUserService.queryUserList(bo);
+        return getDataTable(list);
+    }
+
     /**
      * 获取【通知】详细信息
      */

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/mapper/InformUserMapper.java

@@ -1,7 +1,11 @@
 package com.zhongzheng.modules.inform.mapper;
 
+import com.zhongzheng.modules.inform.bo.InformUserQueryBo;
 import com.zhongzheng.modules.inform.domain.InformUser;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.inform.vo.InformUserVo;
+
+import java.util.List;
 
 /**
  * 通知绑定学员Mapper接口
@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface InformUserMapper extends BaseMapper<InformUser> {
 
+    List<InformUserVo> queryUserList(InformUserQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/IInformUserService.java

@@ -49,4 +49,6 @@ public interface IInformUserService extends IService<InformUser> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    List<InformUserVo> queryUserList(InformUserQueryBo bo);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/service/impl/InformUserServiceImpl.java

@@ -99,4 +99,9 @@ public class InformUserServiceImpl extends ServiceImpl<InformUserMapper, InformU
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public List<InformUserVo> queryUserList(InformUserQueryBo bo) {
+        return baseMapper.queryUserList(bo);
+    }
 }

+ 13 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/inform/vo/InformUserVo.java

@@ -44,4 +44,17 @@ public class InformUserVo {
 	@Excel(name = "已读回执 1已读 0未读")
 	@ApiModelProperty("$column.columnComment")
 	private Long informId;
+
+	@Excel(name = "学员姓名")
+	@ApiModelProperty("学员姓名")
+	private String realName;
+
+	@Excel(name = "电话")
+	@ApiModelProperty("电话")
+	private String telPhone;
+
+
+	@Excel(name = "班级名称")
+	@ApiModelProperty("班级名称")
+	private String className;
 }

+ 4 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -163,8 +163,10 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
                     subjectStudyRecordVo.setSectionType(sectionType.substring(0, sectionType.length() - 1));
                 }
             }
-            BigDecimal divide = new BigDecimal(studyLong.toString()).divide(new BigDecimal(secLong.toString()),2,BigDecimal.ROUND_HALF_UP);
-
+            BigDecimal divide =new BigDecimal("0");
+            if (secLong != 0) {
+                divide = new BigDecimal(studyLong.toString()).divide(new BigDecimal(secLong.toString()), 2, BigDecimal.ROUND_HALF_UP);
+            }
             goodsStudyRecordVo.setStudyNum(divide.multiply(new BigDecimal("100")).longValue());
             goodsStudyRecordVo.setSubjectStudyRecordVos(subjectStudyRecordVos);
             goodsStudyRecordVo.setSecAllNum(secLong);

+ 28 - 0
zhongzheng-system/src/main/resources/mapper/modules/inform/InformUserMapper.xml

@@ -14,5 +14,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.inform.vo.InformUserVo" id="InformUserVo">
+        <result property="id" column="id"/>
+        <result property="userId" column="user_id"/>
+        <result property="sendTime" column="send_time"/>
+        <result property="sendStatus" column="send_status"/>
+        <result property="receiptStatus" column="receipt_status"/>
+        <result property="realName" column="realname"/>
+        <result property="telPhone" column="telphone"/>
+        <result property="className" column="class_name"/>
+    </resultMap>
 
+    <select id="queryUserList" parameterType="com.zhongzheng.modules.inform.bo.InformUserQueryBo" resultMap="InformUserVo">
+        SELECT
+            iu.id,
+            iu.user_id,
+            (SELECT u.realname FROM `user` u where iu.user_id=u.user_id) as realname,
+            (SELECT u.telphone FROM `user` u where iu.user_id=u.user_id) as telphone,
+            (SELECT u.id_card FROM `user` u where iu.user_id=u.user_id) as id_card,
+            (SELECT cg.class_name FROM class_grade_user cgu LEFT JOIN class_grade cg on cgu.grade_id=cg.grade_id where cgu.user_id=iu.user_id) as class_name,
+            iu.send_time,
+            iu.send_status
+        FROM
+            inform_user iu
+        WHERE
+            1 =1
+        <if test="informId != null and informId != ''">
+            and iu.inform_id =  #{informId}
+        </if>
+    </select>
 </mapper>