|
|
@ -31,7 +31,7 @@ public class ShRequester { |
|
|
|
private static String in_stock$index = "/api/system/in_stock/index"; //16.入库申请
|
|
|
|
private static String in_stock$examine = "/api/system/in_stock/examine"; //17.入库审核
|
|
|
|
private static String in_stock$get_record_materiel_list = "/api/system/in_stock/get_record_materiel_list"; //18.入库记录 入库记录列表
|
|
|
|
private static String stock_record$index = "/api/system/stock_record/index"; //19.出入库记录 出入库记录列表
|
|
|
|
private static String stock_record$index = "/api/system/stock_record/index"; //19.出入库记录 storehouse_type为0 出入库记录列表 预付款仓库url一致storehouse_type为1
|
|
|
|
private static String purchase_contract$get_info = "/api/system/purchase_contract/get_info"; //20.出入库合同详情
|
|
|
|
private static String storehouse$index = "/api/system/storehouse/index"; //22.仓库列表
|
|
|
|
private static String supplier$index = "/api/system/supplier/index"; //23.获取供应商 供应商列表
|
|
|
@ -39,6 +39,7 @@ public class ShRequester { |
|
|
|
private static String purchase_contract$index = "/api/system/purchase_contract/index"; //24.查看合同
|
|
|
|
private static String material_brand$index = "/api/system/material_brand/index"; //25.物料品牌
|
|
|
|
private static String materiel$index = "/api/system/materiel/index"; //26.物料管理
|
|
|
|
private static String materiel$get_materiel_group = "/api/system/materiel/get_materiel_group"; //27.获取物料组
|
|
|
|
/** |
|
|
|
* 1.待配货列表 |
|
|
|
* |
|
|
@ -52,7 +53,6 @@ public class ShRequester { |
|
|
|
BaseResponseListObj<ApplyMaterial> respObj = new BaseResponseListObj<>(); |
|
|
|
String s = ShHttp.doGet(apply_material$index, param); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, resp, respObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,resp); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<ApplyMaterial> applyMaterials = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -77,7 +77,6 @@ public class ShRequester { |
|
|
|
params.put("id", id); |
|
|
|
String s = ShHttp.doGet(apply_material$get_actual_order_material, params); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, resp, respObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,resp); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<ActualOrderMaterial> actualOrderMaterials = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -99,7 +98,6 @@ public class ShRequester { |
|
|
|
BaseResponseListObj respObj = new BaseResponseListObj<>(); |
|
|
|
String s = ShHttp.doGet(stock_record$get_material_stat, null); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, resp, respObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,resp); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
if (list == null){ |
|
|
|
respObj.setList(null); |
|
|
@ -143,16 +141,16 @@ public class ShRequester { |
|
|
|
**/ |
|
|
|
public static BaseResponse<BaseResponseListObj<Inventory>> getApi$system$inventory$index(InventoryIndex reqParams){ |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
if (reqParams != null){ |
|
|
|
if (reqParams.getPage() != null){ |
|
|
|
param = BeanUtil.beanToMap(reqParams); |
|
|
|
}else { |
|
|
|
param.put("page",1); |
|
|
|
param.put("limit",2000); |
|
|
|
} |
|
|
|
param.put("page",1); |
|
|
|
param.put("limit",2000); |
|
|
|
BaseResponse<BaseResponseListObj<Inventory>> resp = new BaseResponse<>(); |
|
|
|
BaseResponseListObj<Inventory> respObj = new BaseResponseListObj<>(); |
|
|
|
String s = ShHttp.doGet(inventory$index, param); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> response = toBean(s, resp, respObj); |
|
|
|
BeanUtil.copyProperties(response,resp); |
|
|
|
List<JSONObject> list = response.getData().getList(); |
|
|
|
List<Inventory> inventories = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -246,7 +244,6 @@ public class ShRequester { |
|
|
|
param = BeanUtil.beanToMap(reqParams); |
|
|
|
String s = ShHttp.doGet(out_stock$index, param); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, resp, respObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,resp); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<OutStock> outStocks = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -267,14 +264,14 @@ public class ShRequester { |
|
|
|
BaseResponse<BaseResponseListObj<RecordMaterielList>> req = new BaseResponse<>(); |
|
|
|
BaseResponseListObj<RecordMaterielList> reqObj = new BaseResponseListObj<>(); |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
if (reqParams != null){ |
|
|
|
if (reqParams.getPage() != null){ |
|
|
|
param = BeanUtil.beanToMap(reqParams); |
|
|
|
}else { |
|
|
|
param.put("page",1); |
|
|
|
param.put("limit",2000); |
|
|
|
} |
|
|
|
param.put("page",1); |
|
|
|
param.put("limit",2000); |
|
|
|
String s = ShHttp.doGet(out_stock$get_record_materiel_list, param); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, req, reqObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,req); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<RecordMaterielList> recordMaterielLists = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -345,7 +342,6 @@ public class ShRequester { |
|
|
|
param = BeanUtil.beanToMap(reqParams); |
|
|
|
String s = ShHttp.doGet(in_stock$index, param); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, req, reqObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,req); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<InStockIndex> inStockIndices = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -382,14 +378,14 @@ public class ShRequester { |
|
|
|
BaseResponse<BaseResponseListObj<InStockGetRecordMaterielList>> req = new BaseResponse<>(); |
|
|
|
BaseResponseListObj<InStockGetRecordMaterielList> reqObj = new BaseResponseListObj<>(); |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
if (reqParams != null){ |
|
|
|
if (reqParams.getPage() != null){ |
|
|
|
param = BeanUtil.beanToMap(reqParams); |
|
|
|
}else { |
|
|
|
param.put("page",1); |
|
|
|
param.put("limit",2000); |
|
|
|
} |
|
|
|
param.put("page",1); |
|
|
|
param.put("limit",2000); |
|
|
|
String s = ShHttp.doGet(in_stock$get_record_materiel_list, param); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, req, reqObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,req); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<InStockGetRecordMaterielList> inStockGetRecordMaterielLists = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -410,9 +406,9 @@ public class ShRequester { |
|
|
|
BaseResponse<BaseResponseListObj<StockRecordIndex>> req = new BaseResponse<>(); |
|
|
|
BaseResponseListObj<StockRecordIndex> reqObj = new BaseResponseListObj<>(); |
|
|
|
params.put("record_type", record_type); |
|
|
|
params.put("storehouse_type", 0); |
|
|
|
String s = ShHttp.doGet(stock_record$index, params); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, req, reqObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,req); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<StockRecordIndex> stockRecordIndices = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -447,10 +443,26 @@ public class ShRequester { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description //描述: 21. 预付款仓库 todo 此url跟19.出入库记录一样
|
|
|
|
* @Param |
|
|
|
* @return |
|
|
|
* @Description //描述: 21. 预付款仓库 此url跟19.出入库记录一样 根据storehouse_type来判断是否预付款仓库
|
|
|
|
* @Param [params] |
|
|
|
* @return com.yxt.supervise.gf.shanhai.resp.BaseResponse<com.yxt.supervise.gf.shanhai.resp.BaseResponseListObj<com.yxt.supervise.gf.shanhai.resp.StockRecordIndex>> |
|
|
|
**/ |
|
|
|
public static BaseResponse<BaseResponseListObj<StockRecordIndex>> getApi$system$stock_record$indexY(Map<String, Object> params){ |
|
|
|
BaseResponse<BaseResponseListObj<StockRecordIndex>> req = new BaseResponse<>(); |
|
|
|
BaseResponseListObj<StockRecordIndex> reqObj = new BaseResponseListObj<>(); |
|
|
|
params.put("storehouse_type", 1); |
|
|
|
String s = ShHttp.doGet(stock_record$index, params); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, req, reqObj); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<StockRecordIndex> stockRecordIndices = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
|
StockRecordIndex stockRecordIndex = JSONUtil.toBean(jsonObject, StockRecordIndex.class); |
|
|
|
stockRecordIndices.add(stockRecordIndex); |
|
|
|
} |
|
|
|
reqObj.setList(stockRecordIndices); |
|
|
|
req.setData(reqObj); |
|
|
|
return req; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description //描述: 22. 仓库列表
|
|
|
@ -464,7 +476,6 @@ public class ShRequester { |
|
|
|
map.put("storehouse_name", storehouse_name); |
|
|
|
String s = ShHttp.doGet(storehouse$index, map); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, req, reqObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,req); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<StorehouseIndex> storehouseIndices = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -486,7 +497,6 @@ public class ShRequester { |
|
|
|
BaseResponseListObj<SupplierIndex> reqObj = new BaseResponseListObj<>(); |
|
|
|
String s = ShHttp.doGet(supplier$index, map); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, req, reqObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,req); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<SupplierIndex> supplierIndices = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -512,7 +522,6 @@ public class ShRequester { |
|
|
|
} |
|
|
|
String s = ShHttp.doGet(purchase_contract$index, param); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, req, reqObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,req); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<PurchaseContractIndex> purchaseContractIndices = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -534,7 +543,6 @@ public class ShRequester { |
|
|
|
BaseResponseListObj<MaterialBrandIndex> reqObj = new BaseResponseListObj<>(); |
|
|
|
String s = ShHttp.doGet(material_brand$index, param); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, req, reqObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,req); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<MaterialBrandIndex> materialBrandIndices = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -556,7 +564,6 @@ public class ShRequester { |
|
|
|
BaseResponseListObj<MaterielIndex> reqObj = new BaseResponseListObj<>(); |
|
|
|
String s = ShHttp.doGet(materiel$index, param); |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, req, reqObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,req); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
List<MaterielIndex> materielIndices = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
@ -568,6 +575,25 @@ public class ShRequester { |
|
|
|
return req; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description //描述: 27. 获取物料组
|
|
|
|
* @Param [] |
|
|
|
* @return com.yxt.supervise.gf.shanhai.resp.BaseResponse |
|
|
|
**/ |
|
|
|
public static BaseResponse getApiSystemMaterielGetMaterielGroup(){ |
|
|
|
BaseResponse resp = new BaseResponse<>(); |
|
|
|
String s = ShHttp.doGet(materiel$get_materiel_group, null); |
|
|
|
JSONObject jsonObject = JSONUtil.parseObj(s); |
|
|
|
String code = jsonObject.get("code").toString(); |
|
|
|
String msg = jsonObject.get("msg").toString(); |
|
|
|
resp.setCode(Integer.parseInt(code)); |
|
|
|
resp.setMsg(msg); |
|
|
|
Boolean a = jsonObject.get("data").toString().equals("null") || jsonObject.get("data") == null; |
|
|
|
JSONObject data = a ? null : (JSONObject)jsonObject.get("data"); |
|
|
|
resp.setData(data); |
|
|
|
return resp; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description //描述: 将Json格式数据封装成统一返回对象
|
|
|
|
* @Param [s, resp, respObj] |
|
|
@ -594,4 +620,21 @@ public class ShRequester { |
|
|
|
} |
|
|
|
return resp; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description //描述: 拼接url
|
|
|
|
* @Param [image] |
|
|
|
* @return java.lang.String[] |
|
|
|
**/ |
|
|
|
public static String[] getUrlImage(String[] image){ |
|
|
|
String url = "https://img.shanhainengyuan.com/"; |
|
|
|
if (image != null){ |
|
|
|
System.out.println(image.length); |
|
|
|
for (int i = 0; i < image.length; i++) { |
|
|
|
image[i] = url + image[i]; |
|
|
|
} |
|
|
|
return image; |
|
|
|
} |
|
|
|
return image; |
|
|
|
} |
|
|
|
} |
|
|
|