| | |
| | | return dataModel; |
| | | } |
| | | |
| | | public void exportLab2Excel(){ |
| | | try { |
| | | List<Map> list = sysUserService.getExportUserList(arp, name,departmentName,project,company); |
| | | sysUserService.exportUser2Excel(list); |
| | | FacesUtils.info("导出成功"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | FacesUtils.warn("导出失败"); |
| | | } |
| | | } |
| | | |
| | | public SysUser getSysUser() { |
| | | return sysUser; |
| | | } |
| | |
| | | int getUserCountInProject(Map params); |
| | | |
| | | List<SysUser> getUserInProject(Map params); |
| | | |
| | | List<Map> getExportUserList(@Param("arp") String arp,@Param("name") String name, @Param("departmentName") String departmentName, |
| | | @Param("project") String project,@Param("company") String company); |
| | | } |
| | |
| | | |
| | | <select id="getSysUserByIdCard" parameterType="java.lang.String" resultMap="SysUser" > |
| | | select * from sys_user |
| | | where id_card = #{idCard} and valid_flag = 1 |
| | | where id_card = #{idCard} |
| | | and valid_flag = 1 |
| | | limit 1 |
| | | </select> |
| | | |
| | | <select id="getSysUserList" parameterType="java.util.Map" resultMap="SysUser"> |
| | |
| | | limit #{first}, #{pageSize} |
| | | </if> |
| | | </select> |
| | | <select id="getExportUserList" resultType="Map"> |
| | | select |
| | | bm.meta_value AS departmentName, |
| | | bm1.meta_value AS companyName, |
| | | su.project, |
| | | su.arp, |
| | | su.name, |
| | | su.account, |
| | | su.id_card as idCard, |
| | | su.phone, |
| | | su.email, |
| | | su.memo, |
| | | br. NAME AS roleName, |
| | | CASE WHEN su.approver_flag=0 then '否' else '是' END AS approver, |
| | | CASE WHEN su.see_flag=2 then '一般人员' WHEN su.see_flag=3 then '安全员' WHEN su.see_flag=11 then '系统管理员'WHEN su.see_flag=0 then '实验室管理员' END AS seeName, |
| | | CASE WHEN su.waster=2 then '危废管理员' WHEN su.waster=1 then '危废处理人员' else '' END AS wasterName, |
| | | su.update_time as updateTime |
| | | from sys_user as su |
| | | left join base_role as br on su.role_id = br.id |
| | | left join base_meta bm on su.department = bm.id |
| | | left join base_meta bm1 on bm1.id = su.company |
| | | <where> |
| | | su.valid_flag = 1 |
| | | <if test="arp != null and arp != ''"> |
| | | and su.arp like #{arp} |
| | | </if> |
| | | <if test="name != null and name != ''"> |
| | | and su.name like #{name} |
| | | </if> |
| | | <if test="departmentName != null and departmentName != ''"> |
| | | and su.department like concat("%",#{departmentName},"%") |
| | | </if> |
| | | <if test="project != null and project != ''"> |
| | | and su.project like concat("%",#{project},"%") |
| | | </if> |
| | | <if test="company != null and company != ''"> |
| | | and bm1.meta_value like concat("%",#{company},"%") |
| | | </if> |
| | | </where> |
| | | order by su.arp ASC |
| | | </select> |
| | | <update id="updateUserPointBySelective" parameterType="java.util.Map"> |
| | | update sys_user set point=#{point} |
| | | <where> |
| | |
| | | List<LaboratoryVo.LaboratoryUser> getUserByProject(String project); |
| | | |
| | | List<SysUser> getUserByArp(String arp); |
| | | |
| | | List<Map> getExportUserList(String arp, String name, String departmentName, String project, String company); |
| | | |
| | | void exportUser2Excel(List<Map> list)throws Exception; |
| | | } |
| | |
| | | import com.nanometer.smartlab.exception.AlarmException; |
| | | import com.nanometer.smartlab.exception.BusinessException; |
| | | import com.nanometer.smartlab.exception.ExceptionEnumCode; |
| | | import com.nanometer.smartlab.util.ExcelUtils; |
| | | import com.nanometer.smartlab.util.FacesUtils; |
| | | import com.nanometer.smartlab.util.IDUtils; |
| | | import com.nanometer.smartlab.util.MessageUtil; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by johnny on 17/11/20. |
| | |
| | | return sysUserDao.getUserByArp(arp); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map> getExportUserList(String arp, String name, String departmentName, String project, String company) { |
| | | return sysUserDao.getExportUserList(arp, name, departmentName, project, company); |
| | | } |
| | | |
| | | @Override |
| | | public void exportUser2Excel(List<Map> list)throws Exception { |
| | | Map<String, String> map = new LinkedHashMap<>(); |
| | | map.put("companyName", "单位"); |
| | | map.put("departmentName", "部门"); |
| | | map.put("project", "课题组"); |
| | | map.put("arp", "ARP"); |
| | | map.put("name", "姓名"); |
| | | map.put("account", "账号"); |
| | | map.put("idCard", "ID卡号"); |
| | | map.put("phone", "电话"); |
| | | map.put("email", "邮箱"); |
| | | map.put("memo", "备注"); |
| | | map.put("roleName", "角色"); |
| | | map.put("approver", "审批者"); |
| | | map.put("seeName", "可见度"); |
| | | map.put("wasterName", "危废人员"); |
| | | map.put("updateTime", "更新时间"); |
| | | ExcelUtils.export2Excel(list,"人员信息",map); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | </p:panelGrid> |
| | | </p:panel> |
| | | <p:panel styleClass="center-body"> |
| | | <p:panelGrid columns="5" styleClass="btn"> |
| | | <p:panelGrid columns="6" styleClass="btn"> |
| | | <p:commandButton value="新建" styleClass="new-btn" |
| | | process="@form" |
| | | actionListener="#{userMngController.onNewBtnClick}" |
| | |
| | | <p:outputLabel rendered="#{userMngController.isAccess('导入')}"> |
| | | <a href="resources/template/用户导入模板.xlsx" style="display: inline-block;"><img src="resources/images/xlsx.png" width="30px;" alt=""/></a> |
| | | </p:outputLabel> |
| | | <p:commandButton value="导出" styleClass="new-btn" ajax="false" actionListener="#{userMngController.exportLab2Excel}" |
| | | /> |
| | | <script> |
| | | function importUser(){ |
| | | $("#userMngForm\\:importUserBtn_input").click(); |