Commit 1fee7b49 authored by luben's avatar luben

Merge branch 'dev-lb' into 'dev'

Dev lb

See merge request !28
parents 2a1494fa 5b8c2cfa
...@@ -59,8 +59,15 @@ public class Labels implements Serializable { ...@@ -59,8 +59,15 @@ public class Labels implements Serializable {
private String ylzd5; private String ylzd5;
//适用范围
private String scope;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public String getScope(){return scope;}
public void setScope(String scope){this.scope = scope;}
public String getId() { public String getId() {
return id; return id;
} }
......
...@@ -598,6 +598,11 @@ public class LabelsExample implements Serializable { ...@@ -598,6 +598,11 @@ public class LabelsExample implements Serializable {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andScopeLike(String value) {
addCriterion("scope like", value, "scope");
return (Criteria) this;
}
public Criteria andYlzd1IsNull() { public Criteria andYlzd1IsNull() {
addCriterion("ylzd1 is null"); addCriterion("ylzd1 is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -11,6 +11,11 @@ public class LabelsVO { ...@@ -11,6 +11,11 @@ public class LabelsVO {
private String code; private String code;
private Integer pageNum; private Integer pageNum;
private Integer pageSize; private Integer pageSize;
private String scope;
public String getScope(){return scope;}
public void setScope(String scope){this.scope = scope;}
public String getId() { public String getId() {
return Id; return Id;
......
...@@ -86,6 +86,7 @@ public class LabelsFacadeService { ...@@ -86,6 +86,7 @@ public class LabelsFacadeService {
bsCommon.setParentId(body.getParentId()); bsCommon.setParentId(body.getParentId());
bsCommon.setIsValid(body.getIsValid()); bsCommon.setIsValid(body.getIsValid());
bsCommon.setSort(body.getSort()); bsCommon.setSort(body.getSort());
bsCommon.setScope(body.getScope());
bsCommon.setYlzd1(body.getYlzd1()); bsCommon.setYlzd1(body.getYlzd1());
bsCommon.setYlzd2(body.getYlzd2()); bsCommon.setYlzd2(body.getYlzd2());
bsCommon.setYlzd3(body.getYlzd3()); bsCommon.setYlzd3(body.getYlzd3());
...@@ -200,12 +201,25 @@ public class LabelsFacadeService { ...@@ -200,12 +201,25 @@ public class LabelsFacadeService {
if(StringUtils.isNotBlank(bsCommonVO.getCode())){ if(StringUtils.isNotBlank(bsCommonVO.getCode())){
criteria.andCodeLike("%"+bsCommonVO.getCode()+"%"); criteria.andCodeLike("%"+bsCommonVO.getCode()+"%");
} }
// if(StringUtils.isNotBlank(bsCommonVO.getScope())){
// criteria.andScopeLike("%"+bsCommonVO.getScope()+"%");
// }
} }
bsCommonExample.setOrderByClause(" sort + 0 "); bsCommonExample.setOrderByClause(" sort + 0 ");
List<Labels> bsCommons = bsCommonService.selectByExample(bsCommonExample); List<Labels> bsCommons = bsCommonService.selectByExample(bsCommonExample);
List<Map<String, Object>> jsTreeModels = convertFrBomsCommon(bsCommons); List<Map<String, Object>> jsTreeModels = convertFrBomsCommon(bsCommons);
if(bsCommonVO == null || StringUtils.isBlank(bsCommonVO.getScope())){
return AjaxResult.success("success", jsTreeModels); return AjaxResult.success("success", jsTreeModels);
} }
List<Map<String, Object>> res = new ArrayList<>();
for (Map<String, Object> map : jsTreeModels) {
String scope = (String) map.get("scope");
if(scope.contains(bsCommonVO.getScope())){
res.add(map);
}
}
return AjaxResult.success("success", res);
}
private List<Map<String, Object>> convertFrBomsCommon(List<Labels> bsCommons) { private List<Map<String, Object>> convertFrBomsCommon(List<Labels> bsCommons) {
List<Map<String, Object>> models = new ArrayList<>(); List<Map<String, Object>> models = new ArrayList<>();
...@@ -221,6 +235,7 @@ public class LabelsFacadeService { ...@@ -221,6 +235,7 @@ public class LabelsFacadeService {
model.put("parentId", bsCommon.getParentId()); model.put("parentId", bsCommon.getParentId());
model.put("isValid", bsCommon.getIsValid()); model.put("isValid", bsCommon.getIsValid());
model.put("sort", bsCommon.getSort()); model.put("sort", bsCommon.getSort());
model.put("scope", bsCommon.getScope());
List<Map<String, Object>> childrenDocTypes = convertFromWgCodeByParent(bsCommons, bsCommon.getId()); List<Map<String, Object>> childrenDocTypes = convertFromWgCodeByParent(bsCommons, bsCommon.getId());
model.put("child", childrenDocTypes); model.put("child", childrenDocTypes);
models.add(model); models.add(model);
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<result column="parent_id" jdbcType="VARCHAR" property="parentId" /> <result column="parent_id" jdbcType="VARCHAR" property="parentId" />
<result column="is_valid" jdbcType="VARCHAR" property="isValid" /> <result column="is_valid" jdbcType="VARCHAR" property="isValid" />
<result column="sort" jdbcType="VARCHAR" property="sort" /> <result column="sort" jdbcType="VARCHAR" property="sort" />
<result column="scope" jdbcType="VARCHAR" property="scope" />
<result column="ylzd1" jdbcType="VARCHAR" property="ylzd1" /> <result column="ylzd1" jdbcType="VARCHAR" property="ylzd1" />
<result column="ylzd2" jdbcType="VARCHAR" property="ylzd2" /> <result column="ylzd2" jdbcType="VARCHAR" property="ylzd2" />
<result column="ylzd3" jdbcType="VARCHAR" property="ylzd3" /> <result column="ylzd3" jdbcType="VARCHAR" property="ylzd3" />
...@@ -75,7 +76,7 @@ ...@@ -75,7 +76,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, code, name, description, parent_id, is_valid, sort, ylzd1, ylzd2, ylzd3, id, code, name, description, parent_id, is_valid, sort, ylzd1, ylzd2, ylzd3,
ylzd4, ylzd5 ylzd4, ylzd5, scope
</sql> </sql>
<select id="selectByExample" parameterType="com.ruoyi.system.domain.other.BsCommonExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ruoyi.system.domain.other.BsCommonExample" resultMap="BaseResultMap">
select select
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment