Merge remote-tracking branch 'origin/master'
| | |
| | | private Integer orderNum; |
| | | private String deptType; |
| | | private String deptFunction; |
| | | private String allDeptName; |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String deptFunctionName; |
| | | |
| | | @FieldInfo(name = "allDeptName", type = "varchar", explain = "部门全称") |
| | | @TableField("allDeptName") |
| | | private String allDeptName = ""; |
| | | |
| | | |
| | | private transient String createTimeFrom; |
| | | |
| | | private transient String createTimeTo; |
| | |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("image/{accessoryid}") |
| | | public void getImage(@PathVariable String accessoryid, HttpServletResponse response) throws FebsException { |
| | | try { |
| | | this.empAccessoryService.getImage(accessoryid,response); |
| | | } catch (Exception e) { |
| | | String message = "获取员工图片异常"; |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | } |
| | |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("image/{filesid}") |
| | | public void getImage(@PathVariable String filesid, HttpServletResponse response) throws FebsException { |
| | | try { |
| | | this.filesUploadService.getImage(filesid,response); |
| | | } catch (Exception e) { |
| | | String message = "获取员工图片异常"; |
| | | log.error(message, e); |
| | | throw new FebsException(message); |
| | | } |
| | | } |
| | | } |
| | |
| | | @ExcelField(value = "档案号") |
| | | private String archivesNumb = ""; |
| | | |
| | | //@FieldInfo(name = "deptId", type = "bigint", explain = "部门Id") |
| | | @FieldInfo(name = "deptId", type = "bigint", explain = "部门Id") |
| | | @TableField("deptId") |
| | | private Long deptId = 0L; |
| | | |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private String inOutType; |
| | | |
| | | @FieldInfo(name = "allDeptName", type = "varchar", explain = "部门全称") |
| | | @TableField("allDeptName") |
| | | private String allDeptName = ""; |
| | | } |
| | |
| | | |
| | | |
| | | void autoInstall(String fileids); |
| | | |
| | | void getImage(String accessoryid,HttpServletResponse response) throws Exception; |
| | | } |
| | |
| | | void download(String fileids, HttpServletRequest request, HttpServletResponse response); |
| | | |
| | | void mvFiles(String fileids,Long folderid); |
| | | |
| | | void getImage(String filesid,HttpServletResponse response) throws Exception; |
| | | } |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.*; |
| | | import java.util.*; |
| | | import java.util.logging.Logger; |
| | | |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void getImage(String accessoryid, HttpServletResponse response) throws Exception { |
| | | EmpAccessory empAccessory = this.getById(accessoryid); |
| | | if (StrUtil.isBlank(empAccessory.getFilesaddress())) { |
| | | return; |
| | | } |
| | | EmpBaseInfo empBaseInfo = empBaseInfoService.getById(empAccessory.getEmpid()); |
| | | String nameAndCertificateNumb = empBaseInfo.getEmpName() + "_" + empBaseInfo.getCertificateNumb() + "/"; |
| | | String path = properties.getUploadSinglePath() + nameAndCertificateNumb + empAccessory.getFilesaddress(); |
| | | try (InputStream inputStream = new FileInputStream(path); OutputStream out = response.getOutputStream()) { |
| | | //byte数组用于存放图片字节数据 |
| | | byte[] buff = new byte[inputStream.available()]; |
| | | inputStream.read(buff); |
| | | inputStream.close(); |
| | | if (empAccessory.getFilesformat().equals("tif")){ |
| | | //设置发送到客户端的响应内容类型 |
| | | response.setContentType("image/tiff"); |
| | | }else if (empAccessory.getFilesformat().equals("bmp")){ |
| | | response.setContentType("application/x-bmp"); |
| | | }else if (empAccessory.getFilesformat().equals("jpg")){ |
| | | response.setContentType("image/jpeg"); |
| | | }else if (empAccessory.getFilesformat().equals("png")){ |
| | | response.setContentType("image/png"); |
| | | }else if (empAccessory.getFilesformat().equals("gif")){ |
| | | response.setContentType("image/gif"); |
| | | } |
| | | out.write(buff); |
| | | } |
| | | } |
| | | } |
| | |
| | | Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | IPage<EmpBaseInfo> iPage = empBaseInfoMapper.selectPageVo(page, createQueryWrapper(empBaseInfo)); |
| | | //设置部门 |
| | | List<EmpBaseInfo> list = setDeptName(iPage.getRecords()); |
| | | // List<EmpBaseInfo> list = setDeptName(iPage.getRecords()); |
| | | List<EmpBaseInfo> list = iPage.getRecords(); |
| | | List<DicItem> dicItems = CastUtil.castList(redisService.get("dicItems"), DicItem.class); |
| | | list.forEach(p -> { |
| | | p.setSexName("1".equals(p.getSex()) ? "男" : "女"); |
| | |
| | | .filter(k -> k.getDeptId().equals(empBaseInfo.getDeptId())) |
| | | .findFirst() |
| | | .map(Dept::getDeptName) |
| | | .orElse("")); |
| | | empBaseInfo.setAllDeptName(depts.stream() |
| | | .filter(k -> k.getDeptId().equals(empBaseInfo.getDeptId())) |
| | | .findFirst() |
| | | .map(Dept::getAllDeptName) |
| | | .orElse("")); |
| | | } |
| | | return empBaseInfoList; |
| | |
| | | if (StringUtils.isNotBlank(empBaseInfo.getBaseKey())) { |
| | | queryWrapper.and(p -> { |
| | | p.like("a.EmpNumb", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.EmpName", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.DeptName", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.allDeptName", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.empName", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.CertificateNumb", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.archivesNumb", empBaseInfo.getBaseKey()); |
| | | p.or().like("a.stature", empBaseInfo.getBaseKey()); |
| | |
| | | queryWrapper.like("a.EmpName", empBaseInfo.getEmpName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getDeptName())) { |
| | | queryWrapper.like("a.DeptName", empBaseInfo.getDeptName()); |
| | | queryWrapper.like("a.allDeptName", empBaseInfo.getDeptName()); |
| | | } |
| | | if (StringUtils.isNotBlank(empBaseInfo.getCertificateNumb())) { |
| | | queryWrapper.like("a.CertificateNumb", empBaseInfo.getCertificateNumb()); |
| | |
| | | List<EmpBaseInfo> exportList = this.findZsEmpBaseInfos(request, empBaseinfo).getRecords(); |
| | | List<Map<String, Object>> listMapDicItem = new ArrayList(); |
| | | listMapDicItem.add(map); |
| | | String exportField = FebsUtil.reflectAnnotation(EmpBaseInfo.class); |
| | | List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, listMapDicItem); |
| | | String exportField = "archivesNumb, deptName, jobName, empName, certificateNumb, certificateValidity, sexName, nationName, age, marriageName, stature, birthdate, politicsName, empTypeName, educationName, nativePlaceName, censusAddress, currentAddress, guardNumb, returnReceipt, archivesStatusName, bankName, bankNumb, telePhone, entryDate, InsuranceTypeName, socialNumb, introducer, seniority, empCardStatusName, certificateList, urgencyPhone, handbookStatusName, family, empStatusName, dimissionDate"; |
| | | List<Map<String, Object>> allList = PoiExportExcel.getDataList(exportField, exportList, null); |
| | | Page<EmpBaseInfo> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | List<Long> empIds = exportList.stream().map(i -> i.getEmpId()).collect(Collectors.toList()); |
| | | |
| | |
| | | this.update(wapper); |
| | | |
| | | } |
| | | @Override |
| | | public void getImage(String filesid, HttpServletResponse response) throws Exception { |
| | | FilesUpload filesUpload = this.getById(filesid); |
| | | if (StrUtil.isBlank(filesUpload.getFilesaddress())) { |
| | | return; |
| | | } |
| | | Folder folder = iFolderService.getById(filesUpload.getFolderid()); |
| | | String path = properties.getUploadCommonPath() + folder.getFoldername() + "/" + filesUpload.getFilesaddress(); |
| | | try (InputStream inputStream = new FileInputStream(path); OutputStream out = response.getOutputStream()) { |
| | | //byte数组用于存放图片字节数据 |
| | | byte[] buff = new byte[inputStream.available()]; |
| | | inputStream.read(buff); |
| | | inputStream.close(); |
| | | if (filesUpload.getFilesformat().equals("tif")){ |
| | | //设置发送到客户端的响应内容类型 |
| | | response.setContentType("image/tiff"); |
| | | }else if (filesUpload.getFilesformat().equals("bmp")){ |
| | | response.setContentType("application/x-bmp"); |
| | | }else if (filesUpload.getFilesformat().equals("jpg")){ |
| | | response.setContentType("image/jpeg"); |
| | | }else if (filesUpload.getFilesformat().equals("png")){ |
| | | response.setContentType("image/png"); |
| | | }else if (filesUpload.getFilesformat().equals("gif")){ |
| | | response.setContentType("image/gif"); |
| | | } |
| | | out.write(buff); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | import cc.mrbird.febs.common.core.entity.system.Dept; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Update; |
| | | |
| | | /** |
| | | * @author MrBird |
| | | */ |
| | | public interface DeptMapper extends BaseMapper<Dept> { |
| | | |
| | | @Update("<script>" + |
| | | " update t_dept\n" + |
| | | " set allDeptName = replace(allDeptName, #{fromName}, #{toName})" + |
| | | " where allDeptName like #{queryParam}" + |
| | | "</script>") |
| | | public void changeAllDeptName(@Param("fromName") String fromName, @Param("toName") String toName,@Param("queryParam") String queryParam); |
| | | } |
| | |
| | | import cc.mrbird.febs.common.core.entity.constant.StringConstant; |
| | | import cc.mrbird.febs.common.core.entity.system.Dept; |
| | | import cc.mrbird.febs.common.core.entity.system.DicItem; |
| | | import cc.mrbird.febs.common.core.entity.system.UserDataPermission; |
| | | import cc.mrbird.febs.common.core.utils.FebsUtil; |
| | | import cc.mrbird.febs.common.core.utils.SequenceUtil; |
| | | import cc.mrbird.febs.common.core.utils.SortUtil; |
| | |
| | | public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService { |
| | | private final RedisService redisService; |
| | | private final IUserDataPermissionService userDataPermissionService; |
| | | private final DeptMapper deptMapper; |
| | | |
| | | @Override |
| | | public Map<String, Object> findDepts(QueryRequest request, Dept dept) { |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void createDept(Dept dept) { |
| | | dept.setDeptId(SequenceUtil.generateId(0L, ModuleCode.FRAM_SYSTEM)); |
| | | long deptId = SequenceUtil.generateId(0L, ModuleCode.FRAM_SYSTEM); |
| | | dept.setDeptId(deptId); |
| | | if (dept.getParentId() == null) { |
| | | dept.setParentId(Dept.TOP_DEPT_ID); |
| | | } |
| | | dept.setAllDeptName(createALlDeptName(dept)); |
| | | dept.setCreateTime(new Date()); |
| | | this.save(dept); |
| | | |
| | | UserDataPermission userDataPermission = new UserDataPermission(); |
| | | userDataPermission.setDeptId(deptId); |
| | | userDataPermission.setUserId(Long.parseLong(FebsUtil.getUserId())); |
| | | userDataPermissionService.save(userDataPermission); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (dept.getParentId() == null) { |
| | | dept.setParentId(Dept.TOP_DEPT_ID); |
| | | } |
| | | String oldAllName = dept.getAllDeptName(); |
| | | String newAllName = createALlDeptName(dept); |
| | | dept.setModifyTime(new Date()); |
| | | this.baseMapper.updateById(dept); |
| | | |
| | | deptMapper.changeAllDeptName(oldAllName,newAllName,oldAllName + "%"); |
| | | } |
| | | |
| | | @Override |
| | |
| | | tree.setOrderNum(dept.getOrderNum()); |
| | | tree.setDeptFunction(dept.getDeptFunction()); |
| | | tree.setDeptType(dept.getDeptType()); |
| | | tree.setAllDeptName(dept.getAllDeptName()); |
| | | trees.add(tree); |
| | | }); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private String createALlDeptName(Dept dept){ |
| | | Dept parent = this.getById(dept.getParentId()); |
| | | return parent.getAllDeptName() + "/" + dept.getDeptName(); |
| | | } |
| | | } |