Browse Source

update:内容管理新增分部

yonge 4 years ago
parent
commit
b8c7d5580f

+ 11 - 0
cms/src/main/java/com/ym/mec/cms/controller/queryinfo/NewsInformationQueryInfo.java

@@ -30,6 +30,9 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	@ApiModelProperty(value = "声部编号", required = false)
 	private Integer subjectId;
 	
+	@ApiModelProperty(value = "分部编号", required = false)
+	private Integer organId;
+	
 	private String clientName;
 	
 	private Date date;
@@ -105,4 +108,12 @@ public class NewsInformationQueryInfo extends QueryInfo {
 	public void setSubjectId(Integer subjectId) {
 		this.subjectId = subjectId;
 	}
+
+	public Integer getOrganId() {
+		return organId;
+	}
+
+	public void setOrganId(Integer organId) {
+		this.organId = organId;
+	}
 }

+ 10 - 0
cms/src/main/java/com/ym/mec/cms/dal/entity/SysNewsInformation.java

@@ -75,6 +75,8 @@ public class SysNewsInformation {
 	
 	private String subjectIdList;
 	
+	private String organIdList;
+	
 	private String subjectName;
 
 	public String getLinkUrl() {
@@ -245,6 +247,14 @@ public class SysNewsInformation {
 		this.subjectIdList = subjectIdList;
 	}
 
+	public String getOrganIdList() {
+		return organIdList;
+	}
+
+	public void setOrganIdList(String organIdList) {
+		this.organIdList = organIdList;
+	}
+
 	public String getSubjectName() {
 		return subjectName;
 	}

+ 4 - 0
cms/src/main/java/com/ym/mec/cms/service/impl/SysNewsInformationServiceImpl.java

@@ -70,6 +70,10 @@ public class SysNewsInformationServiceImpl extends BaseServiceImpl<Long, SysNews
 			queryInfo.setTenantId(1);
 		}
 		
+		if(queryInfo.getTenantId() == 1){
+			queryInfo.setOrganId(user.getOrganId());
+		}
+		
 		String memo = queryInfo.getMemo();
 		
 		Map<String, Object> params = new HashMap<String, Object>();

+ 7 - 0
cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -28,6 +28,7 @@
 		<result column="attribute1_" property="attribute1" />
 		<result column="attribute2_" property="attribute2" />
 		<result column="subject_id_list_" property="subjectIdList" />
+		<result column="organ_id_list_" property="organIdList" />
 		<result column="subject_name_" property="subjectName" />
 	</resultMap>
 	
@@ -214,6 +215,9 @@
 			<if test="subjectId != null">
 				and find_in_set(#{subjectId},sni.subject_id_list_)
 			</if>
+			<if test="organId != null">
+				and (find_in_set(#{organId},sni.organ_id_list_) or sni.organ_id_list_ is null)
+			</if>
 		<if test="clientName != 'manage'">
 			<choose>
 				<when test="memo != null and memo != ''">
@@ -254,6 +258,9 @@
 			<if test="subjectId != null">
 				and find_in_set(#{subjectId},sni.subject_id_list_)
 			</if>
+			<if test="organId != null">
+				and (find_in_set(#{organId},sni.organ_id_list_) or sni.organ_id_list_ is null)
+			</if>
 		<if test="clientName != 'manage'">
 			<choose>
 				<when test="memo != null and memo != ''">