一.增加品牌分类关联的前端

prodect文件夹中的brand.vue文件详情如下:

<template><div class="mod-config"><el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"><el-form-item><el-input v-model="dataForm.key" placeholder="参数名" clearable></el-input></el-form-item><el-form-item><el-button @click="getDataList()">查询</el-button><el-buttonv-if="isAuth('product:brand:save')"type="primary"@click="addOrUpdateHandle()">新增</el-button><el-buttonv-if="isAuth('product:brand:delete')"type="danger"@click="deleteHandle()":disabled="dataListSelections.length <= 0">批量删除</el-button></el-form-item></el-form><el-table:data="dataList"borderv-loading="dataListLoading"@selection-change="selectionChangeHandle"style="width: 100%;"><el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column><el-table-column prop="brandId" header-align="center" align="center" label="品牌id"></el-table-column><el-table-column prop="name" header-align="center" align="center" label="品牌名"></el-table-column><el-table-column prop="logo" header-align="center" align="center" label="品牌logo地址"><template slot-scope="scope"><!-- <el-imagestyle="width: 100px; height: 80px":src="scope.row.logo"fit="fill"></el-image>--><img :src="scope.row.logo" style="width: 100px; height: 80px" /></template></el-table-column><el-table-column prop="descript" header-align="center" align="center" label="介绍"></el-table-column><el-table-column prop="showStatus" header-align="center" align="center" label="显示状态"><template slot-scope="scope"><el-switchv-model="scope.row.showStatus"active-color="#13ce66"inactive-color="#ff4949":active-value="1":inactive-value="0"@change="updateBrandStatus(scope.row)"></el-switch></template></el-table-column><el-table-column prop="firstLetter" header-align="center" align="center" label="检索首字母"></el-table-column><el-table-column prop="sort" header-align="center" align="center" label="排序"></el-table-column><el-table-column fixed="right" header-align="center" align="center" width="250" label="操作"><template slot-scope="scope"><el-button type="text" size="small" @click="updateCatelogHandle(scope.row.brandId)">关联分类</el-button><el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.brandId)">修改</el-button><el-button type="text" size="small" @click="deleteHandle(scope.row.brandId,scope.row.name)">删除</el-button></template></el-table-column></el-table><el-pagination@size-change="sizeChangeHandle"@current-change="currentChangeHandle":current-page="pageIndex":page-sizes="[10, 20, 50, 100]":page-size="pageSize":total="totalPage"layout="total, sizes, prev, pager, next, jumper"></el-pagination><!-- 弹窗, 新增 / 修改 --><add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update><el-dialog title="关联分类" :visible.sync="cateRelationDialogVisible" width="30%"><el-popover placement="right-end" v-model="popCatelogSelectVisible"><category-cascader :catelogPath.sync="catelogPath"></category-cascader><div style="text-align: right; margin: 0"><el-button size="mini" type="text" @click="popCatelogSelectVisible = false">取消</el-button><el-button type="primary" size="mini" @click="addCatelogSelect">确定</el-button></div><el-button slot="reference">新增关联</el-button></el-popover><el-table :data="cateRelationTableData" style="width: 100%"><el-table-column prop="id" label="#"></el-table-column><el-table-column prop="brandName" label="品牌名"></el-table-column><el-table-column prop="catelogName" label="分类名"></el-table-column><el-table-column fixed="right" header-align="center" align="center" label="操作"><template slot-scope="scope"><el-buttontype="text"size="small"@click="deleteCateRelationHandle(scope.row.id,scope.row.brandId)">移除</el-button></template></el-table-column></el-table><span slot="footer" class="dialog-footer"><el-button @click="cateRelationDialogVisible = false">取 消</el-button><el-button type="primary" @click="cateRelationDialogVisible = false">确 定</el-button></span></el-dialog></div>
</template><script>
import AddOrUpdate from "./brand-add-or-update";
import CategoryCascader from "../common/category-cascader";
export default {data() {return {dataForm: {key: ""},brandId: 0,catelogPath: [],dataList: [],cateRelationTableData: [],pageIndex: 1,pageSize: 10,totalPage: 0,dataListLoading: false,dataListSelections: [],addOrUpdateVisible: false,cateRelationDialogVisible: false,popCatelogSelectVisible: false};},components: {AddOrUpdate,CategoryCascader},activated() {this.getDataList();},methods: {addCatelogSelect() {//{"brandId":1,"catelogId":2}this.popCatelogSelectVisible =false;this.$http({url: this.$http.adornUrl("/prodect/categorybrandrelation/save"),method: "post",data: this.$http.adornData({brandId:this.brandId,catelogId:this.catelogPath[this.catelogPath.length-1]}, false)}).then(({ data }) => {this.getCateRelation();});},deleteCateRelationHandle(id, brandId) {this.$http({url: this.$http.adornUrl("/prodect/categorybrandrelation/delete"),method: "post",data: this.$http.adornData([id], false)}).then(({ data }) => {this.getCateRelation();});},updateCatelogHandle(brandId) {this.cateRelationDialogVisible = true;this.brandId = brandId;this.getCateRelation();},getCateRelation() {this.$http({url: this.$http.adornUrl("/prodect/categorybrandrelation/catelog/list"),method: "get",params: this.$http.adornParams({brandId: this.brandId})}).then(({ data }) => {this.cateRelationTableData = data.data;});},// 获取数据列表getDataList() {this.dataListLoading = true;this.$http({url: this.$http.adornUrl("/prodect/brand/list"),method: "get",params: this.$http.adornParams({page: this.pageIndex,limit: this.pageSize,key: this.dataForm.key})}).then(({ data }) => {if (data && data.code === 0) {this.dataList = data.page.list;this.totalPage = data.page.totalCount;} else {this.dataList = [];this.totalPage = 0;}this.dataListLoading = false;});},updateBrandStatus(data) {console.log("最新信息", data);let { brandId, showStatus } = data;//发送请求修改状态this.$http({url: this.$http.adornUrl("/prodect/brand/update/status"),method: "post",data: this.$http.adornData({ brandId, showStatus }, false)}).then(({ data }) => {this.$message({type: "success",message: "状态更新成功"});});},// 每页数sizeChangeHandle(val) {this.pageSize = val;this.pageIndex = 1;this.getDataList();},// 当前页currentChangeHandle(val) {this.pageIndex = val;this.getDataList();},// 多选selectionChangeHandle(val) {this.dataListSelections = val;},// 新增 / 修改addOrUpdateHandle(id) {this.addOrUpdateVisible = true;this.$nextTick(() => {this.$refs.addOrUpdate.init(id);});},// 删除deleteHandle(id,name) {var ids = id? [id]: this.dataListSelections.map(item => {return item.brandId;});var names = name? [name]: this.dataListSelections.map(item => {return item.name;});this.$confirm(`确定对品牌=[${names.join(",")}]进行[${name ? "删除" : "批量删除"}]操作?`,"提示",{confirmButtonText: "确定",cancelButtonText: "取消",type: "warning"}).then(() => {this.$http({url: this.$http.adornUrl("/prodect/brand/delete"),method: "post",data: this.$http.adornData(ids, false)}).then(({ data }) => {if (data && data.code === 0) {this.$message({message: "操作成功",type: "success",duration: 1500,onClose: () => {this.getDataList();}});} else {this.$message.error(data.msg);}});});}}
};
</script>

common文件夹增加category-cascader.vue文件,详情如下:

<template>
<!-- 
使用说明:
1)、引入category-cascader.vue
2)、语法:<category-cascader :catelogPath.sync="catelogPath"></category-cascader>解释:catelogPath:指定的值是cascader初始化需要显示的值,应该和父组件的catelogPath绑定;由于有sync修饰符,所以cascader路径变化以后自动会修改父的catelogPath,这是结合子组件this.$emit("update:catelogPath",v);做的--><div><el-cascaderfilterableclearable placeholder="试试搜索:手机"v-model="paths":options="categorys":props="setting"></el-cascader></div>
</template><script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';export default {//import引入的组件需要注入到对象中才能使用components: {},//接受父组件传来的值props: {catelogPath: {type: Array,default(){return [];}}},data() {//这里存放数据return {setting: {value: "catId",label: "name",children: "children"},categorys: [],paths: this.catelogPath};},watch:{catelogPath(v){this.paths = this.catelogPath;},paths(v){this.$emit("update:catelogPath",v);//还可以使用pubsub-js进行传值this.PubSub.publish("catPath",v);}},//方法集合methods: {getCategorys() {this.$http({url: this.$http.adornUrl("/prodect/category/list/tree"),method: "get"}).then(({ data }) => {this.categorys = data.data;});}},//生命周期 - 创建完成(可以访问当前this实例)created() {this.getCategorys();}
};
</script>
<style scoped>
</style>

