| | |
| | | package org.springblade.modules.place.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xxl.job.core.util.FileUtil; |
| | | import liquibase.repackaged.org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import org.springblade.modules.place.service.IPlaceCheckService; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springblade.modules.task.service.ITaskService; |
| | | import org.springblade.modules.task.vo.TaskLabelReportingEventVO; |
| | | import org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity; |
| | | import org.springblade.modules.taskPlaceRectification.service.ITaskPlaceRectificationService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(PlaceCheckServiceImpl.class); |
| | | |
| | | @Autowired |
| | | private IDictBizService dictBizService; |
| | | |
| | | @Override |
| | | public IPage<PlaceCheckVO> selectPlaceCheckPage(IPage<PlaceCheckVO> page, PlaceCheckVO placeCheck) { |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=placeCheck.getNineType()){ |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",placeCheck.getNineType()).eq("code","nineType"); |
| | | // 先查询当前 |
| | | DictBiz one = dictBizService.getOne(queryWrapper); |
| | | // 查询本身和子集的key |
| | | List<DictBiz> list = dictBizService.getList("nineType", one.getId()); |
| | | if (list.size()==0){ |
| | | strings.add(placeCheck.getNineType().toString()); |
| | | }else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(PlaceCheckVO.class,placeCheck); |
| | | List<PlaceCheckVO> placeCheckVOS = baseMapper.selectPlaceCheckPage(page, |
| | | placeCheck, |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getGridCodeList()); |
| | | commonParamSet.getGridCodeList(), |
| | | strings); |
| | | List<DictBiz> nineType = dictBizService.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0)); |
| | | for (PlaceCheckVO placeCheckVO : placeCheckVOS) { |
| | | int number = 0; |
| | | for (PatrolRecord patrolRecord : placeCheckVO.getPatrolRecordVOList()) { |
| | |
| | | } |
| | | } |
| | | placeCheckVO.setNumber(number); |
| | | for (DictBiz dictBiz : nineType) { |
| | | if (StringUtils.isNotBlank(placeCheckVO.getNineType()) && placeCheckVO.getNineType().equals(dictBiz.getDictKey())) { |
| | | if (placeCheckVO.getNineType().contains("10,11,12")) { |
| | | placeCheckVO.setNineType("小学校(幼儿园、校外培训机构)- " + dictBiz.getDictValue()); |
| | | } else if (placeCheckVO.getNineType().contains("13,14,15")) { |
| | | placeCheckVO.setNineType("小医院(诊所、养老院)- " + dictBiz.getDictValue()); |
| | | } else { |
| | | placeCheckVO.setNineType(dictBiz.getDictValue()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return page.setRecords(placeCheckVOS); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public List<PlaceCheckExcel> exportPlaceCheck(PlaceCheckVO placeCheck) { |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=placeCheck.getNineType()){ |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",placeCheck.getNineType()).eq("code","nineType"); |
| | | // 先查询当前 |
| | | DictBiz one = dictBizService.getOne(queryWrapper); |
| | | // 查询本身和子集的key |
| | | List<DictBiz> list = dictBizService.getList("nineType", one.getId()); |
| | | if (list.size()==0){ |
| | | strings.add(placeCheck.getNineType()); |
| | | }else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(PlaceCheckVO.class,placeCheck); |
| | | List<PlaceCheckExcel> placeCheckVOS = baseMapper.selectPlaceCheckListExcel(placeCheck, |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getGridCodeList()); |
| | | commonParamSet.getGridCodeList(), |
| | | strings); |
| | | List<DictBiz> nineType = dictBizService.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0)); |
| | | for (PlaceCheckExcel placeCheckVO : placeCheckVOS) { |
| | | for (DictBiz dictBiz : nineType) { |
| | | if (StringUtils.isNotBlank(placeCheckVO.getNineType()) && placeCheckVO.getNineType().equals(dictBiz.getDictKey())) { |
| | | if (placeCheckVO.getNineType().contains("10,11,12")) { |
| | | placeCheckVO.setNineType("小学校(幼儿园、校外培训机构)- " + dictBiz.getDictValue()); |
| | | } else if (placeCheckVO.getNineType().contains("13,14,15")) { |
| | | placeCheckVO.setNineType("小医院(诊所、养老院)- " + dictBiz.getDictValue()); |
| | | } else { |
| | | placeCheckVO.setNineType(dictBiz.getDictValue()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // 返回 |
| | | return placeCheckVOS; |
| | | } |