From 35057d7fb7a19a2e1b934f5c1b7f692cb7e5bcf0 Mon Sep 17 00:00:00 2001
From: feige <791364011@qq.com>
Date: 星期二, 09 七月 2024 21:46:19 +0800
Subject: [PATCH] get请求修改为了post请求
---
zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java | 25 +++++++++++++++++++++----
1 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java
index 9a06fa0..01b8153 100644
--- a/zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java
+++ b/zhang-content/src/main/java/com/ruoyi/service/impl/IZfPropertyServiceImpl.java
@@ -1,11 +1,13 @@
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.EsModel;
import com.ruoyi.common.core.domain.entity.SysUser;
+
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
@@ -258,6 +260,11 @@
//瑕佹煡鑷繁瀹跺涵鐨�
ZInfoUser myself = zInfoUserService.getMyself();
+ if(myself==null)
+ {
+ // System.out.println("ssssss");
+ return AjaxResult.success("鎮ㄦ病鍔犲叆鍒板搴旂殑瀹跺涵锛岃鑱旂郴绠$悊鍛�");
+ }
Long familyId = myself.getFamilyId();
//涔熻鏌ュ埆浜烘巿鏉冪殑
List<ZAuthority> authority = zAuthorityService.getAuthority();
@@ -299,6 +306,12 @@
else
list = list();
return list;
+ }
+
+ @Override
+ public AjaxResult selectType() {
+ List<String> lis = list(new QueryWrapper<ZfProperty>().select("distinct (type)").lambda()).stream().map(ZfProperty::getType).collect(Collectors.toList());
+ return AjaxResult.success(lis);
}
@Override
@@ -416,8 +429,9 @@
@Override
public AjaxResult updateData(ZfProperty zfProperty) {
ZInfoUser myself = zInfoUserService.getMyself();
- Long familyId = myself.getFamilyId();
+ Long familyId = myself.getFamilyId();
+ // System.out.println("sssssssssssss");
//鍏堟牴鎹甶d鏌ヨ鍑烘暟鎹殑familyId锛岀湅鐪嬫湁娌℃湁鏉冮檺鎿嶄綔
Long dataFamilyId = getById(zfProperty.getId()).getFamilyId();
@@ -439,9 +453,11 @@
if(updateById(zfProperty)){
//鍒版暟鎹簱涓煡璇㈠搴旂殑鏁版嵁
ZfProperty dataById = getById(zfProperty.getId());
-
//鍏堝埌es涓煡璇㈠埌瀵瑰簲閭f潯鏁版嵁鍦╡s鐨刬d
EsModel esResult = esService.findByCtId(dataById.getId().intValue(), "瀹跺涵璧勪骇");
+ if (esResult == null){
+ return AjaxResult.success();
+ }
//鎿嶄綔es淇敼鏁版嵁
EsModel newModel = new EsModel();
@@ -491,7 +507,6 @@
"by6",newModel.getBy6(),
"remark",newModel.getRemark()
);
-
try {
restHighLevelClient.update(updateRequest, RequestOptions.DEFAULT);
} catch (IOException e) {
@@ -529,12 +544,14 @@
//鍒犻櫎es涓殑鏁版嵁
zfPropertys.stream().forEach(zfProperty -> {
EsModel esModel = esService.findByCtId(zfProperty.getId().intValue(), "瀹跺涵璧勪骇");
+ if(esModel!=null)
+ {
DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId());
try {
restHighLevelClient.delete(deleteRequest,RequestOptions.DEFAULT);
} catch (IOException e) {
throw new RuntimeException(e);
- }
+ }}
});
return AjaxResult.success();
}else {
--
Gitblit v1.9.1