|
@@ -297,7 +297,7 @@ public class SupplierController extends BaseController {
|
|
|
|
|
|
/**
|
|
|
* 用户对应客户显示
|
|
|
- * @param type
|
|
|
+ * @param type UserCustomer-客户;UserSupplier-供应商
|
|
|
* @param keyId
|
|
|
* @param request
|
|
|
* @return
|
|
@@ -343,6 +343,49 @@ public class SupplierController extends BaseController {
|
|
|
return arr;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @GetMapping(value = "/findUserSupplier")
|
|
|
+ @ApiOperation(value = "用户对应供应商显示")
|
|
|
+ public JSONArray findUserSupplier(@RequestParam(value = "UBType",defaultValue = "UserSupplier") String type,
|
|
|
+ @RequestParam(value = "UBKeyId") String keyId,
|
|
|
+ HttpServletRequest request) throws Exception{
|
|
|
+ JSONArray arr = new JSONArray();
|
|
|
+ try {
|
|
|
+ //获取权限信息
|
|
|
+ String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId);
|
|
|
+ List<Supplier> dataList = supplierService.findBySelectSup();
|
|
|
+ //开始拼接json数据
|
|
|
+ JSONObject outer = new JSONObject();
|
|
|
+ outer.put("id", 0);
|
|
|
+ outer.put("key", 0);
|
|
|
+ outer.put("value", 0);
|
|
|
+ outer.put("title", "供应商列表");
|
|
|
+ outer.put("attributes", "供应商列表");
|
|
|
+ //存放数据json数组
|
|
|
+ JSONArray dataArray = new JSONArray();
|
|
|
+ if (null != dataList) {
|
|
|
+ for (Supplier supplier : dataList) {
|
|
|
+ JSONObject item = new JSONObject();
|
|
|
+ item.put("id", supplier.getId());
|
|
|
+ item.put("key", supplier.getId());
|
|
|
+ item.put("value", supplier.getId());
|
|
|
+ item.put("title", supplier.getSupplier());
|
|
|
+ item.put("attributes", supplier.getSupplier());
|
|
|
+ Boolean flag = ubValue.contains("[" + supplier.getId().toString() + "]");
|
|
|
+ if (flag) {
|
|
|
+ item.put("checked", true);
|
|
|
+ }
|
|
|
+ dataArray.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ outer.put("children", dataArray);
|
|
|
+ arr.add(outer);
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
+ return arr;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 根据客户或供应商查询期初、期初已收等信息
|
|
|
* @param organId
|