修复设备分类和设备型号问题
This commit is contained in:
@@ -38,6 +38,9 @@ public class Company implements Serializable {
|
|||||||
@ApiModelProperty(value = "类型 10企业 20政府单位")
|
@ApiModelProperty(value = "类型 10企业 20政府单位")
|
||||||
private Integer companyType;
|
private Integer companyType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业类型 多选")
|
||||||
|
private String companyTypeMultiple;
|
||||||
|
|
||||||
@ApiModelProperty(value = "应用标识")
|
@ApiModelProperty(value = "应用标识")
|
||||||
private String companyLogo;
|
private String companyLogo;
|
||||||
|
|
||||||
@@ -47,6 +50,9 @@ public class Company implements Serializable {
|
|||||||
@ApiModelProperty(value = "联系电话")
|
@ApiModelProperty(value = "联系电话")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业法人")
|
||||||
|
private String businessEntity;
|
||||||
|
|
||||||
@ApiModelProperty(value = "发票抬头")
|
@ApiModelProperty(value = "发票抬头")
|
||||||
@TableField("Invoice_header")
|
@TableField("Invoice_header")
|
||||||
private String invoiceHeader;
|
private String invoiceHeader;
|
||||||
@@ -111,9 +117,15 @@ public class Company implements Serializable {
|
|||||||
@ApiModelProperty(value = "状态")
|
@ApiModelProperty(value = "状态")
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
@ApiModelProperty(value = "用户ID")
|
@ApiModelProperty(value = "用户ID")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否含税")
|
||||||
|
private Boolean isTax;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ public class CompanyParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer companyType;
|
private Integer companyType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业类型 多选")
|
||||||
|
private String companyTypeMultiple;
|
||||||
|
|
||||||
@ApiModelProperty(value = "应用标识")
|
@ApiModelProperty(value = "应用标识")
|
||||||
private String companyLogo;
|
private String companyLogo;
|
||||||
|
|
||||||
@@ -48,6 +51,9 @@ public class CompanyParam extends BaseParam {
|
|||||||
@ApiModelProperty(value = "联系电话")
|
@ApiModelProperty(value = "联系电话")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "企业法人")
|
||||||
|
private String businessEntity;
|
||||||
|
|
||||||
@ApiModelProperty(value = "发票抬头")
|
@ApiModelProperty(value = "发票抬头")
|
||||||
private String invoiceHeader;
|
private String invoiceHeader;
|
||||||
|
|
||||||
|
|||||||
@@ -32,11 +32,8 @@ public class TowerModelController extends BaseController {
|
|||||||
@ApiOperation("分页查询设备型号管理表")
|
@ApiOperation("分页查询设备型号管理表")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public ApiResult<PageResult<TowerModel>> page(TowerModelParam param) {
|
public ApiResult<PageResult<TowerModel>> page(TowerModelParam param) {
|
||||||
PageParam<TowerModel, TowerModelParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(towerModelService.page(page, page.getWrapper()));
|
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
//return success(towerModelService.pageRel(param));
|
return success(towerModelService.pageRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('tower:towerModel:list')")
|
@PreAuthorize("hasAuthority('tower:towerModel:list')")
|
||||||
@@ -44,11 +41,8 @@ public class TowerModelController extends BaseController {
|
|||||||
@ApiOperation("查询全部设备型号管理表")
|
@ApiOperation("查询全部设备型号管理表")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<TowerModel>> list(TowerModelParam param) {
|
public ApiResult<List<TowerModel>> list(TowerModelParam param) {
|
||||||
PageParam<TowerModel, TowerModelParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("create_time desc");
|
|
||||||
return success(towerModelService.list(page.getOrderWrapper()));
|
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
//return success(towerModelService.listRel(param));
|
return success(towerModelService.listRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('tower:towerModel:list')")
|
@PreAuthorize("hasAuthority('tower:towerModel:list')")
|
||||||
@@ -56,9 +50,8 @@ public class TowerModelController extends BaseController {
|
|||||||
@ApiOperation("根据id查询设备型号管理表")
|
@ApiOperation("根据id查询设备型号管理表")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ApiResult<TowerModel> get(@PathVariable("id") Integer id) {
|
public ApiResult<TowerModel> get(@PathVariable("id") Integer id) {
|
||||||
return success(towerModelService.getById(id));
|
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
//return success(towerModelService.getByIdRel(id));
|
return success(towerModelService.getByIdRel(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('tower:towerModel:save')")
|
@PreAuthorize("hasAuthority('tower:towerModel:save')")
|
||||||
|
|||||||
@@ -1,20 +1,18 @@
|
|||||||
package com.gxwebsoft.tower.entity;
|
package com.gxwebsoft.tower.entity;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import java.time.LocalDate;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 配件管理
|
* 配件管理
|
||||||
*
|
*
|
||||||
@@ -43,6 +41,9 @@ public class TowerAccessory implements Serializable {
|
|||||||
@ApiModelProperty(value = "适用设备型号")
|
@ApiModelProperty(value = "适用设备型号")
|
||||||
private String accessoryModel;
|
private String accessoryModel;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "适用设备型号(多选)")
|
||||||
|
private String accessoryModelMultiple;
|
||||||
|
|
||||||
@ApiModelProperty(value = "配件规格")
|
@ApiModelProperty(value = "配件规格")
|
||||||
private String accessorySpecs;
|
private String accessorySpecs;
|
||||||
|
|
||||||
|
|||||||
@@ -24,11 +24,14 @@ public class TowerModel implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ApiModelProperty(value = "型号ID")
|
@ApiModelProperty(value = "型号ID")
|
||||||
@TableId(value = "category_id", type = IdType.AUTO)
|
@TableId(value = "model_id", type = IdType.AUTO)
|
||||||
private Integer categoryId;
|
private Integer modelId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "设备型号名称")
|
@ApiModelProperty(value = "设备名称")
|
||||||
private String title;
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设备型号")
|
||||||
|
private String model;
|
||||||
|
|
||||||
@ApiModelProperty(value = "上级分类ID")
|
@ApiModelProperty(value = "上级分类ID")
|
||||||
private Integer parentId;
|
private Integer parentId;
|
||||||
|
|||||||
@@ -7,11 +7,14 @@
|
|||||||
SELECT a.*
|
SELECT a.*
|
||||||
FROM tower_model a
|
FROM tower_model a
|
||||||
<where>
|
<where>
|
||||||
<if test="param.categoryId != null">
|
<if test="param.modelId != null">
|
||||||
AND a.category_id = #{param.categoryId}
|
AND a.model_id = #{param.modelId}
|
||||||
</if>
|
</if>
|
||||||
<if test="param.title != null">
|
<if test="param.name != null">
|
||||||
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.model != null">
|
||||||
|
AND a.model LIKE CONCAT('%', #{param.model}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="param.parentId != null">
|
<if test="param.parentId != null">
|
||||||
AND a.parent_id = #{param.parentId}
|
AND a.parent_id = #{param.parentId}
|
||||||
@@ -46,6 +49,12 @@
|
|||||||
<if test="param.createTimeEnd != null">
|
<if test="param.createTimeEnd != null">
|
||||||
AND a.create_time <= #{param.createTimeEnd}
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (
|
||||||
|
a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR a.model LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
|||||||
@@ -24,10 +24,13 @@ public class TowerModelParam extends BaseParam {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "型号ID")
|
@ApiModelProperty(value = "型号ID")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer categoryId;
|
private Integer modelId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "设备型号名称")
|
@ApiModelProperty(value = "设备名称")
|
||||||
private String title;
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设备型号")
|
||||||
|
private String model;
|
||||||
|
|
||||||
@ApiModelProperty(value = "上级分类ID")
|
@ApiModelProperty(value = "上级分类ID")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class TowerModelServiceImpl extends ServiceImpl<TowerModelMapper, TowerMo
|
|||||||
@Override
|
@Override
|
||||||
public PageResult<TowerModel> pageRel(TowerModelParam param) {
|
public PageResult<TowerModel> pageRel(TowerModelParam param) {
|
||||||
PageParam<TowerModel, TowerModelParam> page = new PageParam<>(param);
|
PageParam<TowerModel, TowerModelParam> page = new PageParam<>(param);
|
||||||
//page.setDefaultOrder("create_time desc");
|
page.setDefaultOrder("create_time desc");
|
||||||
List<TowerModel> list = baseMapper.selectPageRel(page, param);
|
List<TowerModel> list = baseMapper.selectPageRel(page, param);
|
||||||
return new PageResult<>(list, page.getTotal());
|
return new PageResult<>(list, page.getTotal());
|
||||||
}
|
}
|
||||||
@@ -33,14 +33,14 @@ public class TowerModelServiceImpl extends ServiceImpl<TowerModelMapper, TowerMo
|
|||||||
List<TowerModel> list = baseMapper.selectListRel(param);
|
List<TowerModel> list = baseMapper.selectListRel(param);
|
||||||
// 排序
|
// 排序
|
||||||
PageParam<TowerModel, TowerModelParam> page = new PageParam<>();
|
PageParam<TowerModel, TowerModelParam> page = new PageParam<>();
|
||||||
//page.setDefaultOrder("create_time desc");
|
page.setDefaultOrder("create_time desc");
|
||||||
return page.sortRecords(list);
|
return page.sortRecords(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TowerModel getByIdRel(Integer categoryId) {
|
public TowerModel getByIdRel(Integer modelId) {
|
||||||
TowerModelParam param = new TowerModelParam();
|
TowerModelParam param = new TowerModelParam();
|
||||||
param.setCategoryId(categoryId);
|
param.setModelId(modelId);
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user