|
|
@ -2307,7 +2307,7 @@ public class DepositoryRecordController { |
|
|
* @param jsonObject 带查询数据 |
|
|
* @param jsonObject 带查询数据 |
|
|
*/ |
|
|
*/ |
|
|
@PostMapping("/getApplicationForMaterial") |
|
|
@PostMapping("/getApplicationForMaterial") |
|
|
public RestResponse getInventoryApplication(@RequestBody JSONObject jsonObject) { |
|
|
public RestResponse getInventoryApplication(@RequestBody JSONObject jsonObject, HttpServletRequest request) { |
|
|
Integer id = jsonObject.getInteger("id"); |
|
|
Integer id = jsonObject.getInteger("id"); |
|
|
// 获取当前物料的库存数据
|
|
|
// 获取当前物料的库存数据
|
|
|
Inventory inventoryById = materialService.findInventoryById(id); |
|
|
Inventory inventoryById = materialService.findInventoryById(id); |
|
|
@ -2395,19 +2395,33 @@ public class DepositoryRecordController { |
|
|
Map<String, Object> countItemForInventory = depositoryRecordService.createStackedAreaChartSeriesItem("count", inventoryCountList); |
|
|
Map<String, Object> countItemForInventory = depositoryRecordService.createStackedAreaChartSeriesItem("count", inventoryCountList); |
|
|
Map<String, Object> amountItemForInventory = depositoryRecordService.createStackedAreaChartSeriesItem("amount", inventoryAmountList); |
|
|
Map<String, Object> amountItemForInventory = depositoryRecordService.createStackedAreaChartSeriesItem("amount", inventoryAmountList); |
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
result.put("amountItemForIn", amountItemForIn); |
|
|
|
|
|
result.put("countItemForIn", countItemForIn); |
|
|
result.put("countItemForIn", countItemForIn); |
|
|
result.put("amountItemForOut", amountItemForOut); |
|
|
|
|
|
result.put("countItemForOut", countItemForOut); |
|
|
result.put("countItemForOut", countItemForOut); |
|
|
Map<String, List<String>> legendItem = new HashMap<>(); |
|
|
Map<String, List<String>> legendItem = new HashMap<>(); |
|
|
List<String> legends = new ArrayList<>(); |
|
|
List<String> legends = new ArrayList<>(); |
|
|
legends.add("count"); |
|
|
legends.add("count"); |
|
|
legends.add("amount"); |
|
|
|
|
|
legendItem.put("data", legends); |
|
|
legendItem.put("data", legends); |
|
|
result.put("legend", legendItem); |
|
|
|
|
|
result.put("dayNames", dayNames); |
|
|
result.put("dayNames", dayNames); |
|
|
result.put("countItemForInventory", countItemForInventory); |
|
|
result.put("countItemForInventory", countItemForInventory); |
|
|
result.put("amountItemForInventory", amountItemForInventory); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String userAgent = request.getHeader("user-agent"); |
|
|
|
|
|
String token = request.getHeader("user-token"); |
|
|
|
|
|
if (token == null) { |
|
|
|
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
|
|
|
} |
|
|
|
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
|
|
|
if (PublicConfig.roleAdminorgList.contains(userToken.getMaindeparment())) { |
|
|
|
|
|
result.put("amountItemForInventory", amountItemForInventory); |
|
|
|
|
|
result.put("amountItemForOut", amountItemForOut); |
|
|
|
|
|
result.put("amountItemForIn", amountItemForIn); |
|
|
|
|
|
legends.add("amount"); |
|
|
|
|
|
} |
|
|
|
|
|
result.put("legend", legendItem); |
|
|
return new RestResponse(result); |
|
|
return new RestResponse(result); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|