Browse Source

fix 测试后修改BUG

tjf 3 years ago
parent
commit
ad095b156c
27 changed files with 560 additions and 181 deletions
  1. 34 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/IndexController.java
  2. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/QueryConfigController.java
  3. 23 4
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/QueryController.java
  4. 1 1
      ruoyi-admin/src/main/resources/application.yml
  5. 1 1
      ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java
  6. 21 0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java
  7. 14 1
      ruoyi-system/src/main/java/com/ruoyi/system/domain/InspectInfor.java
  8. 9 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/ColumnNewsMapper.java
  9. 11 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/InspectInforMapper.java
  10. 7 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/QueryConfigMapper.java
  11. 10 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/ReportDetailMapper.java
  12. 10 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/ReportQueryLogMapper.java
  13. 15 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IIndexService.java
  14. 4 2
      ruoyi-system/src/main/java/com/ruoyi/system/service/IQueryConfigService.java
  15. 2 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AlicomMessageListenterServiceImpl.java
  16. 106 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IndexServiceImpl.java
  17. 36 4
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QueryConfigServiceImpl.java
  18. 73 46
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QueryServiceImpl.java
  19. 9 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ReportDetailServiceImpl.java
  20. 4 2
      ruoyi-system/src/main/resources/mapper/system/ColumnNavigationBarMapper.xml
  21. 31 20
      ruoyi-system/src/main/resources/mapper/system/ColumnNewsMapper.xml
  22. 23 23
      ruoyi-system/src/main/resources/mapper/system/FriendLinkMapper.xml
  23. 29 28
      ruoyi-system/src/main/resources/mapper/system/ImageDataMapper.xml
  24. 20 5
      ruoyi-system/src/main/resources/mapper/system/InspectInforMapper.xml
  25. 38 29
      ruoyi-system/src/main/resources/mapper/system/QueryConfigMapper.xml
  26. 14 12
      ruoyi-system/src/main/resources/mapper/system/ReportDetailMapper.xml
  27. 13 1
      ruoyi-system/src/main/resources/mapper/system/ReportQueryLogMapper.xml

+ 34 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/IndexController.java

@@ -0,0 +1,34 @@
+package com.ruoyi.web.controller.system;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.domain.QueryConfig;
+import com.ruoyi.system.service.IIndexService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author tjf
+ * @Date: 2021/12/31/11:04
+ */
+@RestController
+@RequestMapping("/system/index")
+public class IndexController extends BaseController {
+
+
+    @Autowired
+    private IIndexService iIndexService;
+
+    /**
+     * 后台首页
+     *
+     * @return
+     */
+    @PostMapping
+    public AjaxResult index() {
+        return iIndexService.getIndex();
+    }
+}

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/QueryConfigController.java

@@ -78,7 +78,7 @@ public class QueryConfigController extends BaseController
     public AjaxResult add(@RequestBody QueryConfig queryConfig)
     public AjaxResult add(@RequestBody QueryConfig queryConfig)
     {
     {
         queryConfig.setCreateBy(getUsername());
         queryConfig.setCreateBy(getUsername());
-        return toAjax(queryConfigService.insertQueryConfig(queryConfig));
+        return queryConfigService.insertQueryConfig(queryConfig);
     }
     }
 
 
     /**
     /**
@@ -90,7 +90,7 @@ public class QueryConfigController extends BaseController
     public AjaxResult edit(@RequestBody QueryConfig queryConfig)
     public AjaxResult edit(@RequestBody QueryConfig queryConfig)
     {
     {
         queryConfig.setUpdateBy(getUsername());
         queryConfig.setUpdateBy(getUsername());
-        return toAjax(queryConfigService.updateQueryConfig(queryConfig));
+        return queryConfigService.updateQueryConfig(queryConfig);
     }
     }
 
 
     /**
     /**

+ 23 - 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/QueryController.java

@@ -7,16 +7,18 @@ import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.ColumnNavigationBar;
 import com.ruoyi.common.core.domain.entity.ColumnNavigationBar;
 import com.ruoyi.common.core.domain.entity.ColumnNews;
 import com.ruoyi.common.core.domain.entity.ColumnNews;
+import com.ruoyi.common.core.domain.entity.SysDictData;
 import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.common.utils.file.FileUploadUtils;
 import com.ruoyi.framework.config.ServerConfig;
 import com.ruoyi.framework.config.ServerConfig;
 import com.ruoyi.system.domain.*;
 import com.ruoyi.system.domain.*;
 import com.ruoyi.system.service.*;
 import com.ruoyi.system.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
 /**门户接口,对外开放
 /**门户接口,对外开放
@@ -49,10 +51,12 @@ public class QueryController extends BaseController {
     @Autowired
     @Autowired
     private IInspectInforService inspectInforService;
     private IInspectInforService inspectInforService;
 
 
-
     @Autowired
     @Autowired
     private ServerConfig serverConfig;
     private ServerConfig serverConfig;
 
 
+    @Autowired
+    private ISysDictTypeService dictTypeService;
+
     /**
     /**
      * 门户查询报告信息
      * 门户查询报告信息
      */
      */
@@ -102,7 +106,7 @@ public class QueryController extends BaseController {
      */
      */
     @PostMapping("/sendInspectInFor")
     @PostMapping("/sendInspectInFor")
     @RepeatSubmit
     @RepeatSubmit
-    public AjaxResult sendInspectInFor(@RequestBody InspectInfor inspectInfor)
+    public AjaxResult sendInspectInFor(InspectInfor inspectInfor)
     {
     {
         if (UserConstants.NOT_UNIQUE.equals(inspectInforService.checkSampleNameUnique(inspectInfor)))
         if (UserConstants.NOT_UNIQUE.equals(inspectInforService.checkSampleNameUnique(inspectInfor)))
         {
         {
@@ -177,7 +181,7 @@ public class QueryController extends BaseController {
      */
      */
     @PostMapping("/getCode")
     @PostMapping("/getCode")
     @RepeatSubmit
     @RepeatSubmit
-    public AjaxResult getCode(@Validated @RequestBody ReportQueryLog reportQueryLog)
+    public AjaxResult getCode( ReportQueryLog reportQueryLog)
     {
     {
         return queryService.sendSms(reportQueryLog);
         return queryService.sendSms(reportQueryLog);
     }
     }
@@ -207,4 +211,19 @@ public class QueryController extends BaseController {
             return AjaxResult.error(e.getMessage());
             return AjaxResult.error(e.getMessage());
         }
         }
     }
     }
+
+
+    /**
+     * 根据字典类型查询字典数据信息
+     */
+    @GetMapping(value = "/type/{dictType}")
+    public AjaxResult dictType(@PathVariable String dictType)
+    {
+        List<SysDictData> data = dictTypeService.selectDictDataByType(dictType);
+        if (StringUtils.isNull(data))
+        {
+            data = new ArrayList<SysDictData>();
+        }
+        return AjaxResult.success(data);
+    }
 }
 }

+ 1 - 1
ruoyi-admin/src/main/resources/application.yml

@@ -118,7 +118,7 @@ xss:
   # 过滤开关
   # 过滤开关
   enabled: true
   enabled: true
   # 排除链接(多个用逗号分隔)
   # 排除链接(多个用逗号分隔)
-  excludes: /system/notice
+  excludes: /system/notice,/system/news
   # 匹配链接
   # 匹配链接
   urlPatterns: /system/*,/monitor/*,/tool/*
   urlPatterns: /system/*,/monitor/*,/tool/*
 
 

+ 1 - 1
ruoyi-common/src/main/java/com/ruoyi/common/constant/UserConstants.java

@@ -89,7 +89,7 @@ public class UserConstants
     /**
     /**
      * 门户查询方式二维码查询
      * 门户查询方式二维码查询
      */
      */
-    public static final String QUERY_MODE_EQ = "0";
+    public static final String QUERY_MODE_QR = "0";
 
 
     /**
     /**
      * 门户查询方式粗略查询
      * 门户查询方式粗略查询

+ 21 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/DateUtils.java

@@ -3,7 +3,13 @@ package com.ruoyi.common.utils;
 import java.lang.management.ManagementFactory;
 import java.lang.management.ManagementFactory;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.Date;
+import java.util.List;
+
 import org.apache.commons.lang3.time.DateFormatUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 
 
 /**
 /**
@@ -158,4 +164,19 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         // long sec = diff % nd % nh % nm / ns;
         // long sec = diff % nd % nh % nm / ns;
         return day + "天" + hour + "小时" + min + "分钟";
         return day + "天" + hour + "小时" + min + "分钟";
     }
     }
+
+    /**
+     *
+     * @param begin 开始日期
+     * @param end 结束日期
+     * @return 开始与结束之间的所以日期,包括起止
+     */
+    public static List<LocalDate> getMiddleDate(LocalDate begin, LocalDate end) {
+        List<LocalDate> localDateList = new ArrayList<>();
+        long length = end.toEpochDay() - begin.toEpochDay();
+        for (long i = length; i >= 0; i--) {
+            localDateList.add(end.minusDays(i));
+        }
+        return localDateList;
+    }
 }
 }

+ 14 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/InspectInfor.java

@@ -53,12 +53,25 @@ public class InspectInfor extends BaseEntity
     /** 委托单位电话 */
     /** 委托单位电话 */
     @Excel(name = "受检单位电话")
     @Excel(name = "受检单位电话")
     private String inspectedPhone;
     private String inspectedPhone;
