016 规格参数

news2024/10/8 18:27:15

文章目录

    • 新增
      • AttrController.java
      • AttrVo.java
      • AttrServiceImpl.java
      • AttrAttrgroupRelationEntity.java
      • AttrEntity.java
      • AttrGroupEntity.java
    • 查询
      • AttrController.java
      • AttrServiceImpl.java
      • AttrRespVo.java
    • 修改回显
      • AttrController.java
      • AttrServiceImpl.java
    • 修改提交
      • AttrController.java
      • AttrServiceImpl.java
    • baseattr.vue

分类属性属性分组

vo

新增

AttrController.java

@RestController
@RequestMapping("product/attr")
public class AttrController {
    @Autowired
    private AttrService attrService;

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("product:attr:save")
    public R save(@RequestBody AttrVo attrVo){
		attrService.saveAttr(attrVo);

        return R.ok();
    }
   
}

AttrVo.java

package com.xd.cubemall.product.vo;



import lombok.Data;

@Data
public class AttrVo {
    private static final long serialVersionUID = 1L;

    /**
     * 自增ID
     */
    private Long id;
    /**
     * 名称
     */
    private String name;
    /**
     * 搜索类型
     */
    private Integer searchType;
    /**
     * 图标
     */
    private String icon;
    /**
     * 选择值
     */
    private String valueSelect;
    /**
     * 属性类型:0-销售属性,1-基本属性,2-既是基本属性又是销售属性
     */
    private Integer attrType;
    /**
     * 启用
     */
    private Long enable;
    /**
     * 分类ID
     */
    private Integer categoryId;
    /**
     * 描述
     */
    private Integer showDesc;

    /**
     * 分组ID
     */
    private Long attrGroupId;
}

AttrServiceImpl.java

@Service("attrService")
public class AttrServiceImpl extends ServiceImpl<AttrDao, AttrEntity> implements AttrService {

    @Autowired
    private AttrAttrgroupRelationDao attrAttrgroupRelationDao;

    /**
     * 在attr表中保存基本属性信息,然后在关联表中保存关联信息
     * @param attrVo
     */
    @Override
    public void saveAttr(AttrVo attrVo) {
        AttrEntity attrEntity = new AttrEntity();
        BeanUtils.copyProperties(attrVo, attrEntity);
        //保存基本属性数据
        this.save(attrEntity);
        //在AttrServiceImpl类中,this.save(attrEntity)这一行代码中的this关键字指的是当前对象的实例,即AttrServiceImpl的一个实例。在这里,this代表了正在执行代码的AttrServiceImpl类的对象。
        //
        //save方法是ServiceImpl类中的一个方法,该类是AttrServiceImpl的父类(通过extends ServiceImpl<AttrDao, AttrEntity>)。ServiceImpl类是MyBatis-Plus框架中提供的一个基础服务实现类,它封装了一些常用的CRUD(创建、读取、更新、删除)操作。save方法用于保存或插入一个新的实体到数据库中。
        //
        //因此,当你调用this.save(attrEntity)时,你实际上是在调用从ServiceImpl类继承来的save方法,将attrEntity对象保存到数据库中。这个方法会利用MyBatis-Plus提供的ORM(对象关系映射)功能,将AttrEntity对象的属性与数据库表中的列进行映射,并执行插入操作。


        //保存关联数据
        AttrAttrgroupRelationEntity attrAttrgroupRelationEntity = new AttrAttrgroupRelationEntity();
        attrAttrgroupRelationEntity.setAttrId(attrEntity.getId());
        attrAttrgroupRelationEntity.setAttrGroupId(attrVo.getAttrGroupId());

        attrAttrgroupRelationDao.insert(attrAttrgroupRelationEntity);
        
    }
}

AttrAttrgroupRelationEntity.java

package com.xd.cubemall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 属性分组关联表
 * 
 * @author xuedong
 * @email email@gmail.com
 * @date 2024-08-13 01:36:04
 */
@Data
@TableName("tb_attr_attrgroup_relation")
public class AttrAttrgroupRelationEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@TableId
	private Long id;
	/**
	 * 属性ID
	 */
	private Long attrId;
	/**
	 * 属性分组ID
	 */
	private Long attrGroupId;
	/**
	 * 排序
	 */
	private Integer attrSort;

}

