正在显示
100 个修改的文件
包含
766 行增加
和
1089 行删除
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-动保信息管理") | ||
| 8 | -public class AfmsBasicAquatic { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "动保名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "类别") | ||
| 17 | - private String category; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "品牌") | ||
| 20 | - private String brand; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "计量单位ID") | ||
| 23 | - private Integer measurementUnitId; | ||
| 24 | - | ||
| 25 | - @ApiModelProperty(value = "规格单位") | ||
| 26 | - private String specificationUnit; | ||
| 27 | - | ||
| 28 | - @ApiModelProperty(value = "供应商ID") | ||
| 29 | - private Integer supplierId; | ||
| 30 | - | ||
| 31 | - @ApiModelProperty(value = "供应商") | ||
| 32 | - private String supplier; | ||
| 33 | - | ||
| 34 | - @ApiModelProperty(value = "创建时间") | ||
| 35 | - private Date createTime; | ||
| 36 | - | ||
| 37 | - // 省略getter和setter方法 | ||
| 38 | - | ||
| 39 | - | ||
| 40 | - public Integer getId() { | ||
| 41 | - return id; | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - public void setId(Integer id) { | ||
| 45 | - this.id = id; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - public String getName() { | ||
| 49 | - return name; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public void setName(String name) { | ||
| 53 | - this.name = name; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - public String getCategory() { | ||
| 57 | - return category; | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - public void setCategory(String category) { | ||
| 61 | - this.category = category; | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | - public String getBrand() { | ||
| 65 | - return brand; | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - public void setBrand(String brand) { | ||
| 69 | - this.brand = brand; | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - public Integer getMeasurementUnitId() { | ||
| 73 | - return measurementUnitId; | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - public void setMeasurementUnitId(Integer measurementUnitId) { | ||
| 77 | - this.measurementUnitId = measurementUnitId; | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | - public String getSpecificationUnit() { | ||
| 81 | - return specificationUnit; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - public void setSpecificationUnit(String specificationUnit) { | ||
| 85 | - this.specificationUnit = specificationUnit; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - public Integer getSupplierId() { | ||
| 89 | - return supplierId; | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - public void setSupplierId(Integer supplierId) { | ||
| 93 | - this.supplierId = supplierId; | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - public String getSupplier() { | ||
| 97 | - return supplier; | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - public void setSupplier(String supplier) { | ||
| 101 | - this.supplier = supplier; | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - public Date getCreateTime() { | ||
| 105 | - return createTime; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - public void setCreateTime(Date createTime) { | ||
| 109 | - this.createTime = createTime; | ||
| 110 | - } | ||
| 111 | -} |
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-品牌信息管理") | ||
| 8 | -public class AfmsBasicBrand { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "描述") | ||
| 17 | - private String description; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "创建时间") | ||
| 20 | - private Date createTime; | ||
| 21 | - | ||
| 22 | - // 省略getter和setter方法 | ||
| 23 | - | ||
| 24 | - public Integer getId() { | ||
| 25 | - return id; | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - public void setId(Integer id) { | ||
| 29 | - this.id = id; | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - public String getName() { | ||
| 33 | - return name; | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - public void setName(String name) { | ||
| 37 | - this.name = name; | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - public String getDescription() { | ||
| 41 | - return description; | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - public void setDescription(String description) { | ||
| 45 | - this.description = description; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - public Date getCreateTime() { | ||
| 49 | - return createTime; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public void setCreateTime(Date createTime) { | ||
| 53 | - this.createTime = createTime; | ||
| 54 | - } | ||
| 55 | -} |
lh-common/lh-domain/src/main/java/com/ruoyi/system/domain/afms/AfmsBasicCategory.java
已删除
100644 → 0
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-品类信息管理") | ||
| 8 | -public class AfmsBasicCategory { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "描述") | ||
| 17 | - private String description; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "创建时间") | ||
| 20 | - private Date createTime; | ||
| 21 | - | ||
| 22 | - // 省略getter和setter方法 | ||
| 23 | - | ||
| 24 | - public Integer getId() { | ||
| 25 | - return id; | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - public void setId(Integer id) { | ||
| 29 | - this.id = id; | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - public String getName() { | ||
| 33 | - return name; | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - public void setName(String name) { | ||
| 37 | - this.name = name; | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - public String getDescription() { | ||
| 41 | - return description; | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - public void setDescription(String description) { | ||
| 45 | - this.description = description; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - public Date getCreateTime() { | ||
| 49 | - return createTime; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public void setCreateTime(Date createTime) { | ||
| 53 | - this.createTime = createTime; | ||
| 54 | - } | ||
| 55 | -} | ||
| 56 | - |
lh-common/lh-domain/src/main/java/com/ruoyi/system/domain/afms/AfmsBasicCustomer.java
已删除
100644 → 0
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-客户信息管理") | ||
| 8 | -public class AfmsBasicCustomer { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "客户名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "客户类型ID") | ||
| 17 | - private Integer customerTypeId; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "联系人") | ||
| 20 | - private String contactPerson; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "联系电话") | ||
| 23 | - private String contactPhone; | ||
| 24 | - | ||
| 25 | - @ApiModelProperty(value = "联系地址") | ||
| 26 | - private String contactAddress; | ||
| 27 | - | ||
| 28 | - @ApiModelProperty(value = "纳税人识别号") | ||
| 29 | - private String taxpayerIdentificationNumber; | ||
| 30 | - | ||
| 31 | - @ApiModelProperty(value = "开户行") | ||
| 32 | - private String bank; | ||
| 33 | - | ||
| 34 | - @ApiModelProperty(value = "用户名") | ||
| 35 | - private String accountName; | ||
| 36 | - | ||
| 37 | - @ApiModelProperty(value = "账号") | ||
| 38 | - private String accountNumber; | ||
| 39 | - | ||
| 40 | - @ApiModelProperty(value = "营业执照") | ||
| 41 | - private String businessLicense; | ||
| 42 | - | ||
| 43 | - @ApiModelProperty(value = "创建时间") | ||
| 44 | - private Date createTime; | ||
| 45 | - | ||
| 46 | - // 省略getter和setter方法 | ||
| 47 | - | ||
| 48 | - public Integer getId() { | ||
| 49 | - return id; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public void setId(Integer id) { | ||
| 53 | - this.id = id; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - public String getName() { | ||
| 57 | - return name; | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - public void setName(String name) { | ||
| 61 | - this.name = name; | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | - public Integer getCustomerTypeId() { | ||
| 65 | - return customerTypeId; | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - public void setCustomerTypeId(Integer customerTypeId) { | ||
| 69 | - this.customerTypeId = customerTypeId; | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - public String getContactPerson() { | ||
| 73 | - return contactPerson; | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - public void setContactPerson(String contactPerson) { | ||
| 77 | - this.contactPerson = contactPerson; | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | - public String getContactPhone() { | ||
| 81 | - return contactPhone; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - public void setContactPhone(String contactPhone) { | ||
| 85 | - this.contactPhone = contactPhone; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - public String getContactAddress() { | ||
| 89 | - return contactAddress; | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - public void setContactAddress(String contactAddress) { | ||
| 93 | - this.contactAddress = contactAddress; | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - public String getTaxpayerIdentificationNumber() { | ||
| 97 | - return taxpayerIdentificationNumber; | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - public void setTaxpayerIdentificationNumber(String taxpayerIdentificationNumber) { | ||
| 101 | - this.taxpayerIdentificationNumber = taxpayerIdentificationNumber; | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - public String getBank() { | ||
| 105 | - return bank; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - public void setBank(String bank) { | ||
| 109 | - this.bank = bank; | ||
| 110 | - } | ||
| 111 | - | ||
| 112 | - public String getAccountName() { | ||
| 113 | - return accountName; | ||
| 114 | - } | ||
| 115 | - | ||
| 116 | - public void setAccountName(String accountName) { | ||
| 117 | - this.accountName = accountName; | ||
| 118 | - } | ||
| 119 | - | ||
| 120 | - public String getAccountNumber() { | ||
| 121 | - return accountNumber; | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | - public void setAccountNumber(String accountNumber) { | ||
| 125 | - this.accountNumber = accountNumber; | ||
| 126 | - } | ||
| 127 | - | ||
| 128 | - public String getBusinessLicense() { | ||
| 129 | - return businessLicense; | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - public void setBusinessLicense(String businessLicense) { | ||
| 133 | - this.businessLicense = businessLicense; | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | - public Date getCreateTime() { | ||
| 137 | - return createTime; | ||
| 138 | - } | ||
| 139 | - | ||
| 140 | - public void setCreateTime(Date createTime) { | ||
| 141 | - this.createTime = createTime; | ||
| 142 | - } | ||
| 143 | -} |
lh-common/lh-domain/src/main/java/com/ruoyi/system/domain/afms/AfmsBasicCustomerType.java
已删除
100644 → 0
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-客户类型信息管理") | ||
| 8 | -public class AfmsBasicCustomerType { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "描述") | ||
| 17 | - private String description; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "创建时间") | ||
| 20 | - private Date createTime; | ||
| 21 | - | ||
| 22 | - // 省略getter和setter方法 | ||
| 23 | - | ||
| 24 | - public Integer getId() { | ||
| 25 | - return id; | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - public void setId(Integer id) { | ||
| 29 | - this.id = id; | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - public String getName() { | ||
| 33 | - return name; | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - public void setName(String name) { | ||
| 37 | - this.name = name; | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - public String getDescription() { | ||
| 41 | - return description; | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - public void setDescription(String description) { | ||
| 45 | - this.description = description; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - public Date getCreateTime() { | ||
| 49 | - return createTime; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public void setCreateTime(Date createTime) { | ||
| 53 | - this.createTime = createTime; | ||
| 54 | - } | ||
| 55 | -} |
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-饲料信息管理") | ||
| 8 | -public class AfmsBasicFeed { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "饲料名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "品牌ID") | ||
| 17 | - private Integer brandId; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "品类ID") | ||
| 20 | - private Integer categoryId; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "规格单位(kg/包)") | ||
| 23 | - private String specificationUnit; | ||
| 24 | - | ||
| 25 | - @ApiModelProperty(value = "供应商ID") | ||
| 26 | - private Integer supplierId; | ||
| 27 | - | ||
| 28 | - @ApiModelProperty(value = "供应商") | ||
| 29 | - private String supplier; | ||
| 30 | - | ||
| 31 | - @ApiModelProperty(value = "创建时间") | ||
| 32 | - private Date createTime; | ||
| 33 | - | ||
| 34 | - // 省略getter和setter方法 | ||
| 35 | - | ||
| 36 | - public Integer getId() { | ||
| 37 | - return id; | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - public void setId(Integer id) { | ||
| 41 | - this.id = id; | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - public String getName() { | ||
| 45 | - return name; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - public void setName(String name) { | ||
| 49 | - this.name = name; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public Integer getBrandId() { | ||
| 53 | - return brandId; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - public void setBrandId(Integer brandId) { | ||
| 57 | - this.brandId = brandId; | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - public Integer getCategoryId() { | ||
| 61 | - return categoryId; | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | - public void setCategoryId(Integer categoryId) { | ||
| 65 | - this.categoryId = categoryId; | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - public String getSpecificationUnit() { | ||
| 69 | - return specificationUnit; | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - public void setSpecificationUnit(String specificationUnit) { | ||
| 73 | - this.specificationUnit = specificationUnit; | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - public Integer getSupplierId() { | ||
| 77 | - return supplierId; | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | - public void setSupplierId(Integer supplierId) { | ||
| 81 | - this.supplierId = supplierId; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - public String getSupplier() { | ||
| 85 | - return supplier; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - public void setSupplier(String supplier) { | ||
| 89 | - this.supplier = supplier; | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - public Date getCreateTime() { | ||
| 93 | - return createTime; | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - public void setCreateTime(Date createTime) { | ||
| 97 | - this.createTime = createTime; | ||
| 98 | - } | ||
| 99 | -} |
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-苗种信息管理") | ||
| 8 | -public class AfmsBasicFry { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "苗种名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "养殖品种ID") | ||
| 17 | - private Integer speciesId; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "类别") | ||
| 20 | - private String category; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "数量单位") | ||
| 23 | - private String quantityUnit; | ||
| 24 | - | ||
| 25 | - @ApiModelProperty(value = "规格单位") | ||
| 26 | - private String specificationUnit; | ||
| 27 | - | ||
| 28 | - @ApiModelProperty(value = "供应商ID") | ||
| 29 | - private Integer supplierId; | ||
| 30 | - | ||
| 31 | - @ApiModelProperty(value = "供应商") | ||
| 32 | - private String supplier; | ||
| 33 | - | ||
| 34 | - @ApiModelProperty(value = "创建时间") | ||
| 35 | - private Date createTime; | ||
| 36 | - | ||
| 37 | - // 省略getter和setter方法 | ||
| 38 | - | ||
| 39 | - public Integer getId() { | ||
| 40 | - return id; | ||
| 41 | - } | ||
| 42 | - | ||
| 43 | - public void setId(Integer id) { | ||
| 44 | - this.id = id; | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - public String getName() { | ||
| 48 | - return name; | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - public void setName(String name) { | ||
| 52 | - this.name = name; | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - public Integer getSpeciesId() { | ||
| 56 | - return speciesId; | ||
| 57 | - } | ||
| 58 | - | ||
| 59 | - public void setSpeciesId(Integer speciesId) { | ||
| 60 | - this.speciesId = speciesId; | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | - public String getCategory() { | ||
| 64 | - return category; | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - public void setCategory(String category) { | ||
| 68 | - this.category = category; | ||
| 69 | - } | ||
| 70 | - | ||
| 71 | - public String getQuantityUnit() { | ||
| 72 | - return quantityUnit; | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - public void setQuantityUnit(String quantityUnit) { | ||
| 76 | - this.quantityUnit = quantityUnit; | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - public String getSpecificationUnit() { | ||
| 80 | - return specificationUnit; | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - public void setSpecificationUnit(String specificationUnit) { | ||
| 84 | - this.specificationUnit = specificationUnit; | ||
| 85 | - } | ||
| 86 | - | ||
| 87 | - public Integer getSupplierId() { | ||
| 88 | - return supplierId; | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - public void setSupplierId(Integer supplierId) { | ||
| 92 | - this.supplierId = supplierId; | ||
| 93 | - } | ||
| 94 | - | ||
| 95 | - public String getSupplier() { | ||
| 96 | - return supplier; | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - public void setSupplier(String supplier) { | ||
| 100 | - this.supplier = supplier; | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | - public Date getCreateTime() { | ||
| 104 | - return createTime; | ||
| 105 | - } | ||
| 106 | - | ||
| 107 | - public void setCreateTime(Date createTime) { | ||
| 108 | - this.createTime = createTime; | ||
| 109 | - } | ||
| 110 | -} |
lh-common/lh-domain/src/main/java/com/ruoyi/system/domain/afms/AfmsBasicMeasurementUnit.java
已删除
100644 → 0
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-计量单位信息管理") | ||
| 8 | -public class AfmsBasicMeasurementUnit { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "描述") | ||
| 17 | - private String description; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "创建时间") | ||
| 20 | - private Date createTime; | ||
| 21 | - | ||
| 22 | - // 省略getter和setter方法 | ||
| 23 | - | ||
| 24 | - public Integer getId() { | ||
| 25 | - return id; | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - public void setId(Integer id) { | ||
| 29 | - this.id = id; | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - public String getName() { | ||
| 33 | - return name; | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - public void setName(String name) { | ||
| 37 | - this.name = name; | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - public String getDescription() { | ||
| 41 | - return description; | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - public void setDescription(String description) { | ||
| 45 | - this.description = description; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - public Date getCreateTime() { | ||
| 49 | - return createTime; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public void setCreateTime(Date createTime) { | ||
| 53 | - this.createTime = createTime; | ||
| 54 | - } | ||
| 55 | -} |
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-塘口信息管理") | ||
| 8 | -public class AfmsBasicPond { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "用户ID") | ||
| 14 | - private Integer userId; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "塘口名称") | ||
| 17 | - private String name; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "负责人") | ||
| 20 | - private String personInCharge; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "养殖品种ID集合(以英文逗号分割)") | ||
| 23 | - private String speciesIds; | ||
| 24 | - | ||
| 25 | - @ApiModelProperty(value = "创建时间") | ||
| 26 | - private Date createTime; | ||
| 27 | - | ||
| 28 | - // 省略getter和setter方法 | ||
| 29 | - | ||
| 30 | - public Integer getId() { | ||
| 31 | - return id; | ||
| 32 | - } | ||
| 33 | - | ||
| 34 | - public void setId(Integer id) { | ||
| 35 | - this.id = id; | ||
| 36 | - } | ||
| 37 | - | ||
| 38 | - public Integer getUserId() { | ||
| 39 | - return userId; | ||
| 40 | - } | ||
| 41 | - | ||
| 42 | - public void setUserId(Integer userId) { | ||
| 43 | - this.userId = userId; | ||
| 44 | - } | ||
| 45 | - | ||
| 46 | - public String getName() { | ||
| 47 | - return name; | ||
| 48 | - } | ||
| 49 | - | ||
| 50 | - public void setName(String name) { | ||
| 51 | - this.name = name; | ||
| 52 | - } | ||
| 53 | - | ||
| 54 | - public String getPersonInCharge() { | ||
| 55 | - return personInCharge; | ||
| 56 | - } | ||
| 57 | - | ||
| 58 | - public void setPersonInCharge(String personInCharge) { | ||
| 59 | - this.personInCharge = personInCharge; | ||
| 60 | - } | ||
| 61 | - | ||
| 62 | - public String getSpeciesIds() { | ||
| 63 | - return speciesIds; | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | - public void setSpeciesIds(String speciesIds) { | ||
| 67 | - this.speciesIds = speciesIds; | ||
| 68 | - } | ||
| 69 | - | ||
| 70 | - public Date getCreateTime() { | ||
| 71 | - return createTime; | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - public void setCreateTime(Date createTime) { | ||
| 75 | - this.createTime = createTime; | ||
| 76 | - } | ||
| 77 | -} |
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-养殖品种管理") | ||
| 8 | -public class AfmsBasicSpecies { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "品种名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "水体类型") | ||
| 17 | - private String waterType; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "重量单位") | ||
| 20 | - private String weightUnit; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "数量单位") | ||
| 23 | - private String quantityUnit; | ||
| 24 | - | ||
| 25 | - @ApiModelProperty(value = "规格单位") | ||
| 26 | - private String specificationUnit; | ||
| 27 | - | ||
| 28 | - @ApiModelProperty(value = "创建时间") | ||
| 29 | - private Date createTime; | ||
| 30 | - | ||
| 31 | - // 省略getter和setter方法 | ||
| 32 | - | ||
| 33 | - public Integer getId() { | ||
| 34 | - return id; | ||
| 35 | - } | ||
| 36 | - | ||
| 37 | - public void setId(Integer id) { | ||
| 38 | - this.id = id; | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | - public String getName() { | ||
| 42 | - return name; | ||
| 43 | - } | ||
| 44 | - | ||
| 45 | - public void setName(String name) { | ||
| 46 | - this.name = name; | ||
| 47 | - } | ||
| 48 | - | ||
| 49 | - public String getWaterType() { | ||
| 50 | - return waterType; | ||
| 51 | - } | ||
| 52 | - | ||
| 53 | - public void setWaterType(String waterType) { | ||
| 54 | - this.waterType = waterType; | ||
| 55 | - } | ||
| 56 | - | ||
| 57 | - public String getWeightUnit() { | ||
| 58 | - return weightUnit; | ||
| 59 | - } | ||
| 60 | - | ||
| 61 | - public void setWeightUnit(String weightUnit) { | ||
| 62 | - this.weightUnit = weightUnit; | ||
| 63 | - } | ||
| 64 | - | ||
| 65 | - public String getQuantityUnit() { | ||
| 66 | - return quantityUnit; | ||
| 67 | - } | ||
| 68 | - | ||
| 69 | - public void setQuantityUnit(String quantityUnit) { | ||
| 70 | - this.quantityUnit = quantityUnit; | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | - public String getSpecificationUnit() { | ||
| 74 | - return specificationUnit; | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | - public void setSpecificationUnit(String specificationUnit) { | ||
| 78 | - this.specificationUnit = specificationUnit; | ||
| 79 | - } | ||
| 80 | - | ||
| 81 | - public Date getCreateTime() { | ||
| 82 | - return createTime; | ||
| 83 | - } | ||
| 84 | - | ||
| 85 | - public void setCreateTime(Date createTime) { | ||
| 86 | - this.createTime = createTime; | ||
| 87 | - } | ||
| 88 | -} |
lh-common/lh-domain/src/main/java/com/ruoyi/system/domain/afms/AfmsBasicSupplier.java
已删除
100644 → 0
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-供应商信息管理") | ||
| 8 | -public class AfmsBasicSupplier { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "供应商名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "供应商类型ID") | ||
| 17 | - private Integer supplierTypeId; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "联系人") | ||
| 20 | - private String contactPerson; | ||
| 21 | - | ||
| 22 | - @ApiModelProperty(value = "联系电话") | ||
| 23 | - private String contactPhone; | ||
| 24 | - | ||
| 25 | - @ApiModelProperty(value = "联系地址") | ||
| 26 | - private String contactAddress; | ||
| 27 | - | ||
| 28 | - @ApiModelProperty(value = "纳税人识别号") | ||
| 29 | - private String taxpayerIdentificationNumber; | ||
| 30 | - | ||
| 31 | - @ApiModelProperty(value = "开户行") | ||
| 32 | - private String bank; | ||
| 33 | - | ||
| 34 | - @ApiModelProperty(value = "用户名") | ||
| 35 | - private String accountName; | ||
| 36 | - | ||
| 37 | - @ApiModelProperty(value = "账号") | ||
| 38 | - private String accountNumber; | ||
| 39 | - | ||
| 40 | - @ApiModelProperty(value = "营业执照") | ||
| 41 | - private String businessLicense; | ||
| 42 | - | ||
| 43 | - @ApiModelProperty(value = "创建时间") | ||
| 44 | - private Date createTime; | ||
| 45 | - | ||
| 46 | - // 省略getter和setter方法 | ||
| 47 | - | ||
| 48 | - public Integer getId() { | ||
| 49 | - return id; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public void setId(Integer id) { | ||
| 53 | - this.id = id; | ||
| 54 | - } | ||
| 55 | - | ||
| 56 | - public String getName() { | ||
| 57 | - return name; | ||
| 58 | - } | ||
| 59 | - | ||
| 60 | - public void setName(String name) { | ||
| 61 | - this.name = name; | ||
| 62 | - } | ||
| 63 | - | ||
| 64 | - public Integer getSupplierTypeId() { | ||
| 65 | - return supplierTypeId; | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - public void setSupplierTypeId(Integer supplierTypeId) { | ||
| 69 | - this.supplierTypeId = supplierTypeId; | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - public String getContactPerson() { | ||
| 73 | - return contactPerson; | ||
| 74 | - } | ||
| 75 | - | ||
| 76 | - public void setContactPerson(String contactPerson) { | ||
| 77 | - this.contactPerson = contactPerson; | ||
| 78 | - } | ||
| 79 | - | ||
| 80 | - public String getContactPhone() { | ||
| 81 | - return contactPhone; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - public void setContactPhone(String contactPhone) { | ||
| 85 | - this.contactPhone = contactPhone; | ||
| 86 | - } | ||
| 87 | - | ||
| 88 | - public String getContactAddress() { | ||
| 89 | - return contactAddress; | ||
| 90 | - } | ||
| 91 | - | ||
| 92 | - public void setContactAddress(String contactAddress) { | ||
| 93 | - this.contactAddress = contactAddress; | ||
| 94 | - } | ||
| 95 | - | ||
| 96 | - public String getTaxpayerIdentificationNumber() { | ||
| 97 | - return taxpayerIdentificationNumber; | ||
| 98 | - } | ||
| 99 | - | ||
| 100 | - public void setTaxpayerIdentificationNumber(String taxpayerIdentificationNumber) { | ||
| 101 | - this.taxpayerIdentificationNumber = taxpayerIdentificationNumber; | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - public String getBank() { | ||
| 105 | - return bank; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - public void setBank(String bank) { | ||
| 109 | - this.bank = bank; | ||
| 110 | - } | ||
| 111 | - | ||
| 112 | - public String getAccountName() { | ||
| 113 | - return accountName; | ||
| 114 | - } | ||
| 115 | - | ||
| 116 | - public void setAccountName(String accountName) { | ||
| 117 | - this.accountName = accountName; | ||
| 118 | - } | ||
| 119 | - | ||
| 120 | - public String getAccountNumber() { | ||
| 121 | - return accountNumber; | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | - public void setAccountNumber(String accountNumber) { | ||
| 125 | - this.accountNumber = accountNumber; | ||
| 126 | - } | ||
| 127 | - | ||
| 128 | - public String getBusinessLicense() { | ||
| 129 | - return businessLicense; | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - public void setBusinessLicense(String businessLicense) { | ||
| 133 | - this.businessLicense = businessLicense; | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | - public Date getCreateTime() { | ||
| 137 | - return createTime; | ||
| 138 | - } | ||
| 139 | - | ||
| 140 | - public void setCreateTime(Date createTime) { | ||
| 141 | - this.createTime = createTime; | ||
| 142 | - } | ||
| 143 | -} |
lh-common/lh-domain/src/main/java/com/ruoyi/system/domain/afms/AfmsBasicSupplierType.java
已删除
100644 → 0
| 1 | -package com.ruoyi.system.domain.afms; | ||
| 2 | - | ||
| 3 | -import io.swagger.annotations.ApiModel; | ||
| 4 | -import io.swagger.annotations.ApiModelProperty; | ||
| 5 | -import java.util.Date; | ||
| 6 | - | ||
| 7 | -@ApiModel(description = "基础信息管理-供应商类型信息管理") | ||
| 8 | -public class AfmsBasicSupplierType { | ||
| 9 | - | ||
| 10 | - @ApiModelProperty(value = "ID") | ||
| 11 | - private Integer id; | ||
| 12 | - | ||
| 13 | - @ApiModelProperty(value = "名称") | ||
| 14 | - private String name; | ||
| 15 | - | ||
| 16 | - @ApiModelProperty(value = "描述") | ||
| 17 | - private String description; | ||
| 18 | - | ||
| 19 | - @ApiModelProperty(value = "创建时间") | ||
| 20 | - private Date createTime; | ||
| 21 | - | ||
| 22 | - // 省略getter和setter方法 | ||
| 23 | - | ||
| 24 | - public Integer getId() { | ||
| 25 | - return id; | ||
| 26 | - } | ||
| 27 | - | ||
| 28 | - public void setId(Integer id) { | ||
| 29 | - this.id = id; | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | - public String getName() { | ||
| 33 | - return name; | ||
| 34 | - } | ||
| 35 | - | ||
| 36 | - public void setName(String name) { | ||
| 37 | - this.name = name; | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - public String getDescription() { | ||
| 41 | - return description; | ||
| 42 | - } | ||
| 43 | - | ||
| 44 | - public void setDescription(String description) { | ||
| 45 | - this.description = description; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - public Date getCreateTime() { | ||
| 49 | - return createTime; | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - public void setCreateTime(Date createTime) { | ||
| 53 | - this.createTime = createTime; | ||
| 54 | - } | ||
| 55 | -} |
| @@ -18,18 +18,21 @@ | @@ -18,18 +18,21 @@ | ||
| 18 | </properties> | 18 | </properties> |
| 19 | 19 | ||
| 20 | <modules> | 20 | <modules> |
| 21 | + <module>lh-common-datasource</module> | ||
| 22 | + <module>lh-common-firewall</module> | ||
| 23 | + <module>lh-common-log</module> | ||
| 24 | + <module>lh-common-swagger</module> | ||
| 21 | <module>lh-domain</module> | 25 | <module>lh-domain</module> |
| 22 | - <module>ruoyi-common</module> | ||
| 23 | - <module>ruoyi-system</module> | ||
| 24 | <module>lh-public-dao</module> | 26 | <module>lh-public-dao</module> |
| 27 | + <module>lh-quartz</module> | ||
| 28 | + <module>ruoyi-auth</module> | ||
| 29 | + <module>ruoyi-common</module> | ||
| 25 | <module>ruoyi-common-core</module> | 30 | <module>ruoyi-common-core</module> |
| 26 | <module>ruoyi-common-redis</module> | 31 | <module>ruoyi-common-redis</module> |
| 27 | <module>ruoyi-common-security</module> | 32 | <module>ruoyi-common-security</module> |
| 28 | - <module>ruoyi-auth</module> | ||
| 29 | - <module>lh-common-datasource</module> | ||
| 30 | - <module>lh-common-log</module> | ||
| 31 | - <module>lh-quartz</module> | 33 | + <module>ruoyi-framework</module> |
| 32 | <module>ruoyi-generator</module> | 34 | <module>ruoyi-generator</module> |
| 35 | + <module>ruoyi-system</module> | ||
| 33 | </modules> | 36 | </modules> |
| 34 | 37 | ||
| 35 | <packaging>pom</packaging> | 38 | <packaging>pom</packaging> |
| @@ -32,10 +32,5 @@ | @@ -32,10 +32,5 @@ | ||
| 32 | <groupId>com.zhonglai.luhui</groupId> | 32 | <groupId>com.zhonglai.luhui</groupId> |
| 33 | <artifactId>lh-jar-sys-service</artifactId> | 33 | <artifactId>lh-jar-sys-service</artifactId> |
| 34 | </dependency> | 34 | </dependency> |
| 35 | - <!-- spring security 安全认证 --> | ||
| 36 | - <dependency> | ||
| 37 | - <groupId>org.springframework.boot</groupId> | ||
| 38 | - <artifactId>spring-boot-starter-security</artifactId> | ||
| 39 | - </dependency> | ||
| 40 | </dependencies> | 35 | </dependencies> |
| 41 | </project> | 36 | </project> |
lh-common/ruoyi-common-security/src/main/java/com/zhonglai/luhui/security/config/SecurityConfig.java
| @@ -3,11 +3,14 @@ package com.zhonglai.luhui.security.config; | @@ -3,11 +3,14 @@ package com.zhonglai.luhui.security.config; | ||
| 3 | import com.zhonglai.luhui.security.filter.JwtAuthenticationTokenFilter; | 3 | import com.zhonglai.luhui.security.filter.JwtAuthenticationTokenFilter; |
| 4 | import com.zhonglai.luhui.security.handle.AuthenticationEntryPointImpl; | 4 | import com.zhonglai.luhui.security.handle.AuthenticationEntryPointImpl; |
| 5 | import com.zhonglai.luhui.security.handle.LogoutSuccessHandlerImpl; | 5 | import com.zhonglai.luhui.security.handle.LogoutSuccessHandlerImpl; |
| 6 | +import com.zhonglai.luhui.security.service.CustomAuthenticationProvider; | ||
| 7 | +import com.zhonglai.luhui.security.service.CustomUserDetailsService; | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.beans.factory.annotation.Value; | 9 | import org.springframework.beans.factory.annotation.Value; |
| 8 | import org.springframework.context.annotation.Bean; | 10 | import org.springframework.context.annotation.Bean; |
| 9 | import org.springframework.http.HttpMethod; | 11 | import org.springframework.http.HttpMethod; |
| 10 | import org.springframework.security.authentication.AuthenticationManager; | 12 | import org.springframework.security.authentication.AuthenticationManager; |
| 13 | +import org.springframework.security.authentication.AuthenticationProvider; | ||
| 11 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; | 14 | import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; |
| 12 | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; | 15 | import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; |
| 13 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; | 16 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
| @@ -31,7 +34,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | @@ -31,7 +34,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | ||
| 31 | * 自定义用户认证逻辑 | 34 | * 自定义用户认证逻辑 |
| 32 | */ | 35 | */ |
| 33 | @Autowired | 36 | @Autowired |
| 34 | - private UserDetailsService userDetailsService; | 37 | + private CustomUserDetailsService userDetailsService; |
| 35 | 38 | ||
| 36 | /** | 39 | /** |
| 37 | * 认证失败处理类 | 40 | * 认证失败处理类 |
| @@ -129,6 +132,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | @@ -129,6 +132,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | ||
| 129 | // 添加CORS filter | 132 | // 添加CORS filter |
| 130 | httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class); | 133 | httpSecurity.addFilterBefore(corsFilter, JwtAuthenticationTokenFilter.class); |
| 131 | httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class); | 134 | httpSecurity.addFilterBefore(corsFilter, LogoutFilter.class); |
| 135 | + | ||
| 132 | } | 136 | } |
| 133 | 137 | ||
| 134 | /** | 138 | /** |
| @@ -140,12 +144,26 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | @@ -140,12 +144,26 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter | ||
| 140 | return new BCryptPasswordEncoder(); | 144 | return new BCryptPasswordEncoder(); |
| 141 | } | 145 | } |
| 142 | 146 | ||
| 143 | - /** | ||
| 144 | - * 身份认证接口 | ||
| 145 | - */ | 147 | +// /** |
| 148 | +// * 身份认证接口 | ||
| 149 | +// */ | ||
| 150 | +// @Override | ||
| 151 | +// protected void configure(AuthenticationManagerBuilder auth) throws Exception | ||
| 152 | +// { | ||
| 153 | +// auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); | ||
| 154 | +// } | ||
| 155 | + | ||
| 156 | + @Bean(name="customAuthenticationProvider") | ||
| 157 | + public AuthenticationProvider customAuthenticationProvider() { | ||
| 158 | + CustomAuthenticationProvider customAuthenticationProvider= new CustomAuthenticationProvider(); | ||
| 159 | + customAuthenticationProvider.setUserDetailsService(userDetailsService); | ||
| 160 | + customAuthenticationProvider.setHideUserNotFoundExceptions(false); | ||
| 161 | + customAuthenticationProvider.setPasswordEncoder(bCryptPasswordEncoder()); | ||
| 162 | + return customAuthenticationProvider; | ||
| 163 | + } | ||
| 164 | + | ||
| 146 | @Override | 165 | @Override |
| 147 | - protected void configure(AuthenticationManagerBuilder auth) throws Exception | ||
| 148 | - { | ||
| 149 | - auth.userDetailsService(userDetailsService).passwordEncoder(bCryptPasswordEncoder()); | 166 | + protected void configure(AuthenticationManagerBuilder auth) throws Exception { |
| 167 | + auth.authenticationProvider(customAuthenticationProvider()); | ||
| 150 | } | 168 | } |
| 151 | } | 169 | } |
| 1 | +package com.zhonglai.luhui.security.controller; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.Api; | ||
| 4 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 5 | +import org.springframework.web.bind.annotation.RestController; | ||
| 6 | + | ||
| 7 | +@Api(tags = "登陆") | ||
| 8 | +@RestController | ||
| 9 | +@RequestMapping("/login") | ||
| 10 | +public class LoginController { | ||
| 11 | + | ||
| 12 | +} |
| 1 | +package com.zhonglai.luhui.security.service; | ||
| 2 | + | ||
| 3 | +import org.springframework.security.authentication.BadCredentialsException; | ||
| 4 | +import org.springframework.security.authentication.InternalAuthenticationServiceException; | ||
| 5 | +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; | ||
| 6 | +import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider; | ||
| 7 | +import org.springframework.security.core.Authentication; | ||
| 8 | +import org.springframework.security.core.AuthenticationException; | ||
| 9 | +import org.springframework.security.core.userdetails.UserDetails; | ||
| 10 | +import org.springframework.security.core.userdetails.UserDetailsPasswordService; | ||
| 11 | +import org.springframework.security.core.userdetails.UserDetailsService; | ||
| 12 | +import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 13 | +import org.springframework.security.crypto.factory.PasswordEncoderFactories; | ||
| 14 | +import org.springframework.security.crypto.password.PasswordEncoder; | ||
| 15 | +import org.springframework.util.Assert; | ||
| 16 | + | ||
| 17 | +import java.util.Map; | ||
| 18 | + | ||
| 19 | +public class CustomAuthenticationProvider extends AbstractUserDetailsAuthenticationProvider { | ||
| 20 | + | ||
| 21 | + /** | ||
| 22 | + * The plaintext password used to perform PasswordEncoder#matches(CharSequence, | ||
| 23 | + * String)} on when the user is not found to avoid SEC-2056. | ||
| 24 | + */ | ||
| 25 | + private static final String USER_NOT_FOUND_PASSWORD = "userNotFoundPassword"; | ||
| 26 | + | ||
| 27 | + private PasswordEncoder passwordEncoder; | ||
| 28 | + | ||
| 29 | + /** | ||
| 30 | + * The password used to perform {@link PasswordEncoder#matches(CharSequence, String)} | ||
| 31 | + * on when the user is not found to avoid SEC-2056. This is necessary, because some | ||
| 32 | + * {@link PasswordEncoder} implementations will short circuit if the password is not | ||
| 33 | + * in a valid format. | ||
| 34 | + */ | ||
| 35 | + private volatile String userNotFoundEncodedPassword; | ||
| 36 | + | ||
| 37 | + private CustomUserDetailsService userDetailsService; | ||
| 38 | + | ||
| 39 | + private UserDetailsPasswordService userDetailsPasswordService; | ||
| 40 | + | ||
| 41 | + public CustomAuthenticationProvider() { | ||
| 42 | + setPasswordEncoder(PasswordEncoderFactories.createDelegatingPasswordEncoder()); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + @Override | ||
| 46 | + @SuppressWarnings("deprecation") | ||
| 47 | + protected void additionalAuthenticationChecks(UserDetails userDetails, | ||
| 48 | + UsernamePasswordAuthenticationToken authentication) throws AuthenticationException { | ||
| 49 | + if (authentication.getCredentials() == null) { | ||
| 50 | + this.logger.debug("Failed to authenticate since no credentials provided"); | ||
| 51 | + throw new BadCredentialsException(this.messages | ||
| 52 | + .getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials")); | ||
| 53 | + } | ||
| 54 | + String presentedPassword = authentication.getCredentials().toString(); | ||
| 55 | + if (!this.passwordEncoder.matches(presentedPassword, userDetails.getPassword())) { | ||
| 56 | + this.logger.debug("Failed to authenticate since password does not match stored value"); | ||
| 57 | + throw new BadCredentialsException(this.messages | ||
| 58 | + .getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials")); | ||
| 59 | + } | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + @Override | ||
| 63 | + protected void doAfterPropertiesSet() { | ||
| 64 | + Assert.notNull(this.userDetailsService, "A UserDetailsService must be set"); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + @Override | ||
| 68 | + protected final UserDetails retrieveUser(String username, UsernamePasswordAuthenticationToken authentication) | ||
| 69 | + throws AuthenticationException { | ||
| 70 | + this.prepareTimingAttackProtection(); | ||
| 71 | + Map<String,String> map = (Map<String, String>) authentication.getDetails(); // 自定义添加 | ||
| 72 | + try { | ||
| 73 | + String userType = map.get("userType"); // 自定义添加 | ||
| 74 | + UserDetails loadedUser = this.getUserDetailsService().loadUserByUsername(username, userType); // 自定义添加userType参数 | ||
| 75 | + if (loadedUser == null) { | ||
| 76 | + throw new InternalAuthenticationServiceException("UserDetailsService returned null, which is an interface contract violation"); | ||
| 77 | + } else { | ||
| 78 | + return loadedUser; | ||
| 79 | + } | ||
| 80 | + } catch (UsernameNotFoundException var4) { | ||
| 81 | + this.mitigateAgainstTimingAttack(authentication); | ||
| 82 | + throw var4; | ||
| 83 | + } catch (InternalAuthenticationServiceException var5) { | ||
| 84 | + throw var5; | ||
| 85 | + } catch (Exception var6) { | ||
| 86 | + throw new InternalAuthenticationServiceException(var6.getMessage(), var6); | ||
| 87 | + } | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + @Override | ||
| 91 | + protected Authentication createSuccessAuthentication(Object principal, Authentication authentication, | ||
| 92 | + UserDetails user) { | ||
| 93 | + boolean upgradeEncoding = this.userDetailsPasswordService != null | ||
| 94 | + && this.passwordEncoder.upgradeEncoding(user.getPassword()); | ||
| 95 | + if (upgradeEncoding) { | ||
| 96 | + String presentedPassword = authentication.getCredentials().toString(); | ||
| 97 | + String newPassword = this.passwordEncoder.encode(presentedPassword); | ||
| 98 | + user = this.userDetailsPasswordService.updatePassword(user, newPassword); | ||
| 99 | + } | ||
| 100 | + return super.createSuccessAuthentication(principal, authentication, user); | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + private void prepareTimingAttackProtection() { | ||
| 104 | + if (this.userNotFoundEncodedPassword == null) { | ||
| 105 | + this.userNotFoundEncodedPassword = this.passwordEncoder.encode(USER_NOT_FOUND_PASSWORD); | ||
| 106 | + } | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + private void mitigateAgainstTimingAttack(UsernamePasswordAuthenticationToken authentication) { | ||
| 110 | + if (authentication.getCredentials() != null) { | ||
| 111 | + String presentedPassword = authentication.getCredentials().toString(); | ||
| 112 | + this.passwordEncoder.matches(presentedPassword, this.userNotFoundEncodedPassword); | ||
| 113 | + } | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + /** | ||
| 117 | + * Sets the PasswordEncoder instance to be used to encode and validate passwords. If | ||
| 118 | + * not set, the password will be compared using | ||
| 119 | + * {@link PasswordEncoderFactories#createDelegatingPasswordEncoder()} | ||
| 120 | + * @param passwordEncoder must be an instance of one of the {@code PasswordEncoder} | ||
| 121 | + * types. | ||
| 122 | + */ | ||
| 123 | + public void setPasswordEncoder(PasswordEncoder passwordEncoder) { | ||
| 124 | + Assert.notNull(passwordEncoder, "passwordEncoder cannot be null"); | ||
| 125 | + this.passwordEncoder = passwordEncoder; | ||
| 126 | + this.userNotFoundEncodedPassword = null; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + protected PasswordEncoder getPasswordEncoder() { | ||
| 130 | + return this.passwordEncoder; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + public void setUserDetailsService(CustomUserDetailsService userDetailsService) { | ||
| 134 | + this.userDetailsService = userDetailsService; | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + protected CustomUserDetailsService getUserDetailsService() { | ||
| 138 | + return this.userDetailsService; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + public void setUserDetailsPasswordService(UserDetailsPasswordService userDetailsPasswordService) { | ||
| 142 | + this.userDetailsPasswordService = userDetailsPasswordService; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | +} | ||
| 146 | + |
| 1 | +package com.zhonglai.luhui.security.service; | ||
| 2 | + | ||
| 3 | +import org.springframework.security.core.userdetails.UserDetails; | ||
| 4 | +import org.springframework.security.core.userdetails.UserDetailsService; | ||
| 5 | +import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 6 | + | ||
| 7 | +public interface CustomUserDetailsService extends UserDetailsService { | ||
| 8 | + UserDetails loadUserByUsername(String username, String usertype) throws UsernameNotFoundException; | ||
| 9 | +} |
| 1 | +package com.zhonglai.luhui.security.service; | ||
| 2 | + | ||
| 3 | +import org.springframework.security.core.userdetails.UserDetails; | ||
| 4 | +import org.springframework.security.core.userdetails.UsernameNotFoundException; | ||
| 5 | +import org.springframework.stereotype.Service; | ||
| 6 | + | ||
| 7 | +@Service | ||
| 8 | +public class UserDetailsServiceImpl implements CustomUserDetailsService { | ||
| 9 | + @Override | ||
| 10 | + public UserDetails loadUserByUsername(String username, String usertype) throws UsernameNotFoundException { | ||
| 11 | + return null; | ||
| 12 | + } | ||
| 13 | + | ||
| 14 | + @Override | ||
| 15 | + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { | ||
| 16 | + return null; | ||
| 17 | + } | ||
| 18 | +} |
| @@ -35,12 +35,6 @@ | @@ -35,12 +35,6 @@ | ||
| 35 | <artifactId>pagehelper-spring-boot-starter</artifactId> | 35 | <artifactId>pagehelper-spring-boot-starter</artifactId> |
| 36 | </dependency> | 36 | </dependency> |
| 37 | 37 | ||
| 38 | - <!-- 自定义验证注解 --> | ||
| 39 | - <dependency> | ||
| 40 | - <groupId>org.springframework.boot</groupId> | ||
| 41 | - <artifactId>spring-boot-starter-validation</artifactId> | ||
| 42 | - </dependency> | ||
| 43 | - | ||
| 44 | <!--常用工具类 --> | 38 | <!--常用工具类 --> |
| 45 | <dependency> | 39 | <dependency> |
| 46 | <groupId>org.apache.commons</groupId> | 40 | <groupId>org.apache.commons</groupId> |
| @@ -145,7 +139,6 @@ | @@ -145,7 +139,6 @@ | ||
| 145 | </dependency> | 139 | </dependency> |
| 146 | 140 | ||
| 147 | <!-- 自定义验证注解 --> | 141 | <!-- 自定义验证注解 --> |
| 148 | - <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-validation --> | ||
| 149 | <dependency> | 142 | <dependency> |
| 150 | <groupId>org.springframework.boot</groupId> | 143 | <groupId>org.springframework.boot</groupId> |
| 151 | <artifactId>spring-boot-starter-validation</artifactId> | 144 | <artifactId>spring-boot-starter-validation</artifactId> |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | 4 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 5 | <parent> | 5 | <parent> |
| 6 | - <artifactId>Luhui</artifactId> | 6 | + <artifactId>lh-common</artifactId> |
| 7 | <groupId>com.zhonglai.luhui</groupId> | 7 | <groupId>com.zhonglai.luhui</groupId> |
| 8 | <version>1.0-SNAPSHOT</version> | 8 | <version>1.0-SNAPSHOT</version> |
| 9 | </parent> | 9 | </parent> |
| 1 | +package com.ruoyi.framework.web.domain.server; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.utils.Arith; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * CPU相关信息 | ||
| 7 | + * | ||
| 8 | + * @author ruoyi | ||
| 9 | + */ | ||
| 10 | +public class Cpu | ||
| 11 | +{ | ||
| 12 | + /** | ||
| 13 | + * 核心数 | ||
| 14 | + */ | ||
| 15 | + private int cpuNum; | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * CPU总的使用率 | ||
| 19 | + */ | ||
| 20 | + private double total; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * CPU系统使用率 | ||
| 24 | + */ | ||
| 25 | + private double sys; | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * CPU用户使用率 | ||
| 29 | + */ | ||
| 30 | + private double used; | ||
| 31 | + | ||
| 32 | + /** | ||
| 33 | + * CPU当前等待率 | ||
| 34 | + */ | ||
| 35 | + private double wait; | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * CPU当前空闲率 | ||
| 39 | + */ | ||
| 40 | + private double free; | ||
| 41 | + | ||
| 42 | + public int getCpuNum() | ||
| 43 | + { | ||
| 44 | + return cpuNum; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public void setCpuNum(int cpuNum) | ||
| 48 | + { | ||
| 49 | + this.cpuNum = cpuNum; | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + public double getTotal() | ||
| 53 | + { | ||
| 54 | + return Arith.round(Arith.mul(total, 100), 2); | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + public void setTotal(double total) | ||
| 58 | + { | ||
| 59 | + this.total = total; | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + public double getSys() | ||
| 63 | + { | ||
| 64 | + return Arith.round(Arith.mul(sys / total, 100), 2); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + public void setSys(double sys) | ||
| 68 | + { | ||
| 69 | + this.sys = sys; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + public double getUsed() | ||
| 73 | + { | ||
| 74 | + return Arith.round(Arith.mul(used / total, 100), 2); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + public void setUsed(double used) | ||
| 78 | + { | ||
| 79 | + this.used = used; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + public double getWait() | ||
| 83 | + { | ||
| 84 | + return Arith.round(Arith.mul(wait / total, 100), 2); | ||
| 85 | + } | ||
| 86 | + | ||
| 87 | + public void setWait(double wait) | ||
| 88 | + { | ||
| 89 | + this.wait = wait; | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + public double getFree() | ||
| 93 | + { | ||
| 94 | + return Arith.round(Arith.mul(free / total, 100), 2); | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + public void setFree(double free) | ||
| 98 | + { | ||
| 99 | + this.free = free; | ||
| 100 | + } | ||
| 101 | +} |
| 1 | +package com.ruoyi.framework.web.domain.server; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.utils.Arith; | ||
| 4 | +import com.ruoyi.common.utils.DateUtils; | ||
| 5 | + | ||
| 6 | +import java.lang.management.ManagementFactory; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * JVM相关信息 | ||
| 10 | + * | ||
| 11 | + * @author ruoyi | ||
| 12 | + */ | ||
| 13 | +public class Jvm | ||
| 14 | +{ | ||
| 15 | + /** | ||
| 16 | + * 当前JVM占用的内存总数(M) | ||
| 17 | + */ | ||
| 18 | + private double total; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * JVM最大可用内存总数(M) | ||
| 22 | + */ | ||
| 23 | + private double max; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * JVM空闲内存(M) | ||
| 27 | + */ | ||
| 28 | + private double free; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * JDK版本 | ||
| 32 | + */ | ||
| 33 | + private String version; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * JDK路径 | ||
| 37 | + */ | ||
| 38 | + private String home; | ||
| 39 | + | ||
| 40 | + public double getTotal() | ||
| 41 | + { | ||
| 42 | + return Arith.div(total, (1024 * 1024), 2); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + public void setTotal(double total) | ||
| 46 | + { | ||
| 47 | + this.total = total; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public double getMax() | ||
| 51 | + { | ||
| 52 | + return Arith.div(max, (1024 * 1024), 2); | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public void setMax(double max) | ||
| 56 | + { | ||
| 57 | + this.max = max; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + public double getFree() | ||
| 61 | + { | ||
| 62 | + return Arith.div(free, (1024 * 1024), 2); | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public void setFree(double free) | ||
| 66 | + { | ||
| 67 | + this.free = free; | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + public double getUsed() | ||
| 71 | + { | ||
| 72 | + return Arith.div(total - free, (1024 * 1024), 2); | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + public double getUsage() | ||
| 76 | + { | ||
| 77 | + return Arith.mul(Arith.div(total - free, total, 4), 100); | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + /** | ||
| 81 | + * 获取JDK名称 | ||
| 82 | + */ | ||
| 83 | + public String getName() | ||
| 84 | + { | ||
| 85 | + return ManagementFactory.getRuntimeMXBean().getVmName(); | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + public String getVersion() | ||
| 89 | + { | ||
| 90 | + return version; | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + public void setVersion(String version) | ||
| 94 | + { | ||
| 95 | + this.version = version; | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + public String getHome() | ||
| 99 | + { | ||
| 100 | + return home; | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + public void setHome(String home) | ||
| 104 | + { | ||
| 105 | + this.home = home; | ||
| 106 | + } | ||
| 107 | + | ||
| 108 | + /** | ||
| 109 | + * JDK启动时间 | ||
| 110 | + */ | ||
| 111 | + public String getStartTime() | ||
| 112 | + { | ||
| 113 | + return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, DateUtils.getServerStartDate()); | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + /** | ||
| 117 | + * JDK运行时间 | ||
| 118 | + */ | ||
| 119 | + public String getRunTime() | ||
| 120 | + { | ||
| 121 | + return DateUtils.getDatePoor(DateUtils.getNowDate(), DateUtils.getServerStartDate()); | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + /** | ||
| 125 | + * 运行参数 | ||
| 126 | + */ | ||
| 127 | + public String getInputArgs() | ||
| 128 | + { | ||
| 129 | + return ManagementFactory.getRuntimeMXBean().getInputArguments().toString(); | ||
| 130 | + } | ||
| 131 | +} |
| 1 | +package com.ruoyi.framework.web.domain.server; | ||
| 2 | + | ||
| 3 | +import com.ruoyi.common.utils.Arith; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * 內存相关信息 | ||
| 7 | + * | ||
| 8 | + * @author ruoyi | ||
| 9 | + */ | ||
| 10 | +public class Mem | ||
| 11 | +{ | ||
| 12 | + /** | ||
| 13 | + * 内存总量 | ||
| 14 | + */ | ||
| 15 | + private double total; | ||
| 16 | + | ||
| 17 | + /** | ||
| 18 | + * 已用内存 | ||
| 19 | + */ | ||
| 20 | + private double used; | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 剩余内存 | ||
| 24 | + */ | ||
| 25 | + private double free; | ||
| 26 | + | ||
| 27 | + public double getTotal() | ||
| 28 | + { | ||
| 29 | + return Arith.div(total, (1024 * 1024 * 1024), 2); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + public void setTotal(long total) | ||
| 33 | + { | ||
| 34 | + this.total = total; | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + public double getUsed() | ||
| 38 | + { | ||
| 39 | + return Arith.div(used, (1024 * 1024 * 1024), 2); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | + public void setUsed(long used) | ||
| 43 | + { | ||
| 44 | + this.used = used; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + public double getFree() | ||
| 48 | + { | ||
| 49 | + return Arith.div(free, (1024 * 1024 * 1024), 2); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + public void setFree(long free) | ||
| 53 | + { | ||
| 54 | + this.free = free; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + public double getUsage() | ||
| 58 | + { | ||
| 59 | + return Arith.mul(Arith.div(used, total, 4), 100); | ||
| 60 | + } | ||
| 61 | +} |
| 1 | +package com.ruoyi.framework.web.domain.server; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 系统相关信息 | ||
| 5 | + * | ||
| 6 | + * @author ruoyi | ||
| 7 | + */ | ||
| 8 | +public class Sys | ||
| 9 | +{ | ||
| 10 | + /** | ||
| 11 | + * 服务器名称 | ||
| 12 | + */ | ||
| 13 | + private String computerName; | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 服务器Ip | ||
| 17 | + */ | ||
| 18 | + private String computerIp; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 项目路径 | ||
| 22 | + */ | ||
| 23 | + private String userDir; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 操作系统 | ||
| 27 | + */ | ||
| 28 | + private String osName; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 系统架构 | ||
| 32 | + */ | ||
| 33 | + private String osArch; | ||
| 34 | + | ||
| 35 | + public String getComputerName() | ||
| 36 | + { | ||
| 37 | + return computerName; | ||
| 38 | + } | ||
| 39 | + | ||
| 40 | + public void setComputerName(String computerName) | ||
| 41 | + { | ||
| 42 | + this.computerName = computerName; | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + public String getComputerIp() | ||
| 46 | + { | ||
| 47 | + return computerIp; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public void setComputerIp(String computerIp) | ||
| 51 | + { | ||
| 52 | + this.computerIp = computerIp; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public String getUserDir() | ||
| 56 | + { | ||
| 57 | + return userDir; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + public void setUserDir(String userDir) | ||
| 61 | + { | ||
| 62 | + this.userDir = userDir; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public String getOsName() | ||
| 66 | + { | ||
| 67 | + return osName; | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + public void setOsName(String osName) | ||
| 71 | + { | ||
| 72 | + this.osName = osName; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + public String getOsArch() | ||
| 76 | + { | ||
| 77 | + return osArch; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public void setOsArch(String osArch) | ||
| 81 | + { | ||
| 82 | + this.osArch = osArch; | ||
| 83 | + } | ||
| 84 | +} |
lh-common/ruoyi-framework/src/main/java/com/ruoyi/framework/web/domain/server/SysFile.java
0 → 100644
| 1 | +package com.ruoyi.framework.web.domain.server; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * 系统文件相关信息 | ||
| 5 | + * | ||
| 6 | + * @author ruoyi | ||
| 7 | + */ | ||
| 8 | +public class SysFile | ||
| 9 | +{ | ||
| 10 | + /** | ||
| 11 | + * 盘符路径 | ||
| 12 | + */ | ||
| 13 | + private String dirName; | ||
| 14 | + | ||
| 15 | + /** | ||
| 16 | + * 盘符类型 | ||
| 17 | + */ | ||
| 18 | + private String sysTypeName; | ||
| 19 | + | ||
| 20 | + /** | ||
| 21 | + * 文件类型 | ||
| 22 | + */ | ||
| 23 | + private String typeName; | ||
| 24 | + | ||
| 25 | + /** | ||
| 26 | + * 总大小 | ||
| 27 | + */ | ||
| 28 | + private String total; | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * 剩余大小 | ||
| 32 | + */ | ||
| 33 | + private String free; | ||
| 34 | + | ||
| 35 | + /** | ||
| 36 | + * 已经使用量 | ||
| 37 | + */ | ||
| 38 | + private String used; | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 资源的使用率 | ||
| 42 | + */ | ||
| 43 | + private double usage; | ||
| 44 | + | ||
| 45 | + public String getDirName() | ||
| 46 | + { | ||
| 47 | + return dirName; | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + public void setDirName(String dirName) | ||
| 51 | + { | ||
| 52 | + this.dirName = dirName; | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + public String getSysTypeName() | ||
| 56 | + { | ||
| 57 | + return sysTypeName; | ||
| 58 | + } | ||
| 59 | + | ||
| 60 | + public void setSysTypeName(String sysTypeName) | ||
| 61 | + { | ||
| 62 | + this.sysTypeName = sysTypeName; | ||
| 63 | + } | ||
| 64 | + | ||
| 65 | + public String getTypeName() | ||
| 66 | + { | ||
| 67 | + return typeName; | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + public void setTypeName(String typeName) | ||
| 71 | + { | ||
| 72 | + this.typeName = typeName; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + public String getTotal() | ||
| 76 | + { | ||
| 77 | + return total; | ||
| 78 | + } | ||
| 79 | + | ||
| 80 | + public void setTotal(String total) | ||
| 81 | + { | ||
| 82 | + this.total = total; | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + public String getFree() | ||
| 86 | + { | ||
| 87 | + return free; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + public void setFree(String free) | ||
| 91 | + { | ||
| 92 | + this.free = free; | ||
| 93 | + } | ||
| 94 | + | ||
| 95 | + public String getUsed() | ||
| 96 | + { | ||
| 97 | + return used; | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + public void setUsed(String used) | ||
| 101 | + { | ||
| 102 | + this.used = used; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + public double getUsage() | ||
| 106 | + { | ||
| 107 | + return usage; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | + public void setUsage(double usage) | ||
| 111 | + { | ||
| 112 | + this.usage = usage; | ||
| 113 | + } | ||
| 114 | +} |
| @@ -219,8 +219,8 @@ public class GenController extends BaseController | @@ -219,8 +219,8 @@ public class GenController extends BaseController | ||
| 219 | @ApiOperation("从数据库结构生成代码") | 219 | @ApiOperation("从数据库结构生成代码") |
| 220 | @ApiImplicitParam(value = "表名集合",name = "tableNames") | 220 | @ApiImplicitParam(value = "表名集合",name = "tableNames") |
| 221 | @GetMapping("/generatorCodeFromDb") | 221 | @GetMapping("/generatorCodeFromDb") |
| 222 | - public void generatorCodeFromDb(HttpServletResponse response,String databaseName, String tableNames,String packageName) throws IOException { | ||
| 223 | - byte[] data = genTableService.generatorCodeFromDb(databaseName,tableNames,packageName); | 222 | + public void generatorCodeFromDb(HttpServletResponse response,String databaseName, String tableNames,String packageName,String dataSource) throws IOException { |
| 223 | + byte[] data = genTableService.generatorCodeFromDb(databaseName,tableNames,packageName,dataSource); | ||
| 224 | genCode(response, data); | 224 | genCode(response, data); |
| 225 | } | 225 | } |
| 226 | 226 |
| @@ -5,6 +5,7 @@ import javax.validation.Valid; | @@ -5,6 +5,7 @@ import javax.validation.Valid; | ||
| 5 | import javax.validation.constraints.NotBlank; | 5 | import javax.validation.constraints.NotBlank; |
| 6 | 6 | ||
| 7 | import com.ruoyi.common.annotation.PublicSQLConfig; | 7 | import com.ruoyi.common.annotation.PublicSQLConfig; |
| 8 | +import com.zhonglai.luhui.datasource.enums.DataSourceType; | ||
| 8 | import org.apache.commons.lang3.ArrayUtils; | 9 | import org.apache.commons.lang3.ArrayUtils; |
| 9 | import com.ruoyi.common.constant.GenConstants; | 10 | import com.ruoyi.common.constant.GenConstants; |
| 10 | import com.ruoyi.common.tool.BaseEntity; | 11 | import com.ruoyi.common.tool.BaseEntity; |
| @@ -98,6 +99,8 @@ public class GenTable extends BaseEntity | @@ -98,6 +99,8 @@ public class GenTable extends BaseEntity | ||
| 98 | /** 上级菜单名称字段 */ | 99 | /** 上级菜单名称字段 */ |
| 99 | private String parentMenuName; | 100 | private String parentMenuName; |
| 100 | 101 | ||
| 102 | + private String dataSource; | ||
| 103 | + | ||
| 101 | public Long getTableId() | 104 | public Long getTableId() |
| 102 | { | 105 | { |
| 103 | return tableId; | 106 | return tableId; |
| @@ -372,4 +375,12 @@ public class GenTable extends BaseEntity | @@ -372,4 +375,12 @@ public class GenTable extends BaseEntity | ||
| 372 | } | 375 | } |
| 373 | return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); | 376 | return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); |
| 374 | } | 377 | } |
| 378 | + | ||
| 379 | + public String getDataSource() { | ||
| 380 | + return dataSource; | ||
| 381 | + } | ||
| 382 | + | ||
| 383 | + public void setDataSource(String dataSource) { | ||
| 384 | + this.dataSource = dataSource; | ||
| 385 | + } | ||
| 375 | } | 386 | } |
| @@ -262,7 +262,7 @@ public class GenTableServiceImpl implements IGenTableService | @@ -262,7 +262,7 @@ public class GenTableServiceImpl implements IGenTableService | ||
| 262 | */ | 262 | */ |
| 263 | @DataSource(value = DataSourceType.SLAVE) | 263 | @DataSource(value = DataSourceType.SLAVE) |
| 264 | @Override | 264 | @Override |
| 265 | - public byte[] generatorCodeFromDb(String databaseName,String tableNames,String packageName) | 265 | + public byte[] generatorCodeFromDb(String databaseName,String tableNames,String packageName,String dataSource) |
| 266 | { | 266 | { |
| 267 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); | 267 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); |
| 268 | ZipOutputStream zip = new ZipOutputStream(outputStream); | 268 | ZipOutputStream zip = new ZipOutputStream(outputStream); |
| @@ -270,7 +270,7 @@ public class GenTableServiceImpl implements IGenTableService | @@ -270,7 +270,7 @@ public class GenTableServiceImpl implements IGenTableService | ||
| 270 | for (String tableName:tableNames.split(",")) | 270 | for (String tableName:tableNames.split(",")) |
| 271 | { | 271 | { |
| 272 | // 查询表信息 | 272 | // 查询表信息 |
| 273 | - GenTable table = generatorFromTablename(databaseName,tableName,packageName); | 273 | + GenTable table = generatorFromTablename(databaseName,tableName,packageName,dataSource); |
| 274 | generatorCode(table, zip); | 274 | generatorCode(table, zip); |
| 275 | } | 275 | } |
| 276 | IOUtils.closeQuietly(zip); | 276 | IOUtils.closeQuietly(zip); |
| @@ -314,7 +314,7 @@ public class GenTableServiceImpl implements IGenTableService | @@ -314,7 +314,7 @@ public class GenTableServiceImpl implements IGenTableService | ||
| 314 | } | 314 | } |
| 315 | } | 315 | } |
| 316 | 316 | ||
| 317 | - public GenTable generatorFromTablename(String databaseName,String tableName,String packageName) | 317 | + public GenTable generatorFromTablename(String databaseName,String tableName,String packageName,String dataSource) |
| 318 | { | 318 | { |
| 319 | List<Map<String,Object>> list = mapMapper.getObjectListBySQL("SELECT COLUMN_NAME,ORDINAL_POSITION,COLUMN_DEFAULT,IS_NULLABLE,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH,CHARACTER_OCTET_LENGTH,NUMERIC_PRECISION,NUMERIC_SCALE,DATETIME_PRECISION,CHARACTER_SET_NAME,COLLATION_NAME,COLUMN_TYPE,COLUMN_KEY,EXTRA,COLUMN_COMMENT FROM information_schema.columns WHERE table_schema = '"+databaseName+"' AND table_name = '"+tableName+"'"); | 319 | List<Map<String,Object>> list = mapMapper.getObjectListBySQL("SELECT COLUMN_NAME,ORDINAL_POSITION,COLUMN_DEFAULT,IS_NULLABLE,DATA_TYPE,CHARACTER_MAXIMUM_LENGTH,CHARACTER_OCTET_LENGTH,NUMERIC_PRECISION,NUMERIC_SCALE,DATETIME_PRECISION,CHARACTER_SET_NAME,COLLATION_NAME,COLUMN_TYPE,COLUMN_KEY,EXTRA,COLUMN_COMMENT FROM information_schema.columns WHERE table_schema = '"+databaseName+"' AND table_name = '"+tableName+"'"); |
| 320 | Map<String,Object> map = mapMapper.getObjectListBySQL("SELECT TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name='"+tableName+"' AND table_schema='"+databaseName+"'").get(0); | 320 | Map<String,Object> map = mapMapper.getObjectListBySQL("SELECT TABLE_COMMENT FROM INFORMATION_SCHEMA.TABLES WHERE table_name='"+tableName+"' AND table_schema='"+databaseName+"'").get(0); |
| @@ -332,7 +332,7 @@ public class GenTableServiceImpl implements IGenTableService | @@ -332,7 +332,7 @@ public class GenTableServiceImpl implements IGenTableService | ||
| 332 | genTable.setFunctionAuthor("钟来"); | 332 | genTable.setFunctionAuthor("钟来"); |
| 333 | genTable.setGenType("1"); | 333 | genTable.setGenType("1"); |
| 334 | genTable.setGenPath("/"); | 334 | genTable.setGenPath("/"); |
| 335 | - | 335 | + genTable.setDataSource("DataSourceType."+dataSource); |
| 336 | List<GenTableColumn> columns = new ArrayList<>(); | 336 | List<GenTableColumn> columns = new ArrayList<>(); |
| 337 | for(Map<String,Object> table:list) | 337 | for(Map<String,Object> table:list) |
| 338 | { | 338 | { |
| @@ -124,5 +124,5 @@ public interface IGenTableService | @@ -124,5 +124,5 @@ public interface IGenTableService | ||
| 124 | * | 124 | * |
| 125 | * @param tableName 表名称 | 125 | * @param tableName 表名称 |
| 126 | */ | 126 | */ |
| 127 | - public byte[] generatorCodeFromDb(String databaseName,String tableName,String packageName); | 127 | + public byte[] generatorCodeFromDb(String databaseName,String tableName,String packageName,String dataSource); |
| 128 | } | 128 | } |
| @@ -276,7 +276,7 @@ public class GenUtils | @@ -276,7 +276,7 @@ public class GenUtils | ||
| 276 | case "mediumint":return "Integer"; | 276 | case "mediumint":return "Integer"; |
| 277 | case "bit":return "Boolean"; | 277 | case "bit":return "Boolean"; |
| 278 | case "bigint":return "java.math.BigInteger"; | 278 | case "bigint":return "java.math.BigInteger"; |
| 279 | - case "float":return "Fload"; | 279 | + case "float":return "Float"; |
| 280 | case "double":return "Double"; | 280 | case "double":return "Double"; |
| 281 | case "decimal":return "java.math.BigDecimal"; | 281 | case "decimal":return "java.math.BigDecimal"; |
| 282 | case "boolean":return "Boolean"; | 282 | case "boolean":return "Boolean"; |
| @@ -294,6 +294,7 @@ public class GenUtils | @@ -294,6 +294,7 @@ public class GenUtils | ||
| 294 | case "int":return "Integer"; | 294 | case "int":return "Integer"; |
| 295 | case "longblob":return "String"; | 295 | case "longblob":return "String"; |
| 296 | case "mediumtext":return "String"; | 296 | case "mediumtext":return "String"; |
| 297 | + case "enum":return "Enum"; | ||
| 297 | default: | 298 | default: |
| 298 | System.out.println("-----------------》转化失败:未发现的类型"+sqlType); | 299 | System.out.println("-----------------》转化失败:未发现的类型"+sqlType); |
| 299 | break; | 300 | break; |
| @@ -60,6 +60,7 @@ public class VelocityUtils | @@ -60,6 +60,7 @@ public class VelocityUtils | ||
| 60 | velocityContext.put("columns", genTable.getColumns()); | 60 | velocityContext.put("columns", genTable.getColumns()); |
| 61 | velocityContext.put("table", genTable); | 61 | velocityContext.put("table", genTable); |
| 62 | velocityContext.put("dicts", getDicts(genTable)); | 62 | velocityContext.put("dicts", getDicts(genTable)); |
| 63 | + velocityContext.put("dataSource", genTable.getDataSource()); | ||
| 63 | setMenuVelocityContext(velocityContext, genTable); | 64 | setMenuVelocityContext(velocityContext, genTable); |
| 64 | if (GenConstants.TPL_TREE.equals(tplCategory)) | 65 | if (GenConstants.TPL_TREE.equals(tplCategory)) |
| 65 | { | 66 | { |
| @@ -5,7 +5,7 @@ import javax.servlet.http.HttpServletResponse; | @@ -5,7 +5,7 @@ import javax.servlet.http.HttpServletResponse; | ||
| 5 | 5 | ||
| 6 | import io.swagger.annotations.Api; | 6 | import io.swagger.annotations.Api; |
| 7 | import io.swagger.annotations.ApiOperation; | 7 | import io.swagger.annotations.ApiOperation; |
| 8 | -import org.springframework.security.access.prepost.PreAuthorize; | 8 | +##import org.springframework.security.access.prepost.PreAuthorize; |
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 9 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | import org.springframework.web.bind.annotation.GetMapping; | 10 | import org.springframework.web.bind.annotation.GetMapping; |
| 11 | import org.springframework.web.bind.annotation.PostMapping; | 11 | import org.springframework.web.bind.annotation.PostMapping; |
| @@ -45,7 +45,7 @@ public class ${ClassName}Controller extends BaseController | @@ -45,7 +45,7 @@ public class ${ClassName}Controller extends BaseController | ||
| 45 | * 查询${functionName}列表 | 45 | * 查询${functionName}列表 |
| 46 | */ | 46 | */ |
| 47 | @ApiOperation("查询${functionName}列表") | 47 | @ApiOperation("查询${functionName}列表") |
| 48 | - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") | 48 | +## @PreAuthorize("@ss.hasPermi('${permissionPrefix}:list')") |
| 49 | @GetMapping("/list") | 49 | @GetMapping("/list") |
| 50 | #if($table.crud || $table.sub) | 50 | #if($table.crud || $table.sub) |
| 51 | public TableDataInfo list(${ClassName} ${className}) | 51 | public TableDataInfo list(${ClassName} ${className}) |
| @@ -66,7 +66,7 @@ public class ${ClassName}Controller extends BaseController | @@ -66,7 +66,7 @@ public class ${ClassName}Controller extends BaseController | ||
| 66 | * 导出${functionName}列表 | 66 | * 导出${functionName}列表 |
| 67 | */ | 67 | */ |
| 68 | @ApiOperation("导出${functionName}列表") | 68 | @ApiOperation("导出${functionName}列表") |
| 69 | - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") | 69 | +## @PreAuthorize("@ss.hasPermi('${permissionPrefix}:export')") |
| 70 | @Log(title = "${functionName}", businessType = BusinessType.EXPORT) | 70 | @Log(title = "${functionName}", businessType = BusinessType.EXPORT) |
| 71 | @PostMapping("/export") | 71 | @PostMapping("/export") |
| 72 | public void export(HttpServletResponse response, ${ClassName} ${className}) | 72 | public void export(HttpServletResponse response, ${ClassName} ${className}) |
| @@ -80,7 +80,7 @@ public class ${ClassName}Controller extends BaseController | @@ -80,7 +80,7 @@ public class ${ClassName}Controller extends BaseController | ||
| 80 | * 获取${functionName}详细信息 | 80 | * 获取${functionName}详细信息 |
| 81 | */ | 81 | */ |
| 82 | @ApiOperation("获取${functionName}详细信息") | 82 | @ApiOperation("获取${functionName}详细信息") |
| 83 | - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')") | 83 | +## @PreAuthorize("@ss.hasPermi('${permissionPrefix}:query')") |
| 84 | @GetMapping(value = "/{${pkColumn.javaField}}") | 84 | @GetMapping(value = "/{${pkColumn.javaField}}") |
| 85 | public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) | 85 | public AjaxResult getInfo(@PathVariable("${pkColumn.javaField}") ${pkColumn.javaType} ${pkColumn.javaField}) |
| 86 | { | 86 | { |
| @@ -91,7 +91,7 @@ public class ${ClassName}Controller extends BaseController | @@ -91,7 +91,7 @@ public class ${ClassName}Controller extends BaseController | ||
| 91 | * 新增${functionName} | 91 | * 新增${functionName} |
| 92 | */ | 92 | */ |
| 93 | @ApiOperation("新增${functionName}") | 93 | @ApiOperation("新增${functionName}") |
| 94 | - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") | 94 | +## @PreAuthorize("@ss.hasPermi('${permissionPrefix}:add')") |
| 95 | @Log(title = "${functionName}", businessType = BusinessType.INSERT) | 95 | @Log(title = "${functionName}", businessType = BusinessType.INSERT) |
| 96 | @PostMapping | 96 | @PostMapping |
| 97 | public AjaxResult add(@RequestBody ${ClassName} ${className}) | 97 | public AjaxResult add(@RequestBody ${ClassName} ${className}) |
| @@ -103,7 +103,7 @@ public class ${ClassName}Controller extends BaseController | @@ -103,7 +103,7 @@ public class ${ClassName}Controller extends BaseController | ||
| 103 | * 修改${functionName} | 103 | * 修改${functionName} |
| 104 | */ | 104 | */ |
| 105 | @ApiOperation("修改${functionName}") | 105 | @ApiOperation("修改${functionName}") |
| 106 | - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") | 106 | +## @PreAuthorize("@ss.hasPermi('${permissionPrefix}:edit')") |
| 107 | @Log(title = "${functionName}", businessType = BusinessType.UPDATE) | 107 | @Log(title = "${functionName}", businessType = BusinessType.UPDATE) |
| 108 | @PutMapping | 108 | @PutMapping |
| 109 | public AjaxResult edit(@RequestBody ${ClassName} ${className}) | 109 | public AjaxResult edit(@RequestBody ${ClassName} ${className}) |
| @@ -115,7 +115,7 @@ public class ${ClassName}Controller extends BaseController | @@ -115,7 +115,7 @@ public class ${ClassName}Controller extends BaseController | ||
| 115 | * 删除${functionName} | 115 | * 删除${functionName} |
| 116 | */ | 116 | */ |
| 117 | @ApiOperation("删除${functionName}") | 117 | @ApiOperation("删除${functionName}") |
| 118 | - @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')") | 118 | +## @PreAuthorize("@ss.hasPermi('${permissionPrefix}:remove')") |
| 119 | @Log(title = "${functionName}", businessType = BusinessType.DELETE) | 119 | @Log(title = "${functionName}", businessType = BusinessType.DELETE) |
| 120 | @DeleteMapping("/{${pkColumn.javaField}s}") | 120 | @DeleteMapping("/{${pkColumn.javaField}s}") |
| 121 | public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) | 121 | public AjaxResult remove(@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) |
| @@ -7,6 +7,11 @@ import com.ruoyi.common.utils.DateUtils; | @@ -7,6 +7,11 @@ import com.ruoyi.common.utils.DateUtils; | ||
| 7 | #break | 7 | #break |
| 8 | #end | 8 | #end |
| 9 | #end | 9 | #end |
| 10 | + | ||
| 11 | +#if($dataSource) | ||
| 12 | +import com.zhonglai.luhui.datasource.enums.DataSource; | ||
| 13 | +import com.zhonglai.luhui.datasource.enums.DataSourceType; | ||
| 14 | +#end | ||
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | import org.springframework.stereotype.Service; | 16 | import org.springframework.stereotype.Service; |
| 12 | #if($table.sub) | 17 | #if($table.sub) |
| @@ -37,6 +42,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | @@ -37,6 +42,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | ||
| 37 | * @param ${pkColumn.javaField} ${functionName}主键 | 42 | * @param ${pkColumn.javaField} ${functionName}主键 |
| 38 | * @return ${functionName} | 43 | * @return ${functionName} |
| 39 | */ | 44 | */ |
| 45 | +#if($dataSource) | ||
| 46 | + @DataSource(${dataSource}) | ||
| 47 | +#end | ||
| 40 | @Override | 48 | @Override |
| 41 | public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) | 49 | public ${ClassName} select${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField}) |
| 42 | { | 50 | { |
| @@ -49,6 +57,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | @@ -49,6 +57,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | ||
| 49 | * @param ${className} ${functionName} | 57 | * @param ${className} ${functionName} |
| 50 | * @return ${functionName} | 58 | * @return ${functionName} |
| 51 | */ | 59 | */ |
| 60 | +#if($dataSource) | ||
| 61 | + @DataSource(${dataSource}) | ||
| 62 | +#end | ||
| 52 | @Override | 63 | @Override |
| 53 | public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) | 64 | public List<${ClassName}> select${ClassName}List(${ClassName} ${className}) |
| 54 | { | 65 | { |
| @@ -61,6 +72,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | @@ -61,6 +72,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | ||
| 61 | * @param ${className} ${functionName} | 72 | * @param ${className} ${functionName} |
| 62 | * @return 结果 | 73 | * @return 结果 |
| 63 | */ | 74 | */ |
| 75 | +#if($dataSource) | ||
| 76 | + @DataSource(${dataSource}) | ||
| 77 | +#end | ||
| 64 | #if($table.sub) | 78 | #if($table.sub) |
| 65 | @Transactional | 79 | @Transactional |
| 66 | #end | 80 | #end |
| @@ -87,6 +101,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | @@ -87,6 +101,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | ||
| 87 | * @param ${className} ${functionName} | 101 | * @param ${className} ${functionName} |
| 88 | * @return 结果 | 102 | * @return 结果 |
| 89 | */ | 103 | */ |
| 104 | +#if($dataSource) | ||
| 105 | + @DataSource(${dataSource}) | ||
| 106 | +#end | ||
| 90 | #if($table.sub) | 107 | #if($table.sub) |
| 91 | @Transactional | 108 | @Transactional |
| 92 | #end | 109 | #end |
| @@ -111,6 +128,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | @@ -111,6 +128,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | ||
| 111 | * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 | 128 | * @param ${pkColumn.javaField}s 需要删除的${functionName}主键 |
| 112 | * @return 结果 | 129 | * @return 结果 |
| 113 | */ | 130 | */ |
| 131 | +#if($dataSource) | ||
| 132 | + @DataSource(${dataSource}) | ||
| 133 | +#end | ||
| 114 | #if($table.sub) | 134 | #if($table.sub) |
| 115 | @Transactional | 135 | @Transactional |
| 116 | #end | 136 | #end |
| @@ -129,6 +149,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | @@ -129,6 +149,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | ||
| 129 | * @param ${pkColumn.javaField} ${functionName}主键 | 149 | * @param ${pkColumn.javaField} ${functionName}主键 |
| 130 | * @return 结果 | 150 | * @return 结果 |
| 131 | */ | 151 | */ |
| 152 | +#if($dataSource) | ||
| 153 | + @DataSource(${dataSource}) | ||
| 154 | +#end | ||
| 132 | #if($table.sub) | 155 | #if($table.sub) |
| 133 | @Transactional | 156 | @Transactional |
| 134 | #end | 157 | #end |
| @@ -147,6 +170,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | @@ -147,6 +170,9 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service | ||
| 147 | * | 170 | * |
| 148 | * @param ${className} ${functionName}对象 | 171 | * @param ${className} ${functionName}对象 |
| 149 | */ | 172 | */ |
| 173 | + #if($dataSource) | ||
| 174 | + @DataSource(${dataSource}) | ||
| 175 | + #end | ||
| 150 | public void insert${subClassName}(${ClassName} ${className}) | 176 | public void insert${subClassName}(${ClassName} ${className}) |
| 151 | { | 177 | { |
| 152 | List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List(); | 178 | List<${subClassName}> ${subclassName}List = ${className}.get${subClassName}List(); |
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | 3 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 4 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | 4 | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 5 | <parent> | 5 | <parent> |
| 6 | - <artifactId>Luhui</artifactId> | 6 | + <artifactId>lh-modules</artifactId> |
| 7 | <groupId>com.zhonglai.luhui</groupId> | 7 | <groupId>com.zhonglai.luhui</groupId> |
| 8 | <version>1.0-SNAPSHOT</version> | 8 | <version>1.0-SNAPSHOT</version> |
| 9 | </parent> | 9 | </parent> |
-
请 注册 或 登录 后发表评论