From a1fc7e3e337393954a95b5f85c1a3f59d61208c4 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期四, 28 十一月 2024 01:31:02 +0800
Subject: [PATCH] 投资基本信息

---
 business/src/main/java/com/ycl/domain/form/ProjectInvestmentInfoForm.java         |   28 +------------
 business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java |    9 ++++
 business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java           |    2 
 business/src/main/java/com/ycl/domain/vo/ProjectInvestmentInfoVO.java             |   11 +----
 business/src/main/java/com/ycl/domain/entity/ProjectInvestmentInfo.java           |   12 +----
 business/src/main/java/com/ycl/controller/ProjectInvestmentInfoController.java    |   16 ++++----
 6 files changed, 26 insertions(+), 52 deletions(-)

diff --git a/business/src/main/java/com/ycl/controller/ProjectInvestmentInfoController.java b/business/src/main/java/com/ycl/controller/ProjectInvestmentInfoController.java
index c809bd6..7a6d79b 100644
--- a/business/src/main/java/com/ycl/controller/ProjectInvestmentInfoController.java
+++ b/business/src/main/java/com/ycl/controller/ProjectInvestmentInfoController.java
@@ -27,55 +27,55 @@
 @RequiredArgsConstructor
 @Api(value = "鎶曡祫椤圭洰鍩虹淇℃伅琛�", tags = "鎶曡祫椤圭洰鍩虹淇℃伅琛ㄧ鐞�")
 @RestController
