模块:实验室管理
新增:实验室课题组多选
提出:秦老师
| | |
| | | return; |
| | | } |
| | | |
| | | //实体类重新获取项目组信息 |
| | | sysLaboratory.setProject(null); |
| | | sysLaboratory.getProject(); |
| | | this.sysLaboratoryService.updateSysLaboratory(sysLaboratory); |
| | | |
| | | FacesUtils.info("修改成功。"); |
| | |
| | | </select> |
| | | |
| | | <insert id="insertSysLaboratory" parameterType="com.nanometer.smartlab.entity.SysLaboratory"> |
| | | insert into sys_laboratory(id, type, name, info_code, bar_code, location1, location2, valid_flag,department, create_time, update_time) |
| | | values (#{id}, #{type}, #{name}, #{infoCode}, #{barCode}, #{location1}, #{location2}, 1,#{department}, now(), now()) |
| | | insert into sys_laboratory(id, type, name, info_code, bar_code, location1, location2, valid_flag,department, create_time, update_time,project) |
| | | values (#{id}, #{type}, #{name}, #{infoCode}, #{barCode}, #{location1}, #{location2}, 1,#{department}, now(), now(),#{project}) |
| | | </insert> |
| | | |
| | | <update id="updateSysLaboratory" parameterType="com.nanometer.smartlab.entity.SysLaboratory"> |
| | | update sys_laboratory set type=#{type}, name=#{name}, info_code=#{infoCode}, bar_code=#{barCode}, location1=#{location1}, location2=#{location2},department=#{department}, |
| | | update_time=now() |
| | | update_time=now(),project = #{project} |
| | | where id=#{id} |
| | | </update> |
| | | |
| | |
| | | public List<SysProject> getSysProjectListByProjectId(Map params) throws DataAccessException; |
| | | |
| | | void insertBatch(List<?> list); |
| | | |
| | | //获取不重复的课题组名 |
| | | List<SysProject> selectDistinctProjects(); |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectDistinctProjects" parameterType="java.util.Map" resultMap="SysProject"> |
| | | SELECT |
| | | sp.* |
| | | FROM |
| | | sys_project sp |
| | | WHERE sp.valid_flag = 1 |
| | | AND sp.project is not null |
| | | GROUP BY |
| | | sp.project |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertBatch" parameterType="java.util.List"> |
| | | insert into sys_project |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by johnny on 17/11/23. |
| | |
| | | private Timestamp createTime; |
| | | private Timestamp updateTime; |
| | | private ValidFlag validFlag; |
| | | //显示 |
| | | private List<String> projects; |
| | | //存放 |
| | | private String project; |
| | | |
| | | public String getId() { |
| | | return id; |
| | |
| | | this.validFlag = validFlag; |
| | | } |
| | | |
| | | public String getDepartment() { |
| | | return department; |
| | | } |
| | | public String getDepartment() { |
| | | return department; |
| | | } |
| | | |
| | | public void setDepartment(String department) { |
| | | this.department = department; |
| | | } |
| | | public void setDepartment(String department) { |
| | | this.department = department; |
| | | } |
| | | |
| | | public List<String> getProjects() { |
| | | if (projects == null && project != null){ |
| | | this.projects = Arrays.asList(this.project.split(",")); |
| | | } |
| | | return projects; |
| | | } |
| | | |
| | | public void setProjects(List<String> projects) { |
| | | this.projects = projects; |
| | | } |
| | | |
| | | public String getProject() { |
| | | if (this.project == null){ |
| | | this.project = ""; |
| | | if (projects != null && projects.size() > 0) { |
| | | projects.forEach(pro->{ |
| | | this.project += ","; |
| | | this.project += pro; |
| | | }); |
| | | this.project = this.project.substring(1); |
| | | } |
| | | } |
| | | return project; |
| | | } |
| | | |
| | | public void setProject(String project) { |
| | | this.project = project; |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public List<SysProject> getAll() { |
| | | return sysProjectDao.getSysProjectList(null).stream().filter(project->project.getProject()!=null).collect(Collectors.toList()); |
| | | return sysProjectDao.selectDistinctProjects(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | <h:outputText value="#{row.name}"></h:outputText> |
| | | </p:column> |
| | | |
| | | <p:column headerText="所属项目组"> |
| | | <h:outputText value="#{row.project}"></h:outputText> |
| | | </p:column> |
| | | |
| | | <p:column headerText="状态码"> |
| | | <h:outputText value="#{row.infoCode}"></h:outputText> |
| | | </p:column> |
| | |
| | | <f:selectItems value="#{baseMetaService.getBaseMetaList(constants.BASE_META_GROUP_USER_DEPARTMENT)}" |
| | | var="item" itemLabel="#{item.metaValue}" itemValue="#{item.id}"></f:selectItems> |
| | | </p:selectOneMenu> |
| | | |
| | | |
| | | <p:outputLabel value="所属课题组" for="multiple"/> |
| | | <p:selectCheckboxMenu id="multiple" value="#{laboratoryMngController.sysLaboratory.projects}" label="Cities" multiple="true" |
| | | filter="true" filterMatchMode="startsWith" panelStyle="width:250px"> |
| | | <f:selectItems value="#{sysProjectServiceImpl.getAll()}" var="item" itemValue="#{item.project}" itemLabel="#{item.project}"/> |
| | | </p:selectCheckboxMenu> |
| | | </p:panelGrid> |
| | | <p:panel styleClass="btn"> |
| | | <p:commandButton value="保存" |