| Line 732... |
Line 732... |
| 732 |
}
|
732 |
}
|
| 733 |
|
733 |
|
| 734 |
List<ComboModel> comboModels = comboModelRepository.selectByWarehouseId(warehouseId).stream().filter(x -> x.getCatalogId() == fofoCatalogResponse.getCatalogId()).collect(Collectors.toList());
|
734 |
List<ComboModel> comboModels = comboModelRepository.selectByWarehouseId(warehouseId).stream().filter(x -> x.getCatalogId() == fofoCatalogResponse.getCatalogId()).collect(Collectors.toList());
|
| 735 |
|
735 |
|
| 736 |
logger.info("comboModels {}", comboModels);
|
736 |
logger.info("comboModels {}", comboModels);
|
| 737 |
|
737 |
|
| 738 |
if (comboModels != null && comboModels.size() > 0) {
|
738 |
if (comboModels != null && comboModels.size() > 0) {
|
| 739 |
fofoCatalogResponse.setComboModels(comboModels);
|
739 |
fofoCatalogResponse.setComboModels(comboModels);
|
| 740 |
}
|
740 |
}
|
| 741 |
|
741 |
|
| 742 |
try {
|
742 |
try {
|
| Line 974... |
Line 974... |
| 974 |
@RequestMapping(value = "/combo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
974 |
@RequestMapping(value = "/combo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 975 |
public ResponseEntity<?> getBanners(@RequestParam int catalogId, @RequestParam int warehouseId) {
|
975 |
public ResponseEntity<?> getBanners(@RequestParam int catalogId, @RequestParam int warehouseId) {
|
| 976 |
List<ComboModel> comboModels = comboModelRepository.selectByCatalogIdAndWarehouseId(catalogId, warehouseId);
|
976 |
List<ComboModel> comboModels = comboModelRepository.selectByCatalogIdAndWarehouseId(catalogId, warehouseId);
|
| 977 |
return responseSender.ok(comboModels);
|
977 |
return responseSender.ok(comboModels);
|
| 978 |
}
|
978 |
}
|
| - |
|
979 |
|
| - |
|
980 |
@RequestMapping(value = "/checkCombo", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| - |
|
981 |
public ResponseEntity<?> checkCombo(HttpServletRequest request, @RequestParam int catalogId, @RequestParam int warehouseId, @RequestParam int qty) throws Exception {
|
| - |
|
982 |
boolean isCombo = false;
|
| - |
|
983 |
ComboModel comboModel = comboModelRepository.selectByCatalogIdWarehouseIdAndQty(catalogId, warehouseId, qty);
|
| - |
|
984 |
if (comboModel != null) {
|
| - |
|
985 |
isCombo = true;
|
| - |
|
986 |
}
|
| - |
|
987 |
|
| - |
|
988 |
return responseSender.ok(isCombo);
|
| - |
|
989 |
}
|
| - |
|
990 |
|
| - |
|
991 |
|
| 979 |
}
|
992 |
}
|
| 980 |
|
993 |
|