From 1b910faabb48b3355783a612e41c5b55942c34a4 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期三, 06 八月 2025 15:55:08 +0800
Subject: [PATCH] 修改bug

---
 pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/crops/CropsCtrl.java |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/crops/CropsCtrl.java b/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/crops/CropsCtrl.java
index 39d892e..d5b1e61 100644
--- a/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/crops/CropsCtrl.java
+++ b/pipIrr-platform/pipIrr-web/pipIrr-web-model/src/main/java/com/dy/pipIrrModel/crops/CropsCtrl.java
@@ -1,6 +1,7 @@
 package com.dy.pipIrrModel.crops;
 
 import com.dy.common.aop.SsoAop;
+import com.dy.common.util.DateTime;
 import com.dy.common.webUtil.BaseResponse;
 import com.dy.common.webUtil.BaseResponseUtils;
 import com.dy.common.webUtil.QueryResultVo;
@@ -20,6 +21,7 @@
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Objects;
 
@@ -53,7 +55,7 @@
                             schema = @Schema(implementation = VoCrops.class))}
             )
     })
-    @GetMapping(path = "one", consumes = MediaType.TEXT_PLAIN_VALUE)
+    @GetMapping(path = "one")
     @SsoAop()
     public BaseResponse<VoCrops> one(Long id){
         return BaseResponseUtils.buildSuccess(this.sv.selectById(id));
@@ -71,7 +73,7 @@
                             schema = @Schema(implementation = VoCrops.class))}
             )
     })
-    @PostMapping(path = "some", consumes = MediaType.APPLICATION_JSON_VALUE)
+    @PostMapping(path = "some")
     @SsoAop()
     public BaseResponse<QueryResultVo<List<VoCrops>>> some(@RequestBody CropsQo qo){
         try {
@@ -104,6 +106,8 @@
             return BaseResponseUtils.buildFail(Objects.requireNonNull(bindingResult.getFieldError()).getDefaultMessage());
         }
         po.id = null ;
+        po.createDt = new Date();
+        po.deleted = 0 ;
         int count;
         try {
             count = this.sv.save(po);
@@ -140,6 +144,8 @@
         if(po.id == null){
             return BaseResponseUtils.buildFail("鏃犳暟鎹疄浣揑D") ;
         }
+        po.createDt = null ;
+        po.deleted = null ;
         int count;
         try {
             count = this.sv.update(po);
@@ -169,7 +175,7 @@
                             schema = @Schema(implementation = Boolean.class))}
             )
     })
-    @GetMapping(path = "delete", consumes = MediaType.TEXT_PLAIN_VALUE)
+    @GetMapping(path = "delete")
     @SsoAop()
     public BaseResponse<Boolean> delete(Long id){
         if(id == null){

--
Gitblit v1.8.0