完善供应商、客户、会员查询接口,支持模糊查询
This commit is contained in:
@@ -149,14 +149,17 @@ public class SupplierController extends BaseController {
|
||||
*/
|
||||
@PostMapping(value = "/findBySelect_cus")
|
||||
@ApiOperation(value = "查找客户信息")
|
||||
public JSONArray findBySelectCus(HttpServletRequest request) {
|
||||
public JSONArray findBySelectCus(@RequestBody JSONObject jsonObject,
|
||||
HttpServletRequest request) {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
String key = jsonObject.get("key")!=null ? jsonObject.getString("key") : null;
|
||||
Long organId = jsonObject.get("organId")!=null ? jsonObject.getLong("organId") : null;
|
||||
String type = "UserCustomer";
|
||||
Long userId = userService.getUserId(request);
|
||||
//获取权限信息
|
||||
String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString());
|
||||
List<Supplier> supplierList = supplierService.findBySelectCus();
|
||||
List<Supplier> supplierList = supplierService.findBySelectCus(key, organId);
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != supplierList) {
|
||||
boolean customerFlag = systemConfigService.getCustomerFlag();
|
||||
@@ -184,10 +187,13 @@ public class SupplierController extends BaseController {
|
||||
*/
|
||||
@PostMapping(value = "/findBySelect_sup")
|
||||
@ApiOperation(value = "查找供应商信息")
|
||||
public JSONArray findBySelectSup(HttpServletRequest request) throws Exception{
|
||||
public JSONArray findBySelectSup(@RequestBody JSONObject jsonObject,
|
||||
HttpServletRequest request) throws Exception{
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Supplier> supplierList = supplierService.findBySelectSup();
|
||||
String key = jsonObject.get("key")!=null ? jsonObject.getString("key") : null;
|
||||
Long organId = jsonObject.get("organId")!=null ? jsonObject.getLong("organId") : null;
|
||||
List<Supplier> supplierList = supplierService.findBySelectSup(key, organId);
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != supplierList) {
|
||||
for (Supplier supplier : supplierList) {
|
||||
@@ -212,12 +218,15 @@ public class SupplierController extends BaseController {
|
||||
*/
|
||||
@PostMapping(value = "/findBySelect_organ")
|
||||
@ApiOperation(value = "查找往来单位,含供应商和客户信息")
|
||||
public JSONArray findBySelectOrgan(HttpServletRequest request) throws Exception{
|
||||
public JSONArray findBySelectOrgan(@RequestBody JSONObject jsonObject,
|
||||
HttpServletRequest request) throws Exception{
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
String key = jsonObject.get("key")!=null ? jsonObject.getString("key") : null;
|
||||
Long organId = jsonObject.get("organId")!=null ? jsonObject.getLong("organId") : null;
|
||||
JSONArray dataArray = new JSONArray();
|
||||
//1、获取供应商信息
|
||||
List<Supplier> supplierList = supplierService.findBySelectSup();
|
||||
List<Supplier> supplierList = supplierService.findBySelectSup(key, organId);
|
||||
if (null != supplierList) {
|
||||
for (Supplier supplier : supplierList) {
|
||||
JSONObject item = new JSONObject();
|
||||
@@ -230,7 +239,7 @@ public class SupplierController extends BaseController {
|
||||
String type = "UserCustomer";
|
||||
Long userId = userService.getUserId(request);
|
||||
String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, userId.toString());
|
||||
List<Supplier> customerList = supplierService.findBySelectCus();
|
||||
List<Supplier> customerList = supplierService.findBySelectCus(key, organId);
|
||||
if (null != customerList) {
|
||||
boolean customerFlag = systemConfigService.getCustomerFlag();
|
||||
for (Supplier supplier : customerList) {
|
||||
@@ -257,10 +266,13 @@ public class SupplierController extends BaseController {
|
||||
*/
|
||||
@PostMapping(value = "/findBySelect_retail")
|
||||
@ApiOperation(value = "查找会员信息")
|
||||
public JSONArray findBySelectRetail(HttpServletRequest request)throws Exception {
|
||||
public JSONArray findBySelectRetail(@RequestBody JSONObject jsonObject,
|
||||
HttpServletRequest request)throws Exception {
|
||||
JSONArray arr = new JSONArray();
|
||||
try {
|
||||
List<Supplier> supplierList = supplierService.findBySelectRetail();
|
||||
String key = jsonObject.get("key")!=null ? jsonObject.getString("key") : null;
|
||||
Long organId = jsonObject.get("organId")!=null ? jsonObject.getLong("organId") : null;
|
||||
List<Supplier> supplierList = supplierService.findBySelectRetail(key, organId);
|
||||
JSONArray dataArray = new JSONArray();
|
||||
if (null != supplierList) {
|
||||
for (Supplier supplier : supplierList) {
|
||||
|
||||
Reference in New Issue
Block a user