ZeroLiYi 1 год назад
Родитель
Сommit
37edadad67

+ 4 - 3
src/main/java/com/chinaitop/depot/storage/mapper/WarehouseSealingRecordMapper.xml

@@ -265,7 +265,7 @@
265 265
   <insert id="insert" keyProperty="id" useGeneratedKeys="true"  parameterType="com.chinaitop.depot.storage.model.WarehouseSealingRecord">
266 266
     insert into warehouse_sealing_record (id,fcqrdh,ywrq,basic_storehouse_id,basic_unit_aisle_id,warehouse_id,bgy,grain_variety_id,grain_nature_id,lssl,grain_grade_id,grain_area_id,shnd,
267 267
                                         sqr,bmsh, dwldsh,bz,czbz,zhgxsj,createname,createdate,
268
-                                       updatename,updatedate,glfs,status)
268
+                                       updatename,updatedate,glfs,status,rcsj)
269 269
     values (
270 270
              #{id,jdbcType=INTEGER},
271 271
             #{fcqrdh,jdbcType=VARCHAR},
@@ -289,7 +289,7 @@
289 289
             #{createname,jdbcType=VARCHAR},
290 290
             #{createdate,jdbcType=TIMESTAMP},
291 291
             #{updatename,jdbcType=VARCHAR},
292
-            #{updatedate,jdbcType=TIMESTAMP},#{glfs,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR})
292
+            #{updatedate,jdbcType=TIMESTAMP},#{glfs,jdbcType=VARCHAR},#{status,jdbcType=VARCHAR},#{rcsj,jdbcType=TIMESTAMP})
293 293
   </insert>
294 294
 
295 295
   <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.storage.model.WarehouseSealingRecord">
@@ -320,7 +320,8 @@
320 320
       updatename=#{updatename,jdbcType=VARCHAR},
321 321
       updatedate=#{updatedate,jdbcType=TIMESTAMP},
322 322
       glfs= #{glfs,jdbcType=VARCHAR},
323
-      status=#{status,jdbcType=VARCHAR}
323
+      status=#{status,jdbcType=VARCHAR},
324
+      rcsj=#{rcsj,jdbcType=TIMESTAMP}
324 325
   where id = #{id,jdbcType=INTEGER}
325 326
   </update>
326 327
 </mapper>

+ 4 - 2
src/main/java/com/chinaitop/depot/storage/service/impl/WarehouseSealingRecordServiceImpl.java

@@ -84,13 +84,14 @@ public class WarehouseSealingRecordServiceImpl implements WarehouseSealingRecord
84 84
             WareHouseVO wareHouseVO= WarehouseSealingRecordMapper.selectTyhwbm(WarehouseSealingRecord.getWarehouseId());
85 85
             if(wareHouseVO!=null){
86 86
                 WarehouseSealingRecord warehouseSealingRecord=  WarehouseSealingRecordMapper.selectFcqrd(WarehouseSealingRecord.getWarehouseId());
87
-                if(warehouseSealingRecord!=null){
87
+               if(warehouseSealingRecord!=null){
88 88
 //                    if(warehouseSealingRecord.getStatus()==1){
89 89
 //                        modelMap.put("message", "该货位已经生成粮情卡");
90 90
 //                        return modelMap;
91 91
 //
92 92
 //                    }
93 93
                     String fcqrd =warehouseSealingRecord.getFcqrdh();
94
+
94 95
                     int startIndex =fcqrd.length() - 11; // 假设20240909开始的位置是从字符串末尾数第15个字符开始
95 96
                     // 要截取的结束位置
96 97
                     int endIndex = fcqrd.length() - 3; // 假设20240909结束的位置是从字符串末尾数第9个字符结束
@@ -99,11 +100,12 @@ public class WarehouseSealingRecordServiceImpl implements WarehouseSealingRecord
99 100
                     String extractedDate = fcqrd.substring(startIndex, endIndex);
100 101
                     // 当前时间
101 102
 
102
-
103 103
                     // 将字符串转换为日期对象
104 104
                     String specificDateStr = extractedDate;
105 105
                     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
106 106
                     LocalDate specificDateObj = LocalDate.parse(specificDateStr, formatter);
107
+                   LocalDate today = LocalDate.now();
108
+
107 109
                     if (formattedDate.equals(extractedDate)){
108 110
                         // 使用正则表达式提取后三位数字
109 111
                         Pattern pattern = Pattern.compile("(\\d{3})$");