|
|
@@ -18,6 +18,7 @@ import com.webflux.launchadmin.mysql.service.planNew.goGenerate.GoGenerateServic
|
|
|
import com.webflux.launchadmin.mysql.service.planNew.ipAnalyze.IpAnalyzeServiceInterface;
|
|
|
import com.webflux.launchadmin.mysql.service.planNew.structure.GoRequest;
|
|
|
import com.webflux.launchadmin.mysql.service.planNew.structure.Item;
|
|
|
+import com.webflux.launchadmin.mysql.service.sourceMaterial.SourceMaterialInterface;
|
|
|
import com.webflux.launchadmin.utils.RandomStr;
|
|
|
import com.webflux.launchcommon.returnObj.RStatus;
|
|
|
import com.weblux.launchredis.utils.RedisKey;
|
|
|
@@ -74,6 +75,9 @@ public class PlanNewOutController {
|
|
|
private PlanServiceInterface planServiceInterface;
|
|
|
@Resource
|
|
|
private ReactiveRedisTemplate<String,String> reactiveRedisTemplate;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SourceMaterialInterface sourceMaterialInterface;
|
|
|
//private static final ConcurrentHashMap<String,Integer> map = new ConcurrentHashMap<String,Integer>();
|
|
|
|
|
|
//清空用户Map数据
|
|
|
@@ -329,6 +333,8 @@ public class PlanNewOutController {
|
|
|
@PostMapping("hfoInfo")
|
|
|
public Mono<RStatus<DataLists>> hfoInfo(@RequestBody HfoRequest request, ServerWebExchange exchange){
|
|
|
Mono<String> stringMono = reactiveRedisTemplate.opsForValue().get(request.getUnique()).switchIfEmpty(Mono.just(""));
|
|
|
+ Mono<String> stringMono1 = reactiveRedisTemplate.opsForValue().get(request.getUnique() + "-returnLoop").switchIfEmpty(Mono.just(""));
|
|
|
+
|
|
|
if (Objects.isNull(request.getCode()) || "".equals(request.getCode().trim())) {
|
|
|
throw new BaseException("code异常");
|
|
|
}
|
|
|
@@ -345,15 +351,20 @@ public class PlanNewOutController {
|
|
|
.columns(COLUMNARRAYPLANNEW), PlanNew.class)
|
|
|
.switchIfEmpty(Mono.error(new BaseException(" code错误")))
|
|
|
.onErrorResume(throwable -> Mono.error(new BaseException(throwable.getMessage())));
|
|
|
- Mono<DataLists> dataListsMono1 = Mono.zip(code0,stringMono).flatMap(tuple2 -> {
|
|
|
+ Mono<DataLists> dataListsMono1 = Mono.zip(code0,stringMono,stringMono1).flatMap(tuple2 -> {
|
|
|
String t21 = tuple2.getT2();
|
|
|
PlanNew planNew = tuple2.getT1();
|
|
|
+ String t31 = tuple2.getT3();
|
|
|
if( !t21.isBlank()){
|
|
|
JSONArray jsonArray = JSONUtil.parseArray(t21);
|
|
|
List<H5ImageAndText> collect = jsonArray.stream().map(str -> JSONUtil.toBean(JSONUtil.parseObj(str), H5ImageAndText.class)).collect(Collectors.toList());
|
|
|
DataLists dataLists = new DataLists();
|
|
|
dataLists.setImages(collect);
|
|
|
dataLists.setPlanNew(planNew);
|
|
|
+ if (!"".equals(t31)) {
|
|
|
+ ReturnLoop returnLoop = sourceMaterialInterface.strParseT(t31, ReturnLoop.class);
|
|
|
+ dataLists.setReturnLoop(returnLoop);
|
|
|
+ }
|
|
|
return Mono.just(dataLists);
|
|
|
}
|
|
|
Mono<PlanNew> code = Mono.just(planNew);
|
|
|
@@ -554,6 +565,9 @@ public class PlanNewOutController {
|
|
|
// return Mono.just(t3);
|
|
|
// });
|
|
|
reactiveRedisTemplate.opsForValue().set(request.getUnique(), JSONUtil.toJsonStr(dataLists.getImages()), Duration.ofHours(1)).subscribe();
|
|
|
+ if (Objects.nonNull(dataLists.getReturnLoop())) {
|
|
|
+ reactiveRedisTemplate.opsForValue().set(request.getUnique()+"-returnLoop", sourceMaterialInterface.tToString(dataLists.getReturnLoop()), Duration.ofHours(1)).subscribe();
|
|
|
+ }
|
|
|
return Mono.just(dataLists);
|
|
|
});
|
|
|
|