Ver Fonte

修复 时间显示bug

lws há 3 anos atrás
pai
commit
5f329bb7ec

+ 5 - 0
src/main/java/com/metro/entity/po/Account.java

@@ -1,6 +1,9 @@
 package com.metro.entity.po;
 
+import com.alibaba.fastjson.annotation.JSONField;
 import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Builder;
 import lombok.Data;
 import lombok.experimental.Accessors;
@@ -83,6 +86,7 @@ public class Account {
      * 创建时间
      */
     @TableField(value = "create_time", fill = FieldFill.INSERT)
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT-8")
     private LocalDateTime createTime;
     /*
     * 创建人
@@ -94,6 +98,7 @@ public class Account {
     * 修改时间
     * */
     @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT-8")
     private LocalDateTime updateTime;
 
     /*

+ 6 - 33
src/main/java/com/metro/entity/po/PassreCords.java

@@ -95,13 +95,10 @@ public class PassreCords {
      * 身份证照片
      **/
     private String idPhoto;
-
-    /*
-    * 临时照片
-    * */
-    private String img;
-
-
+    /**
+     * 现场照片
+     **/
+    private String scenePhoto;
     /**
      * 身份证地区
      */
@@ -117,11 +114,6 @@ public class PassreCords {
      */
     private String branchName;
 
-    /**
-     * 警员名称
-     */
-    private String staffName;
-
     /**
      * 警号
      */
@@ -163,36 +155,17 @@ public class PassreCords {
     * */
     private String displayMsg;
 
-    /*
-     * 详细地址
-     * */
-    private String address;
-
-    /*
-     * 是否删除 true 删除    false 不删除
-     * */
-    private Boolean isDelete;
 
 
-    /*
-    * 创建时间
-    * */
-    private LocalDateTime createTime;
-
-    /*
-    * 修改时间
-    * */
-    private LocalDateTime updateTimestamp;
-
     /*
     * 警示记录
     * */
-    private String warning;
+    /*private String warning;*/
 
     /*
      * 警示负责民警
      * */
-    private String peopleName;
+    private String staffName;
 
 
 

+ 4 - 0
src/main/java/com/metro/entity/ro/account/SelectAccountPageResp.java

@@ -1,6 +1,8 @@
 package com.metro.entity.ro.account;
 
+import com.alibaba.fastjson.annotation.JSONField;
 import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.metro.enums.UserEnums;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -56,6 +58,7 @@ public class SelectAccountPageResp implements Serializable {
     private String address;
 
     @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT-8")
     private LocalDateTime createTime;
 
     @ApiModelProperty(value = "创建人")
@@ -65,6 +68,7 @@ public class SelectAccountPageResp implements Serializable {
     private Integer type;
 
     @ApiModelProperty(value = "修改时间")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT-8")
     private LocalDateTime updateTime;
 
     @ApiModelProperty(value = "修改人")

+ 2 - 4
src/main/java/com/metro/entity/ro/passrecords/SelectPassreCordsPageListResp.java

@@ -31,7 +31,7 @@ public class SelectPassreCordsPageListResp implements Serializable {
     private String cardId;
 
     @ApiModelProperty(value = "现场照片")
-    private String img;
+    private String scenePhoto;
     @ApiModelProperty(value = "手机号")
     private String phone;
 
@@ -66,10 +66,8 @@ public class SelectPassreCordsPageListResp implements Serializable {
     private String branchName;
 
     @ApiModelProperty(value = "民警名")
-    private String peopleName;
+    private String staffName;
 
-    @ApiModelProperty(value = "创建时间")
-    private LocalDateTime createTime;
 
 
 

+ 0 - 56
src/main/java/com/metro/job/HealthCodeTask.java

@@ -1,56 +0,0 @@
-package com.metro.job;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.metro.utils.HttpClientUtil;
-import lombok.extern.log4j.Log4j2;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-import java.time.LocalDateTime;
-
-/**
- * 健康码定时任务
- *
- * @author :lws
- * @date :2022/3/16 12:18
- */
-@Component
-@EnableScheduling
-@Log4j2
-@Slf4j
-public class HealthCodeTask {
-
-    /**
-     * 健康码-新冠疫苗接种-核酸检测3合1接口
-     * 健康码检测定时任务
-     */
-    @Scheduled(cron = "0/5 * * * * ?")
-    public void healthCode() {
-
-        long begin = System.currentTimeMillis();
-        String params = "{\"sfzh\": \"410322199907309877\",\"xm\": \"\"}";
-        String result = HttpClientUtil.httpPostSetConfig("http://115.236.38.205:8903/id/hvn", params);
-        if (StringUtils.isEmpty(result)) {
-            long timeValue = System.currentTimeMillis() - begin;
-            log.error("调用3合1接口调用失败,总耗时: {} 毫秒",timeValue);
-            return;
-        }
-        JSONObject jsonObject = JSON.parseObject(result);
-        if (jsonObject.get("error_code").equals("00")) {
-            long timeValue = System.currentTimeMillis() - begin;
-        } else {
-            long timeValue = System.currentTimeMillis() - begin;
-            log.error("调用核酸检测3合1接口失败!:返回结果为:{},总耗时:{} 毫秒", result,timeValue);
-
-        }
-
-
-
-    }
-
-
-}

+ 0 - 48
src/main/java/com/metro/job/RenheCodeTask.java

@@ -1,48 +0,0 @@
-package com.metro.job;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.metro.utils.HttpClientUtil;
-import lombok.extern.log4j.Log4j2;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
-
-/**
- * @ClassName: RenheCodeTask
- * @Description: TODO
- * @Author: ZS
- * @CreateName: lws
- * @Date 2022/3/23 16:18
- * ...
- */
-@Component
-@EnableScheduling
-@Log4j2
-@Slf4j
-public class RenheCodeTask {
-
-    @Scheduled(cron = "0/5 * * * * ?")
-    public void boot(){
-        long begin = System.currentTimeMillis();
-        String params = "{\"idNumber\": \"410322199907309877\",\"token\":\"hh_token_51063b27-9fd8-420d-b7eb-e5600fe0dec9\"}";
-        String result = HttpClientUtil.httpPostSetConfig("https://renhe.hz-hanghui.com/health-code/hh/getHealthCode", params);
-        if (StringUtils.isEmpty(result)) {
-            long timeValue = System.currentTimeMillis() - begin;
-            log.error("调用仁和接口调用失败,总耗时: {} 毫秒",timeValue);
-            return;
-        }
-        JSONObject jsonObject = JSON.parseObject(result);
-        if (200==jsonObject.getInteger("code")) {
-            long timeValue = System.currentTimeMillis() - begin;
-        } else {
-            long timeValue = System.currentTimeMillis() - begin;
-            log.error("调用仁和失败!:返回结果为:{},总耗时:{} 毫秒", result,timeValue);
-        }
-
-
-
-    }
-}

+ 1 - 0
src/main/java/com/metro/service/impl/AccountServiceImpl.java

@@ -91,6 +91,7 @@ public class AccountServiceImpl extends BaseService implements AccountService {
         wrapper.like(StringUtils.isNotEmpty(req.getUserName()), Account::getUserName, req.getUserName());
         wrapper.eq(StringUtils.isNotEmpty(req.getPhone()), Account::getPhone, req.getPhone());
         wrapper.eq(Account::getIsDelete, UserConstant.NOT_DELETE);
+        wrapper.orderByDesc(Account::getCreateTime);
         if(getAccountInfo().getType()==2){
             wrapper.gt(Account::getType, getAccountInfo().getType());
         } else wrapper.eq(Account::getType, getAccountInfo().getType()+1);

+ 2 - 4
src/main/java/com/metro/service/impl/PassreCordsServiceImpl.java

@@ -79,8 +79,7 @@ public class PassreCordsServiceImpl extends BaseService implements PassreCordsSe
      * */
     @Override
     public DeletePassreCordsResq delete(DeletePassreCordsReq req) {
-        return new DeletePassreCordsResq().setCount(passreCordsMapper.updateById(new PassreCords().setId(req.getId())
-                .setIsDelete(UserConstant.DELETE).setUpdateTimestamp(LocalDateTime.now())));
+        return new DeletePassreCordsResq().setCount(passreCordsMapper.deleteById(req.getId()));
 
     }
 
@@ -111,10 +110,9 @@ public class PassreCordsServiceImpl extends BaseService implements PassreCordsSe
             //显示该民警产生的盘查记录 companyID = 记录companyID branchID = 记录branchId userName = peopleName
             wrapper.eq(PassreCords::getCompanyId, getAccountInfo().getCompanyId()).
                     eq(PassreCords::getBranchId, getAccountInfo().getBranchId()).
-                    eq(PassreCords::getPeopleName,getAccountInfo().getUserName());
+                    eq(PassreCords::getStaffName,getAccountInfo().getUserName());
 
         }
-        //wrapper.eq(PassreCords::getIsDelete, UserConstant.NOT_DELETE);
         wrapper.eq(StringUtils.isNotEmpty(req.getXm()), PassreCords::getXm, req.getXm());
         wrapper.eq(StringUtils.isNotEmpty(req.getCardId()), PassreCords::getCardId, req.getCardId());
         wrapper.eq(StringUtils.isNotEmpty(req.getPhone()), PassreCords::getPhone, req.getPhone());

+ 1 - 1
src/main/java/com/metro/utils/FileUtils.java

@@ -63,7 +63,7 @@ public class FileUtils {
         }
         assert path != null;
         if (!path.exists()) path = new File("");
-        File upload = new File(path.getAbsolutePath(), "../../uploadFile/upload/");
+        File upload = new File(path.getAbsolutePath(), "../uploadFile/upload/");
         if (!upload.exists()) upload.mkdirs();
         return upload.getAbsolutePath();
     }