|
|
@ -226,7 +226,7 @@ public class DepositoryController { |
|
|
Integer depositoryRecordByDateByIn1 = depositoryRecordService.findApplicationInRecordByDate(days.get(i), days.get(i + 1), val); |
|
|
Integer depositoryRecordByDateByIn1 = depositoryRecordService.findApplicationInRecordByDate(days.get(i), days.get(i + 1), val); |
|
|
// 获取一段时间内的出库额度
|
|
|
// 获取一段时间内的出库额度
|
|
|
Integer depositoryRecordByDateByOut1 = depositoryRecordService.findApplicationOutRecordByDate(days.get(i), days.get(i + 1), val); |
|
|
Integer depositoryRecordByDateByOut1 = depositoryRecordService.findApplicationOutRecordByDate(days.get(i), days.get(i + 1), val); |
|
|
Double warehouserCount1 = aDouble - depositoryRecordByDateByIn1 + depositoryRecordByDateByOut1; |
|
|
Double warehouserCount1 = aDouble - depositoryRecordByDateByIn1 + depositoryRecordByDateByOut1; |
|
|
result.add(warehouserCount1); |
|
|
result.add(warehouserCount1); |
|
|
} |
|
|
} |
|
|
Collections.reverse(result); |
|
|
Collections.reverse(result); |
|
|
@ -379,7 +379,7 @@ public class DepositoryController { |
|
|
// 获取某个月某物料出库总额
|
|
|
// 获取某个月某物料出库总额
|
|
|
// 测试
|
|
|
// 测试
|
|
|
Double wareHouseOutCountByMonth1 = depositoryRecordService.findMaterialCountByMonth2(parmOut); |
|
|
Double wareHouseOutCountByMonth1 = depositoryRecordService.findMaterialCountByMonth2(parmOut); |
|
|
Double wareHouseCount1 = (double)productData.get(k++) - wareHouseInCountByMonth1 + wareHouseOutCountByMonth1; |
|
|
Double wareHouseCount1 = (double) productData.get(k++) - wareHouseInCountByMonth1 + wareHouseOutCountByMonth1; |
|
|
productData.add(wareHouseCount1); |
|
|
productData.add(wareHouseCount1); |
|
|
} |
|
|
} |
|
|
List<Object> result = new ArrayList<>(); |
|
|
List<Object> result = new ArrayList<>(); |
|
|
@ -956,12 +956,12 @@ public class DepositoryController { |
|
|
show_data.put(key.toString(), drCountbyDrName.clone()); |
|
|
show_data.put(key.toString(), drCountbyDrName.clone()); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
Future<Object> future = completionService.submit(new distributeTasks(depositoryAllNameAndId,type, 1, userByPort, yesterdayData, depositoryName)); |
|
|
Future<Object> future = completionService.submit(new distributeTasks(depositoryAllNameAndId, type, 1, userByPort, yesterdayData, depositoryName)); |
|
|
futureList.add(future); |
|
|
futureList.add(future); |
|
|
taskNum += 1; |
|
|
taskNum += 1; |
|
|
} |
|
|
} |
|
|
// 获取本月及之前月份各种类别入/出库总量
|
|
|
// 获取本月及之前月份各种类别入/出库总量
|
|
|
Future<Object> future = completionService.submit(new distributeTasks(depositoryAllNameAndId,type, 3, userByPort, yesterdayData, depositoryName)); |
|
|
Future<Object> future = completionService.submit(new distributeTasks(depositoryAllNameAndId, type, 3, userByPort, yesterdayData, depositoryName)); |
|
|
futureList.add(future); |
|
|
futureList.add(future); |
|
|
taskNum += 1; |
|
|
taskNum += 1; |
|
|
// 中国地图数据
|
|
|
// 中国地图数据
|
|
|
@ -971,7 +971,7 @@ public class DepositoryController { |
|
|
Map<String, Object> mapData = new HashMap<>(); |
|
|
Map<String, Object> mapData = new HashMap<>(); |
|
|
if (!"0".equals(type)) { |
|
|
if (!"0".equals(type)) { |
|
|
|
|
|
|
|
|
Future<Object> future1 = completionService.submit(new distributeTasks(depositoryAllNameAndId,type, 4, userByPort, yesterdayData, depositoryName)); |
|
|
Future<Object> future1 = completionService.submit(new distributeTasks(depositoryAllNameAndId, type, 4, userByPort, yesterdayData, depositoryName)); |
|
|
futureList.add(future1); |
|
|
futureList.add(future1); |
|
|
taskNum += 1; |
|
|
taskNum += 1; |
|
|
} |
|
|
} |
|
|
@ -1004,14 +1004,14 @@ public class DepositoryController { |
|
|
if ("0".equals(type)) { |
|
|
if ("0".equals(type)) { |
|
|
// 如果是获取库存
|
|
|
// 如果是获取库存
|
|
|
|
|
|
|
|
|
distributeTasks distributeTasks1 = new distributeTasks(depositoryAllNameAndId,type, 5, userByPort, yesterdayData, depositoryName); |
|
|
distributeTasks distributeTasks1 = new distributeTasks(depositoryAllNameAndId, type, 5, userByPort, yesterdayData, depositoryName); |
|
|
distributeTasks1.setTodayInventory(todayInventory); |
|
|
distributeTasks1.setTodayInventory(todayInventory); |
|
|
distributeTasks1.setDepositoryService(depositoryService); |
|
|
distributeTasks1.setDepositoryService(depositoryService); |
|
|
distributeTasks1.setDepositoryRecordService(depositoryRecordService); |
|
|
distributeTasks1.setDepositoryRecordService(depositoryRecordService); |
|
|
distributeTasks distributeTasks2 = new distributeTasks(depositoryAllNameAndId,type, 6, userByPort, yesterdayData, depositoryName); |
|
|
distributeTasks distributeTasks2 = new distributeTasks(depositoryAllNameAndId, type, 6, userByPort, yesterdayData, depositoryName); |
|
|
distributeTasks2.setDepositoryService(depositoryService); |
|
|
distributeTasks2.setDepositoryService(depositoryService); |
|
|
distributeTasks2.setDepositoryRecordService(depositoryRecordService); |
|
|
distributeTasks2.setDepositoryRecordService(depositoryRecordService); |
|
|
distributeTasks distributeTasks3 = new distributeTasks(depositoryAllNameAndId,type, 7, userByPort, yesterdayData, depositoryName); |
|
|
distributeTasks distributeTasks3 = new distributeTasks(depositoryAllNameAndId, type, 7, userByPort, yesterdayData, depositoryName); |
|
|
distributeTasks3.setDepositoryService(depositoryService); |
|
|
distributeTasks3.setDepositoryService(depositoryService); |
|
|
distributeTasks3.setDepositoryRecordService(depositoryRecordService); |
|
|
distributeTasks3.setDepositoryRecordService(depositoryRecordService); |
|
|
Future<Object> future1 = completionService.submit(distributeTasks1); |
|
|
Future<Object> future1 = completionService.submit(distributeTasks1); |
|
|
@ -1062,7 +1062,7 @@ public class DepositoryController { |
|
|
return resMap; |
|
|
return resMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public Map<String, Object> getShowData(Map<String, Integer> depositoryAllNameAndId,String type, UserByPort userByPort, Map<String, Double> yesterdayData, List<String> depositoryName) { |
|
|
public Map<String, Object> getShowData(Map<String, Integer> depositoryAllNameAndId, String type, UserByPort userByPort, Map<String, Double> yesterdayData, List<String> depositoryName) { |
|
|
// 获取遍历器
|
|
|
// 获取遍历器
|
|
|
Iterator it = depositoryAllNameAndId.keySet().iterator(); |
|
|
Iterator it = depositoryAllNameAndId.keySet().iterator(); |
|
|
// 仓库名称列表
|
|
|
// 仓库名称列表
|
|
|
@ -1417,7 +1417,6 @@ public class DepositoryController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 构造库位树
|
|
|
// 构造库位树
|
|
|
@GetMapping("/treeMenus_Place") |
|
|
@GetMapping("/treeMenus_Place") |
|
|
public RestResponse InitTreeMenus_Place(@RequestParam(value = "depositoryId") Integer depositoryId) { |
|
|
public RestResponse InitTreeMenus_Place(@RequestParam(value = "depositoryId") Integer depositoryId) { |
|
|
@ -1427,7 +1426,7 @@ public class DepositoryController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/treeMenusOnlyDepository") |
|
|
@GetMapping("/treeMenusOnlyDepository") |
|
|
public RestResponse treeMenusOnlyDepository(){ |
|
|
public RestResponse treeMenusOnlyDepository() { |
|
|
List<Object> list = new ArrayList<>(); |
|
|
List<Object> list = new ArrayList<>(); |
|
|
list = depositoryService.InitTreeMenusOnlyDepository(); |
|
|
list = depositoryService.InitTreeMenusOnlyDepository(); |
|
|
return new RestResponse(list); |
|
|
return new RestResponse(list); |
|
|
@ -1491,6 +1490,7 @@ public class DepositoryController { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用于打印图片 |
|
|
* 用于打印图片 |
|
|
|
|
|
* |
|
|
* @param map |
|
|
* @param map |
|
|
* @param request |
|
|
* @param request |
|
|
* @param response |
|
|
* @param response |
|
|
@ -1509,7 +1509,7 @@ public class DepositoryController { |
|
|
String name = depository.getDname() + "-" + place.getKingdeecode(); |
|
|
String name = depository.getDname() + "-" + place.getKingdeecode(); |
|
|
String qrCode = CreateQrCodeUtil.CreateBarCode128(qrCodeByDepository, name, 60, 200); |
|
|
String qrCode = CreateQrCodeUtil.CreateBarCode128(qrCodeByDepository, name, 60, 200); |
|
|
try { |
|
|
try { |
|
|
File file = ZipMultiFileUtil.base64ToFile(qrCode,name); |
|
|
File file = ZipMultiFileUtil.base64ToFile(qrCode, name); |
|
|
qrCodeListForPlaces.add(file); |
|
|
qrCodeListForPlaces.add(file); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
@ -1520,7 +1520,7 @@ public class DepositoryController { |
|
|
String name = depository.getDname(); |
|
|
String name = depository.getDname(); |
|
|
String qrCode = CreateQrCodeUtil.CreateBarCode128(qrCodeByDepository, name, 60, 200); |
|
|
String qrCode = CreateQrCodeUtil.CreateBarCode128(qrCodeByDepository, name, 60, 200); |
|
|
try { |
|
|
try { |
|
|
File file = ZipMultiFileUtil.base64ToFile(qrCode,name); |
|
|
File file = ZipMultiFileUtil.base64ToFile(qrCode, name); |
|
|
qrCodeListForPlaces.add(file); |
|
|
qrCodeListForPlaces.add(file); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
e.printStackTrace(); |
|
|
e.printStackTrace(); |
|
|
@ -1531,31 +1531,44 @@ public class DepositoryController { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用于设置仓库可见范围权限 |
|
|
* 用于设置仓库可见范围权限 |
|
|
* @param map 存储数据 |
|
|
* |
|
|
|
|
|
* @param map 存储数据 |
|
|
* @param request 请求 |
|
|
* @param request 请求 |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@PostMapping("/setWarehouseVisiblePermission") |
|
|
@PostMapping("/setWarehouseVisiblePermission") |
|
|
public RestResponse setWarehouseVisiblePermission(@RequestBody Map<String,Object> map,HttpServletRequest request){ |
|
|
public RestResponse setWarehouseVisiblePermission(@RequestBody Map<String, Object> map, HttpServletRequest request) { |
|
|
if(map.containsKey("type")){ |
|
|
if (map.containsKey("type")) { |
|
|
// 获取当前登录的用户
|
|
|
// 获取当前登录的用户
|
|
|
String token = request.getHeader("user-token"); |
|
|
String token = request.getHeader("user-token"); |
|
|
if (token == null) { |
|
|
if (token == null) { |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
token = (String) request.getSession().getAttribute("userToken"); |
|
|
} |
|
|
} |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
UserByPort userToken = AuthenticationTokenPool.getUserToken(token); |
|
|
map.put("userId",userToken.getId()); |
|
|
map.put("userId", userToken.getId()); |
|
|
// 添加时影响的行数
|
|
|
|
|
|
Integer integer = roleService.addWarehouseVisiblePermission(map); |
|
|
|
|
|
// 需要添加的数量
|
|
|
// 需要添加的数量
|
|
|
Integer count = ObjectFormatUtil.toInteger(map.get("count")); |
|
|
Integer count = ObjectFormatUtil.toInteger(map.get("count")); |
|
|
return CrudUtil.insertHandle(count,integer); |
|
|
// 操作时影响的行数
|
|
|
}else{ |
|
|
Integer integer = 0; |
|
|
|
|
|
if (count == 0) { |
|
|
|
|
|
// 如果要删除
|
|
|
|
|
|
} else { |
|
|
|
|
|
// 如果不是删除
|
|
|
|
|
|
integer = roleService.setWarehouseVisiblePermission(map); |
|
|
|
|
|
} |
|
|
|
|
|
return CrudUtil.insertHandle(count, integer); |
|
|
|
|
|
} else { |
|
|
throw new MyException("缺少必要参数"); |
|
|
throw new MyException("缺少必要参数"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/findWarehouseVisiblePermission") |
|
|
|
|
|
public RestResponse findWarehouseVisiblePermission(@RequestBody Map<String, Object> map){ |
|
|
|
|
|
List<Integer> list = roleService.findDepositoryIdForWarehouseVisiblePermissionByCondition(map); |
|
|
|
|
|
return new RestResponse(list); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 用于获取当前仓库的所有子类 |
|
|
* 用于获取当前仓库的所有子类 |
|
|
* |
|
|
* |
|
|
@ -1596,6 +1609,7 @@ public class DepositoryController { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 用于分发任务
|
|
|
// 用于分发任务
|
|
|
@Data |
|
|
@Data |
|
|
class distributeTasks implements Callable<Object> { |
|
|
class distributeTasks implements Callable<Object> { |
|
|
@ -1610,7 +1624,7 @@ public class DepositoryController { |
|
|
Map<String, Object> todayInventory; // 当前仓库的额度
|
|
|
Map<String, Object> todayInventory; // 当前仓库的额度
|
|
|
Map<String, Integer> depositoryAllNameAndId; // 仓库名称与仓库id的映射
|
|
|
Map<String, Integer> depositoryAllNameAndId; // 仓库名称与仓库id的映射
|
|
|
|
|
|
|
|
|
distributeTasks(Map<String, Integer> depositoryAllNameAndId,String type, int taskType, UserByPort userByPort, Map<String, Double> yesterdayData, List<String> depositoryName) { |
|
|
distributeTasks(Map<String, Integer> depositoryAllNameAndId, String type, int taskType, UserByPort userByPort, Map<String, Double> yesterdayData, List<String> depositoryName) { |
|
|
this.depositoryAllNameAndId = depositoryAllNameAndId;// 仓库名称与仓库id映射
|
|
|
this.depositoryAllNameAndId = depositoryAllNameAndId;// 仓库名称与仓库id映射
|
|
|
this.taskType = taskType; // 任务类型
|
|
|
this.taskType = taskType; // 任务类型
|
|
|
this.type = type; // 请求类型
|
|
|
this.type = type; // 请求类型
|
|
|
@ -1626,7 +1640,7 @@ public class DepositoryController { |
|
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
Map<String, Object> result = new HashMap<>(); |
|
|
if (1 == taskType) { |
|
|
if (1 == taskType) { |
|
|
Map<String, Object> showData = getShowData(depositoryAllNameAndId,type, userByPort, yesterdayData, depositoryName); |
|
|
Map<String, Object> showData = getShowData(depositoryAllNameAndId, type, userByPort, yesterdayData, depositoryName); |
|
|
result.put("show_data", showData); |
|
|
result.put("show_data", showData); |
|
|
} else if (2 == taskType) { |
|
|
} else if (2 == taskType) { |
|
|
|
|
|
|
|
|
@ -1802,6 +1816,4 @@ public class DepositoryController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|