Browse Source

添加查询结果日志记录.

yinhao 3 years ago
parent
commit
dc252b4f4e

+ 7 - 2
huimv-manage/src/main/java/com/huimv/manage/eartag/service/impl/EarmarkServiceImpl.java

@@ -9,6 +9,7 @@ import com.huimv.manage.eartag.service.IEarmarkService;
 import com.huimv.manage.util.*;
 import com.huimv.manage.webservice.Soap;
 import com.huimv.manage.webservice.task.EarmarkTask;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.domain.Example;
@@ -35,6 +36,7 @@ import java.util.*;
  * @Create : 2020-12-25
  **/
 @Service
+@Slf4j
 public class EarmarkServiceImpl implements IEarmarkService {
     @Value("${webservice.url}")
     private String webServiceUrl;
@@ -192,7 +194,8 @@ public class EarmarkServiceImpl implements IEarmarkService {
                 if (optional.isPresent()){
                     EtEarmarkEntity earmarkEntity1  = (EtEarmarkEntity) optional.get();
                     earmarkEntity1.setSetDownState(1);
-                    earmarkEntity1.setSetDownDate(new Timestamp(new Date().getTime()));
+//                    earmarkEntity1.setSetDownDate(new Timestamp(new Date().getTime()));
+                    earmarkEntity1.setSetDownDate(new Timestamp(System.currentTimeMillis()));
                     earmarkRepo.saveAndFlush(earmarkEntity1);
                 }else{
                     return new Result(Const.CODE_NO_RECORD,Const.NO_RECORD,false);
@@ -265,7 +268,8 @@ public class EarmarkServiceImpl implements IEarmarkService {
             Optional optional = earmarkRepo.findById(Integer.parseInt(idArray[a]));
             EtEarmarkEntity earmarkEntity = (EtEarmarkEntity) optional.get();
             earmarkEntity.setSetPrintState(state);
-            earmarkEntity.setSetPrintDate(new Timestamp(new Date().getTime()));
+//            earmarkEntity.setSetPrintDate(new Timestamp(new Date().getTime()));
+            earmarkEntity.setSetPrintDate(new Timestamp(System.currentTimeMillis()));
             earmarkRepo.saveAndFlush(earmarkEntity);
         }
         return new Result(ResultCode.SUCCESS);
@@ -322,6 +326,7 @@ public class EarmarkServiceImpl implements IEarmarkService {
         };
         //
         List<EtEarmarkEntity> dataList = earmarkRepo.findAll(specific);
+        log.info("导出数据数量:"+dataList.size());
         //
         excelUtil.exportEarmarkExcel(response,Const.EXPORT_EARMARK_EXCEL,String.valueOf(applyId),dataList,quantity);
         // test

+ 4 - 0
huimv-manage/src/main/java/com/huimv/manage/util/ExcelUtil.java

@@ -1,6 +1,7 @@
 package com.huimv.manage.util;
 
 import com.huimv.manage.dao.entity.EtEarmarkEntity;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.poi.hssf.usermodel.HSSFCellStyle;
 import org.apache.poi.hssf.util.HSSFColor;
 import org.apache.poi.ss.usermodel.*;
@@ -27,6 +28,7 @@ import java.util.List;
  * @Create : 2020-12-25
  **/
 @Component
+@Slf4j
 public class ExcelUtil {
 
     /**
@@ -70,11 +72,13 @@ public class ExcelUtil {
                 cell.setCellValue(titleList.get(i));
                 cell.setCellStyle(cellStyleHeader);
             }
+            log.info("导出记录数="+dataList.size());
             //设置内容行
             if(dataList!=null && dataList.size()>0){
                 //序号是从1开始的
                 int count = 0;
                 for(int a=0;a<dataList.size();a++){
+                    log.info("行数="+excelRow);
                     EtEarmarkEntity earmarkEntity = dataList.get(a);
                     count = 0;
                     Row dataRow = sheet1.createRow(++excelRow);