|
|
@@ -3,6 +3,7 @@ package com.sckw.payment.service;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
+import com.sckw.core.utils.StringTimeUtil;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
import com.sckw.payment.dao.KwpSettlementLogisticsMapper;
|
|
|
import com.sckw.payment.model.KwpSettlementLogistics;
|
|
|
@@ -16,6 +17,7 @@ import com.sckw.payment.utils.CommonValidator;
|
|
|
import com.sckw.payment.utils.PageMoreRes;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
@@ -86,6 +88,9 @@ public class KwpSettlementLogisticsService {
|
|
|
* @date 2023-07-24 16:22
|
|
|
*/
|
|
|
public SettlementLogisticsDto detailCollection(Long id) {
|
|
|
+ if (id == null) {
|
|
|
+ throw new BusinessException("结算单ID必传");
|
|
|
+ }
|
|
|
return detail(id, LogisticsUnitType.SHIPPER);
|
|
|
}
|
|
|
|
|
|
@@ -106,17 +111,34 @@ public class KwpSettlementLogisticsService {
|
|
|
* @date 2023-07-21 16:16
|
|
|
*/
|
|
|
public List<SettlementLogisticsDto> selectList(SettlementReq settlementReq) {
|
|
|
+ validSettlementReq(settlementReq);
|
|
|
return settlementLogisticsMapper.selectLogisticsList(settlementReq, settlementReq.getIdList());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- private PageMoreRes<SettlementLogisticsDto> pageSelect(SettlementReq settlementReq) {
|
|
|
+ /**
|
|
|
+ * 验证过滤信息
|
|
|
+ *
|
|
|
+ * @param settlementReq
|
|
|
+ * @author Aick Spt
|
|
|
+ * @date 2023-08-01 10:45
|
|
|
+ */
|
|
|
+ private void validSettlementReq(SettlementReq settlementReq) {
|
|
|
+ //判断时间是否成对
|
|
|
CommonValidator.isValidCoexisting(settlementReq.getStartCreateTime(), settlementReq.getEndCreateTime(), "");
|
|
|
CommonValidator.isValidCoexisting(settlementReq.getStartReceiptTime(), settlementReq.getEndReceiptTime(), "预计付款开始和结束时间");
|
|
|
-
|
|
|
+ //补全时间信息
|
|
|
+ if (StringUtils.isNotBlank(settlementReq.getStartCreateTime())) {
|
|
|
+ settlementReq.setStartCreateTime(StringTimeUtil.fillStart(settlementReq.getStartCreateTime()));
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(settlementReq.getEndCreateTime())) {
|
|
|
+ settlementReq.setEndCreateTime(StringTimeUtil.fillEnd(settlementReq.getEndCreateTime()));
|
|
|
+ }
|
|
|
//加上当前登录者顶级企业id用于过滤数据
|
|
|
settlementReq.setEntId(LoginUserHolder.getEntId());
|
|
|
+ }
|
|
|
|
|
|
+ private PageMoreRes<SettlementLogisticsDto> pageSelect(SettlementReq settlementReq) {
|
|
|
+ validSettlementReq(settlementReq);
|
|
|
PageHelper.startPage(settlementReq.getPage(), settlementReq.getPageSize());
|
|
|
List<SettlementLogisticsDto> kwpLedgerLogisticsList = settlementLogisticsMapper.pageSelect(settlementReq);
|
|
|
SettlementLogisticsSumVo settlementLogisticsSum = settlementLogisticsMapper.selectSum(settlementReq);
|
|
|
@@ -133,6 +155,7 @@ public class KwpSettlementLogisticsService {
|
|
|
}
|
|
|
|
|
|
public SettlementLogisticsStatusCountVo getCountList(SettlementReq settlementReq) {
|
|
|
+ validSettlementReq(settlementReq);
|
|
|
SettlementLogisticsStatusCountVo settlementLogisticsStatusCountVos = new SettlementLogisticsStatusCountVo();
|
|
|
|
|
|
//加上当前登录者顶级企业id用于过滤数据
|