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); + } + } }