|
@@ -11,7 +11,12 @@ import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.ModelMap;
|
|
import org.springframework.ui.ModelMap;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
+import org.springframework.web.bind.annotation.ResponseStatus;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
@@ -313,16 +318,12 @@ public class SaleInquiryController {
|
|
|
PageInfo pageInfo = new PageInfo(params);
|
|
PageInfo pageInfo = new PageInfo(params);
|
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
- SearchFilter filters = userService.distribute();
|
|
|
|
|
- if (filters != null && filters.getDistribute() == null) {
|
|
|
|
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
|
|
- List<Object> list = new ArrayList<>();
|
|
|
|
|
- for (Object object : filters.getDistribute()) {
|
|
|
|
|
- list.add(object);
|
|
|
|
|
- }
|
|
|
|
|
- filter.setDistribute(list);
|
|
|
|
|
|
|
+ if (distribute != null && !CollectionUtils.isEmpty(distribute.getDistribute())) {
|
|
|
|
|
+ filter.setDistribute(distribute.getDistribute());
|
|
|
}
|
|
}
|
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
}
|
|
}
|
|
@@ -343,16 +344,12 @@ public class SaleInquiryController {
|
|
|
pageInfo.filter("invalid", Constant.NO);
|
|
pageInfo.filter("invalid", Constant.NO);
|
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
- SearchFilter filters = userService.distribute();
|
|
|
|
|
- if (filters != null && filters.getDistribute() == null) {
|
|
|
|
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
|
|
- List<Object> list = new ArrayList<>();
|
|
|
|
|
- for (Object object : filters.getDistribute()) {
|
|
|
|
|
- list.add(object);
|
|
|
|
|
- }
|
|
|
|
|
- filter.setDistribute(list);
|
|
|
|
|
|
|
+ if (distribute != null && !CollectionUtils.isEmpty(distribute.getDistribute())) {
|
|
|
|
|
+ filter.setDistribute(distribute.getDistribute());
|
|
|
}
|
|
}
|
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
}
|
|
}
|
|
@@ -372,16 +369,12 @@ public class SaleInquiryController {
|
|
|
pageInfo.filter("invalid", Constant.NO);
|
|
pageInfo.filter("invalid", Constant.NO);
|
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
- SearchFilter filters = userService.distribute();
|
|
|
|
|
- if (filters != null && filters.getDistribute() == null) {
|
|
|
|
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
|
|
- List<Object> list = new ArrayList<>();
|
|
|
|
|
- for (Object object : filters.getDistribute()) {
|
|
|
|
|
- list.add(object);
|
|
|
|
|
- }
|
|
|
|
|
- filter.setDistribute(list);
|
|
|
|
|
|
|
+ if (distribute != null && !CollectionUtils.isEmpty(distribute.getDistribute())) {
|
|
|
|
|
+ filter.setDistribute(distribute.getDistribute());
|
|
|
}
|
|
}
|
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
}
|
|
}
|
|
@@ -402,16 +395,12 @@ public class SaleInquiryController {
|
|
|
pageInfo.filter("invalid", Constant.NO);
|
|
pageInfo.filter("invalid", Constant.NO);
|
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
- SearchFilter filters = userService.distribute();
|
|
|
|
|
- if (filters != null && filters.getDistribute() == null) {
|
|
|
|
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
|
|
- List<Object> list = new ArrayList<>();
|
|
|
|
|
- for (Object object : filters.getDistribute()) {
|
|
|
|
|
- list.add(object);
|
|
|
|
|
- }
|
|
|
|
|
- filter.setDistribute(list);
|
|
|
|
|
|
|
+ if (distribute != null && !CollectionUtils.isEmpty(distribute.getDistribute())) {
|
|
|
|
|
+ filter.setDistribute(distribute.getDistribute());
|
|
|
}
|
|
}
|
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
}
|
|
}
|
|
@@ -431,16 +420,12 @@ public class SaleInquiryController {
|
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
pageInfo.filter("invalid", Constant.YES);
|
|
pageInfo.filter("invalid", Constant.YES);
|
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
- SearchFilter filters = userService.distribute();
|
|
|
|
|
- if (filters != null && filters.getDistribute() == null) {
|
|
|
|
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
|
|
- List<Object> list = new ArrayList<>();
|
|
|
|
|
- for (Object object : filters.getDistribute()) {
|
|
|
|
|
- list.add(object);
|
|
|
|
|
- }
|
|
|
|
|
- filter.setDistribute(list);
|
|
|
|
|
|
|
+ if (distribute != null && !CollectionUtils.isEmpty(distribute.getDistribute())) {
|
|
|
|
|
+ filter.setDistribute(distribute.getDistribute());
|
|
|
}
|
|
}
|
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
}
|
|
}
|
|
@@ -461,16 +446,12 @@ public class SaleInquiryController {
|
|
|
pageInfo.filter("invalid", Constant.NO);
|
|
pageInfo.filter("invalid", Constant.NO);
|
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
pageInfo.filter("vendUU", SystemSession.getUser().getEnterprise().getUu());
|
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
- SearchFilter filters = userService.distribute();
|
|
|
|
|
- if (filters != null && filters.getDistribute() == null) {
|
|
|
|
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
|
|
- List<Object> list = new ArrayList<>();
|
|
|
|
|
- for (Object object : filters.getDistribute()) {
|
|
|
|
|
- list.add(object);
|
|
|
|
|
- }
|
|
|
|
|
- filter.setDistribute(list);
|
|
|
|
|
|
|
+ if (distribute != null && !CollectionUtils.isEmpty(distribute.getDistribute())) {
|
|
|
|
|
+ filter.setDistribute(distribute.getDistribute());
|
|
|
}
|
|
}
|
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
}
|
|
}
|
|
@@ -491,16 +472,12 @@ public class SaleInquiryController {
|
|
|
pageInfo.filter("status", Status.REPLIED.value());
|
|
pageInfo.filter("status", Status.REPLIED.value());
|
|
|
pageInfo.filter("invalid", Constant.NO);
|
|
pageInfo.filter("invalid", Constant.NO);
|
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
SearchFilter filter = JSONObject.parseObject(searchFilter, SearchFilter.class);
|
|
|
- SearchFilter filters = userService.distribute();
|
|
|
|
|
- if (filters != null && filters.getDistribute() == null) {
|
|
|
|
|
|
|
+ SearchFilter distribute = userService.distribute();
|
|
|
|
|
+ if (distribute != null && distribute.getDistribute() == null) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- if (filters != null && !CollectionUtils.isEmpty(filters.getDistribute())) {
|
|
|
|
|
- List<Object> list = new ArrayList<>();
|
|
|
|
|
- for (Object object : filters.getDistribute()) {
|
|
|
|
|
- list.add(object);
|
|
|
|
|
- }
|
|
|
|
|
- filter.setDistribute(list);
|
|
|
|
|
|
|
+ if (distribute != null && !CollectionUtils.isEmpty(distribute.getDistribute())) {
|
|
|
|
|
+ filter.setDistribute(distribute.getDistribute());
|
|
|
}
|
|
}
|
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
return purchaseInquiryService.findByPageInfo(pageInfo, null, filter);
|
|
|
}
|
|
}
|