diff --git a/jshERP-boot/docs/jsh_erp.sql b/jshERP-boot/docs/jsh_erp.sql index b66b9a8a..20ebf0d3 100644 --- a/jshERP-boot/docs/jsh_erp.sql +++ b/jshERP-boot/docs/jsh_erp.sql @@ -719,6 +719,7 @@ CREATE TABLE `jsh_role` ( `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键', `name` varchar(50) DEFAULT NULL COMMENT '名称', `type` varchar(50) DEFAULT NULL COMMENT '类型', + `price_limit` varchar(50) DEFAULT NULL COMMENT '价格屏蔽 1-屏蔽采购价 2-屏蔽零售价 3-屏蔽销售价', `value` varchar(200) DEFAULT NULL COMMENT '值', `description` varchar(100) DEFAULT NULL COMMENT '描述', `enabled` bit(1) DEFAULT NULL COMMENT '启用', @@ -731,10 +732,10 @@ CREATE TABLE `jsh_role` ( -- ---------------------------- -- Records of jsh_role -- ---------------------------- -INSERT INTO `jsh_role` VALUES ('4', '管理员', '全部数据', null, null, '', null, null, '0'); -INSERT INTO `jsh_role` VALUES ('10', '租户', '全部数据', null, '', '', null, null, '0'); -INSERT INTO `jsh_role` VALUES ('16', '销售经理', '全部数据', null, 'ddd', '', null, '63', '0'); -INSERT INTO `jsh_role` VALUES ('17', '销售代表', '个人数据', null, 'rrr', '', null, '63', '0'); +INSERT INTO `jsh_role` VALUES ('4', '管理员', '全部数据', null, null, null, '', null, null, '0'); +INSERT INTO `jsh_role` VALUES ('10', '租户', '全部数据', null, null, '', '', null, null, '0'); +INSERT INTO `jsh_role` VALUES ('16', '销售经理', '全部数据', null, null, 'ddd', '', null, '63', '0'); +INSERT INTO `jsh_role` VALUES ('17', '销售代表', '个人数据', null, null, 'rrr', '', null, '63', '0'); -- ---------------------------- -- Table structure for jsh_sequence diff --git a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt index 68f1fd4e..a09d1016 100644 --- a/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt +++ b/jshERP-boot/docs/数据库更新记录-首次安装请勿使用.txt @@ -1414,4 +1414,11 @@ alter table jsh_account_head change remark remark varchar(1000) DEFAULT NULL COM -- by jishenghua -- 给单据明细增加采购单价字段 -- -------------------------------------------------------- -alter table jsh_depot_item add purchase_unit_price decimal(24,6) DEFAULT NULL COMMENT '采购单价' after unit_price; \ No newline at end of file +alter table jsh_depot_item add purchase_unit_price decimal(24,6) DEFAULT NULL COMMENT '采购单价' after unit_price; + +-- -------------------------------------------------------- +-- 时间 2022年10月23日 +-- by jishenghua +-- 给角色表增加价格屏蔽字段 +-- -------------------------------------------------------- +alter table jsh_role add price_limit varchar(50) DEFAULT NULL COMMENT '价格屏蔽 1-屏蔽采购价 2-屏蔽零售价 3-屏蔽销售价' after type; \ No newline at end of file diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/Role.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/Role.java index 346fa26b..b5c67c3b 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/Role.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/Role.java @@ -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; } diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/RoleExample.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/RoleExample.java index 47bbd308..22b12152 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/RoleExample.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/entities/RoleExample.java @@ -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 values) { + addCriterion("price_limit in", values, "priceLimit"); + return (Criteria) this; + } + + public Criteria andPriceLimitNotIn(List 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; diff --git a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java index 9f8977e5..43e24142 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/RoleMapperEx.java @@ -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 selectByConditionRole( + List selectByConditionRole( @Param("name") String name, @Param("offset") Integer offset, @Param("rows") Integer rows); diff --git a/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleService.java b/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleService.java index 60fc5c34..47d59901 100644 --- a/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleService.java +++ b/jshERP-boot/src/main/java/com/jsh/erp/service/role/RoleService.java @@ -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 select(String name, int offset, int rows)throws Exception { - List list=null; + public List select(String name, int offset, int rows)throws Exception { + List 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); } diff --git a/jshERP-boot/src/main/resources/mapper_xml/RoleMapper.xml b/jshERP-boot/src/main/resources/mapper_xml/RoleMapper.xml index e95f1105..1569037d 100644 --- a/jshERP-boot/src/main/resources/mapper_xml/RoleMapper.xml +++ b/jshERP-boot/src/main/resources/mapper_xml/RoleMapper.xml @@ -5,6 +5,7 @@ + @@ -71,7 +72,7 @@ - id, name, type, value, description, enabled, sort, tenant_id, delete_flag + id, name, type, price_limit, value, description, enabled, sort, tenant_id, delete_flag + + +