| | |
| | | public PointMercharsVo queryPointMerchaseDetailOfId(@RequestBody Integer pointMercharsId){ |
| | | PointMercharsVo vo = new PointMercharsVo(); |
| | | PointsMerchandise byId = pmdsService.getById(pointMercharsId); |
| | | List<UserPointsMerchandise> list = upmseService.list(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, pointMercharsId)); |
| | | if (ToolUtil.isNotEmpty(byId)){ |
| | | vo.setName(byId.getName()); |
| | | vo.setCover(byId.getCover()); |
| | | vo.setPics(byId.getProductImages()); |
| | | vo.setQuantityHas(list.size()); |
| | | vo.setQuantityIssued(byId.getQuantityIssued()); |
| | | vo.setPickUpQuantity(byId.getPickUpQuantity()); |
| | | vo.setSort(byId.getSort()); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/updateGoodsDetail") |
| | | public boolean updateGoodsDetail(@RequestBody Map<String, Object> map){ |
| | | try { |
| | | Integer pointMerchandiseId = (Integer) map.get("pointMerchandiseId"); |
| | | PointsMerchandise byId1 = pmdsService.getById(pointMerchandiseId); |
| | | |
| | | Integer quantityIssued = (Integer) map.get("quantityIssued"); |
| | | Integer pickUpQuantity = (Integer) map.get("pickUpQuantity"); |
| | | String redemptionInstructions = (String) map.get("redemptionInstructions"); |
| | | String cover = (String) map.get("cover"); |
| | | String productImages = (String) map.get("productImages"); |
| | | Integer sort = (Integer) map.get("sort"); |
| | | |
| | | byId1.setQuantityIssued(quantityIssued); |
| | | byId1.setPickUpQuantity(pickUpQuantity); |
| | | byId1.setRedemptionInstructions(redemptionInstructions); |
| | | if (ToolUtil.isNotEmpty(cover)){ |
| | | byId1.setCover(cover); |
| | | } |
| | | if (ToolUtil.isNotEmpty(productImages)){ |
| | | byId1.setProductImages(productImages); |
| | | } |
| | | byId1.setSort(sort); |
| | | pmdsService.updateById(byId1); |
| | | return true; |
| | | }catch (Exception e){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | } |