Explorar o código

修改缓存bug

klzhangweiya hai 1 semana
pai
achega
50c5a295ea

+ 5 - 3
SERVER/ChickenFarmV3/vb-admin/src/main/resources/application-dev.yml

@@ -24,10 +24,12 @@ spring:
           # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
           # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
           # url: jdbc:mysql://127.0.0.1:3326/ChickenFarmDB_DEV?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
-          url: jdbc:mysql://192.168.0.104:3316/ChickenFarmDB_DEV?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+          #url: jdbc:mysql://192.168.0.104:3316/ChickenFarmDB_DEV?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+          url: jdbc:mysql://192.168.0.81:3326/ChickenFarmDB_v1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
           username: root
           # password: root
-          password: 123456
+          # password: 123456
+          password: rootcf
         #        # 从库数据源
         #        slave:
         #          lazy: true
@@ -113,7 +115,7 @@ spring.boot.admin.client:
 --- # xxl-job 配置
 xxl.job:
   # 执行器开关
-  enabled: true
+  enabled: false
   # 调度中心地址:如调度中心集群部署存在多个地址则用逗号分隔。
   admin-addresses: http://localhost:6076/job
   # 执行器通讯TOKEN:非空时启用

+ 3 - 3
SERVER/ChickenFarmV3/vb-admin/src/main/resources/application-prod.yml

@@ -23,9 +23,9 @@ spring:
           driverClassName: com.mysql.cj.jdbc.Driver
           # jdbc 所有参数配置参考 https://lionli.blog.csdn.net/article/details/122018562
           # rewriteBatchedStatements=true 批处理优化 大幅提升批量插入更新删除性能(对数据库有性能损耗 使用批量操作应考虑性能问题)
-          url: jdbc:mysql://192.168.0.104:3316/ChickenFarm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
+          url: jdbc:mysql://192.168.0.81:3326/ChickenFarmDB_v1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
           username: root
-          password: 123456
+          password: rootcf
         # 需要和sharding-prod.yaml--->databaseName的值要一致,不然无法识别数据源
 #        sharding:
 #          driverClassName: org.apache.shardingsphere.driver.ShardingSphereDriver
@@ -56,7 +56,7 @@ spring.data:
     # 密码(如没有密码请注释掉)
     password: Iwb-2017
     # 数据库索引
-    database: 10
+    database: 13
     # 连接超时时间
     timeout: 10s
     # 是否开启ssl

+ 2 - 2
SERVER/ChickenFarmV3/vb-modules/vb-base/src/main/java/cn/vber/base/service/impl/DrugServiceImpl.java

