| | |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.weaver.ast.Or; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | import java.util.logging.Logger; |
| | | |
| | | /** |
| | | * 附件管理 Service实现 |
| | |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) |
| | | @Slf4j |
| | | public class EmpAccessoryServiceImpl extends ServiceImpl<EmpAccessoryMapper, EmpAccessory> implements IEmpAccessoryService { |
| | | private final ILabelService labelService; |
| | | private final EmpAccessoryMapper empAccessoryMapper; |
| | |
| | | queryWrapper.in("c.dept_Id", remoteDeptService.userRightDepts().split(StringConstant.COMMA)); |
| | | queryWrapper.orderByAsc("a.deptName,a.empName,a.certificateNumb"); |
| | | Page<EmpAccessory> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | | String querySql = empAccessoryMapper.getQuerySql(); |
| | | IPage<Map<String, Object>> mapIPage = empAccessoryMapper.selectPageVo(page, queryWrapper, querySql); |
| | | // String querySql = empAccessoryMapper.getQuerySql(); |
| | | //List<Label> labelList = labelService.findLabels(new Label()); |
| | | IPage<Map<String, Object>> mapIPage = empAccessoryMapper.selectPageVo(page, queryWrapper); |
| | | mapIPage.getRecords().parallelStream().forEach(i->{ |
| | | List<Map<String, Object>> mapList = this.baseMapper.getEmpAccessoryNumber((Long) i.get("empId")); |
| | | mapList.parallelStream().forEach(j->i.put(j.get("labelCode").toString(),Integer.parseInt(j.get("number").toString()))); |
| | | }); |
| | | return mapIPage; |
| | | } |
| | | |
| | |
| | | public void autoInstall(String fileids) { |
| | | File[] list = FileUtil.ls(fileids); |
| | | for (File file : list) { |
| | | |
| | | String[] fileName = file.getName().split("_"); |
| | | if (fileName.length<2){ |
| | | log.error(file.getName()); |
| | | continue; |
| | | } |
| | | List<EmpBaseInfo> empBaseInfo = empBaseInfoService.list(new LambdaQueryWrapper<EmpBaseInfo>().eq(EmpBaseInfo::getCertificateNumb, fileName[1]).ne(EmpBaseInfo::getDelFlag, 1)); |
| | | if (0 == empBaseInfo.size()) { |
| | | if (null == empBaseInfo ||0 == empBaseInfo.size()) { |
| | | continue; |
| | | } |
| | | File[] childlist = FileUtil.ls(fileids+"/"+file.getName()); |