二.后端添加品牌分类关联代码

以下后端代码完成了两个功能:

  • 品牌分类关联的查看,新增,修改,删除功能
  • 修改品牌或者分类数据,会同步品牌分类关联的冗余数据

CategoryBrandRelationController类详情如下:

import java.util.Arrays;
import java.util.List;
import java.util.Map;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.jiejie.webshop.prodect.entity.CategoryBrandRelationEntity;
import com.jiejie.webshop.prodect.service.CategoryBrandRelationService;
import com.jiejie.common.utils.PageUtils;
import com.jiejie.common.utils.R;/*** 品牌分类关联** @author ${author}* @email jiejie@gmail.com* @date 2020-06-02 23:44:05*/
@RestController
@RequestMapping("prodect/categorybrandrelation")
public class CategoryBrandRelationController {@Autowiredprivate CategoryBrandRelationService categoryBrandRelationService;/*** 列表*/@GetMapping("/catelog/list")//@RequiresPermissions("prodect:categorybrandrelation:list")public R catelogList(@RequestParam("brandId") Long brandId) {List<CategoryBrandRelationEntity> categoryBrandRelationEntities = categoryBrandRelationService.list(new QueryWrapper<CategoryBrandRelationEntity>().eq("brand_id", brandId));return R.ok().put("data", categoryBrandRelationEntities);}/*** 信息*/@RequestMapping("/info/{id}")//@RequiresPermissions("prodect:categorybrandrelation:info")public R info(@PathVariable("id") Long id) {CategoryBrandRelationEntity categoryBrandRelation = categoryBrandRelationService.getById(id);return R.ok().put("categoryBrandRelation", categoryBrandRelation);}/*** 保存*/@RequestMapping("/save")//@RequiresPermissions("prodect:categorybrandrelation:save")public R save(@RequestBody CategoryBrandRelationEntity categoryBrandRelation) {categoryBrandRelationService.insertCategoryBrandRelationEntity(categoryBrandRelation);return R.ok();}/*** 修改*/@RequestMapping("/update")//@RequiresPermissions("prodect:categorybrandrelation:update")public R update(@RequestBody CategoryBrandRelationEntity categoryBrandRelation) {categoryBrandRelationService.updateById(categoryBrandRelation);return R.ok();}/*** 删除*/@RequestMapping("/delete")//@RequiresPermissions("prodect:categorybrandrelation:delete")public R delete(@RequestBody Long[] ids) {categoryBrandRelationService.removeByIds(Arrays.asList(ids));return R.ok();}
}

