Merge remote-tracking branch 'origin/master'
9 files modified
1 files added
| | |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | import org.springblade.common.excel.ExcelDictConverter; |
| | | import org.springblade.common.excel.ExcelDictItem; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | |
| | | |
| | | private static final long serialVersionUID = 2L; |
| | | |
| | | /** 街道名称 */ |
| | | @ExcelProperty( value = "场所名称") |
| | | private String placeName; |
| | | |
| | | @ExcelProperty(value = "场所地址") |
| | | private String location; |
| | | |
| | | @ExcelProperty( value = "场所类别") |
| | | private String nineType; |
| | | |
| | | @ExcelProperty( "所属街道") |
| | | private String streetName; |
| | | |
| | |
| | | @ExcelProperty(value = "所属网格") |
| | | private String gridName; |
| | | |
| | | @ExcelProperty( value = "场所名称") |
| | | private String placeName; |
| | | |
| | | @ExcelProperty( value = "场所隐患") |
| | | private String remark; |
| | | |
| | |
| | | |
| | | @ExcelProperty(value = "场所负责人电话") |
| | | private String principalPhone; |
| | | |
| | | @ExcelProperty(value = "场所地址") |
| | | private String location; |
| | | |
| | | @ExcelProperty(value = "创建时间") |
| | | private String createTime; |
| | |
| | | @Param("placeCheck") PlaceCheckVO placeCheck, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | @Param("gridCodeList") List<String> gridCodeList, |
| | | @Param("nineTypeList") List<String> nineTypeList); |
| | | |
| | | /** |
| | | * 查询场所检查表 |
| | |
| | | List<PlaceCheckExcel> selectPlaceCheckListExcel(@Param("placeCheck") PlaceCheckVO placeCheck, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | @Param("gridCodeList") List<String> gridCodeList, |
| | | @Param("nineTypeList") List<String> nineTypeList); |
| | | } |
| | |
| | | and jp.principal_phone like concat('%', #{placeCheck.principalPhone},'%') |
| | | </if> |
| | | |
| | | <if test="nineTypeList!=null and nineTypeList.size()>0"> |
| | | and jp.nine_type in |
| | | <foreach collection="nineTypeList" separator="," open="(" close=")" item="nineType"> |
| | | #{nineType} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="placeCheck.startTime!=null and placeCheck.startTime!=''"> |
| | | and date_format(jpc.create_time,'%Y-%m-%d') >= #{placeCheck.startTime} |
| | | </if> |
| | |
| | | and jp.principal_phone like concat('%', #{placeCheck.principalPhone},'%') |
| | | </if> |
| | | |
| | | <if test="nineTypeList!=null and nineTypeList.size()>0"> |
| | | and jp.nine_type in |
| | | <foreach collection="nineTypeList" separator="," open="(" close=")" item="nineType"> |
| | | #{nineType} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="placeCheck.startTime!=null and placeCheck.startTime!=''"> |
| | | and date_format(jpc.create_time,'%Y-%m-%d') >= #{placeCheck.startTime} |
| | | </if> |
| | |
| | | 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; |
| | | } |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.place.excel.PlaceCheckExcel; |
| | | import org.springblade.modules.place.vo.PlaceCheckVO; |
| | | import org.springblade.modules.taskPlaceSelfCheck.dto.TaskPlaceSelfCheckDTO; |
| | | import org.springblade.modules.taskPlaceSelfCheck.excel.TaskPlaceSelfCheckExcel; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity; |
| | |
| | | import org.springblade.modules.taskPlaceSelfCheck.wrapper.TaskPlaceSelfCheckWrapper; |
| | | import org.springblade.modules.taskPlaceSelfCheck.service.ITaskPlaceSelfCheckService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 消防自查记任务表 控制器 |
| | |
| | | * 消防自查记任务表 修改 |
| | | */ |
| | | @PostMapping("/updateTaskPlaceSelfCheck") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "更新自查详情接口", notes = "传入taskPlaceSelfCheck") |
| | | public R updateTaskPlaceSelfCheck(@Valid @RequestBody TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception { |
| | | return R.status(taskPlaceSelfCheckService.updateTaskPlaceSelfCheck(taskPlaceSelfCheck)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出消防自查信息 |
| | | * @param taskPlaceSelfCheck |
| | | */ |
| | | @GetMapping("export-taskPlaceSelfCheck") |
| | | @ApiOperationSupport(order = 9) |
| | | @ApiOperation(value = "导出消防自查", notes = "传入taskPlaceSelfCheck") |
| | | public void exportTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck, HttpServletResponse response) { |
| | | List<TaskPlaceSelfCheckExcel> list = taskPlaceSelfCheckService.exportTaskPlaceSelfCheck(taskPlaceSelfCheck); |
| | | ExcelUtil.export(response, "消防自查" + DateUtil.time(), "消防自查记录表", list, TaskPlaceSelfCheckExcel.class); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package org.springblade.modules.taskPlaceSelfCheck.excel; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.alibaba.excel.annotation.write.style.ColumnWidth; |
| | | import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
| | | import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
| | | import lombok.Data; |
| | | import org.springblade.common.excel.ExcelDictConverter; |
| | | import org.springblade.common.excel.ExcelDictItem; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 消费自查检查 |
| | | * |
| | | * @author zhongrj |
| | | * @date 2024/02/22 |
| | | */ |
| | | @Data |
| | | @ColumnWidth(25) |
| | | @HeadRowHeight(20) |
| | | @ContentRowHeight(18) |
| | | public class TaskPlaceSelfCheckExcel implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 2L; |
| | | |
| | | @ExcelProperty( value = "场所名称") |
| | | private String placeName; |
| | | |
| | | @ExcelProperty(value = "场所地址") |
| | | private String location; |
| | | |
| | | @ExcelProperty( value = "场所类别") |
| | | private String nineType; |
| | | |
| | | /** 街道名称 */ |
| | | @ExcelProperty( "所属街道") |
| | | private String streetName; |
| | | |
| | | @ExcelProperty(value = "所属社区") |
| | | private String communityName; |
| | | |
| | | @ExcelProperty(value = "所属网格") |
| | | private String gridName; |
| | | |
| | | @ExcelProperty( value = "场所隐患") |
| | | private String remark; |
| | | |
| | | @ExcelProperty(value = "场所负责人") |
| | | private String principal; |
| | | |
| | | @ExcelProperty(value = "场所负责人电话") |
| | | private String principalPhone; |
| | | |
| | | |
| | | @ExcelProperty(value = "创建时间") |
| | | private String createTime; |
| | | |
| | | @ExcelProperty(value = "审核状态") |
| | | private String status; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.taskPlaceSelfCheck.dto.TaskPlaceSelfCheckDTO; |
| | | import org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity; |
| | | import org.springblade.modules.taskPlaceSelfCheck.excel.TaskPlaceSelfCheckExcel; |
| | | import org.springblade.modules.taskPlaceSelfCheck.vo.TaskPlaceSelfCheckVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | @Param("place") TaskPlaceSelfCheckVO taskPlaceSelfCheck, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | @Param("gridCodeList") List<String> gridCodeList, |
| | | @Param("nineTypeList") List<String> nineTypeList); |
| | | |
| | | /** |
| | | * 查询消防自查记任务表 |
| | |
| | | * @return 消防自查记任务表集合 |
| | | */ |
| | | public List<TaskPlaceSelfCheckDTO> selectTaskPlaceSelfCheckList(TaskPlaceSelfCheckDTO taskPlaceSelfCheckDTO); |
| | | |
| | | /** |
| | | * 导出消防自查信息 |
| | | * @param taskPlaceSelfCheck |
| | | * @param isAdministrator |
| | | * @param regionChildCodesList |
| | | * @param gridCodeList |
| | | * @return |
| | | */ |
| | | List<TaskPlaceSelfCheckExcel> exportTaskPlaceSelfCheck(@Param("nineTypeList") List<String> nineTypeList, |
| | | @Param("place") TaskPlaceSelfCheckVO taskPlaceSelfCheck, |
| | | @Param("isAdministrator") Integer isAdministrator, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("gridCodeList") List<String> gridCodeList); |
| | | } |
| | |
| | | </collection> |
| | | </resultMap> |
| | | |
| | | |
| | | <!--自定义分页查询--> |
| | | <select id="selectTaskPlaceSelfCheckPage" resultMap="taskPlaceSelfCheckResultMap"> |
| | | select jpc.*, |
| | | jp.id jpid, |
| | |
| | | </if> |
| | | <if test="place.principal != null and place.principal != ''"> |
| | | and jp.principal like concat('%', #{place.principal},'%') |
| | | </if> |
| | | |
| | | <if test="nineTypeList!=null and nineTypeList.size()>0"> |
| | | and jp.nine_type in |
| | | <foreach collection="nineTypeList" separator="," open="(" close=")" item="nineType"> |
| | | #{nineType} |
| | | </foreach> |
| | | </if> |
| | | <if test="place.remark != null and place.remark != ''">and jpc.remark = #{place.remark}</if> |
| | | <if test="place.updateTime != null ">and jpc.update_time = #{place.updateTime}</if> |
| | |
| | | <if test="deleteFlag != null ">and delete_flag = #{deleteFlag}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <!--导出消防自查信息--> |
| | | <select id="exportTaskPlaceSelfCheck" resultType="org.springblade.modules.taskPlaceSelfCheck.excel.TaskPlaceSelfCheckExcel"> |
| | | select |
| | | jpc.id, |
| | | case when jpc.status=1 then '待审核' |
| | | when jpc.status=2 then '审核通过' |
| | | when jpc.status=3 then '审核不通过' |
| | | else '待完成' end as status, |
| | | jpc.remark, |
| | | jpc.create_time, |
| | | jp.place_name, |
| | | jp.location, |
| | | jg.grid_name, |
| | | jp.principal, |
| | | jp.principal_phone, |
| | | jp.nine_type, |
| | | jp.is_nine, |
| | | br.town_name as streetName, |
| | | br.village_name as communityName, |
| | | bu.`name`, |
| | | jpe.legal_tel, |
| | | jpe.legal_person |
| | | FROM jczz_task_place_self_check jpc |
| | | LEFT JOIN jczz_place jp ON jpc.house_code = jp.house_code and jp.is_deleted = 0 |
| | | LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code and jg.is_deleted = 0 |
| | | LEFT JOIN blade_region br ON br.`code` = jg.community_code |
| | | LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id and jpe.is_deleted = 0 |
| | | LEFT JOIN blade_user bu ON bu.id = jpc.create_user and bu.is_deleted = 0 |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code and jpag.is_deleted = 0 |
| | | <where> |
| | | <if test="place.id != null ">and jpc.id = #{place.id}</if> |
| | | <if test="place.taskId != null ">and jpc.task_id = #{place.taskId}</if> |
| | | <if test="place.taskName != null and place.taskName != ''">and jpc.task_name = #{place.taskName}</if> |
| | | <if test="place.placeName != null and place.placeName != ''"> |
| | | and jp.place_name like concat('%', #{place.placeName},'%') |
| | | </if> |
| | | <if test="place.principal != null and place.principal != ''"> |
| | | and jp.principal like concat('%', #{place.principal},'%') |
| | | </if> |
| | | |
| | | <if test="nineTypeList!=null and nineTypeList.size()>0"> |
| | | and jp.nine_type in |
| | | <foreach collection="nineTypeList" separator="," open="(" close=")" item="nineType"> |
| | | #{nineType} |
| | | </foreach> |
| | | </if> |
| | | <if test="place.remark != null and place.remark != ''">and jpc.remark = #{place.remark}</if> |
| | | <if test="place.updateTime != null ">and jpc.update_time = #{place.updateTime}</if> |
| | | <if test="place.createTime != null ">and jpc.create_time = #{place.createTime}</if> |
| | | <if test="place.houseCode != null and place.houseCode != ''">and jpc.house_code = #{place.houseCode}</if> |
| | | <if test="place.rectificationEndTime != null ">and jpc.rectification_end_time = |
| | | #{place.rectificationEndTime} |
| | | </if> |
| | | <if test="place.rectificationCompleteTime != null ">and jpc.rectification_complete_time = |
| | | #{place.rectificationCompleteTime} |
| | | </if> |
| | | <if test="place.rectificationFlag != null ">and jpc.rectification_flag = #{place.rectificationFlag}</if> |
| | | <if test="place.policeStation != null and place.policeStation != ''">and jpc.police_station = |
| | | #{place.policeStation} |
| | | </if> |
| | | <if test="place.rectificationNoticeImgUrl != null and place.rectificationNoticeImgUrl != ''">and |
| | | jpc.rectification_notice_img_url = #{place.rectificationNoticeImgUrl} |
| | | </if> |
| | | <if test="place.signaturePath != null and place.signaturePath != ''">and jpc.signature_path = |
| | | #{place.signaturePath} |
| | | </if> |
| | | |
| | | <if test="place.streetName!=null and place.streetName!=''"> |
| | | and br.town_name like concat('%', #{place.streetName},'%') |
| | | </if> |
| | | |
| | | <if test="place.communityName!=null and place.communityName!=''"> |
| | | and br.village_name like concat('%', #{place.communityName},'%') |
| | | </if> |
| | | <if test="place.gridName!=null and place.gridName!=''"> |
| | | and jg.grid_name like concat('%', #{place.gridName},'%') |
| | | </if> |
| | | <if test="place.createUser != null ">and jpc.create_user = #{place.createUser}</if> |
| | | <if test="place.imageUrls != null and place.imageUrls != ''">and jpc.image_urls = #{place.imageUrls}</if> |
| | | <if test="place.status != null ">and jpc.status = #{place.status}</if> |
| | | <if test="place.deleteFlag != null ">and jpc.delete_flag = #{place.deleteFlag}</if> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="place.roleName != null and place.roleName != ''"> |
| | | <if test="place.roleName=='wgy'"> |
| | | <choose> |
| | | <when test="gridCodeList !=null and gridCodeList.size()>0"> |
| | | and jp.grid_code in |
| | | <foreach collection="gridCodeList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jp.grid_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | <if test="place.roleName=='mj'"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" |
| | | separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and jpag.community_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </when> |
| | | <otherwise> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and |
| | | ( |
| | | jg.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | or |
| | | jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | |
| | | </otherwise> |
| | | </choose> |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.taskPlaceSelfCheck.dto.TaskPlaceSelfCheckDTO; |
| | | import org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity; |
| | | import org.springblade.modules.taskPlaceSelfCheck.excel.TaskPlaceSelfCheckExcel; |
| | | import org.springblade.modules.taskPlaceSelfCheck.vo.TaskPlaceSelfCheckVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | Boolean savePlace(TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception; |
| | | |
| | | Boolean updateTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck) throws Exception; |
| | | |
| | | /** |
| | | * 导出消防自查信息 |
| | | * @param taskPlaceSelfCheck |
| | | * @return |
| | | */ |
| | | List<TaskPlaceSelfCheckExcel> exportTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck); |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.taskPlaceSelfCheck.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 liquibase.repackaged.org.apache.commons.lang3.StringUtils; |
| | | import org.springblade.common.constant.CommonConstant; |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.param.CommonParamSet; |
| | |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.patrol.entity.PatrolRecord; |
| | | import org.springblade.modules.patrol.service.IPatrolRecordService; |
| | | import org.springblade.modules.place.excel.NinePlaceExcel; |
| | | import org.springblade.modules.place.vo.PlaceCheckVO; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springblade.modules.task.service.ITaskService; |
| | | import org.springblade.modules.taskPlaceRecord.entity.TaskPlaceRecordEntity; |
| | | import org.springblade.modules.taskPlaceRecord.service.ITaskPlaceRecordService; |
| | |
| | | import org.springblade.modules.taskPlaceRectification.service.ITaskPlaceRectificationService; |
| | | import org.springblade.modules.taskPlaceSelfCheck.dto.TaskPlaceSelfCheckDTO; |
| | | import org.springblade.modules.taskPlaceSelfCheck.entity.TaskPlaceSelfCheckEntity; |
| | | import org.springblade.modules.taskPlaceSelfCheck.excel.TaskPlaceSelfCheckExcel; |
| | | import org.springblade.modules.taskPlaceSelfCheck.vo.TaskPlaceSelfCheckVO; |
| | | import org.springblade.modules.taskPlaceSelfCheck.mapper.TaskPlaceSelfCheckMapper; |
| | | import org.springblade.modules.taskPlaceSelfCheck.service.ITaskPlaceSelfCheckService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | 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; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.concurrent.atomic.AtomicReference; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Service |
| | | public class TaskPlaceSelfCheckServiceImpl extends ServiceImpl<TaskPlaceSelfCheckMapper, TaskPlaceSelfCheckEntity> implements ITaskPlaceSelfCheckService { |
| | | |
| | | |
| | | @Autowired |
| | | private IDictBizService dictBizService; |
| | | |
| | | @Override |
| | | public IPage<TaskPlaceSelfCheckVO> selectTaskPlaceSelfCheckPage(IPage<TaskPlaceSelfCheckVO> page, TaskPlaceSelfCheckVO taskPlaceSelfCheck) { |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=taskPlaceSelfCheck.getNineType()){ |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",taskPlaceSelfCheck.getNineType()).eq("code","nineType"); |
| | | // 先查询当前 |
| | | DictBiz one = dictBizService.getOne(queryWrapper); |
| | | // 查询本身和子集的key |
| | | List<DictBiz> list = dictBizService.getList("nineType", one.getId()); |
| | | if (list.size()==0){ |
| | | strings.add(taskPlaceSelfCheck.getNineType().toString()); |
| | | }else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskPlaceSelfCheckVO.class,taskPlaceSelfCheck); |
| | | List<TaskPlaceSelfCheckVO> placeCheckVOS = baseMapper.selectTaskPlaceSelfCheckPage(page, |
| | | taskPlaceSelfCheck, |
| | | 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 (TaskPlaceSelfCheckVO placeCheckVO : placeCheckVOS) { |
| | | int number = 0; |
| | | for (TaskPlaceRecordVO patrolRecord : placeCheckVO.getTaskPlaceRecordVOList()) { |
| | |
| | | } |
| | | } |
| | | 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); |
| | | } |
| | | |
| | |
| | | } |
| | | throw new Exception("保存失败!"); |
| | | } |
| | | |
| | | /** |
| | | * 导出消防自查信息 |
| | | * @param taskPlaceSelfCheck |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TaskPlaceSelfCheckExcel> exportTaskPlaceSelfCheck(TaskPlaceSelfCheckVO taskPlaceSelfCheck) { |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=taskPlaceSelfCheck.getNineType()){ |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",taskPlaceSelfCheck.getNineType()).eq("code","nineType"); |
| | | // 先查询当前 |
| | | DictBiz one = dictBizService.getOne(queryWrapper); |
| | | // 查询本身和子集的key |
| | | List<DictBiz> list = dictBizService.getList("nineType", one.getId()); |
| | | if (list.size()==0){ |
| | | strings.add(taskPlaceSelfCheck.getNineType().toString()); |
| | | }else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(TaskPlaceSelfCheckVO.class,taskPlaceSelfCheck); |
| | | List<TaskPlaceSelfCheckExcel> taskPlaceSelfCheckExcels = baseMapper.exportTaskPlaceSelfCheck( |
| | | strings, |
| | | taskPlaceSelfCheck, |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getGridCodeList()); |
| | | // 返回 |
| | | List<DictBiz> nineType = dictBizService.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0)); |
| | | for (TaskPlaceSelfCheckExcel ninePlaceExcel : taskPlaceSelfCheckExcels) { |
| | | for (DictBiz dictBiz : nineType) { |
| | | if (StringUtils.isNotBlank(ninePlaceExcel.getNineType()) && ninePlaceExcel.getNineType().equals(dictBiz.getDictKey())) { |
| | | if (ninePlaceExcel.getNineType().contains("10,11,12")) { |
| | | ninePlaceExcel.setNineType("小学校(幼儿园、校外培训机构)- " + dictBiz.getDictValue()); |
| | | } else if (ninePlaceExcel.getNineType().contains("13,14,15")) { |
| | | ninePlaceExcel.setNineType("小医院(诊所、养老院)- " + dictBiz.getDictValue()); |
| | | } else { |
| | | ninePlaceExcel.setNineType(dictBiz.getDictValue()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return taskPlaceSelfCheckExcels; |
| | | } |
| | | } |