瀏覽代碼

修改分页问题

Administrator 1 年之前
父節點
當前提交
a9fd7e4d30

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/investigate/InvestigateDispositionController.java

@@ -79,6 +79,17 @@ public class InvestigateDispositionController extends BaseController
         return toAjax(investigateDispositionService.insertInvestigateDisposition(investigateDisposition));
     }
 
+    /**
+     * 考察配置是否启用
+     */
+    @PreAuthorize("@ss.hasPermi('system:disposition:edit')")
+    @Log(title = "考察配置", businessType = BusinessType.UPDATE)
+    @PostMapping("/status")
+    public AjaxResult status(@RequestBody InvestigateDisposition investigateDisposition)
+    {
+        return toAjax(investigateDispositionService.updateInvestigateDispositionStatus(investigateDisposition));
+    }
+
     /**
      * 修改考察配置
      */

+ 27 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/InvestigateTable.java

@@ -48,6 +48,10 @@ public class InvestigateTable extends BaseEntity
     /** 访问密码 */
     @Excel(name = "访问密码")
     private String cipher;
+    /**
+     * 接待单位
+     */
+    private String receptionUnit;
     /**
      * 考察人员集合
      */
@@ -63,6 +67,26 @@ public class InvestigateTable extends BaseEntity
     private String investigateDispositionIds;
     /** 考察配置组接待指南 */
     private String investigateDispositionIdsJieDai;
+    /**
+     * 状态:未开始 进行中 已结束
+     */
+    private String type;
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getReceptionUnit() {
+        return receptionUnit;
+    }
+
+    public void setReceptionUnit(String receptionUnit) {
+        this.receptionUnit = receptionUnit;
+    }
 
     public String getInvestigateTableIds() {
         return investigateTableIds;
@@ -163,15 +187,18 @@ public class InvestigateTable extends BaseEntity
     public String toString() {
         return "InvestigateTable{" +
                 "investigateTableId=" + investigateTableId +
+                ", investigateTableIds='" + investigateTableIds + '\'' +
                 ", investigateName='" + investigateName + '\'' +
                 ", content='" + content + '\'' +
                 ", endTime=" + endTime +
                 ", beginTime=" + beginTime +
                 ", cipher='" + cipher + '\'' +
+                ", receptionUnit='" + receptionUnit + '\'' +
                 ", investigateUserList=" + investigateUserList +
                 ", investigateDispositionTableList=" + investigateDispositionTableList +
                 ", investigateDispositionIds='" + investigateDispositionIds + '\'' +
                 ", investigateDispositionIdsJieDai='" + investigateDispositionIdsJieDai + '\'' +
+                ", type='" + type + '\'' +
                 '}';
     }
 }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IInvestigateDispositionService.java

@@ -44,6 +44,7 @@ public interface IInvestigateDispositionService
      * @return 结果
      */
     public int updateInvestigateDisposition(InvestigateDisposition investigateDisposition);
