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

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

@@ -265,7 +265,7 @@
265
   <insert id="insert" keyProperty="id" useGeneratedKeys="true"  parameterType="com.chinaitop.depot.storage.model.WarehouseSealingRecord">
265
   <insert id="insert" keyProperty="id" useGeneratedKeys="true"  parameterType="com.chinaitop.depot.storage.model.WarehouseSealingRecord">
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,
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
                                         sqr,bmsh, dwldsh,bz,czbz,zhgxsj,createname,createdate,
267
                                         sqr,bmsh, dwldsh,bz,czbz,zhgxsj,createname,createdate,
268
-                                       updatename,updatedate,glfs,status)
268
+                                       updatename,updatedate,glfs,status,rcsj)
269
     values (
269
     values (
270
              #{id,jdbcType=INTEGER},
270
              #{id,jdbcType=INTEGER},
271
             #{fcqrdh,jdbcType=VARCHAR},
271
             #{fcqrdh,jdbcType=VARCHAR},
@@ -289,7 +289,7 @@
289
             #{createname,jdbcType=VARCHAR},
289
             #{createname,jdbcType=VARCHAR},
290
             #{createdate,jdbcType=TIMESTAMP},
290
             #{createdate,jdbcType=TIMESTAMP},
291
             #{updatename,jdbcType=VARCHAR},
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
   </insert>
293
   </insert>
294
 
294
 
295
   <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.storage.model.WarehouseSealingRecord">
295
   <update id="updateByPrimaryKey" parameterType="com.chinaitop.depot.storage.model.WarehouseSealingRecord">
@@ -320,7 +320,8 @@
320
       updatename=#{updatename,jdbcType=VARCHAR},
320
       updatename=#{updatename,jdbcType=VARCHAR},
321
       updatedate=#{updatedate,jdbcType=TIMESTAMP},
321
       updatedate=#{updatedate,jdbcType=TIMESTAMP},
322
       glfs= #{glfs,jdbcType=VARCHAR},
322
       glfs= #{glfs,jdbcType=VARCHAR},
323
-      status=#{status,jdbcType=VARCHAR}
323
+      status=#{status,jdbcType=VARCHAR},
324
+      rcsj=#{rcsj,jdbcType=TIMESTAMP}
324
   where id = #{id,jdbcType=INTEGER}
325
   where id = #{id,jdbcType=INTEGER}
325
   </update>
326
   </update>
326
 </mapper>
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
             WareHouseVO wareHouseVO= WarehouseSealingRecordMapper.selectTyhwbm(WarehouseSealingRecord.getWarehouseId());
84
             WareHouseVO wareHouseVO= WarehouseSealingRecordMapper.selectTyhwbm(WarehouseSealingRecord.getWarehouseId());
85
             if(wareHouseVO!=null){
85
             if(wareHouseVO!=null){
86
                 WarehouseSealingRecord warehouseSealingRecord=  WarehouseSealingRecordMapper.selectFcqrd(WarehouseSealingRecord.getWarehouseId());
86
                 WarehouseSealingRecord warehouseSealingRecord=  WarehouseSealingRecordMapper.selectFcqrd(WarehouseSealingRecord.getWarehouseId());
87
-                if(warehouseSealingRecord!=null){
87
+               if(warehouseSealingRecord!=null){
88
 //                    if(warehouseSealingRecord.getStatus()==1){
88
 //                    if(warehouseSealingRecord.getStatus()==1){
89
 //                        modelMap.put("message", "该货位已经生成粮情卡");
89
 //                        modelMap.put("message", "该货位已经生成粮情卡");
90
 //                        return modelMap;
90
 //                        return modelMap;
91
 //
91
 //
92
 //                    }
92
 //                    }
93
                     String fcqrd =warehouseSealingRecord.getFcqrdh();
93
                     String fcqrd =warehouseSealingRecord.getFcqrdh();
94
+
94
                     int startIndex =fcqrd.length() - 11; // 假设20240909开始的位置是从字符串末尾数第15个字符开始
95
                     int startIndex =fcqrd.length() - 11; // 假设20240909开始的位置是从字符串末尾数第15个字符开始
95
                     // 要截取的结束位置
96
                     // 要截取的结束位置
96
                     int endIndex = fcqrd.length() - 3; // 假设20240909结束的位置是从字符串末尾数第9个字符结束
97
                     int endIndex = fcqrd.length() - 3; // 假设20240909结束的位置是从字符串末尾数第9个字符结束
@@ -99,11 +100,12 @@ public class WarehouseSealingRecordServiceImpl implements WarehouseSealingRecord
99
                     String extractedDate = fcqrd.substring(startIndex, endIndex);
100
                     String extractedDate = fcqrd.substring(startIndex, endIndex);
100
                     // 当前时间
101
                     // 当前时间
101
 
102
 
102
-
103
                     // 将字符串转换为日期对象
103
                     // 将字符串转换为日期对象
104
                     String specificDateStr = extractedDate;
104
                     String specificDateStr = extractedDate;
105
                     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
105
                     DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
106
                     LocalDate specificDateObj = LocalDate.parse(specificDateStr, formatter);
106
                     LocalDate specificDateObj = LocalDate.parse(specificDateStr, formatter);
107
+                   LocalDate today = LocalDate.now();
108
+
107
                     if (formattedDate.equals(extractedDate)){
109
                     if (formattedDate.equals(extractedDate)){
108
                         // 使用正则表达式提取后三位数字
110
                         // 使用正则表达式提取后三位数字
109
                         Pattern pattern = Pattern.compile("(\\d{3})$");
111
                         Pattern pattern = Pattern.compile("(\\d{3})$");