| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.common.cache.DictCache; |
| | | import org.springblade.common.cache.ParamCache; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.cache.UserCache; |
| | | import org.springblade.common.enums.DictEnum; |
| | | import org.springblade.common.utils.arg; |
| | | import org.springblade.core.cache.utils.CacheUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.support.Kv; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.StringUtil; |
| | | import org.springblade.modules.information.entity.Information; |
| | | import org.springblade.modules.information.excel.ExportInformationExcel; |
| | | import org.springblade.modules.information.excel.ExportInformationSecurityStatistics; |
| | | import org.springblade.modules.information.excel.InforExcel; |
| | | import org.springblade.modules.information.mapper.InformationMapper; |
| | | import org.springblade.modules.information.service.IInformationService; |
| | | import org.springblade.modules.information.vo.InformationStatisticsVO; |
| | | import org.springblade.modules.information.vo.InformationVO; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.system.entity.Role; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IDeptService; |
| | | import org.springblade.modules.system.service.IRoleService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.concurrent.AbstractExecutorService; |
| | | |
| | | import static org.springblade.common.constant.CommonConstant.DEFAULT_PARAM_PASSWORD; |
| | | import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | |
| | | @Service |
| | | public class InformationServiceImpl extends ServiceImpl<InformationMapper, Information> implements IInformationService { |
| | | |
| | | |
| | | @Override |
| | | public IPage<InformationVO> selectInformationPage(IPage<InformationVO> page, InformationVO information) { |
| | | return page.setRecords(baseMapper.selectInformationPage(page, information)); |
| | | List<InformationVO> informationVOS = baseMapper.selectInformationPage(page, information); |
| | | //遍历 |
| | | if (informationVOS.size()>0){ |
| | | //判断有无子级 |
| | | for (InformationVO informationVO : informationVOS) { |
| | | List<Dept> deptList = baseMapper.getDeptHashChildren(informationVO); |
| | | //有子级 |
| | | if (deptList.size()>0){ |
| | | Dept dept = new Dept(); |
| | | dept.setId(Long.parseLong(informationVO.getDepartmentid())); |
| | | //查询当前子单位的人数 |
| | | Integer z = baseMapper.selectInformationUserNumCount(dept) + Integer.parseInt(informationVO.getZnum()); |
| | | informationVO.setZnum(z.toString()); |
| | | //已派遣人数 |
| | | Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + Integer.parseInt(informationVO.getPnum()); |
| | | informationVO.setPnum(p.toString()); |
| | | //持证人数 |
| | | Integer c = baseMapper.selectInformationHoldNumCount(dept) + Integer.parseInt(informationVO.getCnum()); |
| | | informationVO.setCnum(c.toString()); |
| | | } |
| | | } |
| | | } |
| | | return page.setRecords(informationVOS); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteIn(String creditcode) { |
| | | baseMapper.deleteIn(creditcode); |
| | | public void deleteIn(String departmentid) { |
| | | baseMapper.deleteIn(departmentid); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteSh(String creditcode) { |
| | | baseMapper.deleteSh(creditcode); |
| | | public void deleteSh(String deptId) { |
| | | baseMapper.deleteSh(deptId); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteMe(String creditcode) { |
| | | baseMapper.deleteMe(creditcode); |
| | | public void insertIn( Information information) { |
| | | baseMapper.insertIn(information); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteMe(String deptId) { |
| | | baseMapper.deleteMe(deptId); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<Object, Object>> selectExtype(String deptid) { |
| | | return baseMapper.selectExtype(deptid); |
| | | public List<Map<Object, Object>> selectExtype(String deptid,String jurisdiction) { |
| | | return baseMapper.selectExtype(deptid,jurisdiction); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<Object, Object>> selectHold(String deptid) { |
| | | return baseMapper.selectHold(deptid); |
| | | public List<Map<Object, Object>> selectHold(String deptid,String jurisdiction) { |
| | | return baseMapper.selectHold(deptid,jurisdiction); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<Object, Object>> selectDisp(String deptid) { |
| | | return baseMapper.selectDisp(deptid); |
| | | public List<Map<Object, Object>> selectDisp(String deptid,String jurisdiction) { |
| | | return baseMapper.selectDisp(deptid,jurisdiction); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<Object, Object>> selectSoil(String deptid) { |
| | | return baseMapper.selectSoil(deptid); |
| | | public List<Map<Object, Object>> selectSoil(String deptid,String jurisdiction) { |
| | | return baseMapper.selectSoil(deptid,jurisdiction); |
| | | } |
| | | |
| | | @Override |
| | | public List queryYearKh(String year, String jurisdiction, String deptid) { |
| | | return baseMapper.queryYearKh(year, jurisdiction, deptid); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询培训单位信息(可以报名) |
| | |
| | | public IPage<InformationVO> securityPage(IPage<InformationVO> page, InformationVO information) { |
| | | return page.setRecords(baseMapper.securityPage(page, information)); |
| | | } |
| | | |
| | | @Override |
| | | public void importInfor(List<InforExcel> data, Boolean isCovered) { |
| | | data.forEach(InforExcel -> { |
| | | Information information = Objects.requireNonNull(BeanUtil.copy(InforExcel, Information.class)); |
| | | //自招保安公司 |
| | | if (information.getStats().equals("自招保安单位")) { |
| | | information.setStats("0"); |
| | | } |
| | | //保安培训公司 |
| | | if (information.getStats().equals("保安培训公司")) { |
| | | information.setStats("1"); |
| | | } |
| | | //保安服务公司 |
| | | if (information.getStats().equals("保安服务公司")) { |
| | | information.setStats("2"); |
| | | } |
| | | //武装守押公司 |
| | | if (information.getStats().equals("武装守押公司")) { |
| | | information.setStats("3"); |
| | | } |
| | | //跨区域保安公司 |
| | | if (information.getStats().equals("跨区域保安公司")) { |
| | | information.setStats("4"); |
| | | } |
| | | try { |
| | | arg.test01(arg.url+"/information/save",information); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 根据deptid 删除用户信息 |
| | | * @param deptId |
| | | */ |
| | | @Override |
| | | public void deleteUserByDeptId(String deptId) { |
| | | baseMapper.deleteUserByDeptId(deptId); |
| | | } |
| | | |
| | | @Override |
| | | public String selJurchilder(String id) { |
| | | return baseMapper.selJurchilder(id); |
| | | } |
| | | |
| | | /** |
| | | * 业务统计情况 |
| | | * @param page |
| | | * @param information |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage selectBusinessStatistics(IPage page, InformationVO information) { |
| | | List<InformationStatisticsVO> list = baseMapper.selectBusinessStatistics(page, information); |
| | | if (list.size()>0) { |
| | | //遍历 |
| | | for (InformationStatisticsVO informationStatisticsVO : list) { |
| | | List<Dept> deptList = baseMapper.getDeptHashChildrens(informationStatisticsVO); |
| | | //有子级 |
| | | if (deptList.size()>0){ |
| | | Dept dept = new Dept(); |
| | | dept.setId(Long.parseLong(informationStatisticsVO.getDepartmentid())); |
| | | //查询当前子单位的人数 |
| | | Integer z = baseMapper.selectInformationUserNumCount(dept) + informationStatisticsVO.getZnum(); |
| | | informationStatisticsVO.setZnum(z); |
| | | //已派遣人数 |
| | | Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + informationStatisticsVO.getPqnum(); |
| | | informationStatisticsVO.setPqnum(p); |
| | | //持证人数 |
| | | Integer c = baseMapper.selectInformationHoldNumCount(dept) + informationStatisticsVO.getCznum(); |
| | | informationStatisticsVO.setCznum(c); |
| | | //服务单位数 |
| | | Integer f = baseMapper.selectInformationUnitNumCount(dept) + informationStatisticsVO.getFwnum(); |
| | | informationStatisticsVO.setFwnum(f); |
| | | //服务单位到期数 |
| | | Integer d = baseMapper.selectInformationUnitExpireNumCount(dept) + informationStatisticsVO.getDqnum(); |
| | | informationStatisticsVO.setDqnum(d); |
| | | } |
| | | } |
| | | } |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | /** |
| | | * 保安员情况统计 |
| | | * @param page |
| | | * @param information |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage selectSecurityStatistics(IPage page, InformationVO information) { |
| | | List<InformationStatisticsVO> list = baseMapper.selectSecurityStatistics(page,information); |
| | | if (list.size()>0) { |
| | | //遍历 |
| | | for (InformationStatisticsVO informationStatisticsVO : list) { |
| | | List<Dept> deptList = baseMapper.getDeptHashChildrens(informationStatisticsVO); |
| | | //有子级 |
| | | if (deptList.size()>0){ |
| | | Dept dept = new Dept(); |
| | | dept.setId(Long.parseLong(informationStatisticsVO.getDepartmentid())); |
| | | //查询当前子单位的人数 |
| | | Integer z = baseMapper.selectInformationUserNumCount(dept) + informationStatisticsVO.getNum(); |
| | | informationStatisticsVO.setNum(z); |
| | | //持证人数 |
| | | Integer c = baseMapper.selectInformationHoldNumCount(dept) + informationStatisticsVO.getCznum(); |
| | | informationStatisticsVO.setCznum(c); |
| | | //已派遣人数 |
| | | Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + informationStatisticsVO.getPqnum(); |
| | | informationStatisticsVO.setPqnum(p); |
| | | //未派遣人数 |
| | | Integer wpq = baseMapper.selectInformationNotDispatcherNumCount(dept) + informationStatisticsVO.getWpqnum(); |
| | | informationStatisticsVO.setWpqnum(wpq); |
| | | //已采集照片数 |
| | | Integer ycjzp = baseMapper.selectInformationUnitAvatarNumCount(dept) + informationStatisticsVO.getYcjzpnum(); |
| | | informationStatisticsVO.setYcjzpnum(ycjzp); |
| | | //未采集照片数 |
| | | Integer wcjzp = baseMapper.selectInformationUnitNotAvatarNumCount(dept) + informationStatisticsVO.getWcjzpnum(); |
| | | informationStatisticsVO.setWcjzpnum(wcjzp); |
| | | //已采集指纹数 |
| | | Integer ycjzw = baseMapper.selectInformationUnitZwNumCount(dept) + informationStatisticsVO.getYcjzwnum(); |
| | | informationStatisticsVO.setYcjzwnum(ycjzw); |
| | | //审查异常数 |
| | | Integer scyc = baseMapper.selectInformationUnitYcNumCount(dept) + informationStatisticsVO.getScycnum(); |
| | | informationStatisticsVO.setScycnum(scyc); |
| | | //缴纳社保数 |
| | | Integer jnsb = baseMapper.selectInformationUnitJnsbNumCount(dept) + informationStatisticsVO.getJnsbnum(); |
| | | informationStatisticsVO.setJnsbnum(jnsb); |
| | | } |
| | | } |
| | | } |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | /** |
| | | * 业务统计导出 |
| | | * @param information |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ExportInformationExcel> exportBusinessStatis(InformationVO information) { |
| | | List<ExportInformationExcel> list = baseMapper.exportBusinessStatis(information); |
| | | if (list.size()>0) { |
| | | //遍历 |
| | | for (ExportInformationExcel informationStatisticsVO : list) { |
| | | List<Dept> deptList = baseMapper.getDeptChildrens(informationStatisticsVO.getDepartmentid()); |
| | | //有子级 |
| | | if (deptList.size()>0){ |
| | | Dept dept = new Dept(); |
| | | dept.setId(Long.parseLong(informationStatisticsVO.getDepartmentid())); |
| | | //查询当前子单位的人数 |
| | | Integer z = baseMapper.selectInformationUserNumCount(dept) + informationStatisticsVO.getZnum(); |
| | | informationStatisticsVO.setZnum(z); |
| | | //已派遣人数 |
| | | Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + informationStatisticsVO.getPqnum(); |
| | | informationStatisticsVO.setPqnum(p); |
| | | //持证人数 |
| | | Integer c = baseMapper.selectInformationHoldNumCount(dept) + informationStatisticsVO.getCznum(); |
| | | informationStatisticsVO.setCznum(c); |
| | | //服务单位数 |
| | | Integer f = baseMapper.selectInformationUnitNumCount(dept) + informationStatisticsVO.getFwnum(); |
| | | informationStatisticsVO.setFwnum(f); |
| | | //服务单位到期数 |
| | | Integer d = baseMapper.selectInformationUnitExpireNumCount(dept) + informationStatisticsVO.getDqnum(); |
| | | informationStatisticsVO.setDqnum(d); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 保安员统计导出 |
| | | * @param information |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ExportInformationSecurityStatistics> exportSecurityStatisInfo(InformationVO information) { |
| | | List<ExportInformationSecurityStatistics> list = baseMapper.exportSecurityStatisInfo(information); |
| | | if (list.size()>0) { |
| | | //遍历 |
| | | for (ExportInformationSecurityStatistics informationStatisticsVO : list) { |
| | | List<Dept> deptList = baseMapper.getDeptChildrens(informationStatisticsVO.getDepartmentid()); |
| | | //有子级 |
| | | if (deptList.size()>0){ |
| | | Dept dept = new Dept(); |
| | | dept.setId(Long.parseLong(informationStatisticsVO.getDepartmentid())); |
| | | //查询当前子单位的人数 |
| | | Integer z = baseMapper.selectInformationUserNumCount(dept) + informationStatisticsVO.getNum(); |
| | | informationStatisticsVO.setNum(z); |
| | | //持证人数 |
| | | Integer c = baseMapper.selectInformationHoldNumCount(dept) + informationStatisticsVO.getCznum(); |
| | | informationStatisticsVO.setCznum(c); |
| | | //已派遣人数 |
| | | Integer p = baseMapper.selectInformationDispatcherNumCount(dept) + informationStatisticsVO.getPqnum(); |
| | | informationStatisticsVO.setPqnum(p); |
| | | //未派遣人数 |
| | | Integer wpq = baseMapper.selectInformationNotDispatcherNumCount(dept) + informationStatisticsVO.getWpqnum(); |
| | | informationStatisticsVO.setWpqnum(wpq); |
| | | //已采集照片数 |
| | | Integer ycjzp = baseMapper.selectInformationUnitAvatarNumCount(dept) + informationStatisticsVO.getYcjzpnum(); |
| | | informationStatisticsVO.setYcjzpnum(ycjzp); |
| | | //未采集照片数 |
| | | Integer wcjzp = baseMapper.selectInformationUnitNotAvatarNumCount(dept) + informationStatisticsVO.getWcjzpnum(); |
| | | informationStatisticsVO.setWcjzpnum(wcjzp); |
| | | //已采集指纹数 |
| | | Integer ycjzw = baseMapper.selectInformationUnitZwNumCount(dept) + informationStatisticsVO.getYcjzwnum(); |
| | | informationStatisticsVO.setYcjzwnum(ycjzw); |
| | | //审查异常数 |
| | | Integer scyc = baseMapper.selectInformationUnitYcNumCount(dept) + informationStatisticsVO.getScycnum(); |
| | | informationStatisticsVO.setScycnum(scyc); |
| | | //缴纳社保数 |
| | | Integer jnsb = baseMapper.selectInformationUnitJnsbNumCount(dept) + informationStatisticsVO.getJnsbnum(); |
| | | informationStatisticsVO.setJnsbnum(jnsb); |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 保安员详情 |
| | | * @param page |
| | | * @param deptid |
| | | * @param name |
| | | * @param hold |
| | | * @param photo |
| | | * @param examinationtype |
| | | * @param dispatch |
| | | * @param soil |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage selectUIn(IPage<List> page, String deptid, String name, String hold, String photo, String examinationtype, String dispatch, String soil) { |
| | | return page.setRecords(baseMapper.selectUIn(page,deptid, name, hold, photo, examinationtype, dispatch,soil)); |
| | | } |
| | | |
| | | /** |
| | | * 查询学历统计信息 |
| | | * @param deptid 部门id |
| | | * @param jurisdiction 辖区 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getEducationStatistics(String deptid, String jurisdiction) { |
| | | //查询学历分布情况,按学历分组统计对应的人数 |
| | | List<Map<String,Object>> mapList = baseMapper.getEducationStatistics(deptid,jurisdiction); |
| | | return mapList; |
| | | } |
| | | |
| | | /** |
| | | * 获取部门信息() |
| | | * @param information |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getInformationDetails(InformationVO information) { |
| | | //根据部门id 查询部门信息(如果有总公司,则遍历出总公司来) |
| | | List<String> deptIdList = baseMapper.getDeptDetails(information); |
| | | //取第一个查询部门信息 |
| | | InformationVO informationVO = baseMapper.getInformationDetails(deptIdList.get(0)); |
| | | //返回 |
| | | return informationVO; |
| | | } |
| | | } |