ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java
@@ -96,10 +96,9 @@ Page<UmsAdminLoginLog> umsAdminLoginLogPage = new Page<>(); umsAdminLoginLogPage.setCurrent(logQueryParams.getCurrent()); umsAdminLoginLogPage.setSize(logQueryParams.getSize()); String fileName ="日志数据"; response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("utf-8"); response.setHeader("Content-disposition", "attachment;filename=" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + URLEncoder.encode(fileName + ".xlsx", "utf-8")); response.setHeader("Content-disposition", "attachment;filename=" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + URLEncoder.encode( ".xlsx", "utf-8")); EasyExcel .write(response.getOutputStream(), UmsAdminLogVO.class) .sheet("数据") ycl-platform/src/main/java/com/ycl/controller/carManage/CarManageController.java
@@ -98,7 +98,7 @@ CarEnforcecar enforceCar = iCarEnforcecarService .getOne(new LambdaQueryWrapper<CarEnforcecar>() .eq(CarEnforcecar::getCarNumber, carEnforcecar.getCarNumber())); if (StringUtils.isNotBlank(enforceCar.getCarNumber())) { if (enforceCar != null && StringUtils.isNotBlank(enforceCar.getCarNumber())) { throw new ApiException(ResultCode.CAR_NUMBER_REPETITION.getMessage()); } return CommonResult.success(iCarEnforcecarService.save(carEnforcecar)); @@ -111,7 +111,7 @@ CarSlagcar slagCar = iCarSlagcarService .getOne(new LambdaQueryWrapper<CarSlagcar>() .eq(CarSlagcar::getCarNumber, carSlagcar.getCarNumber())); if (StringUtils.isNotBlank(slagCar.getCarNumber())) { if (slagCar != null && StringUtils.isNotBlank(slagCar.getCarNumber())) { throw new ApiException(ResultCode.CAR_NUMBER_REPETITION.getMessage()); } return CommonResult.success(iCarSlagcarService.save(carSlagcar)); ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java
@@ -92,10 +92,9 @@ Page<EquipmentBayonet> equipmentBayonetPage = new Page<>(); equipmentBayonetPage.setCurrent(current); equipmentBayonetPage.setSize(size); String fileName ="卡口数据"; response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("utf-8"); response.setHeader("Content-disposition", "attachment;filename=" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + URLEncoder.encode(fileName + ".xlsx", "utf-8")); response.setHeader("Content-disposition", "attachment;filename=" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + URLEncoder.encode( ".xlsx", "utf-8")); EasyExcel.write(response.getOutputStream(), EquipmentBayonetVO.class) .sheet("数据") .doWrite(iEquipmentBayonetService ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java
@@ -5,6 +5,8 @@ import com.ycl.bo.casePool.CasePoolIllegalBuildingDO; import com.ycl.bo.casePool.CasePoolViolationDO; import com.ycl.entity.caseHandler.BaseCase; import com.ycl.vo.casePool.CasePoolIllegalBuildingVO; import com.ycl.vo.casePool.CasePoolViolationVO; import java.util.Map; @@ -17,9 +19,9 @@ * @since 2022-09-24 */ public interface BaseCaseMapper extends BaseMapper<BaseCase> { Page<CasePoolViolationDO> listViolationsPage(Page page, Integer state, Integer type, Integer resource); Page<CasePoolViolationVO> listViolationsPage(Page page, Integer state, Integer type, Integer resource); Page<CasePoolIllegalBuildingDO> listIllegalBuildingsPage(Page page, Integer state, Integer type, Integer resource); Page<CasePoolIllegalBuildingVO> listIllegalBuildingsPage(Page page, Integer state, Integer type, Integer resource); BaseCase selectCondMap(Map map); } ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -8,8 +8,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ycl.bo.AdminUserDetails; import com.ycl.bo.casePool.CasePoolIllegalBuildingDO; import com.ycl.bo.casePool.CasePoolViolationDO; import com.ycl.common.constant.BaseCaseStatus; import com.ycl.common.constant.StepName; import com.ycl.common.util.DateUtil; @@ -28,7 +26,10 @@ import com.ycl.service.caseHandler.IBaseCaseService; import com.ycl.service.caseHandler.IViolationsService; import com.ycl.service.video.IVideoAlarmReportService; import com.ycl.vo.casePool.*; import com.ycl.vo.casePool.CasePoolViolationVO; import com.ycl.vo.casePool.CurrentSitVo; import com.ycl.vo.casePool.FilesPictureVo; import com.ycl.vo.casePool.HandlePassVo; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -43,7 +44,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; /** * <p> @@ -122,9 +122,7 @@ medias = stringBuilder.toString(); } } EventAddParamDto dto = EventAddParamDto.builder().y84(baseCase.getLatitude() != null ? baseCase.getLatitude().toString() : "") .x84(baseCase.getLongitude() != null ? baseCase.getLongitude().toString() : "") .source(11).address(baseCase.getSite()).eventDesc(eventDesc).eventSign(baseCase.getCode()).medias(medias).build(); EventAddParamDto dto = EventAddParamDto.builder().y84(baseCase.getLatitude() != null ? baseCase.getLatitude().toString() : "").x84(baseCase.getLongitude() != null ? baseCase.getLongitude().toString() : "").source(11).address(baseCase.getSite()).eventDesc(eventDesc).eventSign(baseCase.getCode()).medias(medias).build(); String msg = cityPlatformService.addEvent(dto); ResultResponseDto result = JSONObject.parseObject(msg, ResultResponseDto.class); if (result.getCode() == 0) { @@ -157,57 +155,29 @@ Integer type = 01; Integer hours = 60; Integer day = 24; Page<CasePoolViolationDO> violationsPage = baseCaseMapper.listViolationsPage(page, state, type, resource); List<CasePoolViolationVO> violationVOList = violationsPage .getRecords() .stream() .map(item -> { CasePoolViolationVO casePoolViolationVO = new CasePoolViolationVO(); BeanUtils.copyProperties(item, casePoolViolationVO); Page<CasePoolViolationVO> violationsPage = baseCaseMapper.listViolationsPage(page, state, type, resource); violationsPage.getRecords().stream().forEach(item -> { if (item.getCloseTime() == null) { Duration duration = Duration.between(item.getAlarmTime(), LocalDateTime.now()); long continueHours = duration.toHours() - (duration.toDays() * day); long minutes = duration.toMinutes() - (duration.toHours() * hours); String continueTime = duration.toDays() + "天" + continueHours + "时" + minutes + "分钟"; casePoolViolationVO.setContinueTime(continueTime); item.setContinueTime(continueTime); } else { Duration duration = Duration.between(item.getAlarmTime(), item.getCloseTime()); long continueHours = duration.toHours() - (duration.toDays() * day); long minutes = duration.toMinutes() - (duration.toHours() * hours); String continueTime = duration.toDays() + "天" + continueHours + "时" + minutes + "分钟"; casePoolViolationVO.setContinueTime(continueTime); item.setContinueTime(continueTime); } casePoolViolationVO.setCategory(dataDictionaryMapper.selectById(item.getCategoryId()).getName()); casePoolViolationVO.setType(dataDictionaryMapper.selectById(item.getTypeId()).getName()); casePoolViolationVO.setStreet(dataDictionaryMapper.selectById(item.getStreetId()).getName()); return casePoolViolationVO; }).collect(Collectors.toList()); Page<CasePoolViolationVO> casePoolViolationVOPage = new Page<>(); BeanUtils.copyProperties(violationsPage, casePoolViolationVOPage); casePoolViolationVOPage.setRecords(violationVOList); return casePoolViolationVOPage; }); return violationsPage; } @Override public Page listIllegalBuilding(Page page, Integer state, Integer resource) { Integer type = 02; Page<CasePoolIllegalBuildingDO> casePoolIllegalBuildingDTOPage = baseCaseMapper.listIllegalBuildingsPage(page, state, type, resource); List<CasePoolIllegalBuildingVO> casePoolIllegalBuildingVOList = casePoolIllegalBuildingDTOPage .getRecords() .stream() .map( item -> { CasePoolIllegalBuildingVO casePoolIllegalBuildingVO = new CasePoolIllegalBuildingVO(); BeanUtils.copyProperties(item, casePoolIllegalBuildingVO); casePoolIllegalBuildingVO.setCategory(dataDictionaryMapper.selectById(item.getCategoryId()).getName()); casePoolIllegalBuildingVO.setCommunity(dataDictionaryMapper.selectById(item.getCommunityId()).getName()); return casePoolIllegalBuildingVO; } ).collect(Collectors.toList()); Page<CasePoolIllegalBuildingVO> casePoolViolationVOPage = new Page<>(); BeanUtils.copyProperties(casePoolIllegalBuildingDTOPage, casePoolViolationVOPage); casePoolViolationVOPage.setRecords(casePoolIllegalBuildingVOList); return casePoolViolationVOPage; return baseCaseMapper.listIllegalBuildingsPage(page, state, type, resource); } @Override @@ -306,10 +276,7 @@ } for (DisposeRecord record : records) { if (record != null && record.getEndTime() != null && record.getStartTime() != null) { record.setLinkTime( DateUtil.getDistanceDateTime( DateUtil.fromLocalDateTime(record.getStartTime()), DateUtil.fromLocalDateTime(record.getEndTime()))); record.setLinkTime(DateUtil.getDistanceDateTime(DateUtil.fromLocalDateTime(record.getStartTime()), DateUtil.fromLocalDateTime(record.getEndTime()))); } } step.setDisposeRecords(records); @@ -365,12 +332,8 @@ public ArrayList<String> listCaseImages(Integer id, Integer type) { Integer illegalBuildingType = 02; ArrayList<String> caseImages = new ArrayList<>(); caseImages.add(investigationMapper .selectOne(new LambdaQueryWrapper<Investigation>() .eq(Investigation::getBaseCaseId, id)).getPic()); caseImages.add(arrivalSituationMapper .selectOne(new LambdaQueryWrapper<ArrivalSituation>() .eq(ArrivalSituation::getBaseCaseId, id)).getSituationPic()); caseImages.add(investigationMapper.selectOne(new LambdaQueryWrapper<Investigation>().eq(Investigation::getBaseCaseId, id)).getPic()); caseImages.add(arrivalSituationMapper.selectOne(new LambdaQueryWrapper<ArrivalSituation>().eq(ArrivalSituation::getBaseCaseId, id)).getSituationPic()); if (type == illegalBuildingType) { Writ writ = writMapper.selectOne(new LambdaQueryWrapper<Writ>().eq(Writ::getBaseCaseId, id)); caseImages.add(writ.getWritPic()); ycl-platform/src/main/java/com/ycl/vo/casePool/CasePoolViolationVO.java
@@ -69,4 +69,10 @@ */ @ApiModelProperty(value = "持续时间") private String continueTime; /** * 关闭时间 */ @ApiModelProperty(value = "关闭时间") private LocalDateTime closeTime; } ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml
@@ -44,21 +44,24 @@ , code, event_source, category, street_id, community_id, site, longitude, latitude, alarm_time, create_user, state, handling_opinion, remark, audit_opinion, final_opinion, create_time </sql> <select id="listViolationsPage" resultType="com.ycl.bo.casePool.CasePoolViolationDO"> <select id="listViolationsPage" resultType="com.ycl.vo.casePool.CasePoolViolationVO"> SELECT ubc.`id`, ubc.`code`, ubc.event_source, uv.category_id, uv.type_id, uv.action_cause, t3.name as category, t4.name as type, t5.region_name as street, ubc.site, ubc.street_id, ubc.alarm_time, ubc.close_time FROM `ums_base_case` AS ubc JOIN ums_violations AS uv ON ubc.id = uv.id JOIN ums_data_dictionary AS t3 ON uv.category_id = t3.id JOIN ums_data_dictionary AS t4 ON uv.type_id = t4.id JOIN ums_sccg_region t5 ON ubc.street_id = t5.id <where> <if test="state!=null"> ubc.state=#{state} @@ -73,14 +76,14 @@ </select> <select id="listIllegalBuildingsPage" resultType="com.ycl.bo.casePool.CasePoolIllegalBuildingDO"> <select id="listIllegalBuildingsPage" resultType="com.ycl.vo.casePool.CasePoolIllegalBuildingVO"> SELECT ubc.`id`, ubc.`code`, ubc.event_source, uib.category_id, t1.name as category, ubc.site, ubc.community_id, t2.region_name as community, uib.building_high, uib.building_width, uib.building_length, @@ -89,6 +92,8 @@ FROM `ums_base_case` AS ubc JOIN ums_illegal_building AS uib ON ubc.id = uib.base_case_id JOIN ums_data_dictionary AS t1 ON uib.category_id = t1.id JOIN ums_sccg_region t2 ON ubc.community_id = t2.id <where> <if test="state!=null"> ubc.state=#{state} @@ -105,20 +110,17 @@ <select id="selectCondMap" parameterType="map" resultMap="CondMapResultMap"> SELECT ubc.*, SELECT ubc.*, udd.name category_text, usr.region_name street_text, usr2.region_name community_text, ua.username create_user_text FROM ums_base_case ubc FROM ums_base_case ubc LEFT JOIN ums_data_dictionary udd on ubc.category = udd.id and udd.type_code = '01' LEFT JOIN ums_sccg_region usr on ubc.street_id=usr.id LEFT JOIN ums_sccg_region usr2 on ubc.community_id=usr2.id LEFT JOIN ums_admin ua on ubc.create_user = ua.id WHERE ubc.`code` = #{code} WHERE ubc.`code` = #{code} </select> </mapper>