Browse Source

fix 新车规则维护不保存时间问题

liub 2 weeks ago
parent
commit
f1111455dd

+ 1 - 1
authentication/src/main/java/com/jzg/mapper/SysUserJzgInfoMapper.java

@@ -19,7 +19,7 @@ public interface SysUserJzgInfoMapper extends BaseMapper<SysUserJzgInfo> {
      * 一个用户可能存在多个身份,用逗号分隔返回
      *
      * @param userId sys_user_jzg_info 表中的 userid(即 sys_user.id)
-     * @author lipf
+     * @author liub
      * @date 2026/8/29
      */
     @Select("SELECT GROUP_CONCAT(DISTINCT s.type_attr SEPARATOR ',') FROM sys_user_jzg_info_salesman s " +

+ 4 - 3
commons/src/main/java/com/jzg/commons/entity/po/PtlNewCarJudgeRules.java

@@ -3,12 +3,11 @@ package com.jzg.commons.entity.po;
 
 import com.alibaba.excel.annotation.ExcelIgnore;
 import com.baomidou.mybatisplus.annotation.*;
-import com.jzg.commons.core.base.BaseModel;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
 
 import java.time.LocalDateTime;
-import java.util.Date;
 
 
 /**
@@ -38,7 +37,9 @@ public class PtlNewCarJudgeRules{
 
     private String isEffective;
 
-    private Date saveDate;
+    @Schema(description = "插入时间")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private LocalDateTime saveDate;
 
     @ExcelIgnore
     @Schema(description = "是否删除")

+ 2 - 18
tenant/organization/src/main/java/com/jzg/organization/controller/NewCarJudgeRulesController.java

@@ -1,34 +1,16 @@
 package com.jzg.organization.controller;
 
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.jzg.commons.constants.OperationTypeEnum;
 import com.jzg.commons.core.base.BaseController;
 import com.jzg.commons.core.page.HttpResult;
-import com.jzg.commons.entity.dto.*;
-import com.jzg.commons.entity.enums.YesNoEnum;
-import com.jzg.commons.entity.po.OperatorTrajectory;
-import com.jzg.commons.entity.po.PtlAgreement;
 import com.jzg.commons.entity.po.PtlNewCarJudgeRules;
-import com.jzg.commons.entity.vo.AgreementVo;
 import com.jzg.commons.entity.vo.NewCarQuery;
-import com.jzg.commons.entity.vo.UpAndDownVo;
-import com.jzg.commons.service.OperatorTrajectoryService;
-import com.jzg.commons.util.AssertionUtils;
-import com.jzg.commons.util.spring.SpringUtils;
-import com.jzg.organization.mapper.PtlAgreementMapper;
 import com.jzg.organization.service.NewCarJudgeRulesService;
-import com.jzg.organization.service.PtlAgreementDeptService;
-import com.jzg.organization.service.PtlAgreementService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import java.time.LocalDateTime;
-import java.util.List;
-import java.util.Objects;
 
 /**
  * 协议管理接口
@@ -60,12 +42,14 @@ public class NewCarJudgeRulesController extends BaseController {
     @PostMapping("addNewCar")
     public HttpResult addNewCar(@RequestBody PtlNewCarJudgeRules newCarJudgeRules){
         newCarJudgeRules.setSystemCode(getUserSystemCode());
+        newCarJudgeRules.setSaveDate(LocalDateTime.now());
         return newCarJudgeRulesService.addNewCar(newCarJudgeRules) ? HttpResult.ok("添加新旧车规则成功") : HttpResult.error("添加新旧车规则失败");
     }
 
     @Operation(summary = "修改新旧车规则")
     @PostMapping("updateNewCar")
     public HttpResult updateNewCar(@RequestBody PtlNewCarJudgeRules newCarJudgeRules){
+        newCarJudgeRules.setSaveDate(LocalDateTime.now());
         return newCarJudgeRulesService.updateNewCar(newCarJudgeRules) ? HttpResult.ok("修改新旧车规则成功") : HttpResult.error("修改新旧车规则失败");
     }