@@ -88,7 +88,7 @@ public class DrugServiceImpl implements IDrugService, DrugService {
      * 新增药品信息
      */
     @Override
-    @CachePut(cacheNames = CacheNames.DRUG_ID_NAME, key = "#bo.id")
+    @CacheEvict(cacheNames = CacheNames.DRUG_ID_NAME, key = "#bo.id")
     public Boolean insertByBo(DrugBo bo) {
         Drug add = MapstructUtils.convert(bo, Drug. class);
         validEntityBeforeSave(add);
@@ -102,7 +102,7 @@ public class DrugServiceImpl implements IDrugService, DrugService {
     /**
      * 修改药品信息
      */
-    @CachePut(cacheNames = CacheNames.DRUG_ID_NAME, key = "#bo.id")
+    @CacheEvict(cacheNames = CacheNames.DRUG_ID_NAME, key = "#bo.id")
     @Override
     public Boolean updateByBo(DrugBo bo) {
         Drug update = MapstructUtils.convert(bo, Drug.class);

+ 3 - 2
SERVER/ChickenFarmV3/vb-modules/vb-base/src/main/java/cn/vber/base/service/impl/FeedServiceImpl.java

@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import org.springframework.cache.Cache;
 import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.CachePut;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
@@ -79,7 +80,7 @@ public class FeedServiceImpl implements IFeedService, FeedService {
      * 新增饲料信息
      */
     @Override
-    @CachePut(value = CacheNames.FEED_ID_NAME, key = "#bo.id")
+    @CacheEvict(value = CacheNames.FEED_ID_NAME, key = "#bo.id")
     public Boolean insertByBo(FeedBo bo) {
         Feed add = MapstructUtils.convert(bo, Feed. class);
         validEntityBeforeSave(add);
@@ -94,7 +95,7 @@ public class FeedServiceImpl implements IFeedService, FeedService {
      * 修改饲料信息
      */
     @Override
-    @CachePut(value = CacheNames.FEED_ID_NAME, key = "#bo.id")
+    @CacheEvict(value = CacheNames.FEED_ID_NAME, key = "#bo.id")
     public Boolean updateByBo(FeedBo bo) {
         Feed update = MapstructUtils.convert(bo, Feed. class);
         validEntityBeforeSave(update);

+ 3 - 2
SERVER/ChickenFarmV3/vb-modules/vb-base/src/main/java/cn/vber/base/service/impl/VaccineServiceImpl.java

@@ -14,6 +14,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import org.springframework.cache.Cache;
 import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.CachePut;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
@@ -84,7 +85,7 @@ public class VaccineServiceImpl implements IVaccineService, VaccineService {
      * 新增疫苗信息
      */
     @Override
-    @CachePut(value = CacheNames.VACCINE_ID_NAME, key = "#bo.id")
+    @CacheEvict(value = CacheNames.VACCINE_ID_NAME, key = "#bo.id")
     public Boolean insertByBo(VaccineBo bo) {
         Vaccine add = MapstructUtils.convert(bo, Vaccine. class);
         validEntityBeforeSave(add);
@@ -99,7 +100,7 @@ public class VaccineServiceImpl implements IVaccineService, VaccineService {
      * 修改疫苗信息
      */
     @Override
-    @CachePut(value = CacheNames.VACCINE_ID_NAME, key = "#bo.id")
+    @CacheEvict(value = CacheNames.VACCINE_ID_NAME, key = "#bo.id")
     public Boolean updateByBo(VaccineBo bo) {
         Vaccine update = MapstructUtils.convert(bo, Vaccine. class);
         validEntityBeforeSave(update);

+ 2 - 2
SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/service/impl/BatchServiceImpl.java

@@ -105,7 +105,7 @@ public class BatchServiceImpl implements IBatchService {
      * 新增批次信息
      */
     @Override
-    @CachePut(value = CacheNames.BATCH_NUM_INFO, key = "#bo.batchNum")
+    @CacheEvict(value = CacheNames.BATCH_NUM_INFO, key = "#bo.batchNum")
     public Boolean insertByBo(BatchBo bo) {
         Batch add = MapstructUtils.convert(bo, Batch. class);
         String lineage = bo.getLineage();
@@ -127,7 +127,7 @@ public class BatchServiceImpl implements IBatchService {
      * 修改批次信息
      */
     @Override
-    @CachePut(value = CacheNames.BATCH_NUM_INFO, key = "#bo.batchNum")
+    @CacheEvict(value = CacheNames.BATCH_NUM_INFO, key = "#bo.batchNum")
     public Boolean updateByBo(BatchBo bo) {
         Batch update = MapstructUtils.convert(bo, Batch.class);
         //validEntityBeforeSave(update);

+ 3 - 2
SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/java/cn/vber/breeding/service/impl/ChickenServiceImpl.java

@@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.CachePut;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
@@ -108,7 +109,7 @@ public class ChickenServiceImpl implements IChickenService, ChickenService {
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    @CachePut(value = CacheNames.CHICKEN_ID_INFO, key = "#bo.id")
+    @CacheEvict(value = CacheNames.CHICKEN_ID_INFO, key = "#bo.id")
     public Boolean insertByBo(ChickenBo bo) {
         Chicken add = MapstructUtils.convert(bo, Chicken.class);
         validEntityBeforeSave(add);
@@ -143,7 +144,7 @@ public class ChickenServiceImpl implements IChickenService, ChickenService {
      * 修改鸡只个体信息
      */
     @Override
-    @CachePut(value = CacheNames.CHICKEN_ID_INFO, key = "#bo.id")
+    @CacheEvict(value = CacheNames.CHICKEN_ID_INFO, key = "#bo.id")
     public Boolean updateByBo(ChickenBo bo) {
         Chicken update = MapstructUtils.convert(bo, Chicken.class);
         validEntityBeforeSave(update);

+ 2 - 2
SERVER/ChickenFarmV3/vb-modules/vb-breeding/src/main/resources/mapper/ChickenCageMapper.xml

@@ -25,7 +25,7 @@
         FROM
             f_chicken_cage AS cage
                 LEFT JOIN
-           (select coop_name,id from f_chicken_coop) AS coop
+           (select coop_name,id,create_org from f_chicken_coop) AS coop
             ON
                 cage.chicken_coop_id = coop.id
             ${ew.getCustomSqlSegment}
@@ -47,7 +47,7 @@
         FROM
             f_chicken_cage AS cage
                 LEFT JOIN
-                (select coop_name,id from f_chicken_coop) AS coop
+                (select coop_name,id,create_org from f_chicken_coop) AS coop
             ON
                 cage.chicken_coop_id = coop.id
             ${ew.getCustomSqlSegment}

BIN=BIN
docs/产蛋月报表.xlsx


BIN=BIN
docs/养殖月报表.xlsx


BIN=BIN
docs/报表说明.docx


BIN=BIN
docs/需求说明报告20250603.pdf


BIN=BIN
docs/需求说明报告20250711(1).pdf