AttrEntity.java

package com.xd.cubemall.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 属性表
 * 
 * @author xuedong
 * @email email@gmail.com
 * @date 2024-08-13 01:36:04
 */
@Data
@TableName("tb_attr")
public class AttrEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 自增ID
	 */
	@TableId
	private Long id;
	/**
	 * 名称
	 */
	private String name;
	/**
	 * 搜索类型
	 */
	private Integer searchType;
	/**
	 * 图表
	 */
	private String icon;
	/**
	 * 选择值
	 */
	private String valueSelect;
	/**
	 * 属性类型:0-销售属性,1-基本属性,2-既是基本属性又是销售属性
	 */
	private Integer attrType;
	/**
	 * 启用
	 */
	private Long enable;
	/**
	 * 分类ID
	 */
	private Integer categoryId;
	/**
	 * 描述
	 */
	private Integer showDesc;

}

AttrGroupEntity.java

package com.xd.cubemall.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 属性分组表
 * 
 * @author xuedong
 * @email email@gmail.com
 * @date 2024-08-13 01:36:04
 */
@Data
@TableName("tb_attr_group")
public class AttrGroupEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 自增ID
	 */
	@TableId
	private Long id;
	/**
	 * 名称
	 */
	private String name;
	/**
	 * 排序
	 */
	private Integer sort;
	/**
	 * 描述
	 */
	private String descript;
	/**
	 * 图表
	 */
	private String icon;
	/**
	 * 分类ID
	 */
	private Integer categoryId;

	/**
	 * 完整的categoryID的路径
	 */
	@TableField(exist = false)
	private Long[] categoryPath;
}

查询

AttrController.java

@RestController
@RequestMapping("product/attr")
public class AttrController {
    @Autowired
    private AttrService attrService;

    /**
     * 列表
     */
    @RequestMapping("/base/list/{categoryId}")
    //@RequiresPermissions("product:attr:list")
    public R list(@RequestParam Map<String, Object> params,@PathVariable("categoryId") Long categoryId){
        PageUtils page = attrService.queryBaseAttrPage(params, categoryId);

        return R.ok().put("page", page);
    }

}

AttrServiceImpl.java

@Service("attrService")
public class AttrServiceImpl extends ServiceImpl<AttrDao, AttrEntity> implements AttrService {

    @Autowired
    private AttrAttrgroupRelationDao attrAttrgroupRelationDao;


    @Autowired
    private AttrGroupDao attrGroupDao;

