| | |
| | | |
| | | @Override |
| | | public IPage<NotificationManagement> listpage(Page page, NotificationManagement notificationManagement) { |
| | | // // 1. 创建 Page 实例(IPage 实现类),指定页码和每页条数 |
| | | // IPage<NotificationManagement> page1 = new Page<>(page.getCurrent(), page.getSize()); |
| | | return notificationManagementMapper.listpage(page,notificationManagement); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.collaborativeApproval.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.collaborativeApproval.dto.NoticeDTO; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | @Slf4j |
| | |
| | | |
| | | @Override |
| | | public List<NoticeDTO> selectCount() { |
| | | List<Notice> notices = noticeMapper.selectList(Wrappers.lambdaQuery(Notice.class).groupBy(Notice::getType)); |
| | | List<Notice> noticesList = noticeMapper.selectList(null); |
| | | Map<String, Notice> uniqueByType = noticesList.stream() |
| | | .collect(Collectors.toMap( |
| | | Notice::getType, |
| | | n -> n, |
| | | (existing, replacement) -> existing |
| | | )); |
| | | |
| | | List<Notice> notices = new ArrayList<>(uniqueByType.values()); |
| | | Map<String, Long> countMap = noticesList.stream().collect(Collectors.groupingBy(Notice::getType, Collectors.counting())); |
| | | List<NoticeDTO> result = new ArrayList<>(); |
| | | for (Notice notice : notices) { |
| | | NoticeDTO notice1 = new NoticeDTO(); |
| | | BeanUtils.copyProperties(notice, notice1); |
| | | notice1.setCount(noticeMapper.selectCount(new LambdaQueryWrapper<Notice>().eq(Notice::getType, notice.getType()))); |
| | | if (countMap.containsKey(notice.getType())) { |
| | | notice1.setCount(countMap.get(notice.getType()) == null ? 0 : countMap.get(notice.getType())); |
| | | } |
| | | result.add(notice1); |
| | | } |
| | | return result; |
| | |
| | | |
| | | @Override |
| | | public IPage<CompensationPerformance> listPage(Page page, CompensationPerformance compensationPerformance) { |
| | | IPage<CompensationPerformance> compensationPerformanceIPage = compensationPerformanceMapper.listPage(page, compensationPerformance); |
| | | return compensationPerformanceIPage; |
| | | return compensationPerformanceMapper.listPage(page, compensationPerformance); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.customervisits.pojo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
| | | import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author :yys |
| | |
| | | if (customerVisits != null && !StringUtils.isEmpty(customerVisits.getCustomerName())) { |
| | | customerVisitsLambdaQueryWrapper.like(CustomerVisits::getCustomerName, customerVisits.getCustomerName()); |
| | | } |
| | | Page page1 = customerVisitsMapper.selectPage(page, customerVisitsLambdaQueryWrapper); |
| | | return page1; |
| | | return customerVisitsMapper.selectPage(page, customerVisitsLambdaQueryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean updateCustomerVisit(CustomerVisits customerVisits) { |
| | | if (customerVisits == null || customerVisits.getId() == null) { |
| | | return false; |
| | | throw new RuntimeException("客户ID不能为空"); |
| | | } |
| | | |
| | | if (StringUtils.isEmpty(customerVisits.getCustomerName()) |
| | | || StringUtils.isEmpty(customerVisits.getPurposeVisit()) |
| | | || StringUtils.isEmpty(customerVisits.getVisitAddress()) |
| | | || StringUtils.isEmpty(customerVisits.getPurposeDate())) { |
| | | return false; |
| | | throw new RuntimeException("客户名称、拜访目的、拜访地址、拜访时间不能为空"); |
| | | } |
| | | |
| | | return updateById(customerVisits); |
| | |
| | | public boolean updateByDDR(DeviceDefectRecord deviceDefectRecord) { |
| | | String status = deviceDefectRecord.getStatus(); |
| | | if (status.equals("严重缺陷")) { |
| | | // deviceDefectRecord.setStatus("正常"); |
| | | // deviceDefectRecord.setEliminateTime(LocalDateTime.now()); |
| | | throw new RuntimeException("严重缺陷-设备维修后更新为正常状态"); |
| | | } else if (status.equals("一般缺陷")) { |
| | | } |
| | | if (status.equals("一般缺陷")) { |
| | | deviceDefectRecord.setStatus("正常"); |
| | | } |
| | | deviceDefectRecord.setEliminateTime(LocalDateTime.now()); |
| | |
| | | util.exportExcel(response, deviceLedgerExeclDtos, "设备台账导出"); |
| | | }else { |
| | | ArrayList<Long> arrayList = new ArrayList<>(); |
| | | Arrays.stream(ids).map(id -> { |
| | | return arrayList.add( id); |
| | | }); |
| | | Arrays.stream(ids).map(arrayList::add); |
| | | List<DeviceLedger> supplierManageList = deviceLedgerMapper.selectBatchIds(arrayList); |
| | | ArrayList<DeviceLedgerExeclDto> deviceLedgerExeclDtos = new ArrayList<>(); |
| | | supplierManageList.stream().forEach(deviceLedger -> { |
| | |
| | | DeviceMaintenanceExeclDto deviceRepairExeclDto = new DeviceMaintenanceExeclDto(); |
| | | BeanUtils.copyProperties(deviceMaintenance,deviceRepairExeclDto); |
| | | deviceRepairExeclDto.setStatus(deviceMaintenance.getStatus() == 0 ? "待维修" : deviceMaintenance.getStatus() == 1 ? "完结" : "失败"); |
| | | // deviceRepairExeclDto.setMaintenanceResult(deviceMaintenance.getMaintenanceResult() != null && deviceMaintenance.getMaintenanceResult() == 0 ? "维修" : "完好"); |
| | | deviceLedgerExeclDtos.add(deviceRepairExeclDto); |
| | | }); |
| | | ExcelUtil<DeviceMaintenanceExeclDto> util = new ExcelUtil<DeviceMaintenanceExeclDto>(DeviceMaintenanceExeclDto.class); |
| | |
| | | util.exportExcel(response, deviceLedgerExeclDtos, "设备报修导出"); |
| | | }else { |
| | | ArrayList<Long> arrayList = new ArrayList<>(); |
| | | Arrays.stream(ids).map(id -> { |
| | | return arrayList.add( id); |
| | | }); |
| | | Arrays.stream(ids).map(arrayList::add); |
| | | List<DeviceRepair> supplierManageList = deviceRepairMapper.selectBatchIds(arrayList); |
| | | ArrayList<DeviceRepairExeclDto> deviceLedgerExeclDtos = new ArrayList<>(); |
| | | supplierManageList.stream().forEach(deviceRepair -> { |
| | |
| | | |
| | | @Override |
| | | public IPage<EnergyPeriod> listPage(Page page, EnergyPeriod energyPeriod) { |
| | | IPage<EnergyPeriod> listPage = energyPeriodMapper.listPage(page, energyPeriod); |
| | | return listPage; |
| | | return energyPeriodMapper.listPage(page, energyPeriod); |
| | | } |
| | | } |
| | |
| | | List<OaProjectPhaseDto> collect = oaProjectPhases.stream().map(oaProjectPhase -> { |
| | | OaProjectPhaseDto oaProjectPhaseDto = new OaProjectPhaseDto(); |
| | | BeanUtils.copyProperties(oaProjectPhase, oaProjectPhaseDto); |
| | | // List<OaProjectPhaseTask> oaProjectPhaseTasks = oaProjectPhaseTaskService.listByPhaseId(oaProjectPhaseDto.getPhaseId()); |
| | | oaProjectPhaseDto.setOaProjectPhaseTasks(oaProjectPhaseTaskService.listByPhaseId(oaProjectPhaseDto.getPhaseId())); |
| | | return oaProjectPhaseDto; |
| | | }).collect(Collectors.toList()); |
| | |
| | | package com.ruoyi.procurementrecord.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.procurementrecord.dto.ProcurementPageDto; |
| | | import com.ruoyi.procurementrecord.mapper.GasTankWarningMapper; |
| | | import com.ruoyi.procurementrecord.pojo.GasTankWarning; |
| | | import com.ruoyi.procurementrecord.service.GasTankWarningService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | |
| | | @Override |
| | | public void export(HttpServletResponse response, List<Long> ids) { |
| | | List<GasTankWarning> list = new ArrayList<>(); |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | list = gasTankWarningMapper.selectList(null); |
| | | }else { |
| | | list = gasTankWarningMapper.selectBatchIds(ids); |
| | | LambdaQueryWrapper<GasTankWarning> objectLambdaQueryWrapper = new LambdaQueryWrapper<GasTankWarning>(); |
| | | if (CollectionUtils.isNotEmpty(ids)) { |
| | | objectLambdaQueryWrapper.in(GasTankWarning::getId, ids); |
| | | } |
| | | List<GasTankWarning> list = gasTankWarningMapper.selectList(objectLambdaQueryWrapper); |
| | | ExcelUtil<GasTankWarning> util = new ExcelUtil<>(GasTankWarning.class); |
| | | util.exportExcel(response, list, "储气罐预警.xlsx"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public IPage<InboundManagement> listPage(Page page, InboundManagement inboundManagement) { |
| | | IPage<InboundManagement> result = inboundManagementMapper.listPage(page, inboundManagement); |
| | | return result; |
| | | return inboundManagementMapper.listPage(page, inboundManagement); |
| | | } |
| | | } |
| | |
| | | |
| | | @Override |
| | | public IPage<ProcurementPlan> listPage(Page page, ProcurementPlan procurementPlan) { |
| | | IPage<ProcurementPlan> result = procurementPlanMapper.listPage(page, procurementPlan); |
| | | return result; |
| | | return procurementPlanMapper.listPage(page, procurementPlan); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public IPage<ReturnManagement> listPage(Page page, ReturnManagement returnManagement) { |
| | | IPage<ReturnManagement> returnManagementIPage = returnManagementMapper.listPage(page, returnManagement); |
| | | return returnManagementIPage; |
| | | return returnManagementMapper.listPage(page, returnManagement); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.production.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | |
| | | import com.ruoyi.production.mapper.ProcessRouteItemMapper; |
| | | import com.ruoyi.production.mapper.ProcessRouteMapper; |
| | | import com.ruoyi.production.mapper.ProductOrderMapper; |
| | | import com.ruoyi.production.mapper.ProductProcessRouteMapper; |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | import com.ruoyi.production.pojo.ProcessRouteItem; |
| | | import com.ruoyi.production.pojo.ProductOrder; |
| | | import com.ruoyi.production.pojo.ProductProcessRoute; |
| | | import com.ruoyi.production.service.ProcessRouteService; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | |
| | | public int batchDelete(List<Long> ids) { |
| | | //先判断是否已经引用了 |
| | | List<ProductOrder> productOrders = productOrderMapper.selectList(Wrappers.<ProductOrder>lambdaQuery().in(ProductOrder::getRouteId, ids)); |
| | | if (productOrders.size()>0){ |
| | | if (CollectionUtils.isNotEmpty(productOrders)){ |
| | | throw new RuntimeException("该工艺路线生产已引用,不能删除"); |
| | | } |
| | | //删除工艺路线详情 |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.security.LoginUser; |
| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | } |
| | | // 获取空余炒机 |
| | | String[] split = productionDispatchAddDto.getSpeculativeTradingName().split(","); |
| | | if(split != null && split.length == 0){ |
| | | if(split.length == 0){ |
| | | i++; |
| | | continue; |
| | | } |