|
|
@ -66,10 +66,10 @@ public class MaterialController { |
|
|
*/ |
|
|
*/ |
|
|
@GetMapping("/material") |
|
|
@GetMapping("/material") |
|
|
public RestResponse findMaterial(@RequestParam Map<String, Object> map) { |
|
|
public RestResponse findMaterial(@RequestParam Map<String, Object> map) { |
|
|
if(map.containsKey("materialTypeId")){ |
|
|
if (map.containsKey("materialTypeId")) { |
|
|
Long materialTypeId = ObjectFormatUtil.toLong(map.get("materialTypeId")); |
|
|
Long materialTypeId = ObjectFormatUtil.toLong(map.get("materialTypeId")); |
|
|
List<Long> childForMaterialTypeByParent = materialTypeService.findChildForMaterialTypeByParent(materialTypeId); |
|
|
List<Long> childForMaterialTypeByParent = materialTypeService.findChildForMaterialTypeByParent(materialTypeId); |
|
|
map.put("materialTypeIds",childForMaterialTypeByParent); |
|
|
map.put("materialTypeIds", childForMaterialTypeByParent); |
|
|
map.remove("materialTypeId"); |
|
|
map.remove("materialTypeId"); |
|
|
} |
|
|
} |
|
|
List<Material> materialPByCondition = materialService.findMaterialPByConditionForTable(map); |
|
|
List<Material> materialPByCondition = materialService.findMaterialPByConditionForTable(map); |
|
|
@ -171,19 +171,24 @@ public class MaterialController { |
|
|
List<Integer> didList = roleService.findDepositoryIdForUserHas(userToken); |
|
|
List<Integer> didList = roleService.findDepositoryIdForUserHas(userToken); |
|
|
map.put("depositoryIds", didList); |
|
|
map.put("depositoryIds", didList); |
|
|
} |
|
|
} |
|
|
if(map.containsKey("depositoryId")){ |
|
|
if (map.containsKey("depositoryId")) { |
|
|
// 如果包含仓库id
|
|
|
// 如果包含仓库id
|
|
|
Integer depositoryId = ObjectFormatUtil.toInteger(map.get("depositoryId")); |
|
|
Integer depositoryId = ObjectFormatUtil.toInteger(map.get("depositoryId")); |
|
|
// 获取当前仓库下所有可见的仓库
|
|
|
// 获取当前仓库下所有可见的仓库
|
|
|
List<Integer> allChildDepositoryById = depositoryService.findAllChildDepositoryById(depositoryId, userToken); |
|
|
List<Integer> allChildDepositoryById = depositoryService.findAllChildDepositoryById(depositoryId, userToken); |
|
|
map.put("depositoryIds", allChildDepositoryById); |
|
|
if (allChildDepositoryById.size() > 0) { |
|
|
map.remove("depositoryId"); |
|
|
map.put("depositoryIds", allChildDepositoryById); |
|
|
|
|
|
map.remove("depositoryId"); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if(map.containsKey("materialTypeId")){ |
|
|
if (map.containsKey("materialTypeId")) { |
|
|
Long materialTypeId = ObjectFormatUtil.toLong(map.get("materialTypeId")); |
|
|
Long materialTypeId = ObjectFormatUtil.toLong(map.get("materialTypeId")); |
|
|
List<Long> childForMaterialTypeByParent = materialTypeService.findChildForMaterialTypeByParent(materialTypeId); |
|
|
List<Long> childForMaterialTypeByParent = materialTypeService.findChildForMaterialTypeByParent(materialTypeId); |
|
|
map.put("materialTypeIds", childForMaterialTypeByParent); |
|
|
if (childForMaterialTypeByParent.size() > 0) { |
|
|
map.remove("materialTypeId"); |
|
|
map.put("materialTypeIds", childForMaterialTypeByParent); |
|
|
|
|
|
map.remove("materialTypeId"); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
list = materialService.findInventory(map); |
|
|
list = materialService.findInventory(map); |
|
|
total = materialService.findInventoryCount(map); |
|
|
total = materialService.findInventoryCount(map); |
|
|
@ -193,11 +198,11 @@ public class MaterialController { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@PostMapping("/updateInventoryRemark") |
|
|
@PostMapping("/updateInventoryRemark") |
|
|
public RestResponse updateInventoryRemark(@RequestBody Map<String,Object> map,HttpServletRequest request){ |
|
|
public RestResponse updateInventoryRemark(@RequestBody Map<String, Object> map, HttpServletRequest request) { |
|
|
if(map.containsKey("id")){ |
|
|
if (map.containsKey("id")) { |
|
|
Integer integer = materialService.updateInventoryRemark(map); |
|
|
Integer integer = materialService.updateInventoryRemark(map); |
|
|
return CrudUtil.updateHandle(integer,1); |
|
|
return CrudUtil.updateHandle(integer, 1); |
|
|
}else{ |
|
|
} else { |
|
|
throw new MyException("缺少必要参数"); |
|
|
throw new MyException("缺少必要参数"); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -282,7 +287,7 @@ public class MaterialController { |
|
|
List<Object> list = new ArrayList<>(); |
|
|
List<Object> list = new ArrayList<>(); |
|
|
if (!"".equals(mname)) { |
|
|
if (!"".equals(mname)) { |
|
|
// 如果是出入库
|
|
|
// 如果是出入库
|
|
|
list = materialService.InitTreeForSelectName(mname.split(",")[0], type, map,userToken); |
|
|
list = materialService.InitTreeForSelectName(mname.split(",")[0], type, map, userToken); |
|
|
} else { |
|
|
} else { |
|
|
list = materialService.InitTreeMenus_Test(); |
|
|
list = materialService.InitTreeMenus_Test(); |
|
|
} |
|
|
} |
|
|
@ -624,8 +629,7 @@ public class MaterialController { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
return new RestResponse(); |
|
|
return new RestResponse(); |
|
|
} |
|
|
} else { |
|
|
else { |
|
|
|
|
|
return CrudUtil.insertHandle(-1, 0); |
|
|
return CrudUtil.insertHandle(-1, 0); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -667,6 +671,7 @@ public class MaterialController { |
|
|
return CrudUtil.insertHandle(-1, 0); |
|
|
return CrudUtil.insertHandle(-1, 0); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@PostMapping("/getTemporaryValueForMaterial") |
|
|
@PostMapping("/getTemporaryValueForMaterial") |
|
|
public RestResponse getTemporaryValueForMaterial(@RequestBody Map<String, Object> map, HttpServletRequest request) { |
|
|
public RestResponse getTemporaryValueForMaterial(@RequestBody Map<String, Object> map, HttpServletRequest request) { |
|
|
String token = request.getHeader("user-token"); |
|
|
String token = request.getHeader("user-token"); |
|
|
|