+    /**
+     * 是否未生成报告
+     */
+    @Excel(name = "是否未生成报告", readConverterExp = "N=生成,Y=未生成")
+    private String isReport;
 
 
     /** 是否删除(N正常 Y删除) */
     /** 是否删除(N正常 Y删除) */
     @Excel(name = "是否删除", readConverterExp = "N=正常,Y=删除")
     @Excel(name = "是否删除", readConverterExp = "N=正常,Y=删除")
     private String isDel;
     private String isDel;
 
 
-    public void setInspectId(Long inspectId) 
+    public String getIsReport() {
+        return isReport;
+    }
+
+    public void setIsReport(String isReport) {
+        this.isReport = isReport;
+    }
+
+    public void setInspectId(Long inspectId)
     {
     {
         this.inspectId = inspectId;
         this.inspectId = inspectId;
     }
     }

+ 9 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ColumnNewsMapper.java

@@ -1,7 +1,10 @@
 package com.ruoyi.system.mapper;
 package com.ruoyi.system.mapper;
 
 
+import java.time.LocalDate;
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 import com.ruoyi.common.core.domain.entity.ColumnNews;
 import com.ruoyi.common.core.domain.entity.ColumnNews;
+import org.apache.ibatis.annotations.Param;
 
 
 /**
 /**
  * 新闻信息Mapper接口
  * 新闻信息Mapper接口
@@ -86,4 +89,10 @@ public interface ColumnNewsMapper
      * @return
      * @return
      */
      */
     public int examineColumnNews(Integer newsId);
     public int examineColumnNews(Integer newsId);
+
+    /**
+     * 查询发布文章数量
+     * @return
+     */
+    int selectColumnNewsCount(@Param("today") LocalDate today,@Param("startTime") LocalDate startTime, @Param("endTime") LocalDate endTime);
 }
 }

+ 11 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/InspectInforMapper.java

@@ -1,5 +1,7 @@
 package com.ruoyi.system.mapper;
 package com.ruoyi.system.mapper;
 
 
+import java.time.LocalDate;
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 import com.ruoyi.system.domain.InspectInfor;
 import com.ruoyi.system.domain.InspectInfor;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -66,4 +68,13 @@ public interface InspectInforMapper
      * @return
      * @return
      */
      */
     InspectInfor checkSampleNameUnique(@Param("sampleName") String sampleName);
     InspectInfor checkSampleNameUnique(@Param("sampleName") String sampleName);
+
+
+    /**
+     * 查询送检次数
+     * @param startTime
+     * @param endTime
+     * @return
+     */
+   int selectInspectInforCount(@Param("today") LocalDate today,@Param("startTime") LocalDate startTime,@Param("endTime") LocalDate endTime);
 }
 }

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/QueryConfigMapper.java

@@ -65,4 +65,11 @@ public interface QueryConfigMapper
      * @return 结果
      * @return 结果
      */
      */
     public int deleteQueryConfigByConfigIds(Long[] configIds);
     public int deleteQueryConfigByConfigIds(Long[] configIds);
+
+    /**
+     * 根据主体和方式查看该配置是否存在
+     * @param queryConfig
+     * @return
+     */
+    public int selectQueryConfigByTypeAndMode(QueryConfig queryConfig);
 }
 }

+ 10 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ReportDetailMapper.java

@@ -1,7 +1,10 @@
 package com.ruoyi.system.mapper;
 package com.ruoyi.system.mapper;
 
 
+import java.time.LocalDate;
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 import com.ruoyi.system.domain.ReportDetail;
 import com.ruoyi.system.domain.ReportDetail;
+import org.apache.ibatis.annotations.Param;
 
 
 /**
 /**
  * 报告信息Mapper接口
  * 报告信息Mapper接口
@@ -80,4 +83,11 @@ public interface ReportDetailMapper
      * @return
      * @return
      */
      */
     ReportDetail selectReportDetailByReportNumberDetail(String reportNumber);
     ReportDetail selectReportDetailByReportNumberDetail(String reportNumber);
+
+    /**
+     * 查询报告生成次数
+     * @return
+     */
+    int selectReportDetailCount(@Param("today") LocalDate today,@Param("startTime") LocalDate startTime, @Param("endTime") LocalDate endTime);
+
 }
 }

+ 10 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/ReportQueryLogMapper.java

@@ -1,7 +1,10 @@
 package com.ruoyi.system.mapper;
 package com.ruoyi.system.mapper;
 
 
+import java.time.LocalDate;
+import java.util.Date;
 import java.util.List;
 import java.util.List;
 import com.ruoyi.system.domain.ReportQueryLog;
 import com.ruoyi.system.domain.ReportQueryLog;
+import org.apache.ibatis.annotations.Param;
 
 
 /**
 /**
  * 查询日志Mapper接口
  * 查询日志Mapper接口
@@ -58,4 +61,11 @@ public interface ReportQueryLogMapper
      * @return 结果
      * @return 结果
      */
      */
     public int deleteReportQueryLogByLogIds(Long[] logIds);
     public int deleteReportQueryLogByLogIds(Long[] logIds);
+
+    /**
+     * 查询查询次数
+     * @return
+     */
+    int selectReportQueryLogCount(@Param("today") LocalDate today,@Param("startTime") LocalDate startTime, @Param("endTime") LocalDate endTime);
+
 }
 }

+ 15 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IIndexService.java

@@ -0,0 +1,15 @@
+package com.ruoyi.system.service;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+
+/**
+ * @author tjf
+ * @Date: 2021/12/31/11:06
+ */
+public interface IIndexService {
+    /**
+     * 获取后台首页
+     * @return
+     */
+    AjaxResult getIndex();
+}

+ 4 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/IQueryConfigService.java

@@ -1,6 +1,8 @@
 package com.ruoyi.system.service;
 package com.ruoyi.system.service;
 
 
 import java.util.List;
 import java.util.List;
+
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.system.domain.QueryConfig;
 import com.ruoyi.system.domain.QueryConfig;
 
 
 /**
 /**
@@ -33,7 +35,7 @@ public interface IQueryConfigService
      * @param queryConfig 查询配置
      * @param queryConfig 查询配置
      * @return 结果
      * @return 结果
      */
      */
-    public int insertQueryConfig(QueryConfig queryConfig);
+    public AjaxResult insertQueryConfig(QueryConfig queryConfig);
 
 
     /**
     /**
      * 修改查询配置
      * 修改查询配置
@@ -41,7 +43,7 @@ public interface IQueryConfigService
      * @param queryConfig 查询配置
      * @param queryConfig 查询配置
      * @return 结果
      * @return 结果
      */
      */
-    public int updateQueryConfig(QueryConfig queryConfig);
+    public AjaxResult updateQueryConfig(QueryConfig queryConfig);
 
 
     /**
     /**
      * 批量删除查询配置
      * 批量删除查询配置

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

@@ -64,6 +64,8 @@ public class AlicomMessageListenterServiceImpl implements AlicomMessageListenter
                     if ("OK".equals(ok)){
                     if ("OK".equals(ok)){
                         //设置查询码10分钟有效期
                         //设置查询码10分钟有效期
                         redisCache.setCacheObject(UserConstants.QUERY_NUM_KEY + phone,code,10, TimeUnit.MINUTES);
                         redisCache.setCacheObject(UserConstants.QUERY_NUM_KEY + phone,code,10, TimeUnit.MINUTES);
+                        //删除询问查询码key
+                        redisCache.deleteObject(verifyKey);
                     }
                     }
                 }
                 }
             }
             }

+ 106 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/IndexServiceImpl.java

@@ -0,0 +1,106 @@
+package com.ruoyi.system.service.impl;
+
+import com.aliyun.mns.common.utils.DateUtil;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.system.mapper.ColumnNewsMapper;
+import com.ruoyi.system.mapper.InspectInforMapper;
+import com.ruoyi.system.mapper.ReportDetailMapper;
+import com.ruoyi.system.mapper.ReportQueryLogMapper;
+import com.ruoyi.system.service.IIndexService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.DecimalFormat;
+import java.time.LocalDate;
+import java.util.*;
+
+/**
+ * @author tjf
+ * @Date: 2021/12/31/11:06
+ */
+@Service
+public class IndexServiceImpl implements IIndexService {
+    @Autowired
+    private InspectInforMapper inspectInforMapper;
+    @Autowired
+    private ReportDetailMapper reportDetailMapper;
+    @Autowired
+    private ReportQueryLogMapper reportQueryLogMapper;
+    @Autowired
+    private ColumnNewsMapper columnNewsMapper;
+
+    /**
+     * 获取后台首页
+     *
+     * @return
+     */
+    @Override
+    public AjaxResult getIndex() {
+        Map<String, Object> map = new HashMap<>();
+        LocalDate nowDate = LocalDate.now();
+        DecimalFormat df = new DecimalFormat("00.0%");
+        //全部送检数量
+        int inspectNum = inspectInforMapper.selectInspectInforCount(null, null, null);
+        //今日送检数量
+        int inspectTodayNum = inspectInforMapper.selectInspectInforCount(nowDate, null, null);
+        String inspect = "00.0%";
+        if (inspectNum > 0) {
+            inspect = df.format(inspectTodayNum / inspectNum);
+        }
+        //全部报告数量
+        int reportDetailNum = reportDetailMapper.selectReportDetailCount(null, null, null);
+        //今日报告数量
+        int reportDetailTodayNum = reportDetailMapper.selectReportDetailCount(nowDate, null, null);
+        String reportDetail = "00.0%";
+        if (reportDetailNum > 0) {
+            reportDetail = df.format(reportDetailTodayNum / reportDetailNum);
+        }
+        //查询总次数
+        int reportQueryLogNum = reportQueryLogMapper.selectReportQueryLogCount(null, null, null);
+        //今日查询次数
+        int reportQueryLogTodayNum = reportQueryLogMapper.selectReportQueryLogCount(nowDate, null, null);
+        String reportQueryLog = "00.0%";
+        if (reportQueryLogNum > 0) {
+            reportQueryLog = df.format(reportQueryLogTodayNum / reportQueryLogNum);
+        }
+        //总发文数量
+        int columnNewsNum = columnNewsMapper.selectColumnNewsCount(null, null, null);
+        //今日发文数量
+        int columnNewsTodayNum = columnNewsMapper.selectColumnNewsCount(nowDate, null, null);
+        String columnNews = "00.0%";
+        if (columnNewsNum > 0) {
+            columnNews = df.format(columnNewsTodayNum / columnNewsNum);
+        }
+        //前一周的所有时间
+        List<LocalDate> middleDate = DateUtils.getMiddleDate(nowDate.minusWeeks(1), nowDate);
+        List<Integer> inspectNumDate = new ArrayList<>();
+        List<Integer> reportDetailNumDate = new ArrayList<>();
+        List<Integer> columnNewsNumDate = new ArrayList<>();
+        List<Integer> reportQueryLogNumDate = new ArrayList<>();
+        for (LocalDate localDate : middleDate) {
+            inspectNumDate.add(inspectInforMapper.selectInspectInforCount(localDate, null, null));
+            reportDetailNumDate.add(reportDetailMapper.selectReportDetailCount(localDate, null, null));
+            reportQueryLogNumDate.add(reportQueryLogMapper.selectReportQueryLogCount(localDate, null, null));
+            columnNewsNumDate.add(columnNewsMapper.selectColumnNewsCount(localDate, null, null));
+        }
+        map.put("inspectNum",inspectNum);
+        map.put("inspectTodayNum",inspectTodayNum);
+        map.put("inspect",reportDetail);
+        map.put("reportDetailNum",reportDetailNum);
+        map.put("reportDetailTodayNum",reportDetailTodayNum);
+        map.put("reportDetail",reportDetail);
+        map.put("reportQueryLogNum",reportQueryLogNum);
+        map.put("reportQueryLogTodayNum",reportQueryLogTodayNum);
+        map.put("reportQueryLog",reportQueryLog);
+        map.put("columnNewsNum",columnNewsNum);
+        map.put("columnNewsTodayNum",columnNewsTodayNum);
+        map.put("columnNews",columnNews);
+        map.put("x",middleDate);
+        map.put("inspectNumDate",inspectNumDate);
+        map.put("reportDetailNumDate",reportDetailNumDate);
+        map.put("columnNewsNumDate",columnNewsNumDate);
+        map.put("reportQueryLogNumDate",reportQueryLogNumDate);
+        return AjaxResult.success(map);
+    }
+}

+ 36 - 4
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QueryConfigServiceImpl.java

@@ -1,7 +1,11 @@
 package com.ruoyi.system.service.impl;
 package com.ruoyi.system.service.impl;
 
 
 import java.util.List;
 import java.util.List;
+
+import com.ruoyi.common.constant.UserConstants;
+import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import com.ruoyi.system.mapper.QueryConfigMapper;
 import com.ruoyi.system.mapper.QueryConfigMapper;
@@ -51,10 +55,25 @@ public class QueryConfigServiceImpl implements IQueryConfigService
      * @return 结果
      * @return 结果
      */
      */
     @Override
     @Override
-    public int insertQueryConfig(QueryConfig queryConfig)
+    public AjaxResult insertQueryConfig(QueryConfig queryConfig)
     {
     {
         queryConfig.setCreateTime(DateUtils.getNowDate());
         queryConfig.setCreateTime(DateUtils.getNowDate());
-        return queryConfigMapper.insertQueryConfig(queryConfig);
+         //一种方式只能有一个数据
+        //查询对应的主题和方式是否存在
+        int rows = queryConfigMapper.selectQueryConfigByTypeAndMode(queryConfig);
+        if ( rows > 0){
+            return AjaxResult.error("该类型已存在,请勿重复添加");
+        }
+        if (queryConfig.getQueryMode().equals(UserConstants.QUERY_MODE_QR)){
+            String qrTime = queryConfig.getQrTime();
+            String qrUnit = queryConfig.getQrUnit();
+            if (StringUtils.isBlank(qrTime) || StringUtils.isBlank(qrUnit)){
+                return  AjaxResult.error("二维码失效时间和单位必须填写");
+            }
+        }
+        int row = queryConfigMapper.insertQueryConfig(queryConfig);
+
+        return row > 0?AjaxResult.success():AjaxResult.error();
     }
     }
 
 
     /**
     /**
@@ -64,10 +83,23 @@ public class QueryConfigServiceImpl implements IQueryConfigService
      * @return 结果
      * @return 结果
      */
      */
     @Override
     @Override