    @Autowired
    private CategoryDao categoryDao;

/**  
 * 获取指定分类的所有基本属性列表  
 * @param params 查询参数,可能包含分页信息和其他筛选条件  
 * @param categoryId 分类ID,用于筛选属性所属的分类  
 * @return 封装了查询结果和分页信息的PageUtils对象  
 */  
@Override  
public PageUtils queryBaseAttrPage(Map<String, Object> params, Long categoryId) {  
    // 创建一个QueryWrapper对象,用于构建查询条件  
    QueryWrapper<AttrEntity> queryWrapper = new QueryWrapper<>();  
      
    // 如果categoryId不为0,则添加查询条件:属性所属的分类ID等于传入的categoryId  
    if (categoryId != 0) {  
        queryWrapper.eq("category_id", categoryId);  
    }  
      
    // 从查询参数中获取关键字key  
    String key = (String) params.get("key");  
    // 如果key不为空,则添加查询条件:属性ID等于key或者属性名称包含key  
    // 注意:这里的逻辑可能有些问题,因为通常我们不会用ID来做模糊查询,这里可能是为了演示多种查询方式  
    // 实际上,应该根据实际需求来调整查询逻辑  
    if (StringUtils.isEmpty(key)){ // 这里判断应该是 !StringUtils.isEmpty(key),即key不为空时才执行查询  
        queryWrapper.and(wrapper -> {  
            wrapper.eq("id", key).or().like("name", key);  
        });  
    }  
      
    // 使用分页查询,获取属性列表的分页结果  
    IPage<AttrEntity> page = this.page(  
            new Query<AttrEntity>().getPage(params), // 从查询参数中获取分页信息  
            queryWrapper // 传入构建好的查询条件  
    );  
  
    // 创建一个PageUtils对象,用于封装分页结果和额外信息  
    PageUtils pageUtils = new PageUtils(page);  
      
    // 获取分页结果中的属性列表  
    List<AttrEntity> records = page.getRecords();  
      
    // 使用Java 8的Stream API对属性列表进行转换,封装成包含额外信息的AttrRespVo对象列表  
    List<AttrRespVo> respVos = records.stream().map(attrEntity -> {  
        // 创建一个AttrRespVo对象,用于封装返回的属性信息  
        AttrRespVo attrRespVo = new AttrRespVo();  
          
        // 1. 复制属性实体的基础信息到AttrRespVo对象中  
        BeanUtils.copyProperties(attrEntity, attrRespVo);  
          
        // 2. 封装属性分组名称  
        // 根据属性ID查询属性与属性分组的关联关系  
        AttrAttrgroupRelationEntity attrAttrgroupRelationEntity = attrAttrgroupRelationDao.selectOne(  
                new QueryWrapper<AttrAttrgroupRelationEntity>().eq("attr_id", attrEntity.getId())  
        );  
        // 如果关联关系存在,则根据关联的属性分组ID查询属性分组名称  
        if (attrAttrgroupRelationEntity != null) {  
            AttrGroupEntity attrGroupEntity = attrGroupDao.selectById(attrAttrgroupRelationEntity.getAttrGroupId());  
            if (attrGroupEntity != null) {  
                attrRespVo.setGroupName(attrGroupEntity.getName());  
            }  
        }  
          
        // 3. 封装分类名称  
        // 根据属性所属的分类ID查询分类名称  
        CategoryEntity categoryEntity = categoryDao.selectById(attrEntity.getCategoryId());  
        if (categoryEntity != null) {  
            attrRespVo.setCategoryName(categoryEntity.getName());  
        }  
          
        // 返回封装好的AttrRespVo对象  
        return attrRespVo;  
    }).collect(Collectors.toList());  
      
    // 将封装好的AttrRespVo对象列表设置到PageUtils对象中  
    pageUtils.setList(respVos);  
      
    // 返回封装了查询结果和分页信息的PageUtils对象  
    return pageUtils;  
}
}

AttrRespVo.java

package com.xd.cubemall.product.vo;

import lombok.Data;

@Data
public class AttrRespVo extends AttrVo{

    /**
     * 分类名称
     */
    private String categoryName;


    /**
     * 属性分组名称
     */
    private String groupName;


    /**
     * 分类路径
     */
    private Long[] categoryPath;
}

修改回显

AttrController.java

    /**
     * 指定属性信息的回显
     */
    @RequestMapping("/info/{id}")
    //@RequiresPermissions("product:attr:info")
    public R info(@PathVariable("id") Long id){
		//AttrEntity attr = attrService.getById(id);
        AttrRespVo attrRespVo = attrService.getAttrInfo(id);


        return R.ok().put("attr", attrRespVo);
    }

AttrServiceImpl.java

import com.xd.cubemall.common.utils.PageUtils;
import com.xd.cubemall.common.utils.Query;
import com.xd.cubemall.product.dao.AttrAttrgroupRelationDao;
import com.xd.cubemall.product.dao.AttrGroupDao;
import com.xd.cubemall.product.dao.CategoryDao;
import com.xd.cubemall.product.entity.AttrAttrgroupRelationEntity;
import com.xd.cubemall.product.entity.AttrGroupEntity;
import com.xd.cubemall.product.entity.CategoryEntity;
import com.xd.cubemall.product.service.CategoryService;
import com.xd.cubemall.product.vo.AttrRespVo;
import com.xd.cubemall.product.vo.AttrVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

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.xd.cubemall.product.dao.AttrDao;
import com.xd.cubemall.product.entity.AttrEntity;
import com.xd.cubemall.product.service.AttrService;


