Administrator
2024-01-22 8394c7de622940269dca3160b8e74a99bcb87a4f
pipIrr-platform/pipIrr-web/pipIrr-web-sell/src/main/java/com/dy/pipIrrSell/cardOperate/CardOperateSv.java
@@ -2,24 +2,25 @@
import com.dy.common.webUtil.BaseResponse;
import com.dy.common.webUtil.BaseResponseUtils;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoSe.SeCardOperateMapper;
import com.dy.pipIrrGlobal.daoSe.SeClientCardMapper;
import com.dy.pipIrrGlobal.daoSe.SeClientMapper;
import com.dy.pipIrrGlobal.pojoSe.SeCardOperate;
import com.dy.pipIrrGlobal.pojoSe.SeClientCard;
import com.dy.pipIrrGlobal.voSe.VoRecharge;
import com.dy.pipIrrSell.cardOperate.dto.DtoRecharge;
import com.dy.pipIrrSell.cardOperate.enums.OperateTypeENUM;
import com.dy.pipIrrSell.cardOperate.qo.QoRecharge;
import com.dy.pipIrrSell.clientCard.ClientCardSv;
import com.dy.pipIrrSell.clientCard.LastOperateENUM;
import com.dy.pipIrrSell.result.SellResultCode;
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.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.*;
/**
 * @author ZhuBaoMin
@@ -63,6 +64,14 @@
        return seClientMapper.getAreaCodeByNum(clientNum);
    }
    /**
     * 根据农户编号获取5级行政区划串areaCode,补卡过程中开新卡使用
     * @param clientId
     * @return
     */
    public Long getAreaCodeById(Long clientId) {
        return seClientMapper.getAreaCodeById(clientId);
    }
    /**
     * 根据行政区划串模块查询水卡编号,开卡使用
     * @param areaCode
@@ -174,4 +183,41 @@
        return BaseResponseUtils.buildSuccess(true) ;
    }
    public QueryResultVo<List<VoRecharge>> getRecharges(QoRecharge queryVo) {
        //完善查询充值记录的起止时间
        String rechargeTimeStart = queryVo.rechargeTimeStart;
        String rechargeTimeStop = queryVo.rechargeTimeStop;
        if(rechargeTimeStart != null) {
            rechargeTimeStart = rechargeTimeStart + " 00:00:00";
            queryVo.setRechargeTimeStart(rechargeTimeStart);
        }
        if(rechargeTimeStop != null) {
            rechargeTimeStop = rechargeTimeStop + " 23:59:59";
            queryVo.setRechargeTimeStop(rechargeTimeStop);
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(queryVo);
        Long itemTotal = seCardOperateMapper.getRecordCount(params);
        QueryResultVo<List<VoRecharge>> rsVo = new QueryResultVo<>() ;
        Integer pageCurr = 0;
        Integer pageSize = 10000;
        rsVo.pageCurr = 1;
        rsVo.pageSize = 10000;
        if(queryVo.pageSize != null && queryVo.pageCurr != null) {
            rsVo.pageSize = queryVo.pageSize ;
            rsVo.pageCurr = queryVo.pageCurr;
            pageSize = queryVo.pageSize ;
            pageCurr = (Integer.parseInt(params.get("pageCurr").toString()) - 1) * Integer.parseInt(params.get("pageSize").toString());
        }
        params.put("pageCurr", pageCurr);
        params.put("pageSize", pageSize);
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = seCardOperateMapper.getRecharges(params);
        return rsVo ;
    }
}