-@RequestMapping("/project-investment-info")
+@RequestMapping("/project/investmentInfo")
 public class ProjectInvestmentInfoController {
 
     private final ProjectInvestmentInfoService projectInvestmentInfoService;
 
     @PostMapping
     @ApiOperation(value = "娣诲姞", notes = "娣诲姞")
-    @PreAuthorize("hasAuthority('projectInvestmentInfo:add')")
+//    @PreAuthorize("hasAuthority('projectInvestmentInfo:add')")
     public Result add(@RequestBody @Validated(Add.class) ProjectInvestmentInfoForm form) {
         return projectInvestmentInfoService.add(form);
     }
 
     @PutMapping
     @ApiOperation(value = "淇敼", notes = "淇敼")
-    @PreAuthorize("hasAuthority('projectInvestmentInfo:edit')")
+//    @PreAuthorize("hasAuthority('projectInvestmentInfo:edit')")
     public Result update(@RequestBody @Validated(Update.class) ProjectInvestmentInfoForm form) {
         return projectInvestmentInfoService.update(form);
     }
 
     @DeleteMapping("/{id}")
     @ApiOperation(value = "ID鍒犻櫎", notes = "ID鍒犻櫎")
-    @PreAuthorize("hasAuthority('projectInvestmentInfo:del')")
+//    @PreAuthorize("hasAuthority('projectInvestmentInfo:del')")
     public Result removeById(@PathVariable("id") String id) {
         return projectInvestmentInfoService.removeById(id);
     }
 
     @DeleteMapping("/batch")
     @ApiOperation(value = "鎵归噺鍒犻櫎", notes = "鎵归噺鍒犻櫎")
-    @PreAuthorize("hasAuthority('projectInvestmentInfo:del:batch')")
+//    @PreAuthorize("hasAuthority('projectInvestmentInfo:del:batch')")
     public Result remove(@RequestBody @NotEmpty(message = "璇烽�夋嫨鏁版嵁") List<String> ids) {
         return projectInvestmentInfoService.remove(ids);
     }
 
     @GetMapping("/page")
     @ApiOperation(value = "鍒嗛〉", notes = "鍒嗛〉")
-    @PreAuthorize("hasAuthority('projectInvestmentInfo:page')")
+//    @PreAuthorize("hasAuthority('projectInvestmentInfo:page')")
     public Result page(ProjectInvestmentInfoQuery query) {
         return projectInvestmentInfoService.page(query);
     }
 
     @GetMapping("/{id}")
     @ApiOperation(value = "璇︽儏", notes = "璇︽儏")
-    @PreAuthorize("hasAuthority('projectInvestmentInfo:detail')")
+//    @PreAuthorize("hasAuthority('projectInvestmentInfo:detail')")
     public Result detail(@PathVariable("id") Integer id) {
         return projectInvestmentInfoService.detail(id);
     }
 
     @GetMapping("/list")
-    @PreAuthorize("hasAuthority('projectInvestmentInfo:list')")
+//    @PreAuthorize("hasAuthority('projectInvestmentInfo:list')")
     @ApiOperation(value = "鍒楄〃", notes = "鍒楄〃")
     public Result list() {
         return projectInvestmentInfoService.all();
diff --git a/business/src/main/java/com/ycl/domain/entity/ProjectInvestmentInfo.java b/business/src/main/java/com/ycl/domain/entity/ProjectInvestmentInfo.java
index 13fbbbb..fefc6a7 100644
--- a/business/src/main/java/com/ycl/domain/entity/ProjectInvestmentInfo.java
+++ b/business/src/main/java/com/ycl/domain/entity/ProjectInvestmentInfo.java
@@ -6,6 +6,7 @@
 import lombok.Data;
 
 import java.time.LocalDateTime;
+import java.util.Date;
 
 /**
  * 鎶曡祫椤圭洰鍩虹淇℃伅琛�
@@ -45,11 +46,11 @@
 
     @TableField("planned_start_date")
     /** 璁″垝寮�宸ユ椂闂� */
-    private LocalDateTime plannedStartDate;
+    private Date plannedStartDate;
 
     @TableField("expected_completion_date")
     /** 鎷熷缓鎴愭椂闂� */
-    private LocalDateTime expectedCompletionDate;
+    private Date expectedCompletionDate;
 
     @TableField("national_industry_classification")
     /** 鍥芥爣琛屼笟鍒嗙被 */
@@ -79,17 +80,10 @@
     /** 寤虹骞冲彴浠g爜 */
     private String code;
 
-    @TableField("gmt_create_time")
-    /** 鍒涘缓鏃堕棿 */
-    private LocalDateTime gmtCreateTime;
-
     @TableField("create_by")
     /** 鍒涘缓浜� */
     private Long createBy;
 
-    @TableField("gmt_update_time")
-    /** 鏇存柊鏃堕棿 */
-    private LocalDateTime gmtUpdateTime;
 
     @TableField("update_by")
     /** 鏇存柊浜� */
diff --git a/business/src/main/java/com/ycl/domain/form/ProjectInvestmentInfoForm.java b/business/src/main/java/com/ycl/domain/form/ProjectInvestmentInfoForm.java
index eaad73a..3faafe5 100644
--- a/business/src/main/java/com/ycl/domain/form/ProjectInvestmentInfoForm.java
+++ b/business/src/main/java/com/ycl/domain/form/ProjectInvestmentInfoForm.java
@@ -1,5 +1,6 @@
 package com.ycl.domain.form;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ycl.common.group.Update;
 import com.ycl.common.group.Add;
 import com.ycl.system.domain.base.AbsForm;
@@ -23,79 +24,56 @@
 @ApiModel(value = "ProjectInvestmentInfo琛ㄥ崟", description = "鎶曡祫椤圭洰鍩虹淇℃伅琛ㄨ〃鍗�")
 public class ProjectInvestmentInfoForm extends AbsForm {
 
-    @NotNull(message = "椤圭洰id涓嶈兘涓虹┖", groups = {Add.class, Update.class})
     @ApiModelProperty("椤圭洰id")
     private Long projectId;
 
-    @NotNull(message = "寤鸿鍦扮偣鏄惁璺ㄥ煙涓嶈兘涓虹┖", groups = {Add.class, Update.class})
     @ApiModelProperty("寤鸿鍦扮偣鏄惁璺ㄥ煙")
     private Integer beCrossRegion;
 
-    @NotBlank(message = "椤圭洰寤鸿鍦扮偣涓嶈兘涓虹┖", groups = {Add.class, Update.class})
     @ApiModelProperty("椤圭洰寤鸿鍦扮偣")
     private String constructionLocation;
 
-    @NotBlank(message = "寤鸿璇︾粏鍦板潃涓嶈兘涓虹┖", groups = {Add.class, Update.class})
     @ApiModelProperty("寤鸿璇︾粏鍦板潃")
     private String detailedAddress;
 
-    @NotNull(message = "鏄惁鏄ˉ鐮侀」鐩笉鑳戒负绌�", groups = {Add.class, Update.class})
     @ApiModelProperty("鏄惁鏄ˉ鐮侀」鐩�")
     private Integer beCompensationProject;
 
-    @NotBlank(message = "琛ョ爜鍘熷洜涓嶈兘涓虹┖", groups = {Add.class, Update.class})
     @ApiModelProperty("琛ョ爜鍘熷洜")
     private String compensationReason;
 
-    @NotNull(message = "璁″垝寮�宸ユ椂闂翠笉鑳戒负绌�", groups = {Add.class, Update.class})
     @ApiModelProperty("璁″垝寮�宸ユ椂闂�")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date plannedStartDate;
 
-    @NotNull(message = "鎷熷缓鎴愭椂闂翠笉鑳戒负绌�", groups = {Add.class, Update.class})
     @ApiModelProperty("鎷熷缓鎴愭椂闂�")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date expectedCompletionDate;
 
-    @NotBlank(message = "鍥芥爣琛屼笟鍒嗙被涓嶈兘涓虹┖", groups = {Add.class, Update.class})
     @ApiModelProperty("鍥芥爣琛屼笟鍒嗙被")
     private String nationalIndustryClassification;
 
-    @NotBlank(message = "鎵�灞炶涓氬垎绫讳笉鑳戒负绌�", groups = {Add.class, Update.class})
     @ApiModelProperty("鎵�灞炶涓氬垎绫�")
     private String industryClassification;
 
-    @NotBlank(message = "椤圭洰寤鸿鎬ц川涓嶈兘涓虹┖", groups = {Add.class, Update.class})
     @ApiModelProperty("椤圭洰寤鸿鎬ц川")
     private String projectNature;
 
-    @NotBlank(message = "椤圭洰灞炴�т笉鑳戒负绌�", groups = {Add.class, Update.class})
     @ApiModelProperty("椤圭洰灞炴��")
     private String projectAttribute;
 
-    @NotNull(message = "鏄惁浣跨敤鍦熷湴涓嶈兘涓虹┖", groups = {Add.class, Update.class})
     @ApiModelProperty("鏄惁浣跨敤鍦熷湴")
     private Integer useEarth;
 
-    @NotBlank(message = "涓昏寤鸿鍐呭鍙婅妯′笉鑳戒负绌�", groups = {Add.class, Update.class})
     @ApiModelProperty("涓昏寤鸿鍐呭鍙婅妯�")
     private String contentScale;
 
-    @NotBlank(message = "寤虹骞冲彴浠g爜涓嶈兘涓虹┖", groups = {Add.class, Update.class})
     @ApiModelProperty("寤虹骞冲彴浠g爜")
     private String code;
 
-    @NotNull(message = "鍒涘缓鏃堕棿涓嶈兘涓虹┖", groups = {Add.class, Update.class})
-    @ApiModelProperty("鍒涘缓鏃堕棿")
-    private Date gmtCreateTime;
-
-    @NotNull(message = "鍒涘缓浜轰笉鑳戒负绌�", groups = {Add.class, Update.class})
     @ApiModelProperty("鍒涘缓浜�")
     private Long createBy;
 
-    @NotNull(message = "鏇存柊鏃堕棿涓嶈兘涓虹┖", groups = {Add.class, Update.class})
-    @ApiModelProperty("鏇存柊鏃堕棿")
-    private Date gmtUpdateTime;
-
-    @NotNull(message = "鏇存柊浜轰笉鑳戒负绌�", groups = {Add.class, Update.class})
     @ApiModelProperty("鏇存柊浜�")
     private Long updateBy;
 
diff --git a/business/src/main/java/com/ycl/domain/vo/ProjectInvestmentInfoVO.java b/business/src/main/java/com/ycl/domain/vo/ProjectInvestmentInfoVO.java
index 4cd10ec..327eada 100644
--- a/business/src/main/java/com/ycl/domain/vo/ProjectInvestmentInfoVO.java
+++ b/business/src/main/java/com/ycl/domain/vo/ProjectInvestmentInfoVO.java
@@ -1,5 +1,6 @@
 package com.ycl.domain.vo;
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ycl.system.domain.base.AbsVo;
 import com.ycl.domain.entity.ProjectInvestmentInfo;
 import java.util.List;
@@ -46,10 +47,12 @@
 
     /** 璁″垝寮�宸ユ椂闂� */
     @ApiModelProperty("璁″垝寮�宸ユ椂闂�")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date plannedStartDate;
 
     /** 鎷熷缓鎴愭椂闂� */
     @ApiModelProperty("鎷熷缓鎴愭椂闂�")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date expectedCompletionDate;
 
     /** 鍥芥爣琛屼笟鍒嗙被 */
@@ -80,17 +83,9 @@
     @ApiModelProperty("寤虹骞冲彴浠g爜")
     private String code;
 
-    /** 鍒涘缓鏃堕棿 */
-    @ApiModelProperty("鍒涘缓鏃堕棿")
-    private Date gmtCreateTime;
-
     /** 鍒涘缓浜� */
     @ApiModelProperty("鍒涘缓浜�")
     private Long createBy;
-
-    /** 鏇存柊鏃堕棿 */
-    @ApiModelProperty("鏇存柊鏃堕棿")
-    private Date gmtUpdateTime;
 
     /** 鏇存柊浜� */
     @ApiModelProperty("鏇存柊浜�")
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
index 22848db..1cddb79 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInfoServiceImpl.java
@@ -63,7 +63,7 @@
             item.setType(FileTypeEnum.PROJECT_INFO);
         });
         fileService.saveBatch(fileList);
-        return Result.ok("娣诲姞鎴愬姛");
+        return Result.ok("娣诲姞鎴愬姛").data(entity.getId());
     }
 
     /**
diff --git a/business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java b/business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java
index 064a4b9..d054f1a 100644
--- a/business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java
+++ b/business/src/main/java/com/ycl/service/impl/ProjectInvestmentInfoServiceImpl.java
@@ -1,6 +1,7 @@
 package com.ycl.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ycl.common.utils.SecurityUtils;
 import com.ycl.domain.entity.ProjectInvestmentInfo;
 import com.ycl.mapper.ProjectInvestmentInfoMapper;
 import com.ycl.service.ProjectInvestmentInfoService;
@@ -38,8 +39,12 @@
     @Override
     public Result add(ProjectInvestmentInfoForm form) {
         ProjectInvestmentInfo entity = ProjectInvestmentInfoForm.getEntityByForm(form, null);
+        Long userId = SecurityUtils.getUserId();
+        entity.setCreateBy(userId);
+        entity.setUpdateBy(userId);
+
         baseMapper.insert(entity);
-        return Result.ok("娣诲姞鎴愬姛");
+        return Result.ok("娣诲姞鎴愬姛").data(entity.getId());
     }
 
     /**
@@ -54,6 +59,8 @@
         // 涓虹┖鎶汭llegalArgumentException锛屽仛鍏ㄥ眬寮傚父澶勭悊
         Assert.notNull(entity, "璁板綍涓嶅瓨鍦�");
         BeanUtils.copyProperties(form, entity);
+        Long userId = SecurityUtils.getUserId();
+        entity.setUpdateBy(userId);
         baseMapper.updateById(entity);
         return Result.ok("淇敼鎴愬姛");
     }

--
Gitblit v1.8.0