Kaynağa Gözat

Merge branch 'dev' into sky_v2

15928045575 2 yıl önce
ebeveyn
işleme
a168160b56

+ 11 - 0
slope-common/slope-common-core/src/main/java/com/sckw/core/model/enums/MessageLogEnum.java

@@ -154,6 +154,17 @@ public enum MessageLogEnum {
     DEVICE_SETVALUE("slope_manage", "PROJECT_LOG", "设备基准值调整", "25",
             "设备【${name}】已被调整阈值,相关要素【${type}】,所属边坡【${desc}】", "设备基准值调整"),
 
+    /**
+     * 报表批量下载
+     */
+    REPORT_BATCH_EXPORT("slope_manage", "PROJECT_LOG", "报表批量下载", "26",
+            "共有${count}条边坡报表被批量下载,请确认", "报表批量下载"),
+    /**
+     * 报表批量删除
+     */
+    REPORT_BATCH_DELETE("slope_manage", "PROJECT_LOG", "报表批量删除", "27",
+            "共有${count}条边坡报表被批量删除,请确认", "报表批量删除"),
+
     ;
 
 

+ 1 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/model/vo/OriginalDeviceVO.java

@@ -22,7 +22,7 @@ public class OriginalDeviceVO implements Serializable {
 
     private String jsonText;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss:SSS",timezone = "GMT+8")
     private Date ts;
 
 }

+ 9 - 7
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/CommonService.java

@@ -23,14 +23,16 @@ import com.sckw.slope.detection.model.vo.QueryDictTypePageReqVo;
 import com.sckw.slope.detection.service.api.DetectionApiService;
 import jakarta.servlet.http.HttpServletRequest;
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
-import java.util.*;
+import java.util.Base64;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @author lfdc
@@ -57,11 +59,11 @@ public class CommonService {
         /**
          * {"companyId":"198","companyName":"四川金顶集团","createBy":"2","createName":"600678","updateBy":"2","updateName":"600678","mountainId":"198"}
          */
-//        String uInfo = request.getHeader("u_info");
-        String uInfo = "eyJjb21wYW55SWQiOiIxOTgiLCJjb21wYW55TmFtZSI6IuWbm+W3nemHkemhtumbhuWboiIsImNyZWF0ZUJ5IjoiMiIsImNyZWF0ZU5hbWUiOiI2MDA2NzgiLCJ1cGRhdGVCeSI6IjIiLCJ1cGRhdGVOYW1lIjoiNjAwNjc4IiwibW91bnRhaW5JZCI6IjE5OCJ9";
-        if (StringUtils.isBlank(uInfo)) {
-            throw new BusinessException("数据请求异常!");
-        }
+        String uInfo = request.getHeader("u_info");
+//        String uInfo = "eyJjb21wYW55SWQiOiIxOTgiLCJjb21wYW55TmFtZSI6IuWbm+W3nemHkemhtumbhuWboiIsImNyZWF0ZUJ5IjoiMiIsImNyZWF0ZU5hbWUiOiI2MDA2NzgiLCJ1cGRhdGVCeSI6IjIiLCJ1cGRhdGVOYW1lIjoiNjAwNjc4IiwibW91bnRhaW5JZCI6IjE5OCJ9";
+//        if (StringUtils.isBlank(uInfo)) {
+//            throw new BusinessException("数据请求异常!");
+//        }
         String message = new String(Base64.getDecoder().decode(uInfo));
         HeaderData headerData = JSONObject.parseObject(message, HeaderData.class);
         if (headerData.getMountainId().isBlank()) {

+ 9 - 0
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ReportService.java

@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.MessageLogEnum;
 import com.sckw.core.model.enums.ReportTypeEnum;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.StringUtils;
@@ -91,6 +93,9 @@ public class ReportService {
                         .set(KwsReportData::getDelFlag, 1));
             });
         }
+        Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+        logMap.put("count", list.size());
+        commonService.insertLog(MessageLogEnum.REPORT_BATCH_DELETE, headerData, logMap, headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
         return HttpResult.ok();
     }
 
@@ -100,6 +105,7 @@ public class ReportService {
      * @return
      */
     public HttpResult export(String ids, HttpServletRequest request) {
+        HeaderData headerData = commonService.getHeaderData(request);
         List<Long> list = StringUtils.splitStrToList(ids, Long.class);
         List<KwsReportData> kwsReportData = reportDataMapper.selectList(new LambdaQueryWrapper<KwsReportData>()
                 .eq(KwsReportData::getDelFlag, 0)
@@ -107,6 +113,9 @@ public class ReportService {
         List<String> fileUrls = new ArrayList<>();
         if (!CollectionUtils.isEmpty(kwsReportData)) {
             fileUrls = kwsReportData.stream().map(KwsReportData::getFileUrl).collect(Collectors.toList());
+            Map<String, Object> logMap = new HashMap<>(NumberConstant.SIXTEEN);
+            logMap.put("count", fileUrls.size());
+            commonService.insertLog(MessageLogEnum.REPORT_BATCH_EXPORT, headerData, logMap, headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
         }
         return HttpResult.ok(fileUrls);
     }

+ 1 - 1
slope-modules/slope-detection/src/main/java/com/sckw/slope/detection/service/ThresholdService.java

@@ -158,7 +158,7 @@ public class ThresholdService {
             dto.setStatus(setting);
             dto.setStatusName(statusName);
             dto.setPhones(phones.toString());
-            dto.setUpdateByName(CollectionUtils.isEmpty(kwsThresholds) ? null : kwsThresholds.get(0).getCreateName());
+            dto.setUpdateByName(CollectionUtils.isEmpty(kwsThresholds) ? null : kwsThresholds.get(0).getCreateBy().toString());
             dto.setUpdateTime(CollectionUtils.isEmpty(kwsThresholds) ? null : kwsThresholds.get(0).getCreateTime());
         }
         return PageRes.build(info, dtoList);