diff --git a/ruoyi-basetyre/pom.xml b/ruoyi-basetyre/pom.xml new file mode 100644 index 0000000..82c09ce --- /dev/null +++ b/ruoyi-basetyre/pom.xml @@ -0,0 +1,26 @@ + + + + ruoyi + com.ruoyi + 3.8.5 + + 4.0.0 + + com.ruoyi + ruoyi-basetyre + 3.8.5 + + + + + + + com.ruoyi + ruoyi-common + + + + \ No newline at end of file diff --git a/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/controller/BaseTyreController.java b/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/controller/BaseTyreController.java new file mode 100644 index 0000000..ecc92ef --- /dev/null +++ b/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/controller/BaseTyreController.java @@ -0,0 +1,104 @@ +package com.ruoyi.basetyre.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.basetyre.domain.BaseTyre; +import com.ruoyi.basetyre.service.IBaseTyreService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 轮胎基础信息Controller + * + * @author Yangwl + * @date 2023-02-06 + */ +@RestController +@RequestMapping("/basetyre/basetyre") +public class BaseTyreController extends BaseController +{ + @Autowired + private IBaseTyreService baseTyreService; + + /** + * 查询轮胎基础信息列表 + */ + @PreAuthorize("@ss.hasPermi('basetyre:basetyre:list')") + @GetMapping("/list") + public TableDataInfo list(BaseTyre baseTyre) + { + startPage(); + List list = baseTyreService.selectBaseTyreList(baseTyre); + return getDataTable(list); + } + + /** + * 导出轮胎基础信息列表 + */ + @PreAuthorize("@ss.hasPermi('basetyre:basetyre:export')") + @Log(title = "轮胎基础信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, BaseTyre baseTyre) + { + List list = baseTyreService.selectBaseTyreList(baseTyre); + ExcelUtil util = new ExcelUtil(BaseTyre.class); + util.exportExcel(response, list, "轮胎基础信息数据"); + } + + /** + * 获取轮胎基础信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('basetyre:basetyre:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return success(baseTyreService.selectBaseTyreById(id)); + } + + /** + * 新增轮胎基础信息 + */ + @PreAuthorize("@ss.hasPermi('basetyre:basetyre:add')") + @Log(title = "轮胎基础信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody BaseTyre baseTyre) + { + return toAjax(baseTyreService.insertBaseTyre(baseTyre)); + } + + /** + * 修改轮胎基础信息 + */ + @PreAuthorize("@ss.hasPermi('basetyre:basetyre:edit')") + @Log(title = "轮胎基础信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody BaseTyre baseTyre) + { + return toAjax(baseTyreService.updateBaseTyre(baseTyre)); + } + + /** + * 删除轮胎基础信息 + */ + @PreAuthorize("@ss.hasPermi('basetyre:basetyre:remove')") + @Log(title = "轮胎基础信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(baseTyreService.deleteBaseTyreByIds(ids)); + } +} diff --git a/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/domain/BaseTyre.java b/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/domain/BaseTyre.java new file mode 100644 index 0000000..e009c14 --- /dev/null +++ b/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/domain/BaseTyre.java @@ -0,0 +1,322 @@ +package com.ruoyi.basetyre.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 轮胎基础信息对象 base_tyre + * + * @author Yangwl + * @date 2023-02-06 + */ +public class BaseTyre extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private String id; + + /** 轮胎厂编码 */ + @Excel(name = "轮胎厂编码") + private String tyreFacCode; + + /** 企业编码 */ + @Excel(name = "企业编码") + private String companyCode; + + /** 车辆ID */ + @Excel(name = "车辆ID") + private String carId; + + /** 车牌号 */ + @Excel(name = "车牌号") + private String carLicense; + + /** 轮胎编号 */ + @Excel(name = "轮胎编号") + private String tureCode; + + /** 轮胎型号 */ + @Excel(name = "轮胎型号") + private String tureModel; + + /** 轮胎型号表ID */ + @Excel(name = "轮胎型号表ID") + private String tureModelId; + + /** 品牌ID */ + @Excel(name = "品牌ID") + private String tureBrandId; + + /** RFID */ + @Excel(name = "RFID") + private String tyreRfid; + + /** 轮位(拼四段式1-1-1-21)第一轴左侧外,总第21个胎 */ + @Excel(name = "轮位", readConverterExp = "拼=四段式1-1-1-21") + private String tyrePosition; + + /** 当前轮胎传感器ID */ + @Excel(name = "当前轮胎传感器ID") + private String sensorId; + + /** 当前花纹深度 */ + @Excel(name = "当前花纹深度") + private Long currentTextureDepth; + + /** 状态 */ + @Excel(name = "状态") + private Long state; + + /** 是否删除 */ + @Excel(name = "是否删除") + private Long isDelete; + + /** 创建者ID */ + @Excel(name = "创建者ID") + private String createId; + + /** 创建者姓名 */ + @Excel(name = "创建者姓名") + private String createName; + + /** 修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date modifyTime; + + /** 修改者ID */ + @Excel(name = "修改者ID") + private String modifyId; + + /** 修改者账号 */ + @Excel(name = "修改者账号") + private String modifyBy; + + /** 编辑者姓名 */ + @Excel(name = "编辑者姓名") + private String modifyName; + + public void setId(String id) + { + this.id = id; + } + + public String getId() + { + return id; + } + public void setTyreFacCode(String tyreFacCode) + { + this.tyreFacCode = tyreFacCode; + } + + public String getTyreFacCode() + { + return tyreFacCode; + } + public void setCompanyCode(String companyCode) + { + this.companyCode = companyCode; + } + + public String getCompanyCode() + { + return companyCode; + } + public void setCarId(String carId) + { + this.carId = carId; + } + + public String getCarId() + { + return carId; + } + public void setCarLicense(String carLicense) + { + this.carLicense = carLicense; + } + + public String getCarLicense() + { + return carLicense; + } + public void setTureCode(String tureCode) + { + this.tureCode = tureCode; + } + + public String getTureCode() + { + return tureCode; + } + public void setTureModel(String tureModel) + { + this.tureModel = tureModel; + } + + public String getTureModel() + { + return tureModel; + } + public void setTureModelId(String tureModelId) + { + this.tureModelId = tureModelId; + } + + public String getTureModelId() + { + return tureModelId; + } + public void setTureBrandId(String tureBrandId) + { + this.tureBrandId = tureBrandId; + } + + public String getTureBrandId() + { + return tureBrandId; + } + public void setTyreRfid(String tyreRfid) + { + this.tyreRfid = tyreRfid; + } + + public String getTyreRfid() + { + return tyreRfid; + } + public void setTyrePosition(String tyrePosition) + { + this.tyrePosition = tyrePosition; + } + + public String getTyrePosition() + { + return tyrePosition; + } + public void setSensorId(String sensorId) + { + this.sensorId = sensorId; + } + + public String getSensorId() + { + return sensorId; + } + public void setCurrentTextureDepth(Long currentTextureDepth) + { + this.currentTextureDepth = currentTextureDepth; + } + + public Long getCurrentTextureDepth() + { + return currentTextureDepth; + } + public void setState(Long state) + { + this.state = state; + } + + public Long getState() + { + return state; + } + public void setIsDelete(Long isDelete) + { + this.isDelete = isDelete; + } + + public Long getIsDelete() + { + return isDelete; + } + public void setCreateId(String createId) + { + this.createId = createId; + } + + public String getCreateId() + { + return createId; + } + public void setCreateName(String createName) + { + this.createName = createName; + } + + public String getCreateName() + { + return createName; + } + public void setModifyTime(Date modifyTime) + { + this.modifyTime = modifyTime; + } + + public Date getModifyTime() + { + return modifyTime; + } + public void setModifyId(String modifyId) + { + this.modifyId = modifyId; + } + + public String getModifyId() + { + return modifyId; + } + public void setModifyBy(String modifyBy) + { + this.modifyBy = modifyBy; + } + + public String getModifyBy() + { + return modifyBy; + } + public void setModifyName(String modifyName) + { + this.modifyName = modifyName; + } + + public String getModifyName() + { + return modifyName; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("tyreFacCode", getTyreFacCode()) + .append("companyCode", getCompanyCode()) + .append("carId", getCarId()) + .append("carLicense", getCarLicense()) + .append("tureCode", getTureCode()) + .append("tureModel", getTureModel()) + .append("tureModelId", getTureModelId()) + .append("tureBrandId", getTureBrandId()) + .append("tyreRfid", getTyreRfid()) + .append("tyrePosition", getTyrePosition()) + .append("sensorId", getSensorId()) + .append("currentTextureDepth", getCurrentTextureDepth()) + .append("state", getState()) + .append("isDelete", getIsDelete()) + .append("createTime", getCreateTime()) + .append("createId", getCreateId()) + .append("createBy", getCreateBy()) + .append("createName", getCreateName()) + .append("modifyTime", getModifyTime()) + .append("modifyId", getModifyId()) + .append("modifyBy", getModifyBy()) + .append("modifyName", getModifyName()) + .toString(); + } +} diff --git a/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/mapper/BaseTyreMapper.java b/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/mapper/BaseTyreMapper.java new file mode 100644 index 0000000..1f3d309 --- /dev/null +++ b/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/mapper/BaseTyreMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.basetyre.mapper; + +import java.util.List; +import com.ruoyi.basetyre.domain.BaseTyre; + +/** + * 轮胎基础信息Mapper接口 + * + * @author Yangwl + * @date 2023-02-06 + */ +public interface BaseTyreMapper +{ + /** + * 查询轮胎基础信息 + * + * @param id 轮胎基础信息主键 + * @return 轮胎基础信息 + */ + public BaseTyre selectBaseTyreById(String id); + + /** + * 查询轮胎基础信息列表 + * + * @param baseTyre 轮胎基础信息 + * @return 轮胎基础信息集合 + */ + public List selectBaseTyreList(BaseTyre baseTyre); + + /** + * 新增轮胎基础信息 + * + * @param baseTyre 轮胎基础信息 + * @return 结果 + */ + public int insertBaseTyre(BaseTyre baseTyre); + + /** + * 修改轮胎基础信息 + * + * @param baseTyre 轮胎基础信息 + * @return 结果 + */ + public int updateBaseTyre(BaseTyre baseTyre); + + /** + * 删除轮胎基础信息 + * + * @param id 轮胎基础信息主键 + * @return 结果 + */ + public int deleteBaseTyreById(String id); + + /** + * 批量删除轮胎基础信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteBaseTyreByIds(String[] ids); +} diff --git a/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/service/IBaseTyreService.java b/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/service/IBaseTyreService.java new file mode 100644 index 0000000..c090484 --- /dev/null +++ b/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/service/IBaseTyreService.java @@ -0,0 +1,61 @@ +package com.ruoyi.basetyre.service; + +import java.util.List; +import com.ruoyi.basetyre.domain.BaseTyre; + +/** + * 轮胎基础信息Service接口 + * + * @author Yangwl + * @date 2023-02-06 + */ +public interface IBaseTyreService +{ + /** + * 查询轮胎基础信息 + * + * @param id 轮胎基础信息主键 + * @return 轮胎基础信息 + */ + public BaseTyre selectBaseTyreById(String id); + + /** + * 查询轮胎基础信息列表 + * + * @param baseTyre 轮胎基础信息 + * @return 轮胎基础信息集合 + */ + public List selectBaseTyreList(BaseTyre baseTyre); + + /** + * 新增轮胎基础信息 + * + * @param baseTyre 轮胎基础信息 + * @return 结果 + */ + public int insertBaseTyre(BaseTyre baseTyre); + + /** + * 修改轮胎基础信息 + * + * @param baseTyre 轮胎基础信息 + * @return 结果 + */ + public int updateBaseTyre(BaseTyre baseTyre); + + /** + * 批量删除轮胎基础信息 + * + * @param ids 需要删除的轮胎基础信息主键集合 + * @return 结果 + */ + public int deleteBaseTyreByIds(String[] ids); + + /** + * 删除轮胎基础信息信息 + * + * @param id 轮胎基础信息主键 + * @return 结果 + */ + public int deleteBaseTyreById(String id); +} diff --git a/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/service/impl/BaseTyreServiceImpl.java b/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/service/impl/BaseTyreServiceImpl.java new file mode 100644 index 0000000..d05327a --- /dev/null +++ b/ruoyi-basetyre/src/main/java/com/ruoyi/basetyre/service/impl/BaseTyreServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.basetyre.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.basetyre.mapper.BaseTyreMapper; +import com.ruoyi.basetyre.domain.BaseTyre; +import com.ruoyi.basetyre.service.IBaseTyreService; + +/** + * 轮胎基础信息Service业务层处理 + * + * @author Yangwl + * @date 2023-02-06 + */ +@Service +public class BaseTyreServiceImpl implements IBaseTyreService +{ + @Autowired + private BaseTyreMapper baseTyreMapper; + + /** + * 查询轮胎基础信息 + * + * @param id 轮胎基础信息主键 + * @return 轮胎基础信息 + */ + @Override + public BaseTyre selectBaseTyreById(String id) + { + return baseTyreMapper.selectBaseTyreById(id); + } + + /** + * 查询轮胎基础信息列表 + * + * @param baseTyre 轮胎基础信息 + * @return 轮胎基础信息 + */ + @Override + public List selectBaseTyreList(BaseTyre baseTyre) + { + return baseTyreMapper.selectBaseTyreList(baseTyre); + } + + /** + * 新增轮胎基础信息 + * + * @param baseTyre 轮胎基础信息 + * @return 结果 + */ + @Override + public int insertBaseTyre(BaseTyre baseTyre) + { + baseTyre.setCreateTime(DateUtils.getNowDate()); + return baseTyreMapper.insertBaseTyre(baseTyre); + } + + /** + * 修改轮胎基础信息 + * + * @param baseTyre 轮胎基础信息 + * @return 结果 + */ + @Override + public int updateBaseTyre(BaseTyre baseTyre) + { + return baseTyreMapper.updateBaseTyre(baseTyre); + } + + /** + * 批量删除轮胎基础信息 + * + * @param ids 需要删除的轮胎基础信息主键 + * @return 结果 + */ + @Override + public int deleteBaseTyreByIds(String[] ids) + { + return baseTyreMapper.deleteBaseTyreByIds(ids); + } + + /** + * 删除轮胎基础信息信息 + * + * @param id 轮胎基础信息主键 + * @return 结果 + */ + @Override + public int deleteBaseTyreById(String id) + { + return baseTyreMapper.deleteBaseTyreById(id); + } +} diff --git a/ruoyi-basetyre/src/main/resources/mapper/basetyre/BaseTyreMapper.xml b/ruoyi-basetyre/src/main/resources/mapper/basetyre/BaseTyreMapper.xml new file mode 100644 index 0000000..9eb8769 --- /dev/null +++ b/ruoyi-basetyre/src/main/resources/mapper/basetyre/BaseTyreMapper.xml @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, tyre_fac_code, company_code, car_id, car_license, ture_code, ture_model, ture_model_id, ture_brand_id, tyre_rfid, tyre_position, sensor_id, current_texture_depth, state, is_delete, create_time, create_id, create_by, create_name, modify_time, modify_id, modify_by, modify__name from base_tyre + + + + + + + + insert into base_tyre + + id, + tyre_fac_code, + company_code, + car_id, + car_license, + ture_code, + ture_model, + ture_model_id, + ture_brand_id, + tyre_rfid, + tyre_position, + sensor_id, + current_texture_depth, + state, + is_delete, + create_time, + create_id, + create_by, + create_name, + modify_time, + modify_id, + modify_by, + modify__name, + + + #{id}, + #{tyreFacCode}, + #{companyCode}, + #{carId}, + #{carLicense}, + #{tureCode}, + #{tureModel}, + #{tureModelId}, + #{tureBrandId}, + #{tyreRfid}, + #{tyrePosition}, + #{sensorId}, + #{currentTextureDepth}, + #{state}, + #{isDelete}, + #{createTime}, + #{createId}, + #{createBy}, + #{createName}, + #{modifyTime}, + #{modifyId}, + #{modifyBy}, + #{modifyName}, + + + + + update base_tyre + + tyre_fac_code = #{tyreFacCode}, + company_code = #{companyCode}, + car_id = #{carId}, + car_license = #{carLicense}, + ture_code = #{tureCode}, + ture_model = #{tureModel}, + ture_model_id = #{tureModelId}, + ture_brand_id = #{tureBrandId}, + tyre_rfid = #{tyreRfid}, + tyre_position = #{tyrePosition}, + sensor_id = #{sensorId}, + current_texture_depth = #{currentTextureDepth}, + state = #{state}, + is_delete = #{isDelete}, + create_time = #{createTime}, + create_id = #{createId}, + create_by = #{createBy}, + create_name = #{createName}, + modify_time = #{modifyTime}, + modify_id = #{modifyId}, + modify_by = #{modifyBy}, + modify__name = #{modifyName}, + + where id = #{id} + + + + delete from base_tyre where id = #{id} + + + + delete from base_tyre where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 2125853..b8d5e28 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -111,7 +111,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter // 过滤请求 .authorizeRequests() // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/login", "/register", "/captchaImage").permitAll() + .antMatchers("/login", "/register", "/captchaImage","/basetyre/basetyre/**").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() diff --git a/ruoyi-ui/src/api/basetyre/basetyre.js b/ruoyi-ui/src/api/basetyre/basetyre.js new file mode 100644 index 0000000..d7cf806 --- /dev/null +++ b/ruoyi-ui/src/api/basetyre/basetyre.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询轮胎基础信息列表 +export function listBasetyre(query) { + return request({ + url: '/basetyre/basetyre/list', + method: 'get', + params: query + }) +} + +// 查询轮胎基础信息详细 +export function getBasetyre(id) { + return request({ + url: '/basetyre/basetyre/' + id, + method: 'get' + }) +} + +// 新增轮胎基础信息 +export function addBasetyre(data) { + return request({ + url: '/basetyre/basetyre', + method: 'post', + data: data + }) +} + +// 修改轮胎基础信息 +export function updateBasetyre(data) { + return request({ + url: '/basetyre/basetyre', + method: 'put', + data: data + }) +} + +// 删除轮胎基础信息 +export function delBasetyre(id) { + return request({ + url: '/basetyre/basetyre/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/basetyre/basetyre/index.vue b/ruoyi-ui/src/views/basetyre/basetyre/index.vue new file mode 100644 index 0000000..75ce628 --- /dev/null +++ b/ruoyi-ui/src/views/basetyre/basetyre/index.vue @@ -0,0 +1,454 @@ + + +