@Service("attrService")
public class AttrServiceImpl extends ServiceImpl<AttrDao, AttrEntity> implements AttrService {

    @Autowired
    private AttrAttrgroupRelationDao attrAttrgroupRelationDao;


    @Autowired
    private AttrGroupDao attrGroupDao;

    @Autowired
    private CategoryDao categoryDao;

    @Autowired
    private CategoryService categoryService;

    @Override
    public AttrRespVo getAttrInfo(Long id) {

        AttrRespVo attrRespVo = new AttrRespVo();
        AttrEntity attrEntity = this.getById(id);
        //attrEntity中的基本属性 拷贝到 attrRespVo
        BeanUtils.copyProperties(attrEntity,attrRespVo);
        //1.设置分组信息
        AttrAttrgroupRelationEntity attrAttrgroupRelationEntity = attrAttrgroupRelationDao.selectOne(
                new QueryWrapper<AttrAttrgroupRelationEntity>().eq("attr_id",attrEntity.getId())
        );
        if (attrAttrgroupRelationEntity != null) {
            attrRespVo.setAttrGroupId(attrAttrgroupRelationEntity.getAttrGroupId());
            AttrGroupEntity attrGroupEntity = attrGroupDao.selectById(attrAttrgroupRelationEntity.getAttrGroupId());
            if (attrGroupEntity != null) {
                attrRespVo.setGroupName(attrGroupEntity.getName());
            }
        }

        //2.设置分类路径
        Long[] categoryPath = categoryService.findCategoryPath(attrEntity.getCategoryId());
        attrRespVo.setCategoryPath(categoryPath);

        //3.设置分类名称
        CategoryEntity categoryEntity = categoryDao.selectById(attrEntity.getCategoryId());
        if (categoryEntity != null) {
            attrRespVo.setCategoryName(categoryEntity.getName());
        }
        return attrRespVo;
    }

}

修改提交

AttrController.java

    /**
     * 修改提交操作
     */
    @RequestMapping("/update")
    //@RequiresPermissions("product:attr:update")
    public R update(@RequestBody AttrVo attrVo){
		attrService.updateAttr(attrVo);

        return R.ok();
    }

AttrServiceImpl.java

    /**
     * 基本属性的修改--提交操作
     * @param attrVo
     */
    @Override
    public void updateAttr(AttrVo attrVo) {
        AttrEntity attrEntity = new AttrEntity();
        //基本属性的对拷
        BeanUtils.copyProperties(attrVo,attrEntity);
        this.updateById(attrEntity);

        //修改属性分组关联
        AttrAttrgroupRelationEntity attrAttrgroupRelationEntity = new AttrAttrgroupRelationEntity();
        attrAttrgroupRelationEntity.setAttrId(attrVo.getId());
        attrAttrgroupRelationEntity.setAttrGroupId(attrVo.getAttrGroupId());

        Integer count = attrAttrgroupRelationDao.selectCount(
                new QueryWrapper<AttrAttrgroupRelationEntity>().eq("attr_id", attrVo.getId())
        );
        if(count > 0){
            attrAttrgroupRelationDao.update(
              attrAttrgroupRelationEntity,
              new UpdateWrapper<AttrAttrgroupRelationEntity>().eq("attr_id",attrVo.getId())
            );
        }else {
            attrAttrgroupRelationDao.insert(attrAttrgroupRelationEntity);

        }
    }

baseattr.vue