CategoryBrandRelationService类详情如下:

package com.jiejie.webshop.prodect.service;import com.baomidou.mybatisplus.extension.service.IService;
import com.jiejie.common.utils.PageUtils;
import com.jiejie.webshop.prodect.entity.CategoryBrandRelationEntity;
import sun.util.resources.ga.LocaleNames_ga;import java.util.Map;/*** 品牌分类关联** @author ${author}* @email jiejie@gmail.com* @date 2020-06-02 23:44:05*/
public interface CategoryBrandRelationService extends IService<CategoryBrandRelationEntity> {PageUtils queryPage(Map<String, Object> params);/*** 新增品牌分类关联** @param categoryBrandRelation*/void insertCategoryBrandRelationEntity(CategoryBrandRelationEntity categoryBrandRelation);/*** 通过品牌id更新品牌名称** @param brandName* @param brandId*/void updateBrandNameByBrandId(String brandName, Long brandId);/*** 通过分类id更新分类名称** @param catelogName* @param catelogId*/void updateCatelogNameByCatelogId(String catelogName, Long catelogId);
}

CategoryBrandRelationServiceImpl类详情如下:

package com.jiejie.webshop.prodect.service.impl;import com.jiejie.webshop.prodect.dao.BrandDao;
import com.jiejie.webshop.prodect.dao.CategoryDao;
import com.jiejie.webshop.prodect.entity.BrandEntity;
import com.jiejie.webshop.prodect.entity.CategoryEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.util.Map;import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiejie.common.utils.PageUtils;
import com.jiejie.common.utils.Query;import com.jiejie.webshop.prodect.dao.CategoryBrandRelationDao;
import com.jiejie.webshop.prodect.entity.CategoryBrandRelationEntity;
import com.jiejie.webshop.prodect.service.CategoryBrandRelationService;@Service("categoryBrandRelationService")
public class CategoryBrandRelationServiceImpl extends ServiceImpl<CategoryBrandRelationDao, CategoryBrandRelationEntity> implements CategoryBrandRelationService {@Autowiredprivate BrandDao brandDao;@Autowiredprivate CategoryDao categoryDao;@Overridepublic PageUtils queryPage(Map<String, Object> params) {IPage<CategoryBrandRelationEntity> page = this.page(new Query<CategoryBrandRelationEntity>().getPage(params),new QueryWrapper<CategoryBrandRelationEntity>());return new PageUtils(page);}@Overridepublic void insertCategoryBrandRelationEntity(CategoryBrandRelationEntity categoryBrandRelation) {Long brandId = categoryBrandRelation.getBrandId();Long catelogId = categoryBrandRelation.getCatelogId();BrandEntity brandEntity = brandDao.selectById(brandId);CategoryEntity categoryEntity = categoryDao.selectById(catelogId);categoryBrandRelation.setBrandName(brandEntity.getName());categoryBrandRelation.setCatelogName(categoryEntity.getName());this.save(categoryBrandRelation);}@Overridepublic void updateBrandNameByBrandId(String brandName, Long brandId) {this.baseMapper.updateBrandNameByBrandId(brandName, brandId);}@Overridepublic void updateCatelogNameByCatelogId(String catelogName, Long catelogId) {this.baseMapper.updateCatelogNameByCatelogId(catelogName, catelogId);}
}