+    public int updateInvestigateDispositionStatus(InvestigateDisposition investigateDisposition);
 
     /**
      * 批量删除考察配置

+ 11 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InvestigateDispositionServiceImpl.java

@@ -81,7 +81,11 @@ public class InvestigateDispositionServiceImpl implements IInvestigateDispositio
     private String getFileName(InvestigateDisposition investigateDisposition) {
         //获取HTML文件
         String content = investigateDisposition.getContent();
-        content = " <meta charset=\"utf-8\">" + content;
+        content = " <meta charset=\"utf-8\">\n" +
+                "<style>\n" +
+                " body{margin: 0 !important;}\n" +
+                "img{max-width: 100% !important;height: auto !important;}\n" +
+                "</style>" + content;
         String fileName = "";
         try {
             // 上传文件路径
@@ -137,6 +141,12 @@ public class InvestigateDispositionServiceImpl implements IInvestigateDispositio
         return investigateDispositionMapper.updateInvestigateDisposition(investigateDisposition);
     }
 
+    @Override
+    public int updateInvestigateDispositionStatus(InvestigateDisposition investigateDisposition) {
+        investigateDisposition.setUpdateTime(DateUtils.getNowDate());
+        return investigateDispositionMapper.updateInvestigateDisposition(investigateDisposition);
+    }
+
     /**
      * 修改子元素关系
      *

+ 2 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InvestigateDispositionTableServiceImpl.java

@@ -71,7 +71,7 @@ public class InvestigateDispositionTableServiceImpl implements IInvestigateDispo
         content = " <meta charset=\"utf-8\">\n" +
                 "<style>\n" +
                 " body{margin: 0 !important;}\n" +
-                " img{max-width: 100% !important;}\n" +
+                "img{max-width: 100% !important;height: auto !important;}\n" +
                 "</style>" + content;
         try {
             // 上传文件路径
@@ -113,7 +113,7 @@ public class InvestigateDispositionTableServiceImpl implements IInvestigateDispo
         content = " <meta charset=\"utf-8\">\n" +
                 "<style>\n" +
                 " body{margin: 0 !important;}\n" +
-                " img{max-width: 100% !important;}\n" +
+                "img{max-width: 100% !important;height: auto !important;}\n" +
                 "</style>" + content;
         try {
             // 上传文件路径

+ 20 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InvestigateTableServiceImpl.java

@@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl;
 import java.io.*;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.UUID;
 
@@ -100,6 +101,24 @@ public class InvestigateTableServiceImpl implements IInvestigateTableService {
             investigateTable.setInvestigateTableIds(substring);
             investigateTablesAll = investigateTableMapper.selectInvestigateTableListALL(investigateTable);
         }
+        if (investigateTablesAll != null && investigateTablesAll.size() > 0){
+            for (InvestigateTable table : investigateTablesAll) {
+                table.setType("进行中");
+                //根据开始时间结束时间计算状态
+                Date beginTime = table.getBeginTime();
+                Date endTime = table.getEndTime();
+                Date nowDate = DateUtils.getNowDate();
+                //默认进行中
+                if (nowDate.before(beginTime)){
+                    //未开始
+                    table.setType("未开始");
+
+                }else if (nowDate.after(endTime)){
+                    //已结束
+                    table.setType("已结束");
+                }
+            }
+        }
         TableDataInfo rspData = new TableDataInfo();
         rspData.setCode(HttpStatus.SUCCESS);
         rspData.setMsg("查询成功");
@@ -174,7 +193,7 @@ public class InvestigateTableServiceImpl implements IInvestigateTableService {
             content = " <meta charset=\"utf-8\">\n" +
                     "<style>\n" +
                     " body{margin: 0 !important;}\n" +
-                    " img{max-width: 100% !important;}\n" +
+                    " img{max-width: 100% !important;height: auto !important;}\n" +
                     "</style>" + content;
             try {
                 // 上传文件路径

+ 2 - 2
ruoyi-system/src/main/resources/mapper/system/InvestigateDispositionTableMapper.xml

@@ -93,9 +93,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
     <insert id="batchDispositionTable">
-        insert into investigate_disposition_table(investigate_table_id, investigate_disposition_id,url,content,title) values
+        insert into investigate_disposition_table(investigate_table_id, investigate_disposition_id,url,content,title,create_time) values
         <foreach item="item" index="index" collection="list" separator=",">
-            (#{item.investigateTableId},#{item.investigateDispositionId},#{item.url},#{item.content},#{item.title})
+            (#{item.investigateTableId},#{item.investigateDispositionId},#{item.url},#{item.content},#{item.title},sysdate())
         </foreach>
     </insert>
 </mapper>

+ 12 - 3
ruoyi-system/src/main/resources/mapper/system/InvestigateTableMapper.xml

@@ -11,6 +11,7 @@
         <result property="beginTime" column="begin_time"/>
         <result property="endTime" column="end_time"/>
         <result property="cipher" column="cipher"/>
+        <result property="receptionUnit" column="reception_unit"/>
         <result property="investigateDispositionIds" column="investigate_disposition_ids"/>
         <result property="investigateDispositionIdsJieDai" column="investigate_disposition_ids_jie_dai"/>
         <result property="createBy" column="create_by"/>
@@ -53,6 +54,7 @@
                investigate_disposition_ids,
                investigate_disposition_ids_jie_dai,
                cipher,
+               reception_unit,
                create_by,
                create_time,
                update_by,
@@ -70,7 +72,8 @@
         t.begin_time,
         t.investigate_disposition_ids,
         t.investigate_disposition_ids_jie_dai,
-        t.CIPHER,
+        t.cipher,
+        t.reception_unit,
         t.create_by,
         t.create_time,
         t.update_by,
@@ -97,7 +100,8 @@
         t.begin_time,
         t.investigate_disposition_ids,
         t.investigate_disposition_ids_jie_dai,
-        t.CIPHER,
+        t.cipher,
+        t.reception_unit,
         t.create_by,
         t.create_time,
         t.update_by,
@@ -136,7 +140,8 @@
             t.begin_time,
             t.investigate_disposition_ids,
             t.investigate_disposition_ids_jie_dai,
-            t.CIPHER,
+            t.cipher,
+            t.reception_unit,
             t.create_by,
             t.create_time,
             t.update_by,
@@ -157,6 +162,7 @@
                 left join investigate_user u on t.investigate_table_id = u.investigate_id
                 left join investigate_disposition_table idt on idt.investigate_table_id = t.investigate_table_id
         where t.investigate_table_id = #{investigateTableId}
+        order by  idt.create_time
     </select>
 
     <insert id="insertInvestigateTable" parameterType="InvestigateTable" useGeneratedKeys="true"
@@ -170,6 +176,7 @@
             <if test="investigateDispositionIds != null">investigate_disposition_ids,</if>
             <if test="investigateDispositionIdsJieDai != null">investigate_disposition_ids_jie_dai,</if>
             <if test="cipher != null">cipher,</if>
+            <if test="receptionUnit != null">reception_unit,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
@@ -184,6 +191,7 @@
             <if test="investigateDispositionIds != null">#{investigateDispositionIds},</if>
             <if test="investigateDispositionIdsJieDai != null">#{investigateDispositionIdsJieDai},</if>
             <if test="cipher != null">#{cipher},</if>
+            <if test="receptionUnit != null">#{receptionUnit},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
@@ -202,6 +210,7 @@
             <if test="investigateDispositionIds != null">investigate_disposition_ids = #{investigateDispositionIds},</if>
             <if test="investigateDispositionIdsJieDai != null">investigate_disposition_ids_jie_dai = #{investigateDispositionIdsJieDai},</if>
             <if test="cipher != null">cipher = #{cipher},</if>
+            <if test="receptionUnit != null">reception_unit = #{receptionUnit},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="updateBy != null">update_by = #{updateBy},</if>