| | |
| | | private PinDuoDuoCacheUtil pinDuoDuoCacheUtil; |
| | | |
| | | @Override |
| | | public void saveHead(MultipartFile file, GoodsEvaluate record) throws GoodsEvaluateException { |
| | | public String saveHead(MultipartFile file, GoodsEvaluate record) throws GoodsEvaluateException { |
| | | Integer state = record.getState(); |
| | | if (state == null) { |
| | | state = 0; |
| | |
| | | record.setStartTime(new Date()); |
| | | record.setPublishTime(record.getStartTime()); |
| | | |
| | | if (StringUtil.isNullOrEmpty(record.getId())) { |
| | | record.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | String id = record.getId(); |
| | | if (StringUtil.isNullOrEmpty(id)) { |
| | | id = UUID.randomUUID().toString().replace("-", ""); |
| | | record.setId(id); |
| | | record.setShareNumReal(0); |
| | | record.setCreateTime(new Date()); |
| | | goodsEvaluateDao.save(record); |
| | | } else { |
| | | GoodsEvaluate resultObj = goodsEvaluateDao.getById(record.getId()); |
| | | GoodsEvaluate resultObj = goodsEvaluateDao.getById(id); |
| | | if (resultObj == null) |
| | | throw new GoodsEvaluateException(1, "修改内容已不存在"); |
| | | |
| | |
| | | resultObj.setTitle(tilte); |
| | | goodsEvaluateDao.save(resultObj); |
| | | } |
| | | return id; |
| | | } |
| | | |
| | | /** |
| | |
| | | String picLink = pics[i]; |
| | | if (fileRequest != null) { |
| | | MultipartFile file = fileRequest.getFile("file" + i); |
| | | if (file == null) { |
| | | continue; |
| | | if (file != null) { |
| | | picLink = uploadPicture(file); |
| | | } |
| | | picLink = uploadPicture(file); |
| | | |
| | | } |
| | | if (picLink.startsWith("http")) { |
| | | listpic.add(picLink); |