<template>
  <el-row :gutter="20">
    <el-col :span="6">
      <category @tree-node-click="treenodeclick"></category>
    </el-col>
    <el-col :span="18">
      <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-button type="success" @click="getAllDataList()">查询全部</el-button>
            <el-button
              type="primary"
              @click="addOrUpdateHandle()"
            >新增</el-button>
            <el-button
              v-if="isAuth('product:attr:delete')"
              type="danger"
              @click="deleteHandle()"
              :disabled="dataListSelections.length <= 0"
            >批量删除</el-button>
          </el-form-item>
        </el-form>
        <el-table
          :data="dataList"
          border
          v-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="id" 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
            v-if="attrtype == 1"
            prop="searchType"
            header-align="center"
            align="center"
            label="可检索"
          >
            <template slot-scope="scope">
              <i class="el-icon-success" v-if="scope.row.searchType==1"></i>
              <i class="el-icon-error" v-else></i>
            </template>
          </el-table-column>
          <el-table-column prop="valueType" header-align="center" align="center" label="值类型">
            <template slot-scope="scope">
              <el-tag type="success" v-if="scope.row.valueType==0">单选</el-tag>
              <el-tag v-else>多选</el-tag>
            </template>
          </el-table-column>
          <el-table-column prop="icon" header-align="center" align="center" label="图标"></el-table-column>
          <el-table-column prop="valueSelect" header-align="center" align="center" label="可选值">
            <template slot-scope="scope">
              <el-tooltip placement="top">
                <div slot="content">
                  <span v-for="(i,index) in scope.row.valueSelect.split(';')" :key="index">{{i}}<br/></span>
                </div>
                <el-tag>{{scope.row.valueSelect.split(";")[0]+" ..."}}</el-tag>
              </el-tooltip>
            </template>
          </el-table-column>
          <el-table-column prop="enable" header-align="center" align="center" label="启用">
            <template slot-scope="scope">
              <i class="el-icon-success" v-if="scope.row.enable==1"></i>
              <i class="el-icon-error" v-else></i>
            </template>
          </el-table-column>
          <el-table-column prop="categoryName" header-align="center" align="center" label="所属分类"></el-table-column>
          <el-table-column
            v-if="attrtype == 1"
            prop="groupName"
            header-align="center"
            align="center"
            label="所属分组"
          ></el-table-column>
          <el-table-column v-if="attrtype == 1" prop="showDesc" header-align="center" align="center" label="快速展示">
            <template slot-scope="scope">
              <i class="el-icon-success" v-if="scope.row.showDesc==1"></i>
              <i class="el-icon-error" v-else></i>
            </template>
          </el-table-column>
          <el-table-column
            fixed="right"
            header-align="center"
            align="center"
            width="150"
            label="操作"
          >
            <template slot-scope="scope">
              <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">修改</el-button>
              <el-button type="text" size="small" @click="deleteHandle(scope.row.id)">删除</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
          :type="attrtype"
          v-if="addOrUpdateVisible"
          ref="addOrUpdate"
          @refreshDataList="getDataList"
        ></add-or-update>
      </div>
    </el-col>
  </el-row>
</template>

