|
|
@ -6,6 +6,7 @@ import cn.hutool.json.JSONUtil; |
|
|
|
import com.yxt.supervise.gf.shanhai.req.*; |
|
|
|
import com.yxt.supervise.gf.shanhai.resp.*; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -46,8 +47,17 @@ public class ShRequester { |
|
|
|
BaseResponse<BaseResponseListObj<ApplyMaterial>> resp = new BaseResponse<>(); |
|
|
|
BaseResponseListObj<ApplyMaterial> respObj = new BaseResponseListObj<>(); |
|
|
|
String s = ShHttp.doGet(apply_material$index, param); |
|
|
|
BaseResponse<BaseResponseListObj<ApplyMaterial>> baseResponse = toBean(s, resp, respObj); |
|
|
|
return baseResponse; |
|
|
|
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) { |
|
|
|
ApplyMaterial applyMaterial = JSONUtil.toBean(jsonObject, ApplyMaterial.class); |
|
|
|
applyMaterials.add(applyMaterial); |
|
|
|
} |
|
|
|
respObj.setList(applyMaterials); |
|
|
|
resp.setData(respObj); |
|
|
|
return resp; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -62,8 +72,17 @@ public class ShRequester { |
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
params.put("id", id); |
|
|
|
String s = ShHttp.doGet(apply_material$get_actual_order_material, params); |
|
|
|
BaseResponse<BaseResponseListObj<ActualOrderMaterial>> baseResponse = toBean(s, resp, respObj); |
|
|
|
return baseResponse; |
|
|
|
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) { |
|
|
|
ActualOrderMaterial actualOrderMaterial = JSONUtil.toBean(jsonObject, ActualOrderMaterial.class); |
|
|
|
actualOrderMaterials.add(actualOrderMaterial); |
|
|
|
} |
|
|
|
respObj.setList(actualOrderMaterials); |
|
|
|
resp.setData(respObj); |
|
|
|
return resp; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -75,8 +94,22 @@ public class ShRequester { |
|
|
|
BaseResponse<BaseResponseListObj<MaterialStat>> resp = new BaseResponse<>(); |
|
|
|
BaseResponseListObj respObj = new BaseResponseListObj<>(); |
|
|
|
String s = ShHttp.doGet(stock_record$get_material_stat, null); |
|
|
|
BaseResponse<BaseResponseListObj<MaterialStat>> baseResponse = toBean(s, resp, respObj); |
|
|
|
return baseResponse; |
|
|
|
BaseResponse<BaseResponseListObj<JSONObject>> baseResponse = toBean(s, resp, respObj); |
|
|
|
BeanUtil.copyProperties(baseResponse,resp); |
|
|
|
List<JSONObject> list = baseResponse.getData().getList(); |
|
|
|
if (list == null){ |
|
|
|
respObj.setList(null); |
|
|
|
resp.setData(respObj); |
|
|
|
}else { |
|
|
|
List<MaterialStat> materialStats = new ArrayList<>(); |
|
|
|
for (JSONObject jsonObject : list) { |
|
|
|
MaterialStat materialStat = JSONUtil.toBean(jsonObject, MaterialStat.class); |
|
|
|
materialStats.add(materialStat); |
|
|
|
} |
|
|
|
respObj.setList(materialStats); |
|
|
|
resp.setData(respObj); |
|
|
|
} |
|
|
|
return resp; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -111,8 +144,17 @@ public class ShRequester { |
|
|
|
BaseResponse<BaseResponseListObj<Inventory>> resp = new BaseResponse<>(); |
|
|
|
BaseResponseListObj<Inventory> respObj = new BaseResponseListObj<>(); |
|
|
|
String s = ShHttp.doGet(inventory$index, param); |
|
|
|
BaseResponse<BaseResponseListObj<Inventory>> response = toBean(s, resp, respObj); |
|
|
|
return response; |
|
|
|
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) { |
|
|
|
Inventory inventory = JSONUtil.toBean(jsonObject, Inventory.class); |
|
|
|
inventories.add(inventory); |
|
|
|
} |
|
|
|
respObj.setList(inventories); |
|
|
|
resp.setData(respObj); |
|
|
|
return resp; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -306,8 +348,17 @@ public class ShRequester { |
|
|
|
if (reqParams != null) |
|
|
|
param = BeanUtil.beanToMap(reqParams); |
|
|
|
String s = ShHttp.doGet(in_stock$get_record_materiel_list, param); |
|
|
|
BaseResponse<BaseResponseListObj<InStockGetRecordMaterielList>> baseResponse = toBean(s, req, reqObj); |
|
|
|
return baseResponse; |
|
|
|
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) { |
|
|
|
InStockGetRecordMaterielList inStockGetRecordMaterielList = JSONUtil.toBean(jsonObject, InStockGetRecordMaterielList.class); |
|
|
|
inStockGetRecordMaterielLists.add(inStockGetRecordMaterielList); |
|
|
|
} |
|
|
|
reqObj.setList(inStockGetRecordMaterielLists); |
|
|
|
req.setData(reqObj); |
|
|
|
return req; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|