From 99f4fdfe24b9e62c41f8604692bd07339940c54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=93=B2=E5=A5=87?= <13840175730@139.com> Date: Thu, 24 Oct 2024 14:22:58 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BD=9C=E4=B8=9A=E8=AE=A1=E5=88=92=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E5=BA=8F=E6=9F=A5=E7=9C=8B=E5=BC=80=E5=85=B3?= =?UTF-8?q?,=E7=AE=A1=E7=90=86=E7=94=9F=E4=BA=A7=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8A=A5=E5=B7=A5=E6=97=B6,=E4=B8=8B=E9=81=93=E5=BA=8F?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81=E4=B8=8A=E9=81=93=E5=BA=8F?= =?UTF-8?q?=E5=AE=8C=E5=B7=A5=E5=90=8E=E6=89=8D=E5=8F=AF=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=202.=E8=B0=83=E6=95=B4=E5=90=84=E5=B7=A5=E5=BA=8F=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E9=80=BB=E8=BE=91,=E9=BB=98=E8=AE=A4=E4=B8=8B?= =?UTF-8?q?=E9=81=93=E5=BA=8F=E9=9C=80=E8=A6=81=E4=B8=8A=E9=81=93=E5=BA=8F?= =?UTF-8?q?=E6=8A=A5=E5=B7=A5=E5=90=8E=E6=89=8D=E8=83=BD=E7=9C=8B=E5=88=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gj_erp/controller/zyjh/ZyjhController.java | 9 +++++++++ .../com/dsic/gj_erp/service/zyjh/ZyjhService.java | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java index 8458f08..7e3351e 100644 --- a/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java +++ b/src/main/java/com/dsic/gj_erp/controller/zyjh/ZyjhController.java @@ -294,6 +294,15 @@ public class ZyjhController { return new ResultBean<>(); } + /** + * 报工数据查看控制器 + * 可根据配置情况控制是否根据上道序报工后下道序才可查看到作业计划数据 + */ + @PostMapping("bgControl") + public ResultBean bgControl(String gx){ + return new ResultBean<>(zyjhService.cacheable(gx)); + } + @PostMapping("test") public ResultBean test(@RequestBody Message msg){ wsHandler.tip(msg.toJson()); diff --git a/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java b/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java index 336fa69..d3e1fc0 100644 --- a/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java +++ b/src/main/java/com/dsic/gj_erp/service/zyjh/ZyjhService.java @@ -13,8 +13,11 @@ import com.dsic.gj_erp.mapper.jhgk.DmYdjhMapper; import com.dsic.gj_erp.service.jcsj.DmCbxxpService; import com.google.common.collect.ImmutableMap; import lombok.AllArgsConstructor; +import org.springframework.cache.annotation.Cacheable; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; +import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -24,6 +27,7 @@ import java.util.stream.Collectors; public class ZyjhService extends ServiceImpl { private final DmCbxxpService dmCbxxpService; + private final RedisTemplate redisTemplate; public List> gcjd(){ @@ -85,4 +89,15 @@ public class ZyjhService extends ServiceImpl { this.update(wrapper); } + + private static final String KEY="gxControl"; + + public Object cacheable(String gx){ + if (gx!=null){ + redisTemplate.opsForValue().set(KEY,gx); + return gx; + }else{ + return redisTemplate.opsForValue().get(KEY); + } + } }