| | |
| | | import cn.hutool.core.util.ZipUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import org.aspectj.weaver.ast.Or; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> findEmpAccessorys(QueryRequest request, EmpAccessoryVO vo) { |
| | | QueryWrapper<EmpAccessoryVO> queryWrapper = new QueryWrapper<>(); |
| | | QueryWrapper<EmpAccessoryVO> queryWrapper = new QueryWrapper<>(); |
| | | if (StrUtil.isNotBlank(vo.getBasic())) { |
| | | queryWrapper.like("a.empNumb", vo.getBasic()).or().like("a.deptName", vo.getBasic()).or().like("a.certificateNumb", vo.getBasic()).or().like("a.certificateNumb", vo.getBasic()).or().like("a.jobName", vo.getBasic()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getEmpName())) { |
| | | queryWrapper.like("a.empName", vo.getEmpName()); |
| | | } |
| | |
| | | queryWrapper.between("a.entryDate", vo.getEntryDate().split(",")[0], vo.getEntryDate().split(",")[1]); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getAge())) { |
| | | if (StrUtil.equals(vo.getAge(), "1")) { |
| | | queryWrapper.between("a.age", 18, 29); |
| | | } else if (StrUtil.equals(vo.getAge(), "2")) { |
| | | queryWrapper.between("a.age", 30, 39); |
| | | } else if (StrUtil.equals(vo.getAge(), "3")) { |
| | | queryWrapper.between("a.age", 40, 49); |
| | | } else if (StrUtil.equals(vo.getAge(), "4")) { |
| | | queryWrapper.between("a.age", 50, 59); |
| | | } else if (StrUtil.equals(vo.getAge(), "5")) { |
| | | queryWrapper.between("a.age", 60, 69); |
| | | } else if (StrUtil.equals(vo.getAge(), "6")) { |
| | | queryWrapper.ge("a.age", 69); |
| | | String[] arr = vo.getAge().split(","); |
| | | for (String s : arr) { |
| | | if (StrUtil.equals(s, "1")) { |
| | | queryWrapper.between("a.age", 18, 29); |
| | | } if (StrUtil.equals(s, "2")) { |
| | | queryWrapper.between("a.age", 30, 39); |
| | | } if (StrUtil.equals(s, "3")) { |
| | | queryWrapper.between("a.age", 40, 49); |
| | | } if (StrUtil.equals(s, "4")) { |
| | | queryWrapper.between("a.age", 50, 59); |
| | | } if (StrUtil.equals(s, "5")) { |
| | | queryWrapper.between("a.age", 60, 69); |
| | | } if (StrUtil.equals(s, "6")) { |
| | | queryWrapper.ge("a.age", 69); |
| | | } |
| | | } |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getArchivesStatus())) { |
| | | if (!StrUtil.equals(vo.getArchivesStatus(), "-1")) { |
| | | queryWrapper.eq("a.archivesStatus", vo.getArchivesStatus()); |
| | | } |
| | | queryWrapper.in("a.archivesStatus", vo.getArchivesStatus()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getEducation())) { |
| | | if (!StrUtil.equals(vo.getEducation(), "-1")) { |
| | | queryWrapper.eq("a.education", vo.getEducation()); |
| | | } |
| | | queryWrapper.in("a.education", vo.getEducation()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getSex())) { |
| | | if (!StrUtil.equals(vo.getSex(), "-1")) { |
| | | queryWrapper.eq("a.sex", vo.getSex()); |
| | | } |
| | | queryWrapper.in("a.sex", vo.getSex()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getInsuranceType())) { |
| | | if (!StrUtil.equals(vo.getInsuranceType(), "-1")) { |
| | | queryWrapper.eq("a.insuranceType", vo.getInsuranceType()); |
| | | } |
| | | queryWrapper.in("a.insuranceType", vo.getInsuranceType()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getPolitics())) { |
| | | if (!StrUtil.equals(vo.getPolitics(), "-1")) { |
| | | queryWrapper.eq("a.politics", vo.getPolitics()); |
| | | } |
| | | queryWrapper.in("a.politics", vo.getPolitics()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getEmpStatus())) { |
| | | queryWrapper.in("a.empStatus", vo.getEmpStatus()); |
| | | } |
| | | if (StrUtil.isNotBlank(vo.getPolitics())) { |
| | | queryWrapper.in("a.politics", vo.getPolitics()); |
| | | } |
| | | queryWrapper.eq("a.delFlag", 0); |
| | | Page<EmpAccessory> page = new Page<>(request.getPageNum(), request.getPageSize()); |
| | |
| | | @Override |
| | | public void mvFiles(String accessoryids,Long labelid,Long empId) { |
| | | String[] arr = accessoryids.split(","); |
| | | |
| | | LambdaUpdateWrapper<EmpAccessory> wapper = new LambdaUpdateWrapper<>(); |
| | | wapper.in(EmpAccessory::getAccessoryid, arr); |
| | | wapper.set(EmpAccessory::getModifier,operatorId); |
| | |
| | | FileUtil.del(new StringBuilder().append(mianFileStr, 0, mianFileStr.length() - 1).append(".zip").toString()); |
| | | FileUtil.del(mianFileStr); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Integer getLabelCount(Long labelId) { |
| | | LambdaQueryWrapper<EmpAccessory> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(EmpAccessory::getDelFlag,0); |
| | | wrapper.eq(EmpAccessory::getLabelid,labelId); |
| | | return this.count(wrapper); |
| | | } |
| | | } |