| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.dto.TelecomCabinetLogDTO; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.TelecomJkCabinetLogVO; |
| | | import com.doumee.service.business.third.model.PageData; |
| | | import com.doumee.service.business.third.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | |
| | | QueryWrapper<JkCabinetLog> wrapper = new QueryWrapper<>(jkCabinetLog); |
| | | return jkCabinetLogMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<TelecomJkCabinetLogVO> getLogListForTelecom(TelecomCabinetLogDTO model){ |
| | | MPJLambdaWrapper<JkCabinetLog> wrapper = new MPJLambdaWrapper<JkCabinetLog>() |
| | | .selectAll(JkCabinetLog.class) |
| | | .selectAs(Member::getName,JkCabinetLog::getMemberName) |
| | | .selectAs(Company::getName,JkCabinetLog::getCompanyName) |
| | | .selectAs(JkCabinet::getName,JkCabinetLog::getCabinetName) |
| | | .selectAs(JkCabinetGrid::getCode,JkCabinetLog::getGridCode) |
| | | .selectAs(JkKeys::getCarCode,JkCabinetLog::getCarCode) |
| | | .select("j.CREATE_DATE",JkCabinetLog::getReturnDate) |
| | | .leftJoin(JkCabinet.class,JkCabinet::getId,JkCabinetLog::getCabinetId) |
| | | .leftJoin(JkCabinetGrid.class,JkCabinetGrid::getId,JkCabinetLog::getGridId) |
| | | .leftJoin(JkKeys.class,JkKeys::getId,JkCabinetGrid::getKeyId) |
| | | .leftJoin(Member.class,Member::getId,JkCabinetLog::getMemberId) |
| | | .leftJoin(Company.class,Company::getId,Member::getCompanyId) |
| | | .leftJoin(" jk_cabinet_log j on j.id=t.CLOSE_LOG_ID ") |
| | | .ge(Objects.nonNull(model.getStartDate()),JkCabinetLog::getCreateDate, Utils.Date.getStart(model.getStartDate())) |
| | | .le(Objects.nonNull(model.getEndDate()),JkCabinetLog::getCreateDate, Utils.Date.getEnd(model.getEndDate())) |
| | | .eq(JkCabinetLog::getIsdeleted, Constants.ZERO) |
| | | .eq(JkCabinetLog::getKeyStatus,Constants.TWO) |
| | | .orderByDesc(JkCabinetLog::getCreateDate); |
| | | List<JkCabinetLog> jkCabinetLogs = jkCabinetLogMapper.selectJoinList(JkCabinetLog.class,wrapper); |
| | | List<TelecomJkCabinetLogVO> telecomJkCabinetLogVOList = new ArrayList<TelecomJkCabinetLogVO>(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(jkCabinetLogs)){ |
| | | for (JkCabinetLog jkCabinetLog:jkCabinetLogs) { |
| | | TelecomJkCabinetLogVO telecomJkCabinetLogVO = new TelecomJkCabinetLogVO(); |
| | | BeanUtil.copyProperties(jkCabinetLog,telecomJkCabinetLogVO); |
| | | telecomJkCabinetLogVO.setStatus(Objects.nonNull(jkCabinetLog.getReturnDate())?Constants.ZERO:Constants.ONE); |
| | | telecomJkCabinetLogVOList.add(telecomJkCabinetLogVO); |
| | | } |
| | | } |
| | | return telecomJkCabinetLogVOList; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |