| New file | 
|  |  |  | 
|---|
|  |  |  | package com.dy.pipIrrSell.loss; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.dy.common.webUtil.QueryResultVo; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.daoSe.SeLossMapper; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.pojoSe.SeLoss; | 
|---|
|  |  |  | import com.dy.pipIrrGlobal.voSe.VoLoss; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.apache.dubbo.common.utils.PojoUtils; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * @author ZhuBaoMin | 
|---|
|  |  |  | * @date 2023/12/6 9:46 | 
|---|
|  |  |  | * @LastEditTime 2023/12/6 9:46 | 
|---|
|  |  |  | * @Description | 
|---|
|  |  |  | */ | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | public class LossSv { | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private SeLossMapper seLossMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public QueryResultVo<List<VoLoss>> getLosses(QueryVo queryVo) { | 
|---|
|  |  |  | String lossTimeStart = queryVo.lossTimeStart; | 
|---|
|  |  |  | String lossTimeStop = queryVo.lossTimeStop; | 
|---|
|  |  |  | if(lossTimeStart != null) { | 
|---|
|  |  |  | lossTimeStart = lossTimeStart + " 00:00:00"; | 
|---|
|  |  |  | queryVo.setLossTimeStart(lossTimeStart); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(lossTimeStop != null) { | 
|---|
|  |  |  | lossTimeStop = lossTimeStop + " 23:59:59"; | 
|---|
|  |  |  | queryVo.setLossTimeStop(lossTimeStop); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | Long itemTotal = seLossMapper.getRecordCount(params); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | QueryResultVo<List<VoLoss>> rsVo = new QueryResultVo<>() ; | 
|---|
|  |  |  | rsVo.pageSize = queryVo.pageSize ; | 
|---|
|  |  |  | rsVo.pageCurr = queryVo.pageCurr ; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | rsVo.calculateAndSet(itemTotal, params); | 
|---|
|  |  |  | rsVo.obj = seLossMapper.getLosses(params); | 
|---|
|  |  |  | return rsVo ; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 添加挂失记录 | 
|---|
|  |  |  | * @param po | 
|---|
|  |  |  | * @return | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | public Long add(SeLoss po) { | 
|---|
|  |  |  | seLossMapper.insert(po); | 
|---|
|  |  |  | return po.getId(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|