给角色模块增加价格屏蔽字段
This commit is contained in:
@@ -7,6 +7,8 @@ public class Role {
|
||||
|
||||
private String type;
|
||||
|
||||
private String priceLimit;
|
||||
|
||||
private String value;
|
||||
|
||||
private String description;
|
||||
@@ -43,6 +45,14 @@ public class Role {
|
||||
this.type = type == null ? null : type.trim();
|
||||
}
|
||||
|
||||
public String getPriceLimit() {
|
||||
return priceLimit;
|
||||
}
|
||||
|
||||
public void setPriceLimit(String priceLimit) {
|
||||
this.priceLimit = priceLimit == null ? null : priceLimit.trim();
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -304,6 +304,76 @@ public class RoleExample {
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitIsNull() {
|
||||
addCriterion("price_limit is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitIsNotNull() {
|
||||
addCriterion("price_limit is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitEqualTo(String value) {
|
||||
addCriterion("price_limit =", value, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitNotEqualTo(String value) {
|
||||
addCriterion("price_limit <>", value, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitGreaterThan(String value) {
|
||||
addCriterion("price_limit >", value, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("price_limit >=", value, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitLessThan(String value) {
|
||||
addCriterion("price_limit <", value, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitLessThanOrEqualTo(String value) {
|
||||
addCriterion("price_limit <=", value, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitLike(String value) {
|
||||
addCriterion("price_limit like", value, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitNotLike(String value) {
|
||||
addCriterion("price_limit not like", value, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitIn(List<String> values) {
|
||||
addCriterion("price_limit in", values, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitNotIn(List<String> values) {
|
||||
addCriterion("price_limit not in", values, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitBetween(String value1, String value2) {
|
||||
addCriterion("price_limit between", value1, value2, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andPriceLimitNotBetween(String value1, String value2) {
|
||||
addCriterion("price_limit not between", value1, value2, "priceLimit");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andValueIsNull() {
|
||||
addCriterion("value is null");
|
||||
return (Criteria) this;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jsh.erp.datasource.mappers;
|
||||
|
||||
import com.jsh.erp.datasource.entities.Role;
|
||||
import com.jsh.erp.datasource.entities.RoleEx;
|
||||
import com.jsh.erp.datasource.entities.RoleExample;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@@ -9,7 +10,7 @@ import java.util.List;
|
||||
|
||||
public interface RoleMapperEx {
|
||||
|
||||
List<Role> selectByConditionRole(
|
||||
List<RoleEx> selectByConditionRole(
|
||||
@Param("name") String name,
|
||||
@Param("offset") Integer offset,
|
||||
@Param("rows") Integer rows);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.jsh.erp.service.role;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jsh.erp.constants.BusinessConstants;
|
||||
import com.jsh.erp.datasource.entities.Role;
|
||||
import com.jsh.erp.datasource.entities.RoleEx;
|
||||
import com.jsh.erp.datasource.entities.RoleExample;
|
||||
import com.jsh.erp.datasource.entities.User;
|
||||
import com.jsh.erp.datasource.mappers.RoleMapper;
|
||||
@@ -73,10 +74,19 @@ public class RoleService {
|
||||
return list;
|
||||
}
|
||||
|
||||
public List<Role> select(String name, int offset, int rows)throws Exception {
|
||||
List<Role> list=null;
|
||||
public List<RoleEx> select(String name, int offset, int rows)throws Exception {
|
||||
List<RoleEx> list=null;
|
||||
try{
|
||||
list=roleMapperEx.selectByConditionRole(name, offset, rows);
|
||||
for(RoleEx roleEx: list) {
|
||||
String priceLimit = roleEx.getPriceLimit();
|
||||
if(StringUtil.isNotEmpty(priceLimit)) {
|
||||
String priceLimitStr = priceLimit.replace("1", "屏蔽采购价")
|
||||
.replace("2", "屏蔽零售价")
|
||||
.replace("3", "屏蔽销售价");
|
||||
roleEx.setPriceLimitStr(priceLimitStr);
|
||||
}
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user