CategoryBrandRelationDao类详情如下:

package com.jiejie.webshop.prodect.dao;import com.jiejie.webshop.prodect.entity.CategoryBrandRelationEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;/*** 品牌分类关联** @author ${author}* @email jiejie@gmail.com* @date 2020-06-02 23:44:05*/
@Mapper
public interface CategoryBrandRelationDao extends BaseMapper<CategoryBrandRelationEntity> {/*** 通过品牌id更新品牌名称** @param brandName* @param brandId*/void updateBrandNameByBrandId(@Param("brandName") String brandName, @Param("brandId") Long brandId);/*** 通过分类id更新分类名称** @param catelogName* @param catelogId*/void updateCatelogNameByCatelogId(@Param("catelogName") String catelogName, @Param("catelogId") Long catelogId);
}

CategoryBrandRelationDao.xml文件详情如下:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mapper namespace="com.jiejie.webshop.prodect.dao.CategoryBrandRelationDao"><!-- 可根据自己的需求,是否要使用 --><resultMap type="com.jiejie.webshop.prodect.entity.CategoryBrandRelationEntity" id="categoryBrandRelationMap"><result property="id" column="id"/><result property="brandId" column="brand_id"/><result property="catelogId" column="catelog_id"/><result property="brandName" column="brand_name"/><result property="catelogName" column="catelog_name"/></resultMap><select id="updateBrandNameByBrandId">update pms_category_brand_relation set  brand_name=#{brandName} where brand_id=#{brandId}</select><select id="updateCatelogNameByCatelogId">update pms_category_brand_relation set  catelog_name=#{catelogName} where catelog_id=#{catelogId}</select>
</mapper>

BrandController类详情如下:

package com.jiejie.webshop.prodect.controller;import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;//import org.apache.shiro.authz.annotation.RequiresPermissions;
import com.jiejie.common.valid.AddGroup;
import com.jiejie.common.valid.UpdateGroup;
import com.jiejie.common.valid.UpdateStatusGroup;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;import com.jiejie.webshop.prodect.entity.BrandEntity;
import com.jiejie.webshop.prodect.service.BrandService;
import com.jiejie.common.utils.PageUtils;
import com.jiejie.common.utils.R;import javax.validation.Valid;/*** 品牌** @author ${author}* @email jiejie@gmail.com* @date 2020-06-02 23:44:05*/
@RestController
@RequestMapping("prodect/brand")
public class BrandController {@Autowiredprivate BrandService brandService;/*** 列表*/@RequestMapping("/list")//@RequiresPermissions("prodect:brand:list")public R list(@RequestParam Map<String, Object> params) {PageUtils page = brandService.queryPage(params);return R.ok().put("page", page);}/*** 信息*/@RequestMapping("/info/{brandId}")//@RequiresPermissions("prodect:brand:info")public R info(@PathVariable("brandId") Long brandId) {BrandEntity brand = brandService.getById(brandId);return R.ok().put("brand", brand);}/*** 保存*/@PostMapping("/save")//@RequiresPermissions("prodect:brand:save")public R save(@Validated(AddGroup.class) @RequestBody BrandEntity brand) {brandService.save(brand);return R.ok();}/*** 修改*/@PostMapping("/update")//@RequiresPermissions("prodect:brand:update")public R updateBrandEntity(@Validated(UpdateGroup.class) @RequestBody BrandEntity brand) {brandService.updateBrandEntity(brand);return R.ok();}/*** 更新品牌状态*/@PostMapping("/update/status")//@RequiresPermissions("prodect:brand:update")public R updateStatus(@Validated(UpdateStatusGroup.class) @RequestBody BrandEntity brand) {brandService.updateById(brand);return R.ok();}/*** 删除*/@RequestMapping("/delete")//@RequiresPermissions("prodect:brand:delete")public R delete(@RequestBody Long[] brandIds) {brandService.removeByIds(Arrays.asList(brandIds));return R.ok();}
}

BrandService类详情如下:

package com.jiejie.webshop.prodect.service;import com.baomidou.mybatisplus.extension.service.IService;
import com.jiejie.common.utils.PageUtils;
import com.jiejie.webshop.prodect.entity.BrandEntity;import java.util.Map;/*** 品牌** @author ${author}* @email jiejie@gmail.com* @date 2020-06-02 23:44:05*/
public interface BrandService extends IService<BrandEntity> {PageUtils queryPage(Map<String, Object> params);/*** 更新品牌信息** @param brand*/void updateBrandEntity(BrandEntity brand);
}

BrandServiceImpl类详情如下:

package com.jiejie.webshop.prodect.service.impl;import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiejie.common.utils.PageUtils;
import com.jiejie.common.utils.Query;
import com.jiejie.webshop.prodect.dao.BrandDao;
import com.jiejie.webshop.prodect.entity.BrandEntity;
import com.jiejie.webshop.prodect.service.BrandService;
import com.jiejie.webshop.prodect.service.CategoryBrandRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;import java.util.Map;@Service("brandService")
public class BrandServiceImpl extends ServiceImpl<BrandDao, BrandEntity> implements BrandService {@Autowiredprivate CategoryBrandRelationService categoryBrandRelationService;@Overridepublic PageUtils queryPage(Map<String, Object> params) {//获取到keyString key = (String) params.get("key");QueryWrapper<BrandEntity> queryWrapper = new QueryWrapper<>();//如果搜索的key不为null,那么就模糊匹配出id相同或者品牌名称相同的数据if (!StringUtils.isEmpty(key)) {queryWrapper.eq("brand_Id", key).or().like("name", key);}IPage<BrandEntity> page = this.page(new Query<BrandEntity>().getPage(params),queryWrapper);return new PageUtils(page);}@Overridepublic void updateBrandEntity(BrandEntity brand) {//更新品牌信息this.updateById(brand);//更新品牌分类关联表信息,因为存了冗余字段,所以得保证冗余字段的数据一致categoryBrandRelationService.updateBrandNameByBrandId(brand.getName(), brand.getBrandId());//todo 其他关联表}
}

CategoryController类详情如下:

package com.jiejie.webshop.prodect.controller;import java.util.Arrays;
import java.util.List;
import java.util.Map;//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;import com.jiejie.webshop.prodect.entity.CategoryEntity;
import com.jiejie.webshop.prodect.service.CategoryService;
import com.jiejie.common.utils.PageUtils;
import com.jiejie.common.utils.R;/*** 商品三级分类** @author ${author}* @email jiejie@gmail.com* @date 2020-06-02 23:44:05*/
@RestController
@RequestMapping("prodect/category")
public class CategoryController {@Autowiredprivate CategoryService categoryService;/*** 获取树形结构商品分类*/@GetMapping("/list/tree")//@RequiresPermissions("prodect:category:list")public R getCategoryforTree() {List<CategoryEntity> categoryEntities = categoryService.getListToTree();return R.ok().put("data", categoryEntities);}/*** 信息*/@RequestMapping("/info/{catId}")//@RequiresPermissions("prodect:category:info")public R info(@PathVariable("catId") Long catId) {CategoryEntity category = categoryService.getById(catId);return R.ok().put("data", category);}/*** 新增*/@RequestMapping("/save")//@RequiresPermissions("prodect:category:save")public R save(@RequestBody CategoryEntity category) {categoryService.save(category);return R.ok();}/*** 拖拽功能,批量修改分类排序*/@RequestMapping("/update/sort")//@RequiresPermissions("prodect:category:update")public R updateSort(@RequestBody CategoryEntity[] categories) {categoryService.updateBatchById(Arrays.asList(categories));return R.ok();}/*** 修改*/@RequestMapping("/update")//@RequiresPermissions("prodect:category:update")public R updateCategoryEntity(@RequestBody CategoryEntity category) {categoryService.updateCategoryEntity(category);return R.ok();}/*** 删除*/@RequestMapping("/delete")//@RequiresPermissions("prodect:category:delete")public R delete(@RequestBody Long[] catIds) {categoryService.removeMenusByIds(Arrays.asList(catIds));return R.ok();}
}

CategoryService类详情如下:

package com.jiejie.webshop.prodect.service;import com.baomidou.mybatisplus.extension.service.IService;
import com.jiejie.common.utils.PageUtils;
import com.jiejie.webshop.prodect.entity.CategoryEntity;import java.util.List;
import java.util.Map;/*** 商品三级分类** @author ${author}* @email jiejie@gmail.com* @date 2020-06-02 23:44:05*/
public interface CategoryService extends IService<CategoryEntity> {PageUtils queryPage(Map<String, Object> params);/*** 获取树形结构商品分类** @return*/List<CategoryEntity> getListToTree();/*** 删除商品分类** @param catIds*/void removeMenusByIds(List<Long> catIds);/*** 获取所属分类的完整路径** @param catelogId* @return*/Long[] findCatelogPath(Long catelogId);/*** 更新分类信息** @param category*/void updateCategoryEntity(CategoryEntity category);
}

CategoryServiceImpl类详情如下:

package com.jiejie.webshop.prodect.service.impl;import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiejie.common.utils.PageUtils;
import com.jiejie.common.utils.Query;
import com.jiejie.webshop.prodect.dao.CategoryDao;
import com.jiejie.webshop.prodect.entity.CategoryEntity;
import com.jiejie.webshop.prodect.service.CategoryBrandRelationService;
import com.jiejie.webshop.prodect.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;@Service("categoryService")
public class CategoryServiceImpl extends ServiceImpl<CategoryDao, CategoryEntity> implements CategoryService {@Autowiredprivate CategoryBrandRelationService categoryBrandRelationService;@Overridepublic PageUtils queryPage(Map<String, Object> params) {IPage<CategoryEntity> page = this.page(new Query<CategoryEntity>().getPage(params),new QueryWrapper<CategoryEntity>());return new PageUtils(page);}@Overridepublic List<CategoryEntity> getListToTree() {//1.获取所有分类数据List<CategoryEntity> categoryEntities = baseMapper.selectList(null);//2.组装成树形结构//2.1).先找到所有的一级分类,然后继续设置分类下的子分类,最后排序,归约List<CategoryEntity> firstLevelMenu = categoryEntities.stream().filter(categoryEntity -> categoryEntity.getParentCid() == 0).map((menu) -> {menu.setChildren(getChildrens(categoryEntities, menu));return menu;}).sorted((menu1, menu2) -> {return (menu1.getSort() == null ? 0 : menu1.getSort()) - (menu2.getSort() == null ? 0 : menu2.getSort());}).collect(Collectors.toList());return firstLevelMenu;}/*** 递归设置各级子菜单** @param all  所有的分类数据* @param root 一级菜单* @return*/private List<CategoryEntity> getChildrens(List<CategoryEntity> all, CategoryEntity root) {List<CategoryEntity> children = all.stream().filter(categoryEntity -> categoryEntity.getParentCid().equals(root.getCatId())).map(categoryEntity -> {//递归设置子菜单categoryEntity.setChildren(getChildrens(all, categoryEntity));return categoryEntity;}).sorted((menu1, menu2) -> {return (menu1.getSort() == null ? 0 : menu1.getSort()) - (menu2.getSort() == null ? 0 : menu2.getSort());}).collect(Collectors.toList());return children;}@Overridepublic void removeMenusByIds(List<Long> catIds) {//todo 如果被删除的分类菜单有被引用,则给出阻拦//逻辑删除商品分类baseMapper.deleteBatchIds(catIds);}private List<Long> findParentPath(Long catelogId, List<Long> paths) {//收集当前节点idpaths.add(catelogId);CategoryEntity byId = this.getById(catelogId);if (byId.getParentCid() != 0) {//递归调用,添加节点findParentPath(byId.getParentCid(), paths);}return paths;}@Overridepublic Long[] findCatelogPath(Long catelogId) {List<Long> paths = new ArrayList<>();//调用findParentPath方法添加各级节点List<Long> parentPath = findParentPath(catelogId, paths);//反转数据,才是正确的顺序Collections.reverse(parentPath);//转为数组返回return parentPath.toArray(new Long[parentPath.size()]);}@Overridepublic void updateCategoryEntity(CategoryEntity category) {//更新分类信息this.updateById(category);//更新品牌分类关联表信息,因为存了冗余字段,所以得保证冗余字段的数据一致categoryBrandRelationService.updateCatelogNameByCatelogId(category.getName(), category.getCatId());//todo 其他关联表}
}

三.测试效果

修改前品牌分类关联列表展示:
在这里插入图片描述
修改手机分类名称改为手机1,品牌名称华为改为华为1:
在这里插入图片描述

增加品牌分类关联成功。

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. Linux的高并发服务器(多进程多线程)

    高并发服务器多进程并发服务器server.cclient.c多线程并发服务器server.cclient.c 多进程并发服务器 使用多进程并发服务器时要考虑以下几点: 父进程最大文件描述个数(父进程中需要close关闭accept返回的新文件描述符) 系统内创建进程个数(与内存大小相关) 进程创建过多是否降…...

    2024/5/5 23:36:39
  2. Android 知识体系

    Android 知识体系一、平台架构1.1 Linux Kernel硬件抽象层 (HAL)Android RuntimeNative C/C++ LibraryJava API FrameworkSystem AppsAndroid 通信机制Android核心系统启动系统服务SensorServiceAPP感谢: 一、平台架构 Google Android 平台架构Android 是一个针对多种不同设备…...

    2024/5/5 17:22:10
  3. 安装Wampserver,搭建Web服务器的问题:由于找不到MSVCR110.dll,无法继续执行代码...

    我们电脑在安装Wampserver后,打开软件出现问题:问题产生的原因:我们电脑没有运行库,只要安装常用运行库合集就也可用了 安装常用运行库合集方法如下:*点击链接下载: http://www.pc6.com/softview/SoftView_104246.html 下载好后进行安装,如下:安装好后问题就得解决,我…...

    2024/4/20 2:32:59
  4. SpringCloud学习之PassCloud——(三)passcloud-master各模块启动

    一、编译通过二、启动顺序1.启动PassCloudEurekaApplication2.启动PassCloudDiscoveryApplication3.启动PassCloudUacApplication启动PassCloudGatewayApplication报错:需要先启动Uac4.再启动其他(无先后顺序)。全部启动成功。...

    2024/4/28 4:07:39
  5. zeppelin的安装和使用

    一 下载安装包 http://zeppelin.apache.org/download.html 选择zeppelin-0.8.1-bin-all.tgz 二 上传并解压 上传到Linux tar -zvxf zeppelin-0.8.1-bin-all.tgz -C /root #解压的路径根据自己需求设置,这里选择root文件夹下进入目录 cd /root/zeppelin-0.8.1-bin-all/------…...

    2024/4/28 19:14:57
  6. leetcode 64 最小路径和(动态规划)

    https://leetcode-cn.com/problems/minimum-path-sum/题目 给定一个包含非负整数的 m x n 网格,请找出一条从左上角到右下角的路径,使得路径上的数字总和为最小。 说明:每次只能向下或者向右移动一步。 示例输入: [ [1,3,1], [1,5,1], [4,2,1] ] 输出: 7 解释: 因为路径 1→…...

    2024/4/28 19:00:48
  7. Vue学习笔记(二)

    文章目录1 条件判断1.1 普通if1.2 if-else1.3 v-show2 循环3 计算属性3.1 computed3.2 computed与methods3.3 setter 1 条件判断 1.1 普通if 条件判断使用v-if指令: <div id="app"><p v-if="seen">看到了</p>; </div><script&…...

    2024/4/28 7:58:31
  8. springcloud学习笔记

    1.eureka的部署1. 部署server的集群时,出现unavailable-replicas的问题原因:部署集群时,同一个集群的eureka.instance.appname需要保持一致,该属性标志实例是否属于同一个服务。解决:把server的每个实例eureka.instance.appname设置为同一个值,spring.application.name不…...

    2024/4/28 18:56:12
  9. 微信小程序canvas制作海报总结

    一、由于海报中元素的宽高位置等是动态的,所以把这些值放在data中,并且为rpx单位data: {// data中均为rpx值wrap: {x: 0, y: 0, w: 600, h: 1000, src: /images/img1.png},photo: {x: 200, y: 0, w: 200, h: 200, src: /images/img2.png},finalPhoto: {x: 200, y: 0, w: 200,…...

    2024/4/28 17:36:11
  10. P卡: 1个人卡和企业卡有什么不一样 特别是汇率 2. 可以不绑定银行卡?汇率会折损吗?

    1、目前Payoneer(俗称P卡)提供个人账户、企业账户两种身份类型。从功能上来说,两种账户基本差不多,基本都可以使用。除非有特别的要求,如亚马逊欧洲站、英国站考虑到KYC,建议注册公司账户,另外Newegg、Lazada、京东海外站等平台只允许企业入驻。同样地,这些平台也要求您…...

    2024/4/28 14:45:43
  11. 126.(5460)好数对的数目(第 197 场周赛)

    题目描述:给你一个整数数组 nums 。如果一组数字 (i,j) 满足 nums[i] == nums[j] 且 i < j ,就可以认为这是一组 好数对 。返回好数对的数目。示例 1:输入:nums = [1,2,3,1,1,3] 输出:4 解释:有 4 组好数对,分别是 (0,3), (0,4), (3,4), (2,5) ,下标从 0 开始示例 2…...

    2024/4/28 7:47:32
  12. 剑指offer:树的子结构

    首先:树的子结构和子树不是同一个概念。这边需要看清题目,区分一下;关于树这边的题大多数都是使用递归;步骤一般为: 1.单独切开看某一个点 2.然后从根节点开始进行依次执行1中的逻辑。 比如这道题,是需要判断两颗二叉树A和B,判断B是不是A的子结构(约定空树不是任意一个…...

    2024/4/28 14:01:26
  13. 2020年最新-《Pytorch深度学习实战》书

    本书介绍这本书旨在讲解深度学习PyTorch相关的基础知识,并展示一些现实生活中实际项目。本书详细讲解深度学习相关的关键概念、算法和模型,并展示PyTorch是如何实现这些算法、概念和模型。在这本书里,我们试图提供一些启发,来促进进一步的探索,并且在这一过程中,我们有选…...

    2024/5/1 12:29:48
  14. Pyqt5实现计时器功能

    1.利用计时器模块QTimer# 初始化一个定时器 self.timer = QTimer(self) # 将定时器超时信号与槽函数showTime()连接 self.timer.timeout.connect(self.showTime)self.timer.start(1000)启动timerself.timer.stop() 停止timer#!usr/bin/python # -*- coding: utf-8 -*- from PyQ…...

    2024/4/28 13:05:14
  15. Linux中的进程组会话守护进程

    守护进程终端进程组概念特性进程组操作函数getpgrp函数getpgid函数setpgid函数会话创建会话getsid函数setsid函数守护进程创建守护进程模型 终端 在UNIX系统中,用户通过终端登录系统后得到一个Shell进程,这个终端成为Shell进程的控制终端(Controlling Terminal),进程中,控…...

    2024/4/28 11:24:44
  16. node.js搭建静态服务器

    Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。 Node.js 使用了一个事件驱动、非阻塞式 I/O 的模型,使其轻量又高效。Node.js 的包管理器 npm,是全球最大的开源库生态系统。 首先,在搭建一个简单的静态服务器之前,我们先来了解下node.js应用应该由哪几个部分组…...

    2024/4/28 20:55:44
  17. 关于node创建静态服务器

    一,简介 关于安装node和基础的node知识,之前的博客都要介绍完毕,这次的博客讲讲关于node搭建静态服务器。 以前我们所谓说的前端静态页面以为是没有设置任何效果的页面就是静态页面,但是这并不是,因为没有任何的数据交互,再炫酷的效果,那也是静态页面,只是前端工程师拿…...

    2024/4/28 21:35:19
  18. 27、深度学习之决策树学习

    具体参考决策树基本原理和讲解:信息熵的学习参考:链接:https://pan.baidu.com/s/1_AF7xoUhm3XgcYGfGrk5ng 提取码:kztu决策树的学习参考:https://sklearn.apachecn.org/docs/master/11.html代码使用的csv参考:链接:https://pan.baidu.com/s/1IxbFuwET7qMbJyEu76WROg 提…...

    2024/4/28 2:36:35
  19. Linux中的进程

    进程进程控制块(PCB)进程状态进程控制fork函数getpid函数getppid函数getuid函数getgid函数进程共享exec函数族execlp函数execl函数execvp函数exec函数族规律回收子进程wait函数waitpid函数...

    2024/4/27 21:39:54
  20. MySQL分区分表

    1、为什么要分表? 数据库数据越来越大,随之而来的是单个表中数据太多。以至于查询速度变慢,而且由于表的锁机制导致应用操作也搜到严重影响,出现了数据库性能瓶颈。 mysql中有一种机制是表锁定和行锁定,是为了保证数据的完整性。表锁定表示你们都不能对这张表进行操作,必…...

    2024/4/28 0:54:45

最新文章

  1. 记录PR学习查漏补缺(持续补充中。。。)

    记录PR学习查漏补缺 常用快捷键文件编辑素材序列标记字幕窗口帮助 效果基本3D高斯模糊查找边缘色彩颜色平衡超级键马赛克中间值变形稳定器轨道遮罩键 常用 快捷键 注意&#xff1a;比较常用的用红色字体显示 文件 快捷键作用Ctrl Alt N新建项目Ctrl O打开项目Ctrl I导入…...

    2024/5/6 3:32:56
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/3/20 10:50:27
  3. 【Locust分布式压力测试】

    Locust分布式压力测试 https://docs.locust.io/en/stable/running-distributed.html Distributed load generation A single process running Locust can simulate a reasonably high throughput. For a simple test plan and small payloads it can make more than a thousan…...

    2024/5/5 21:03:09
  4. 17、Lua 文件 I-O

    Lua 文件 I/O Lua 文件 I/O简单模式完全模式 Lua 文件 I/O LuaI/O 库用于读取和处理文件。分为简单模式&#xff08;和C一样&#xff09;、完全模式。 简单模式&#xff08;simple model&#xff09;拥有一个当前输入文件和一个当前输出文件&#xff0c;并且提供针对这些文件…...

    2024/5/3 5:42:41
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/5/4 23:54:56
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/5/4 23:54:56
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/5/4 23:54:56
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/5/4 23:55:17
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/5/4 23:54:56
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/5/4 23:55:05
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/5/4 23:54:56
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/5/4 23:55:16
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/5/4 23:54:56
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/5/6 1:40:42
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/5/4 23:54:56
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/5/4 23:55:17
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/5/4 23:55:06
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/5/4 23:54:56
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/5/4 23:55:06
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/5/5 8:13:33
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/5/4 23:55:16
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/5/4 23:54:58
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/5/4 23:55:01
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/5/4 23:54:56
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57