| | |
| | | } else { |
| | | sysPictureBaseService.insert(sysPictureBase); |
| | | } |
| | | if (sysPictureBase.getIsDefault()==1){ |
| | | if (sysPictureBase.getId()==null){ |
| | | sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType()); |
| | | sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),null); |
| | | }else{ |
| | | if (!sysPictureBase.getId().equals(sysPictureBase.getId())){ |
| | | sysPictureBaseService.updateByDefault(sysPictureBase.getId(),sysPictureBase.getProductType()); |
| | | sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(),sysPictureBase.getProductType(),sysPictureBase.getId()); |
| | | } |
| | | } |
| | | if (sysPictureBase.getIsDefault() == 1 && sysPictureBase.getProductType()!=20) { |
| | | sysPictureBaseService.updateByDefault(sysPictureBase.getId(), sysPictureBase.getProductType()); |
| | | sysPictureBaseService.updateProdeuctImg(sysPictureBase.getId(), sysPictureBase.getProductType(), null); |
| | | } |
| | | return Result.ok(); |
| | | } |
| | |
| | | //关流 |
| | | outputStream.close(); |
| | | in.close(); |
| | | } catch (IOException e) { |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | |
| | | response.getWriter().flush(); |
| | | response.getWriter().close(); |
| | | |
| | | } catch (IOException e) { |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | |
| | | SysPictureBase data = sysPictureBaseService.getDefaultImg(productType); |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @ApiOperation("删除") |
| | | @LogOperation("删除") |