<script>
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
//例如:import 《组件名称》 from '《组件路径》';
import Category from "../common/category";
import AddOrUpdate from "./attr-add-or-update";
export default {
  //import引入的组件需要注入到对象中才能使用
  components: { Category, AddOrUpdate },
  props: {
    attrtype: {
      type: Number,
      default: 1
    }
  },
  data() {
    return {
      catId: 0,
      type: 1,
      dataForm: {
        key: ""
      },
      dataList: [],
      pageIndex: 1,
      pageSize: 10,
      totalPage: 0,
      dataListLoading: false,
      dataListSelections: [],
      addOrUpdateVisible: false
    };
  },
  activated() {
    this.getDataList();
  },
  methods: {
    //感知树节点被点击
    treenodeclick(data, node, component) {
      if (node.level == 3) {
        this.catId = data.catId;
        this.getDataList(); //重新查询
      }
    },
    getAllDataList(){
      this.catId = 0;
      this.getDataList();
    },
    // 获取数据列表
    getDataList() {
      this.dataListLoading = true;
      let type = this.attrtype == 0 ? "sale" : "base";
      this.$http({
        url: this.$http.adornUrl(`/product/attr/${type}/list/${this.catId}`),
        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;
      });
    },
    // 每页数
    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) {
      var ids = id
        ? [id]
        : this.dataListSelections.map(item => {
            return item.id;
          });
      this.$confirm(
        `确定对[id=${ids.join(",")}]进行[${id ? "删除" : "批量删除"}]操作?`,
        "提示",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }
      ).then(() => {
        this.$http({
          url: this.$http.adornUrl("/product/attr/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>
<style scoped>
</style>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2196947.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

京东云主机和云服务器有啥区别?轻量云主机就是轻量应用服务器吗?

京东云主机和云服务器有啥区别&#xff1f;轻量云主机就是轻量应用服务器吗&#xff1f;云主机就是云服务器的意思&#xff0c;是京东云给自家云服务器取的名字&#xff0c;阿里云叫云服务器ECS&#xff0c;腾讯云叫云服务器CVM&#xff0c;京东云服务器叫云主机&#xff0c;京…

C++ osgEarth 多窗口 同步绘制geometry

开发环境&#xff1a; win10 64bit、Qt5.15.2、C 、MSVC2019 、osg3.5.6、 osgEarth3.1 接触osgEarth不久&#xff0c;贴出来&#xff0c;希望大家指正。 注意osgEarth版本。 采用观察者设计模式&#xff0c;设置 master 和 slave 窗口&#xff0c;通过管理类和信号槽维护窗…

_c++11

嗨喽大家好呀&#xff0c;今天阿鑫给大家带来的是c进阶——c11的内容&#xff0c;好久不见啦&#xff0c;下面让我们进入本节博客的内容吧&#xff01; _c11 统一的列表初始化右值引用可变模板参数(了解&#xff0c;不常接触)lambda表达式function和bind包装器 1. 统一的列表…

JavaWeb 15.详解Servlet及其源码

所有受过的委屈&#xff0c;都在提醒你 要好好争气。 —— 24.10.7 一、Servlet简介 1.动态资源和静态资源 静态资源 无需在程序运行时通过代码运行生成的资源&#xff0c;在程序运行之前就写好的资源&#xff0c;例如&#xff1a;html、css、js、img、音频文件和视频文件 …

职场秘籍:面试加薪,竟然拥有不同的技巧!

假如你是一位测试主管&#xff0c;去评价一名测试工程师是否优秀&#xff0c;那么你将如何去判断呢&#xff1f;你最看重的是哪方面的能力呢&#xff1f; 对于这个问题&#xff0c;是不能一概而论的&#xff0c;要分为两种情况&#xff0c;情况不同&#xff0c;答案一定是不同…

高校新生报道管理系统使用SpringBootSSM框架开发

&#xff01;&#xff01;&#xff01;页面底部,文章结尾,加我好友,获取计算机毕设开发资料 目录 一、引言 二、相关技术介绍 三、系统需求分析 四、系统设计 五、关键技术实现 六、测试与优化 七、总结与展望 一、引言 当前高校新生报到过程中存在许多问题&#xff0c;…

从0到1:用Python构建你人生中的第一个人工智能AI模型

文章目录 摘要引言数据预处理&#xff1a;为模型打下坚实基础数据预处理的步骤Python示例代码说明&#xff1a;注意事项&#xff1a; 模型建立&#xff1a;选择合适的模型神经网络示例代码说明&#xff1a; 模型训练与测试训练示例代码说明&#xff1a; 解读模型结果性能指标 深…

原生小程序开发|小程序卡片(Widget) 开发指南

开发 Widget 代表应用的一个小程序卡片&#xff0c;负责小程序卡片的展示和交互。 小程序卡片(Widget) 的开发在智能小程序的基础上增加一个目录即可&#xff0c;用于存放小程序卡片(Widget)的代码。并在 project.tuya.json 中增加一个声明。 创建小程序卡片(Widget)项目 在 …

九、Drf序列化器

九、序列化器 9.1序列化 从数据库取QuerySet或数据对象转换成JSON 9.1.1序列化器的简易使用 #新建一张部门表 class Depart(models.Model):title=models.CharField(verbose_name=部门,max_length=32)order=models.IntegerField(verbose_name=顺序)count=models.IntegerFiel…

vscode中安装python的包

首先需要调出命令行。然后运行代码&#xff0c;找到你所需要的环境。 PS C:\Users\Administrator\AppData\Local\ESRI\conda\envs\arcgispro-env> conda env list # conda environments: #C:\ProgramData\Anaconda3 base * C:\Users\Administrator\.con…

【无人机设计与控制】无人机三维路径规划,对比蚁群算法,ACO_Astar_RRT算法

摘要 本文探讨了三种不同的无人机三维路径规划算法&#xff0c;即蚁群算法&#xff08;ACO&#xff09;、A算法&#xff08;Astar&#xff09;以及快速随机树算法&#xff08;RRT&#xff09;。通过仿真实验对比了各算法在不同环境下的性能&#xff0c;包括路径长度、计算效率…

软考越来越难了,2024年软考究竟还值不值得考?

最近不少同学沟通&#xff0c;聊到软考现在越来越难了&#xff0c;考了两三次都没过&#xff0c;也有不少新同学咨询软考考试的一些福利政策&#xff0c;投入大量的物力&#xff0c;财力&#xff0c;精力&#xff0c;那么到底软考值不值得考呢&#xff1f; 01 / 关于软考 软考…

【FlagScale】异构算力混合训练方案

背景以及必要性 算力需求的高峰&#xff1a;随着人工智能&#xff08;AI&#xff09;和生成内容&#xff08;AIGC&#xff09;的发展&#xff0c;对计算资源的需求急剧增加。尤其是参数规模达到数百亿的大模型训练&#xff0c;需要大量的计算资源。 算力市场供应紧张&#xff…

一键拯救废片!3个在线教程,实现光线重塑、表情迁移、模糊图像修复

每逢国庆「黄金周」&#xff0c;都是旅游业的高光时刻。根据研判&#xff0c;今年国庆假期全社会跨区域人员流动量将达到 19.4 亿人次&#xff0c;平均每天 2.77 亿人次。 与旅游业同步增长的还有摄影行业&#xff0c;旅拍带动的妆造、服饰租赁等相关环节发展火热&#xff0c;…

Linux安装Redis7.40

一、环境检查 1.1 查看是否已经安装了Redis应用 ps -ef |grep redis或者 whereis redis1.2 若已经安装了redis应用或者有遗留的Redis文件&#xff0c;进行移除或者启动即可。 二、下载&安装 2.1 找到对应的安装包资源&#xff0c;使用wget命令下载&#xff0c;这里安装…

小众交友软件有哪些?小众交友APP排行榜前十名推荐

在网络的广袤天地中&#xff0c;小众交友软件如隐藏的宝藏&#xff0c;散发着独特魅力。它们为人们提供别样的社交舞台&#xff0c;让孤独的灵魂有处可栖。今天&#xff0c;就让我们一同探寻那些小众交友软件的奇妙世界。 1. 咕哇找搭子小程序&#xff1a;这是一个实名制的找搭…

想要加密电脑?盘点2024年企业常用的10款电脑文件加密软件

在企业数据安全的时代背景下&#xff0c;文件加密已经成为保护企业核心信息、应对网络安全威胁的关键举措。无论是保护机密的商业数据&#xff0c;还是遵守数据隐私合规性要求&#xff0c;企业对文件加密软件的需求日益增长。本文将盘点2024年企业常用的10款电脑文件加密软件&a…

【Java 问题】基础——序列化

接上文 序列化 45.什么是序列化&#xff1f;什么是反序列化&#xff1f;46.说说有几种序列化方式&#xff1f; 45.什么是序列化&#xff1f;什么是反序列化&#xff1f; 什么是序列化&#xff0c;序列化就是把Java对象转为二进制流&#xff0c;方便存储和传输。 所以反序列化…

SOA是什么

SOA SOA 即 Service-Oriented Architecture&#xff08;面向服务的架构&#xff09;。 一、定义 SOA 是一种软件设计方法和架构理念&#xff0c;它将应用程序的不同功能单元&#xff08;称为服务&#xff09;通过定义良好的接口和契约联系起来。这些服务可以独立部署、独立运…

【JavaEE初阶】深入理解不同锁的意义,synchronized的加锁过程理解以及CAS的原子性实现(面试经典题);

前言 &#x1f31f;&#x1f31f;本期讲解关于锁的相关知识了解&#xff0c;这里涉及到高频面试题哦~~~ &#x1f308;上期博客在这里&#xff1a;【JavaEE初阶】深入理解线程池的概念以及Java标准库提供的方法参数分析-CSDN博客 &#x1f308;感兴趣的小伙伴看一看小编主页&am…