-    public int updateQueryConfig(QueryConfig queryConfig)
+    public AjaxResult updateQueryConfig(QueryConfig queryConfig)
     {
     {
         queryConfig.setUpdateTime(DateUtils.getNowDate());
         queryConfig.setUpdateTime(DateUtils.getNowDate());
-        return queryConfigMapper.updateQueryConfig(queryConfig);
+        int rows = queryConfigMapper.selectQueryConfigByTypeAndMode(queryConfig);
+        if ( rows > 0){
+            return AjaxResult.error("该类型已存在,请勿重复添加");
+        }
+        if (queryConfig.getQueryMode().equals(UserConstants.QUERY_MODE_QR)){
+            String qrTime = queryConfig.getQrTime();
+            String qrUnit = queryConfig.getQrUnit();
+            if (StringUtils.isBlank(qrTime) || StringUtils.isBlank(qrUnit)){
+                return  AjaxResult.error("二维码失效时间和单位必须填写");
+            }
+        }
+        int row = queryConfigMapper.updateQueryConfig(queryConfig);
+        return row > 0?AjaxResult.success():AjaxResult.error();
+
     }
     }
 
 
     /**
     /**

+ 73 - 46
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/QueryServiceImpl.java

@@ -73,14 +73,14 @@ public class QueryServiceImpl implements IQueryService {
     @Override
     @Override
     public AjaxResult selectReport(ReportQueryLog reportQueryLog) {
     public AjaxResult selectReport(ReportQueryLog reportQueryLog) {
         //通用校验
         //通用校验
-        AjaxResult validateResult = queryPublic(reportQueryLog);
+        AjaxResult validateResult = queryPublic(reportQueryLog,true);
         if (!UserConstants.QUERY_SUCCESS.equals(validateResult.get(MSG_TAG))) {
         if (!UserConstants.QUERY_SUCCESS.equals(validateResult.get(MSG_TAG))) {
             return validateResult;
             return validateResult;
         }
         }
         //获取查询方式
         //获取查询方式
         String queryMode = reportQueryLog.getQueryMode();
         String queryMode = reportQueryLog.getQueryMode();
         //二维码查询
         //二维码查询
-        if (UserConstants.QUERY_MODE_EQ.equals(queryMode)) {
+        if (UserConstants.QUERY_MODE_QR.equals(queryMode)) {
             return queryByQr(reportQueryLog);
             return queryByQr(reportQueryLog);
             //粗略查询
             //粗略查询
         } else if (UserConstants.QUERY_MODE_ROUGH.equals(queryMode)) {
         } else if (UserConstants.QUERY_MODE_ROUGH.equals(queryMode)) {
@@ -156,8 +156,8 @@ public class QueryServiceImpl implements IQueryService {
      */
      */
     @Override
     @Override
     public AjaxResult sendQueryNum(ReportQueryLog reportQueryLog) {
     public AjaxResult sendQueryNum(ReportQueryLog reportQueryLog) {
-        //发送查询码前,先校验验证码是否通过
-        AjaxResult result = queryPublic(reportQueryLog);
+        //发送查询码前,先校验验证码是否通过,且不删除redis中key
+        AjaxResult result = queryPublic(reportQueryLog,false);
         if (!UserConstants.QUERY_SUCCESS.equals(result.get(MSG_TAG))) {
         if (!UserConstants.QUERY_SUCCESS.equals(result.get(MSG_TAG))) {
             return result;
             return result;
         }
         }
@@ -165,38 +165,47 @@ public class QueryServiceImpl implements IQueryService {
         String reportNumber = reportQueryLog.getReportNumber();
         String reportNumber = reportQueryLog.getReportNumber();
         if (StringUtils.isNotBlank(reportNumber)) {
         if (StringUtils.isNotBlank(reportNumber)) {
             ReportDetail reportDetail = reportDetailMapper.selectReportDetailByReportNumberDetail(reportNumber);
             ReportDetail reportDetail = reportDetailMapper.selectReportDetailByReportNumberDetail(reportNumber);
-            //档案拥有者的手机号码
-            String phonenumber = reportDetail.getPhonenumber();
-            if (StringUtils.isNotBlank(phonenumber)) {
-                //给文档创建人发送询问短信
-                try {
-                    String queryType = reportQueryLog.getQueryType();
-                    StringBuilder sb = new StringBuilder();
-                    String phone = "";
-                    if (UserConstants.QUERY_TYPE_PEOPLE.equals(queryType)) {
-                        sb.append(reportQueryLog.getQueryName()).append("(个人)");
-                        phone = reportQueryLog.getQueryPhone();
+            if (reportDetail != null){
+                //档案拥有者的手机号码
+                String phonenumber = reportDetail.getPhonenumber();
+                if (StringUtils.isNotBlank(phonenumber)) {
+                    //给文档创建人发送询问短信
+                    try {
+                        String queryType = reportQueryLog.getQueryType();
+                        StringBuilder sb = new StringBuilder();
+                        String phone = "";
+                        if (UserConstants.QUERY_TYPE_PEOPLE.equals(queryType)) {
+                            sb.append(reportQueryLog.getQueryName()).append("(个人)");
+                            phone = reportQueryLog.getQueryPhone();
+                        }
+                        if (UserConstants.QUERY_TYPE_UNIT.equals(queryType)) {
+                            sb.append(reportQueryLog.getCompanyName()).append("(单位)");
+                            phone = reportQueryLog.getCompanyPhone();
+                        }
+                        //"{\"code\":\"" + code + "\"}"
+                        //"{\"name\":\"" + sb.toString() + "\",\"reportNumber\":\"" + reportNumber + "\"}"
+                        String code = "1234";
+                        SendSmsResponse sendSmsResponse = SendSmsUtils.sendSms(phonenumber, "{\"code\":\"" + code + "\"}", accessKeyId, accessKeySecret, signNameQuery, templateCodeQuery);
+                        QuerySendDetailsResponse querySendDetailsResponse = SendSmsUtils.querySendDetails(sendSmsResponse.getBizId(), phonenumber, accessKeyId, accessKeySecret);
+                        String ok = querySendDetailsResponse.getCode();
+                        if ("OK".equals(ok)) {
+                            //redis存储查询人的手机号码
+                            redisCache.setCacheObject(UserConstants.QUERY_NUM_CREATE + phonenumber, phone, 30, TimeUnit.MINUTES);
+                            return AjaxResult.success("发送成功,请等待对方回复");
+                        } else {
+                            return AjaxResult.error(querySendDetailsResponse.getMessage());
+                        }
+                    } catch (ClientException e) {
+                        e.printStackTrace();
                     }
                     }
-                    if (UserConstants.QUERY_TYPE_UNIT.equals(queryType)) {
-                        sb.append(reportQueryLog.getCompanyName()).append("(单位)");
-                        phone = reportQueryLog.getCompanyPhone();
-                    }
-                    SendSmsResponse sendSmsResponse = SendSmsUtils.sendSms(phonenumber, "{\"name\":\"" + sb.toString() + "\",\"reportNumber\":\"" + reportNumber + "\"}", accessKeyId, accessKeySecret, signNameQuery, templateCodeQuery);
-                    QuerySendDetailsResponse querySendDetailsResponse = SendSmsUtils.querySendDetails(sendSmsResponse.getBizId(), phonenumber, accessKeyId, accessKeySecret);
-                    String ok = querySendDetailsResponse.getCode();
-                    if ("OK".equals(ok)) {
-                        //redis存储查询人的手机号码
-                        redisCache.setCacheObject(UserConstants.QUERY_NUM_CREATE + phonenumber, phone, 30, TimeUnit.MINUTES);
-                        return AjaxResult.success("发送成功,请等待对方回复");
-                    } else {
-                        return AjaxResult.error(querySendDetailsResponse.getMessage());
-                    }
-                } catch (ClientException e) {
-                    e.printStackTrace();
+                }else {
+                    return AjaxResult.error("文档拥有者暂未填写手机号,无法获得查询码");
                 }
                 }
+            }else {
+                return AjaxResult.error("查询的文档编号不存在");
             }
             }
         }
         }
-        return null;
+        return AjaxResult.error("未填写查询报告编号");
     }
     }
 
 
     /**
     /**
@@ -233,14 +242,18 @@ public class QueryServiceImpl implements IQueryService {
                 return AjaxResult.error(remark);
                 return AjaxResult.error(remark);
             }
             }
             ReportDetail reportDetail = reportDetailMapper.selectReportDetailByReportNumber(reportNumber);
             ReportDetail reportDetail = reportDetailMapper.selectReportDetailByReportNumber(reportNumber);
-            reportDetail.setReportUrl(null);
-            reportQueryLog.setIsSuccess("0");
-            reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
-            return AjaxResult.success(reportDetail);
+            if (reportDetail != null) {
+                reportDetail.setReportUrl(null);
+                reportQueryLog.setIsSuccess("Y");
+                reportQueryLog.setRemark(UserConstants.QUERY_SUCCESS);
+                reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
+                return AjaxResult.success(reportDetail);
+            }
         } catch (Exception e) {
         } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
+            return AjaxResult.error("未查询到对应信息");
         }
         }
-        return AjaxResult.success();
+        return AjaxResult.error("未查询到对应信息");
     }
     }
 
 
 
 
@@ -252,11 +265,17 @@ public class QueryServiceImpl implements IQueryService {
      */
      */
     private AjaxResult queryByRough(ReportQueryLog reportQueryLog) {
     private AjaxResult queryByRough(ReportQueryLog reportQueryLog) {
         String reportNumber = reportQueryLog.getReportNumber();
         String reportNumber = reportQueryLog.getReportNumber();
-        reportQueryLog.setIsSuccess("0");
         ReportDetail reportDetail = reportDetailMapper.selectReportDetailByReportNumber(reportNumber);
         ReportDetail reportDetail = reportDetailMapper.selectReportDetailByReportNumber(reportNumber);
-        reportDetail.setReportUrl(null);
+        if (reportDetail != null) {
+            reportDetail.setReportUrl(null);
+            reportQueryLog.setRemark(UserConstants.QUERY_SUCCESS);
+            reportQueryLog.setIsSuccess("Y");
+            reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
+            return AjaxResult.success(reportDetail);
+        }
+        reportQueryLog.setRemark("查询的文档编号不存在");
         reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
         reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
-        return AjaxResult.success(reportDetail);
+        return AjaxResult.error("查询的文档编号不存在");
     }
     }
 
 
     /**
     /**
@@ -283,17 +302,23 @@ public class QueryServiceImpl implements IQueryService {
             return AjaxResult.error(resultNum);
             return AjaxResult.error(resultNum);
         }
         }
         String reportNumber = reportQueryLog.getReportNumber();
         String reportNumber = reportQueryLog.getReportNumber();
-        reportQueryLog.setIsSuccess("0");
         ReportDetail reportDetail = reportDetailMapper.selectReportDetailByReportNumber(reportNumber);
         ReportDetail reportDetail = reportDetailMapper.selectReportDetailByReportNumber(reportNumber);
+        if (reportDetail != null) {
+            reportQueryLog.setIsSuccess("Y");
+            reportQueryLog.setRemark(UserConstants.QUERY_SUCCESS);
+            reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
+            return AjaxResult.success(reportDetail);
+        }
+        reportQueryLog.setRemark("查询的文档编号不存在");
         reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
         reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
-        return AjaxResult.success(reportDetail);
+        return AjaxResult.error("查询的文档编号不存在");
     }
     }
 
 
 
 
     /**
     /**
      * 查询通用校验模块
      * 查询通用校验模块
      */
      */
-    private AjaxResult queryPublic(ReportQueryLog reportQueryLog) {
+    private AjaxResult queryPublic(ReportQueryLog reportQueryLog,Boolean isDelKey) {
         //获取查询主体
         //获取查询主体
         String queryType = reportQueryLog.getQueryType();
         String queryType = reportQueryLog.getQueryType();
         String queryMode = reportQueryLog.getQueryMode();
         String queryMode = reportQueryLog.getQueryMode();
@@ -318,7 +343,7 @@ public class QueryServiceImpl implements IQueryService {
         }
         }
 
 
         //校验验证码
         //校验验证码
-        String resultCaptcha = validateCaptcha(phone, reportQueryLog.getCode());
+        String resultCaptcha = validateCaptcha(phone, reportQueryLog.getCode(),isDelKey);
         if (!UserConstants.QUERY_SUCCESS.equals(resultCaptcha)) {
         if (!UserConstants.QUERY_SUCCESS.equals(resultCaptcha)) {
             reportQueryLog.setRemark(resultCaptcha);
             reportQueryLog.setRemark(resultCaptcha);
             reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
             reportQueryLogMapper.insertReportQueryLog(reportQueryLog);
@@ -333,7 +358,7 @@ public class QueryServiceImpl implements IQueryService {
      * @param queryPhone 查询者手机号
      * @param queryPhone 查询者手机号
      * @return 结果
      * @return 结果
      */
      */
-    public String validateCaptcha(String queryPhone, String code) {
+    public String validateCaptcha(String queryPhone, String code,Boolean isDelKey) {
         String verifyKey = UserConstants.QUERY_CODE_KEY + queryPhone;
         String verifyKey = UserConstants.QUERY_CODE_KEY + queryPhone;
         String captcha = redisCache.getCacheObject(verifyKey);
         String captcha = redisCache.getCacheObject(verifyKey);
         if (captcha == null) {
         if (captcha == null) {
@@ -342,7 +367,9 @@ public class QueryServiceImpl implements IQueryService {
         if (!code.equalsIgnoreCase(captcha)) {
         if (!code.equalsIgnoreCase(captcha)) {
             return "验证码不正确,请检查";
             return "验证码不正确,请检查";
         }
         }
-        redisCache.deleteObject(verifyKey);
+        if (isDelKey){
+            redisCache.deleteObject(verifyKey);
+        }
         return UserConstants.QUERY_SUCCESS;
         return UserConstants.QUERY_SUCCESS;
     }
     }
 
 

+ 9 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ReportDetailServiceImpl.java

@@ -11,6 +11,7 @@ import com.ruoyi.common.utils.QRCodeUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.system.domain.InspectInfor;
 import com.ruoyi.system.domain.InspectInfor;
 import com.ruoyi.system.domain.QueryConfig;
 import com.ruoyi.system.domain.QueryConfig;
+import com.ruoyi.system.mapper.InspectInforMapper;
 import com.ruoyi.system.mapper.QueryConfigMapper;
 import com.ruoyi.system.mapper.QueryConfigMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -36,6 +37,9 @@ public class ReportDetailServiceImpl implements IReportDetailService
     @Autowired
     @Autowired
     private RedisCache redisCache;
     private RedisCache redisCache;
 
 
+    @Autowired
+    private InspectInforMapper inspectInforMapper;
+
     /**
     /**
      * 查询报告信息
      * 查询报告信息
      * 
      * 
@@ -90,6 +94,11 @@ public class ReportDetailServiceImpl implements IReportDetailService
             e.printStackTrace();
             e.printStackTrace();
         }
         }
         reportDetail.setCreateTime(DateUtils.getNowDate());
         reportDetail.setCreateTime(DateUtils.getNowDate());
+        //把对应送检信息该为已经生成报告
+        InspectInfor inspectInfor = new InspectInfor();
+        inspectInfor.setInspectId(reportDetail.getInspectId());
+        inspectInfor.setIsReport("N");
+        inspectInforMapper.updateInspectInfor(inspectInfor);
         return reportDetailMapper.insertReportDetail(reportDetail);
         return reportDetailMapper.insertReportDetail(reportDetail);
     }
     }
 
 

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

@@ -29,7 +29,7 @@
     <select id="selectColumnNavigationBarList" parameterType="ColumnNavigationBar"
     <select id="selectColumnNavigationBarList" parameterType="ColumnNavigationBar"
             resultMap="ColumnNavigationBarResult">
             resultMap="ColumnNavigationBarResult">
         <include refid="selectColumnNavigationBarVo"/>
         <include refid="selectColumnNavigationBarVo"/>
-        where
+        <where>
         del_flag = 'N'
         del_flag = 'N'
         <if test="parentId != null ">and parent_id = #{parentId}</if>
         <if test="parentId != null ">and parent_id = #{parentId}</if>
         <if test="ancestors != null  and ancestors != ''">and ancestors = #{ancestors}</if>
         <if test="ancestors != null  and ancestors != ''">and ancestors = #{ancestors}</if>
@@ -38,16 +38,18 @@
         <if test="isNavigationBar != null ">and is_navigation_bar = #{isNavigationBar}</if>
         <if test="isNavigationBar != null ">and is_navigation_bar = #{isNavigationBar}</if>
         <if test="isTitle != null ">and is_title = #{isTitle}</if>
         <if test="isTitle != null ">and is_title = #{isTitle}</if>
         <if test="isBottom != null ">and is_bottom = #{isBottom}</if>
         <if test="isBottom != null ">and is_bottom = #{isBottom}</if>
+        </where>
     </select>
     </select>
 
 
     <select id="selectColumnNavigationBarListMenHu" parameterType="ColumnNavigationBar"
     <select id="selectColumnNavigationBarListMenHu" parameterType="ColumnNavigationBar"
             resultMap="ColumnNavigationBarResult">
             resultMap="ColumnNavigationBarResult">
         select column_id, column_name,open_mode from column_navigation_bar
         select column_id, column_name,open_mode from column_navigation_bar
-        where
+        <where>
         status = '0'
         status = '0'
         and del_flag = 'N'
         and del_flag = 'N'
         <if test="isTitle != null ">and is_title = #{isTitle}</if>
         <if test="isTitle != null ">and is_title = #{isTitle}</if>
         <if test="isBottom != null ">and is_bottom = #{isBottom}</if>
         <if test="isBottom != null ">and is_bottom = #{isBottom}</if>
+        </where>
     </select>
     </select>
 
 
     <select id="selectColumnNavigationBarByColumnId" parameterType="Long" resultMap="ColumnNavigationBarResult">
     <select id="selectColumnNavigationBarByColumnId" parameterType="Long" resultMap="ColumnNavigationBarResult">

+ 31 - 20
ruoyi-system/src/main/resources/mapper/system/ColumnNewsMapper.xml

@@ -29,8 +29,8 @@
 
 
     <select id="selectColumnNewsList" parameterType="ColumnNews" resultMap="ColumnNewsResult">
     <select id="selectColumnNewsList" parameterType="ColumnNews" resultMap="ColumnNewsResult">
         <include refid="selectColumnNewsVo"/>
         <include refid="selectColumnNewsVo"/>
-        where
-        n.is_del = 'N'
+        <where>
+            n.is_del = 'N'
             <if test="newsTitle != null  and newsTitle != ''">and n.news_title like concat('%', #{newsTitle}, '%')</if>
             <if test="newsTitle != null  and newsTitle != ''">and n.news_title like concat('%', #{newsTitle}, '%')</if>
             <if test="newsContent != null  and newsContent != ''">and n.news_content like concat('%', #{newsContent},
             <if test="newsContent != null  and newsContent != ''">and n.news_content like concat('%', #{newsContent},
                 '%')
                 '%')
@@ -39,31 +39,32 @@
             <if test="isDel != null  and isDel != ''">and n.is_del = #{isDel}</if>
             <if test="isDel != null  and isDel != ''">and n.is_del = #{isDel}</if>
             <if test="columnName != null  and columnName != ''">and c.column_name = #{columnName}</if>
             <if test="columnName != null  and columnName != ''">and c.column_name = #{columnName}</if>
             <if test="isTop != null  and isTop != ''">and n.is_top = #{isTop}</if>
             <if test="isTop != null  and isTop != ''">and n.is_top = #{isTop}</if>
-
+        </where>
         order by n.create_time DESC , n.update_time DESC
         order by n.create_time DESC , n.update_time DESC
     </select>
     </select>
 
 
     <select id="selectColumnNewsListMenHu" parameterType="ColumnNews" resultMap="ColumnNewsResult">
     <select id="selectColumnNewsListMenHu" parameterType="ColumnNews" resultMap="ColumnNewsResult">
         select n.news_id, n.news_title,n.news_image, n.create_time from column_news n
         select n.news_id, n.news_title,n.news_image, n.create_time from column_news n
-        where
-        n.status = '0'
-        and n.is_del = 'N'
-        <if test="newsTitle != null  and newsTitle != ''">and (n.news_title like concat('%', #{newsTitle}, '%') or
-            n.news_content like concat('%', #{newsContent}, '%'))
-        </if>
-        <if test="columnId != null  and columnId != ''">and n.column_id = #{columnId}</if>
-        <if test="isTop != null  and isTop != ''">and n.is_top = #{isTop}</if>
-
+        <where>
+            n.status = '0'
+            and n.is_del = 'N'
+            <if test="newsTitle != null  and newsTitle != ''">and (n.news_title like concat('%', #{newsTitle}, '%') or
+                n.news_content like concat('%', #{newsContent}, '%'))
+            </if>
+            <if test="columnId != null  and columnId != ''">and n.column_id = #{columnId}</if>
+            <if test="isTop != null  and isTop != ''">and n.is_top = #{isTop}</if>
+        </where>
         order by n.create_time DESC,n.update_time DESC
         order by n.create_time DESC,n.update_time DESC
     </select>
     </select>
 
 
     <select id="selectColumnNewsListMenHuByColumnId" parameterType="Long" resultMap="ColumnNewsResult">
     <select id="selectColumnNewsListMenHuByColumnId" parameterType="Long" resultMap="ColumnNewsResult">
         select n.news_id, n.news_title,n.news_image, n.create_time from column_news n
         select n.news_id, n.news_title,n.news_image, n.create_time from column_news n
-        where
-        n.status = '0'
-        and n.is_del = 'N'
-        <if test="columnId != null  and columnId != ''">and n.column_id = #{columnId}</if>
-        order by n.create_time DESC,n.update_time DESC limit 6
+        <where>
+            n.status = '0'
+            and n.is_del = 'N'
+            <if test="columnId != null  and columnId != ''">and n.column_id = #{columnId}</if>
+        </where>
+        order by n.create_time DESC,n.update_time DESC limit 10
     </select>
     </select>
 
 
     <select id="selectColumnNewsByNewsId" parameterType="Integer" resultMap="ColumnNewsResult">
     <select id="selectColumnNewsByNewsId" parameterType="Integer" resultMap="ColumnNewsResult">
@@ -134,15 +135,25 @@
         delete from column_news where news_id = #{newsId}
         delete from column_news where news_id = #{newsId}
     </delete>
     </delete>
 
 
-    <delete id="deleteColumnNewsByNewsIds" parameterType="String">
-        delete from column_news where news_id in
+    <update id="deleteColumnNewsByNewsIds" parameterType="String">
+        update  column_news set is_del = 'Y' where news_id in
         <foreach item="newsId" collection="array" open="(" separator="," close=")">
         <foreach item="newsId" collection="array" open="(" separator="," close=")">
             #{newsId}
             #{newsId}
         </foreach>
         </foreach>
-    </delete>
+    </update>
 
 
     <update id="examineColumnNews" parameterType="ColumnNews">
     <update id="examineColumnNews" parameterType="ColumnNews">
         update column_news set  status = '0'
         update column_news set  status = '0'
         where news_id = #{newsId}
         where news_id = #{newsId}
     </update>
     </update>
+
+    <select id="selectColumnNewsCount" parameterType="Date" resultType="int">
+        select ifnull(count(1),0) as num from column_news
+        <where>
+            is_del = 'N'
+            <if test="today != null">and DATE_FORMAT(create_time,'%Y-%m-%d') = DATE_FORMAT(#{today},'%Y-%m-%d')</if>
+            <if test="startTime != null">and DATE_FORMAT(create_time,'%Y-%m-%d') &gt;= DATE_FORMAT(#{startTime},'%Y-%m-%d')</if>
+            <if test="endTime != null">and DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d')</if>
+        </where>
+    </select>
 </mapper>
 </mapper>

+ 23 - 23
ruoyi-system/src/main/resources/mapper/system/FriendLinkMapper.xml

@@ -1,19 +1,19 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.system.mapper.FriendLinkMapper">
 <mapper namespace="com.ruoyi.system.mapper.FriendLinkMapper">
-    
+
     <resultMap type="FriendLink" id="FriendLinkResult">
     <resultMap type="FriendLink" id="FriendLinkResult">
-        <result property="linkId"    column="link_id"    />
-        <result property="linkName"    column="link_name"    />
-        <result property="linkSpace"    column="link_space"    />
-        <result property="status"    column="status"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
+        <result property="linkId" column="link_id"/>
+        <result property="linkName" column="link_name"/>
+        <result property="linkSpace" column="link_space"/>
+        <result property="status" column="status"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectFriendLinkVo">
     <sql id="selectFriendLinkVo">
@@ -22,20 +22,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectFriendLinkList" parameterType="FriendLink" resultMap="FriendLinkResult">
     <select id="selectFriendLinkList" parameterType="FriendLink" resultMap="FriendLinkResult">
         select link_id, link_name, link_space, status, del_flag from friend_link
         select link_id, link_name, link_space, status, del_flag from friend_link
-        where
-        del_flag = 'N'
-            <if test="linkName != null  and linkName != ''"> and link_name like concat('%', #{linkName}, '%')</if>
-            <if test="linkSpace != null  and linkSpace != ''"> and link_space = #{linkSpace}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
-
+        <where>
+            del_flag = 'N'
+            <if test="linkName != null  and linkName != ''">and link_name like concat('%', #{linkName}, '%')</if>
+            <if test="linkSpace != null  and linkSpace != ''">and link_space = #{linkSpace}</if>
+            <if test="status != null  and status != ''">and status = #{status}</if>
+        </where>
         order by create_time DESC
         order by create_time DESC
     </select>
     </select>
-    
+
     <select id="selectFriendLinkByLinkId" parameterType="Long" resultMap="FriendLinkResult">
     <select id="selectFriendLinkByLinkId" parameterType="Long" resultMap="FriendLinkResult">
         <include refid="selectFriendLinkVo"/>
         <include refid="selectFriendLinkVo"/>
         where link_id = #{linkId} and del_flag = 'N'
         where link_id = #{linkId} and del_flag = 'N'
     </select>
     </select>
-        
+
     <insert id="insertFriendLink" parameterType="FriendLink" useGeneratedKeys="true" keyProperty="linkId">
     <insert id="insertFriendLink" parameterType="FriendLink" useGeneratedKeys="true" keyProperty="linkId">
         insert into friend_link
         insert into friend_link
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="updateTime != null">update_time,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="linkName != null">#{linkName},</if>
             <if test="linkName != null">#{linkName},</if>
             <if test="linkSpace != null">#{linkSpace},</if>
             <if test="linkSpace != null">#{linkSpace},</if>
@@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
-         </trim>
+        </trim>
     </insert>
     </insert>
 
 
     <update id="updateFriendLink" parameterType="FriendLink">
     <update id="updateFriendLink" parameterType="FriendLink">
@@ -80,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
     </delete>
 
 
     <delete id="deleteFriendLinkByLinkIds" parameterType="String">
     <delete id="deleteFriendLinkByLinkIds" parameterType="String">
-        delete from friend_link where link_id in 
+        delete from friend_link where link_id in
         <foreach item="linkId" collection="array" open="(" separator="," close=")">
         <foreach item="linkId" collection="array" open="(" separator="," close=")">
             #{linkId}
             #{linkId}
         </foreach>
         </foreach>

+ 29 - 28
ruoyi-system/src/main/resources/mapper/system/ImageDataMapper.xml

@@ -1,22 +1,22 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.system.mapper.ImageDataMapper">
 <mapper namespace="com.ruoyi.system.mapper.ImageDataMapper">
-    
+
     <resultMap type="ImageDatas" id="ImageDataResult">
     <resultMap type="ImageDatas" id="ImageDataResult">
-        <result property="imageId"    column="image_id"    />
-        <result property="imageName"    column="image_name"    />
-        <result property="imageContent"    column="image_content"    />
-        <result property="imageIntroduce"    column="image_introduce"    />
-        <result property="status"    column="status"    />
-        <result property="type"    column="type"    />
-        <result property="isDel"    column="is_del"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="remark"    column="remark"    />
+        <result property="imageId" column="image_id"/>
+        <result property="imageName" column="image_name"/>
+        <result property="imageContent" column="image_content"/>
+        <result property="imageIntroduce" column="image_introduce"/>
+        <result property="status" column="status"/>
+        <result property="type" column="type"/>
+        <result property="isDel" column="is_del"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectImageDataVo">
     <sql id="selectImageDataVo">
@@ -25,28 +25,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectImageDatasList" parameterType="ImageDatas" resultMap="ImageDataResult">
     <select id="selectImageDatasList" parameterType="ImageDatas" resultMap="ImageDataResult">
         <include refid="selectImageDataVo"/>
         <include refid="selectImageDataVo"/>
-       where
+        where
         is_del = 'N'
         is_del = 'N'
-        <if test="imageName != null  and imageName != ''"> and image_name like concat('%', #{imageName}, '%')</if>
-        <if test="type != null  and type != ''"> and type = #{type}</if>
+        <if test="imageName != null  and imageName != ''">and image_name like concat('%', #{imageName}, '%')</if>
+        <if test="type != null  and type != ''">and type = #{type}</if>
         order by create_time DESC
         order by create_time DESC
     </select>
     </select>
 
 
     <select id="selectImageDatasListMenHu" parameterType="ImageDatas" resultMap="ImageDataResult">
     <select id="selectImageDatasListMenHu" parameterType="ImageDatas" resultMap="ImageDataResult">
         select image_name,image_name, image_content, image_introduce,type from image_data
         select image_name,image_name, image_content, image_introduce,type from image_data
-        where
-        is_del = 'N'
-        and status = '0'
-        <if test="imageName != null  and imageName != ''"> and image_name like concat('%', #{imageName}, '%')</if>
-        <if test="type != null  and type != ''"> and type = #{type}</if>
+        <where>
+            is_del = 'N'
+            and status = '0'
+            <if test="imageName != null  and imageName != ''">and image_name like concat('%', #{imageName}, '%')</if>
+            <if test="type != null  and type != ''">and type = #{type}</if>
+        </where>
         order by create_time DESC
         order by create_time DESC
     </select>
     </select>
-    
+
     <select id="selectImageDatasByImageId" parameterType="Long" resultMap="ImageDataResult">
     <select id="selectImageDatasByImageId" parameterType="Long" resultMap="ImageDataResult">
         <include refid="selectImageDataVo"/>
         <include refid="selectImageDataVo"/>
         where image_id = #{imageId} and is_del = 'N'
         where image_id = #{imageId} and is_del = 'N'
     </select>
     </select>
-        
+
     <insert id="insertImageDatas" parameterType="ImageDatas" useGeneratedKeys="true" keyProperty="imageId">
     <insert id="insertImageDatas" parameterType="ImageDatas" useGeneratedKeys="true" keyProperty="imageId">
         insert into image_data
         insert into image_data
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -61,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
             <if test="remark != null">remark,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="imageName != null and imageName != ''">#{imageName},</if>
             <if test="imageName != null and imageName != ''">#{imageName},</if>
             <if test="imageContent != null">#{imageContent},</if>
             <if test="imageContent != null">#{imageContent},</if>
@@ -74,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
             <if test="remark != null">#{remark},</if>
-         </trim>
+        </trim>
     </insert>
     </insert>
 
 
     <update id="updateImageDatas" parameterType="ImageDatas">
     <update id="updateImageDatas" parameterType="ImageDatas">
@@ -100,7 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
     </delete>
 
 
     <delete id="deleteImageDatasByImageIds" parameterType="String">
     <delete id="deleteImageDatasByImageIds" parameterType="String">
-        delete from image_data where image_id in 
+        delete from image_data where image_id in
         <foreach item="imageId" collection="array" open="(" separator="," close=")">
         <foreach item="imageId" collection="array" open="(" separator="," close=")">
             #{imageId}
             #{imageId}
         </foreach>
         </foreach>

+ 20 - 5
ruoyi-system/src/main/resources/mapper/system/InspectInforMapper.xml

@@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="manufacturerPhone"    column="manufacturer_phone"    />
         <result property="manufacturerPhone"    column="manufacturer_phone"    />
         <result property="inspectedName"    column="inspected_name"    />
         <result property="inspectedName"    column="inspected_name"    />
         <result property="inspectedPhone"    column="inspected_phone"    />
         <result property="inspectedPhone"    column="inspected_phone"    />
+        <result property="isReport"    column="is_report"    />
         <result property="isDel"    column="is_del"    />
         <result property="isDel"    column="is_del"    />
         <result property="createBy"    column="create_by"    />
         <result property="createBy"    column="create_by"    />
         <result property="createTime"    column="create_time"    />
         <result property="createTime"    column="create_time"    />
@@ -24,12 +25,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
     </resultMap>
 
 
     <sql id="selectInspectInforVo">
     <sql id="selectInspectInforVo">
-        select inspect_id, sample_name, sample_num, norms_model, test_items, provide_type, manufacturer_name, manufacturer_phone, inspected_name, inspected_phone, is_del, create_by, create_time, update_by, update_time, remark from inspect_infor
+        select inspect_id, sample_name, sample_num, norms_model, test_items, provide_type, manufacturer_name, manufacturer_phone, inspected_name, inspected_phone,is_report, is_del, create_by, create_time, update_by, update_time, remark from inspect_infor
     </sql>
     </sql>
 
 
     <select id="selectInspectInforList" parameterType="InspectInfor" resultMap="InspectInforResult">
     <select id="selectInspectInforList" parameterType="InspectInfor" resultMap="InspectInforResult">
         <include refid="selectInspectInforVo"/>
         <include refid="selectInspectInforVo"/>
-        where
+        <where>
             is_del = 'N'
             is_del = 'N'
             <if test="sampleName != null  and sampleName != ''"> and sample_name like concat('%', #{sampleName}, '%')</if>
             <if test="sampleName != null  and sampleName != ''"> and sample_name like concat('%', #{sampleName}, '%')</if>
             <if test="sampleNum != null "> and sample_num = #{sampleNum}</if>
             <if test="sampleNum != null "> and sample_num = #{sampleNum}</if>
@@ -40,6 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="manufacturerPhone != null  and manufacturerPhone != ''"> and manufacturer_phone = #{manufacturerPhone}</if>
             <if test="manufacturerPhone != null  and manufacturerPhone != ''"> and manufacturer_phone = #{manufacturerPhone}</if>
             <if test="inspectedName != null  and inspectedName != ''"> and inspected_name like concat('%', #{inspectedName}, '%')</if>
             <if test="inspectedName != null  and inspectedName != ''"> and inspected_name like concat('%', #{inspectedName}, '%')</if>
             <if test="inspectedPhone != null  and inspectedPhone != ''"> and inspected_phone = #{inspectedPhone}</if>
             <if test="inspectedPhone != null  and inspectedPhone != ''"> and inspected_phone = #{inspectedPhone}</if>
+        </where>
         order by create_time DESC
         order by create_time DESC
     </select>
     </select>
     
     
@@ -60,6 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="manufacturerPhone != null">manufacturer_phone,</if>
             <if test="manufacturerPhone != null">manufacturer_phone,</if>
             <if test="inspectedName != null">inspected_name,</if>
             <if test="inspectedName != null">inspected_name,</if>
             <if test="inspectedPhone != null">inspected_phone,</if>
             <if test="inspectedPhone != null">inspected_phone,</if>
+            <if test="isReport != null">is_report,</if>
             <if test="isDel != null">is_del,</if>
             <if test="isDel != null">is_del,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
@@ -77,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="manufacturerPhone != null">#{manufacturerPhone},</if>
             <if test="manufacturerPhone != null">#{manufacturerPhone},</if>
             <if test="inspectedName != null">#{inspectedName},</if>
             <if test="inspectedName != null">#{inspectedName},</if>
             <if test="inspectedPhone != null">#{inspectedPhone},</if>
             <if test="inspectedPhone != null">#{inspectedPhone},</if>
+            <if test="isReport != null">#{isReport},</if>
             <if test="isDel != null">#{isDel},</if>
             <if test="isDel != null">#{isDel},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
@@ -98,6 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="manufacturerPhone != null">manufacturer_phone = #{manufacturerPhone},</if>
             <if test="manufacturerPhone != null">manufacturer_phone = #{manufacturerPhone},</if>
             <if test="inspectedName != null">inspected_name = #{inspectedName},</if>
             <if test="inspectedName != null">inspected_name = #{inspectedName},</if>
             <if test="inspectedPhone != null">inspected_phone = #{inspectedPhone},</if>
             <if test="inspectedPhone != null">inspected_phone = #{inspectedPhone},</if>
+            <if test="isReport != null">is_report = #{isReport},</if>
             <if test="isDel != null">is_del = #{isDel},</if>
             <if test="isDel != null">is_del = #{isDel},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createBy != null">create_by = #{createBy},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
             <if test="createTime != null">create_time = #{createTime},</if>
@@ -112,15 +117,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         delete from inspect_infor where inspect_id = #{inspectId}
         delete from inspect_infor where inspect_id = #{inspectId}
     </delete>
     </delete>
 
 
-    <delete id="deleteInspectInforByInspectIds" parameterType="String">
-        delete from inspect_infor where inspect_id in 
+    <update id="deleteInspectInforByInspectIds" parameterType="String">
+        update  inspect_infor set is_del = 'Y' where inspect_id in
         <foreach item="inspectId" collection="array" open="(" separator="," close=")">
         <foreach item="inspectId" collection="array" open="(" separator="," close=")">
             #{inspectId}
             #{inspectId}
         </foreach>
         </foreach>
-    </delete>
+    </update>
 
 
     <select id="checkSampleNameUnique" resultMap="InspectInforResult">
     <select id="checkSampleNameUnique" resultMap="InspectInforResult">
         <include refid="selectInspectInforVo"/>
         <include refid="selectInspectInforVo"/>
         where sample_name=#{sampleName} and is_del = 'N' limit 1
         where sample_name=#{sampleName} and is_del = 'N' limit 1
     </select>
     </select>
+
+    <select id="selectInspectInforCount" parameterType="Date" resultType="int">
+       select ifnull(count(1),0) as num from inspect_infor
+        <where>
+            is_del = 'N'
+            <if test="today != null">and DATE_FORMAT(create_time,'%Y-%m-%d') = DATE_FORMAT(#{today},'%Y-%m-%d')</if>
+            <if test="startTime != null">and DATE_FORMAT(create_time,'%Y-%m-%d') &gt;= DATE_FORMAT(#{startTime},'%Y-%m-%d')</if>
+            <if test="endTime != null">and DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d')</if>
+        </where>
+    </select>
 </mapper>
 </mapper>

+ 38 - 29
ruoyi-system/src/main/resources/mapper/system/QueryConfigMapper.xml

@@ -1,23 +1,23 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ruoyi.system.mapper.QueryConfigMapper">
 <mapper namespace="com.ruoyi.system.mapper.QueryConfigMapper">
-    
+
     <resultMap type="QueryConfig" id="QueryConfigResult">
     <resultMap type="QueryConfig" id="QueryConfigResult">
-        <result property="configId"    column="config_id"    />
-        <result property="queryNumber"    column="query_number"    />
-        <result property="qrUnit"    column="qr_unit"    />
-        <result property="qrTime"    column="qr_time"    />
-        <result property="queryType"    column="query_type"    />
-        <result property="queryMode"    column="query_mode"    />
-        <result property="status"    column="status"    />
-        <result property="isDel"    column="is_del"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="remark"    column="remark"    />
+        <result property="configId" column="config_id"/>
+        <result property="queryNumber" column="query_number"/>
+        <result property="qrUnit" column="qr_unit"/>
+        <result property="qrTime" column="qr_time"/>
+        <result property="queryType" column="query_type"/>
+        <result property="queryMode" column="query_mode"/>
+        <result property="status" column="status"/>
+        <result property="isDel" column="is_del"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="remark" column="remark"/>
     </resultMap>
     </resultMap>
 
 
     <sql id="selectQueryConfigVo">
     <sql id="selectQueryConfigVo">
@@ -26,21 +26,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectQueryConfigList" parameterType="QueryConfig" resultMap="QueryConfigResult">
     <select id="selectQueryConfigList" parameterType="QueryConfig" resultMap="QueryConfigResult">
         <include refid="selectQueryConfigVo"/>
         <include refid="selectQueryConfigVo"/>
-        where
-        is_del = 'N'
-            <if test="qrTime != null  and qrTime != ''"> and qr_time = #{qrTime}</if>
-            <if test="queryType != null  and queryType != ''"> and query_type = #{queryType}</if>
-            <if test="queryMode != null  and queryMode != ''"> and query_mode = #{queryMode}</if>
-            <if test="status != null  and status != ''"> and status = #{status}</if>
+        <where>
+            is_del = 'N'
+            <if test="qrTime != null  and qrTime != ''">and qr_time = #{qrTime}</if>
+            <if test="queryType != null  and queryType != ''">and query_type = #{queryType}</if>
+            <if test="queryMode != null  and queryMode != ''">and query_mode = #{queryMode}</if>
+            <if test="status != null  and status != ''">and status = #{status}</if>
+        </where>
     </select>
     </select>
 
 
     <select id="selectQueryConfig" parameterType="QueryConfig" resultMap="QueryConfigResult">
     <select id="selectQueryConfig" parameterType="QueryConfig" resultMap="QueryConfigResult">
         <include refid="selectQueryConfigVo"/>
         <include refid="selectQueryConfigVo"/>
-        where
+        <where>
             status = 'N'
             status = 'N'
             and is_del = 'N'
             and is_del = 'N'
-            <if test="queryType != null  and queryType != ''"> and query_type = #{queryType}</if>
-            <if test="queryMode != null  and queryMode != ''"> and query_mode = #{queryMode}</if>
+            <if test="queryType != null  and queryType != ''">and query_type = #{queryType}</if>
+            <if test="queryMode != null  and queryMode != ''">and query_mode = #{queryMode}</if>
+        </where>
         order by create_time DESC
         order by create_time DESC
     </select>
     </select>
 
 
@@ -48,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectQueryConfigVo"/>
         <include refid="selectQueryConfigVo"/>
         where config_id = #{configId} and is_del = 'N'
         where config_id = #{configId} and is_del = 'N'
     </select>
     </select>
-        
+
     <insert id="insertQueryConfig" parameterType="QueryConfig" useGeneratedKeys="true" keyProperty="configId">
     <insert id="insertQueryConfig" parameterType="QueryConfig" useGeneratedKeys="true" keyProperty="configId">
         insert into query_config
         insert into query_config
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -64,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">update_by,</if>
             <if test="updateBy != null">update_by,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="updateTime != null">update_time,</if>
             <if test="remark != null">remark,</if>
             <if test="remark != null">remark,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="queryNumber != null">#{queryNumber},</if>
             <if test="queryNumber != null">#{queryNumber},</if>
             <if test="qrUnit != null and qrUnit != ''">#{qrUnit},</if>
             <if test="qrUnit != null and qrUnit != ''">#{qrUnit},</if>
@@ -78,7 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateBy != null">#{updateBy},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
             <if test="remark != null">#{remark},</if>
             <if test="remark != null">#{remark},</if>
-         </trim>
+        </trim>
     </insert>
     </insert>
 
 
     <update id="updateQueryConfig" parameterType="QueryConfig">
     <update id="updateQueryConfig" parameterType="QueryConfig">
@@ -105,9 +107,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
     </delete>
 
 
     <delete id="deleteQueryConfigByConfigIds" parameterType="String">
     <delete id="deleteQueryConfigByConfigIds" parameterType="String">
-        delete from query_config where config_id in 
+        delete from query_config where config_id in
         <foreach item="configId" collection="array" open="(" separator="," close=")">
         <foreach item="configId" collection="array" open="(" separator="," close=")">
             #{configId}
             #{configId}
         </foreach>
         </foreach>
     </delete>
     </delete>
+
+    <select id="selectQueryConfigByTypeAndMode" parameterType="QueryConfig" resultType="int">
+        select count(1) from query_config
+        <where>query_type = #{queryType} and query_mode = #{queryMode} and is_del = 'N'
+            <if test="configId != null">and config_id not in (#{configId})</if>
+        </where>
+    </select>
 </mapper>
 </mapper>

+ 14 - 12
ruoyi-system/src/main/resources/mapper/system/ReportDetailMapper.xml

@@ -29,7 +29,7 @@
 
 
     <select id="selectReportDetailList" parameterType="ReportDetail" resultMap="ReportDetailResult">
     <select id="selectReportDetailList" parameterType="ReportDetail" resultMap="ReportDetailResult">
         <include refid="selectReportDetailVo"/>
         <include refid="selectReportDetailVo"/>
-        where
+        <where>
         is_del = 'N'
         is_del = 'N'
             <if test="reportNumber != null  and reportNumber != ''">and report_number = #{reportNumber}</if>
             <if test="reportNumber != null  and reportNumber != ''">and report_number = #{reportNumber}</if>
             <if test="inspectId != null ">and inspect_id = #{inspectId}</if>
             <if test="inspectId != null ">and inspect_id = #{inspectId}</if>
@@ -43,6 +43,7 @@
             </if>
             </if>
             <if test="isQualify != null  and isQualify != ''">and is_qualify = #{isQualify}</if>
             <if test="isQualify != null  and isQualify != ''">and is_qualify = #{isQualify}</if>
             <if test="reportUrl != null  and reportUrl != ''">and report_url = #{reportUrl}</if>
             <if test="reportUrl != null  and reportUrl != ''">and report_url = #{reportUrl}</if>
+        </where>
         order by create_time DESC
         order by create_time DESC
     </select>
     </select>
 
 
@@ -62,12 +63,8 @@
             <if test="isQualify != null">is_qualify,</if>
             <if test="isQualify != null">is_qualify,</if>
             <if test="reportUrl != null">report_url,</if>
             <if test="reportUrl != null">report_url,</if>
             <if test="qrPath != null">qr_path,</if>
             <if test="qrPath != null">qr_path,</if>
-            <if test="isDel != null">is_del,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createBy != null">create_by,</if>
             <if test="createTime != null">create_time,</if>
             <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="remark != null">remark,</if>
         </trim>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="reportNumber != null and reportNumber != ''">#{reportNumber},</if>
             <if test="reportNumber != null and reportNumber != ''">#{reportNumber},</if>
@@ -78,12 +75,8 @@
             <if test="isQualify != null">#{isQualify},</if>
             <if test="isQualify != null">#{isQualify},</if>
             <if test="reportUrl != null">#{reportUrl},</if>
             <if test="reportUrl != null">#{reportUrl},</if>
             <if test="qrPath != null">#{qrPath},</if>
             <if test="qrPath != null">#{qrPath},</if>
-            <if test="isDel != null">#{isDel},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createBy != null">#{createBy},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="remark != null">#{remark},</if>
         </trim>
         </trim>
     </insert>
     </insert>
 
 
@@ -112,12 +105,12 @@
         delete from report_detail where report_id = #{reportId}
         delete from report_detail where report_id = #{reportId}
     </delete>
     </delete>
 
 
-    <delete id="deleteReportDetailByReportIds" parameterType="String">
-        delete from report_detail where report_id in
+    <update id="deleteReportDetailByReportIds" parameterType="String">
+        update  report_detail set is_del = 'Y' where report_id in
         <foreach item="reportId" collection="array" open="(" separator="," close=")">
         <foreach item="reportId" collection="array" open="(" separator="," close=")">
             #{reportId}
             #{reportId}
         </foreach>
         </foreach>
-    </delete>
+    </update>
 
 
     <select id="checkReportNumberUnique" resultMap="ReportDetailResult">
     <select id="checkReportNumberUnique" resultMap="ReportDetailResult">
         <include refid="selectReportDetailVo"/>
         <include refid="selectReportDetailVo"/>
@@ -134,4 +127,13 @@
         where r.report_number=#{reportNumber} and r.is_del = 'N' and s.status = '0' and s.del_flag = '0' limit 1
         where r.report_number=#{reportNumber} and r.is_del = 'N' and s.status = '0' and s.del_flag = '0' limit 1
     </select>
     </select>
 
 
+    <select id="selectReportDetailCount" parameterType="Date" resultType="int">
+        select ifnull(count(1),0) as num from report_detail
+        <where>
+            is_del = 'N'
+            <if test="today != null">and DATE_FORMAT(create_time,'%Y-%m-%d') = DATE_FORMAT(#{today},'%Y-%m-%d')</if>
+            <if test="startTime != null">and DATE_FORMAT(create_time,'%Y-%m-%d') &gt;= DATE_FORMAT(#{startTime},'%Y-%m-%d')</if>
+            <if test="endTime != null">and DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d')</if>
+        </where>
+    </select>
 </mapper>
 </mapper>

+ 13 - 1
ruoyi-system/src/main/resources/mapper/system/ReportQueryLogMapper.xml

@@ -31,7 +31,7 @@
 
 
     <select id="selectReportQueryLogList" parameterType="ReportQueryLog" resultMap="ReportQueryLogResult">
     <select id="selectReportQueryLogList" parameterType="ReportQueryLog" resultMap="ReportQueryLogResult">
         <include refid="selectReportQueryLogVo"/>
         <include refid="selectReportQueryLogVo"/>
-        where
+        <where>
         is_del = 'N'
         is_del = 'N'
         <if test="reportNumber != null  and reportNumber != ''">and report_number = #{reportNumber}</if>
         <if test="reportNumber != null  and reportNumber != ''">and report_number = #{reportNumber}</if>
         <if test="queryName != null  and queryName != ''">and query_name like concat('%', #{queryName}, '%')</if>
         <if test="queryName != null  and queryName != ''">and query_name like concat('%', #{queryName}, '%')</if>
@@ -42,6 +42,7 @@
         <if test="queryType != null  and queryType != ''">and query_type = #{queryType}</if>
         <if test="queryType != null  and queryType != ''">and query_type = #{queryType}</if>
         <if test="queryMode != null  and queryMode != ''">and query_mode = #{queryMode}</if>
         <if test="queryMode != null  and queryMode != ''">and query_mode = #{queryMode}</if>
         <if test="queryNum != null  and queryNum != ''">and query_num = #{queryNum}</if>
         <if test="queryNum != null  and queryNum != ''">and query_num = #{queryNum}</if>
+        </where>
         order by create_time DESC
         order by create_time DESC
     </select>
     </select>
 
 
@@ -126,4 +127,15 @@
             #{logId}
             #{logId}
         </foreach>
         </foreach>
     </delete>
     </delete>
+
+
+    <select id="selectReportQueryLogCount" parameterType="Date" resultType="int">
+        select ifnull(count(1),0) as num from report_query_log
+        <where>
+            is_del = 'N'
+            <if test="today != null">and DATE_FORMAT(create_time,'%Y-%m-%d') = DATE_FORMAT(#{today},'%Y-%m-%d')</if>
+            <if test="startTime != null">and DATE_FORMAT(create_time,'%Y-%m-%d') &gt;= DATE_FORMAT(#{startTime},'%Y-%m-%d')</if>
+            <if test="endTime != null">and DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{endTime},'%Y-%m-%d')</if>
+        </where>
+    </select>
 </mapper>
 </mapper>