|
|
@@ -2,40 +2,78 @@ package com.sckw.payment.service;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.sckw.core.common.enums.enums.DictTypeEnum;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.model.page.PageRes;
|
|
|
+import com.sckw.core.utils.CollectionUtils;
|
|
|
import com.sckw.core.utils.IdWorker;
|
|
|
+import com.sckw.core.utils.OrderGenerateUtils;
|
|
|
import com.sckw.payment.dao.KwpLedgerLogisticsMapper;
|
|
|
-import com.sckw.payment.dao.KwpLedgerLogisticsOrderMapper;
|
|
|
-import com.sckw.payment.model.KwpLedgerLogistics;
|
|
|
-import com.sckw.payment.model.KwpLedgerLogisticsOrder;
|
|
|
-import com.sckw.payment.model.KwpLedgerLogisticsTrack;
|
|
|
-import com.sckw.payment.model.KwpSettlementLogistics;
|
|
|
+import com.sckw.payment.model.*;
|
|
|
import com.sckw.payment.model.constant.LedgerEnum;
|
|
|
import com.sckw.payment.model.constant.LedgerTrackEnum;
|
|
|
+import com.sckw.payment.model.constant.LogisticsUnitType;
|
|
|
+import com.sckw.payment.model.dto.LedgerCountVo;
|
|
|
import com.sckw.payment.model.dto.LedgerLogisticsDto;
|
|
|
import com.sckw.payment.model.vo.req.*;
|
|
|
-import lombok.AllArgsConstructor;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
+import com.sckw.system.api.RemoteSystemService;
|
|
|
+import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
+import com.sckw.transport.api.dubbo.TransportDubboService;
|
|
|
+import com.sckw.transport.api.model.dto.vo.KwtLogisticsOrderVO;
|
|
|
+import jakarta.annotation.Resource;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Objects;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author xucaiqin
|
|
|
* @date 2023-07-10 16:38:36
|
|
|
*/
|
|
|
@Service
|
|
|
-@AllArgsConstructor
|
|
|
+@Slf4j
|
|
|
public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
- private final KwpLedgerLogisticsTrackService logisticsTrackService;
|
|
|
- private final KwpSettlementLogisticsService settlementLogisticsService;
|
|
|
- private final KwpLedgerLogisticsMapper logisticsMapper;
|
|
|
- private final KwpLedgerLogisticsOrderMapper logisticsOrderMapper;
|
|
|
+ @Resource
|
|
|
+ private KwpLedgerLogisticsTrackService logisticsTrackService;
|
|
|
+ @Resource
|
|
|
+ private KwpSettlementLogisticsService settlementLogisticsService;
|
|
|
+ @Resource
|
|
|
+ private KwpLedgerLogisticsUnitService logisticsUnitService;
|
|
|
+ @Resource
|
|
|
+ private KwpLedgerLogisticsOrderService logisticsOrderService;
|
|
|
+ @Resource
|
|
|
+ private KwpLedgerLogisticsMapper logisticsMapper;
|
|
|
+ @DubboReference(version = "2.0.0", group = "design", check = false)
|
|
|
+ private RemoteSystemService remoteSystemService;
|
|
|
+ @DubboReference(version = "2.0.0", group = "design", check = false)
|
|
|
+ private TransportDubboService transportDubboService;
|
|
|
+
|
|
|
+ private void changeDict(List<LedgerLogisticsDto> list) {
|
|
|
+ List<SysDictResDto> taxRateDict = remoteSystemService.queryDictByType(DictTypeEnum.TAX_RATE.getType());
|
|
|
+ Map<String, String> taxRateMap = new HashMap<>();
|
|
|
+ Map<String, String> tradingMap = new HashMap<>();
|
|
|
+
|
|
|
+ if (!CollectionUtils.isEmpty(taxRateDict)) {
|
|
|
+ taxRateMap = taxRateDict.stream().collect(Collectors.toMap(SysDictResDto::getValue, SysDictResDto::getLabel, (a, b) -> a));
|
|
|
+ }
|
|
|
+ List<SysDictResDto> tradingDict = remoteSystemService.queryDictByType(DictTypeEnum.TRADE_TYPE.getType());
|
|
|
+ if (!CollectionUtils.isEmpty(tradingDict)) {
|
|
|
+ tradingMap = tradingDict.stream().collect(Collectors.toMap(SysDictResDto::getValue, SysDictResDto::getLabel, (a, b) -> a));
|
|
|
+ }
|
|
|
+ for (LedgerLogisticsDto logisticsDto : list) {
|
|
|
+ Integer trading = logisticsDto.getTrading();
|
|
|
+ logisticsDto.setTradingLabel(tradingMap.get(String.valueOf(trading)));
|
|
|
+ Integer taxRate = logisticsDto.getTaxRate();
|
|
|
+ logisticsDto.setTaxRateLabel(taxRateMap.get(String.valueOf(taxRate)));
|
|
|
+
|
|
|
+ logisticsDto.setStatusLabel(LedgerEnum.getDesc(logisticsDto.getStatus()));
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 分页查询物流对账单列表
|
|
|
@@ -44,15 +82,12 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
* @return
|
|
|
*/
|
|
|
public PageRes<LedgerLogisticsDto> pageList(LogisticsReq logisticsReq) {
|
|
|
- //todo 查询缓存,获取客户企业id
|
|
|
- String keywords = logisticsReq.getKeywords();
|
|
|
- if (StringUtils.isNotBlank(keywords)) {
|
|
|
-
|
|
|
- }
|
|
|
PageHelper.startPage(logisticsReq.getPage(), logisticsReq.getPageSize());
|
|
|
-
|
|
|
List<LedgerLogisticsDto> kwpLedgerLogisticsList = logisticsMapper.pageSelect(logisticsReq, new ArrayList<>());
|
|
|
-
|
|
|
+ //字典转换
|
|
|
+ if (!CollectionUtils.isEmpty(kwpLedgerLogisticsList)) {
|
|
|
+ changeDict(kwpLedgerLogisticsList);
|
|
|
+ }
|
|
|
return new PageRes<>(new PageInfo<>(kwpLedgerLogisticsList));
|
|
|
}
|
|
|
|
|
|
@@ -67,10 +102,129 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
Long id = logisticsReq.getId();
|
|
|
if (Objects.isNull(id)) {
|
|
|
//新增
|
|
|
+ logisticsReq.setGenerateTime(LocalDateTime.now());
|
|
|
+ logisticsReq.setStatus(LedgerEnum.TO_LEDGER.getStatus());
|
|
|
+ Long aLong = saveDraft(logisticsReq);
|
|
|
+ logisticsTrackService.saveTrack(aLong, "", LedgerTrackEnum.TO_LEDGER);
|
|
|
+ } else {
|
|
|
+ removeDraft(id);
|
|
|
+ logisticsReq.setGenerateTime(LocalDateTime.now());
|
|
|
+ logisticsReq.setStatus(LedgerEnum.TO_LEDGER.getStatus());
|
|
|
+ Long aLong = saveDraft(logisticsReq);
|
|
|
+ logisticsTrackService.saveTrack(aLong, "", LedgerTrackEnum.TO_LEDGER);
|
|
|
+
|
|
|
+ }
|
|
|
+ return "保存对账单成功";
|
|
|
+ }
|
|
|
+
|
|
|
+ private void removeDraft(Long id) {
|
|
|
+ //删除 kwp_ledger_logistics_order
|
|
|
+ logisticsOrderService.remove(id);
|
|
|
+ //删除 kwp_ledger_logistics_track
|
|
|
+ logisticsTrackService.remove(id);
|
|
|
+ //删除 kwp_ledger_logistics_unit
|
|
|
+ logisticsUnitService.remove(id);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Long saveDraft(LogisticsSendReq logisticsSendReq) {
|
|
|
+ KwpLedgerLogistics kwpLedgerLogistics = new KwpLedgerLogistics();
|
|
|
+ kwpLedgerLogistics.setId(Objects.isNull(logisticsSendReq.getId()) ? new IdWorker(1).nextId() : logisticsSendReq.getId());
|
|
|
+ kwpLedgerLogistics.setEntId(0L);
|
|
|
+ kwpLedgerLogistics.setName(logisticsSendReq.getName());
|
|
|
+ kwpLedgerLogistics.setStartTime(logisticsSendReq.getStartTime());
|
|
|
+ kwpLedgerLogistics.setEndTime(logisticsSendReq.getEndTime());
|
|
|
+ kwpLedgerLogistics.setTaxRate(logisticsSendReq.getTaxRate());
|
|
|
+ kwpLedgerLogistics.setTrading(logisticsSendReq.getTrading());
|
|
|
+ kwpLedgerLogistics.setTotalPrice(logisticsSendReq.getTotalPrice());
|
|
|
+ kwpLedgerLogistics.setExTaxPrice(logisticsSendReq.getTotalPrice());//todo 不含税金额计算方式:订单含税金额总和/1.13(税率)
|
|
|
+ kwpLedgerLogistics.setSettlePrice(logisticsSendReq.getSettlePrice());
|
|
|
+ kwpLedgerLogistics.setActualPrice(new BigDecimal("0.0"));
|
|
|
+ kwpLedgerLogistics.setAuditUser("");
|
|
|
+ kwpLedgerLogistics.setAuditPhone("");
|
|
|
+ kwpLedgerLogistics.setReceiptTime(null);
|
|
|
+ kwpLedgerLogistics.setOrderCount(logisticsSendReq.getIds().size());
|
|
|
+ kwpLedgerLogistics.setUrl("");
|
|
|
+ kwpLedgerLogistics.setGenerateTime(logisticsSendReq.getGenerateTime());
|
|
|
+ kwpLedgerLogistics.setRemark("");
|
|
|
+ kwpLedgerLogistics.setStatus(logisticsSendReq.getStatus());
|
|
|
+ kwpLedgerLogistics.setCreateBy(0L);
|
|
|
+ kwpLedgerLogistics.setCreateTime(LocalDateTime.now());
|
|
|
+ kwpLedgerLogistics.setUpdateBy(0L);
|
|
|
+ kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
|
|
|
+ kwpLedgerLogistics.setDelFlag(0);
|
|
|
+ if (Objects.isNull(logisticsSendReq.getId())) {
|
|
|
+ kwpLedgerLogistics.setLLedgerNo(OrderGenerateUtils.generateOrderNo("LL"));
|
|
|
+ logisticsMapper.insert(kwpLedgerLogistics);
|
|
|
} else {
|
|
|
- //修改
|
|
|
+ logisticsMapper.updateById(kwpLedgerLogistics);
|
|
|
+ }
|
|
|
+ /*保存物流订单关联数据*/
|
|
|
+ List<String> ids = logisticsSendReq.getIds();
|
|
|
+ List<KwtLogisticsOrderVO> acceptCarriageOrderDetail = transportDubboService.getAcceptCarriageOrderDetail(ids);
|
|
|
+ if (CollectionUtils.isEmpty(acceptCarriageOrderDetail)) {
|
|
|
+ throw new BusinessException("未找到物流订单!");
|
|
|
}
|
|
|
- return "新增对账单成功";
|
|
|
+ List<KwpLedgerLogisticsOrder> collect = acceptCarriageOrderDetail.stream().map(a -> {
|
|
|
+ KwpLedgerLogisticsOrder logisticsOrder = new KwpLedgerLogisticsOrder();
|
|
|
+ logisticsOrder.setId(new IdWorker(1).nextId());
|
|
|
+ logisticsOrder.setLLedgerId(kwpLedgerLogistics.getId());
|
|
|
+ logisticsOrder.setLOrderId(a.getId());
|
|
|
+ logisticsOrder.setRemark("");
|
|
|
+ logisticsOrder.setStatus(0);
|
|
|
+ logisticsOrder.setCreateBy(0L);
|
|
|
+ logisticsOrder.setCreateTime(LocalDateTime.now());
|
|
|
+ logisticsOrder.setUpdateBy(0L);
|
|
|
+ logisticsOrder.setUpdateTime(LocalDateTime.now());
|
|
|
+ logisticsOrder.setDelFlag(0);
|
|
|
+ return logisticsOrder;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+ logisticsOrderService.saveList(collect);
|
|
|
+ /*保存企业相关信息*/
|
|
|
+ Long checkEntId = logisticsSendReq.getCheckEntId();
|
|
|
+
|
|
|
+ List<KwpLedgerLogisticsUnit> logisticsUnits = new ArrayList<>();
|
|
|
+ KwpLedgerLogisticsUnit kwpLedgerLogisticsUnit = new KwpLedgerLogisticsUnit();
|
|
|
+ kwpLedgerLogisticsUnit.setId(new IdWorker(1).nextId());
|
|
|
+ kwpLedgerLogisticsUnit.setLLedgerId(kwpLedgerLogistics.getId());
|
|
|
+ kwpLedgerLogisticsUnit.setLLedgerNo(kwpLedgerLogistics.getLLedgerNo());
|
|
|
+ kwpLedgerLogisticsUnit.setUnitType(LogisticsUnitType.SHIPPER);
|
|
|
+ kwpLedgerLogisticsUnit.setEntId(checkEntId);
|
|
|
+ kwpLedgerLogisticsUnit.setTopEntId(checkEntId);//todo
|
|
|
+ kwpLedgerLogisticsUnit.setFirmName("");
|
|
|
+ kwpLedgerLogisticsUnit.setContacts("");
|
|
|
+ kwpLedgerLogisticsUnit.setPhone("");
|
|
|
+ kwpLedgerLogisticsUnit.setRemark("");
|
|
|
+ kwpLedgerLogisticsUnit.setStatus(0);
|
|
|
+ kwpLedgerLogisticsUnit.setCreateBy(0L);
|
|
|
+ kwpLedgerLogisticsUnit.setCreateTime(LocalDateTime.now());
|
|
|
+ kwpLedgerLogisticsUnit.setUpdateBy(0L);
|
|
|
+ kwpLedgerLogisticsUnit.setUpdateTime(LocalDateTime.now());
|
|
|
+ kwpLedgerLogisticsUnit.setDelFlag(0);
|
|
|
+
|
|
|
+ logisticsUnits.add(kwpLedgerLogisticsUnit);
|
|
|
+
|
|
|
+ KwpLedgerLogisticsUnit carrierUnit = new KwpLedgerLogisticsUnit();
|
|
|
+ carrierUnit.setId(new IdWorker(1).nextId());
|
|
|
+ carrierUnit.setLLedgerId(kwpLedgerLogistics.getId());
|
|
|
+ carrierUnit.setLLedgerNo(kwpLedgerLogistics.getLLedgerNo());
|
|
|
+ carrierUnit.setUnitType(LogisticsUnitType.CARRIER);
|
|
|
+ carrierUnit.setEntId(checkEntId);//todo
|
|
|
+ carrierUnit.setTopEntId(checkEntId);//todo
|
|
|
+ carrierUnit.setFirmName("");
|
|
|
+ carrierUnit.setContacts("");
|
|
|
+ carrierUnit.setPhone("");
|
|
|
+ carrierUnit.setRemark("");
|
|
|
+ carrierUnit.setStatus(0);
|
|
|
+ carrierUnit.setCreateBy(0L);
|
|
|
+ carrierUnit.setCreateTime(LocalDateTime.now());
|
|
|
+ carrierUnit.setUpdateBy(0L);
|
|
|
+ carrierUnit.setUpdateTime(LocalDateTime.now());
|
|
|
+ carrierUnit.setDelFlag(0);
|
|
|
+
|
|
|
+ logisticsUnits.add(carrierUnit);
|
|
|
+ logisticsUnitService.saveList(logisticsUnits);
|
|
|
+ return kwpLedgerLogistics.getId();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -81,48 +235,11 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String sendLedgerDraft(LogisticsSendReq logisticsReq) {
|
|
|
- /*插入物流对账单*/
|
|
|
- KwpLedgerLogistics kwpLedgerLogistics = new KwpLedgerLogistics();
|
|
|
- kwpLedgerLogistics.setId(new IdWorker(1).nextId());
|
|
|
- kwpLedgerLogistics.setEntId(0L);//todo
|
|
|
- kwpLedgerLogistics.setLLedgerNo("");//todo
|
|
|
- kwpLedgerLogistics.setName(logisticsReq.getName());
|
|
|
- kwpLedgerLogistics.setStartTime(logisticsReq.getStartTime());
|
|
|
- kwpLedgerLogistics.setEndTime(logisticsReq.getEndTime());
|
|
|
- kwpLedgerLogistics.setTaxRate(logisticsReq.getTaxRate());//todo 发票税率数据库字段类型
|
|
|
- kwpLedgerLogistics.setTrading(logisticsReq.getTrading());
|
|
|
- kwpLedgerLogistics.setTotalPrice(logisticsReq.getTotalPrice());
|
|
|
- kwpLedgerLogistics.setSettlePrice(logisticsReq.getSettlePrice());
|
|
|
- //todo 查询运单
|
|
|
-
|
|
|
- kwpLedgerLogistics.setUnloadAmount(new BigDecimal("0"));
|
|
|
- kwpLedgerLogistics.setLoadAmount(new BigDecimal("0"));
|
|
|
- kwpLedgerLogistics.setDeficitAmount(new BigDecimal("0"));
|
|
|
- kwpLedgerLogistics.setLoseAmount(new BigDecimal("0"));
|
|
|
- kwpLedgerLogistics.setActualPrice(new BigDecimal("0"));
|
|
|
- kwpLedgerLogistics.setGenerateTime(null);
|
|
|
- kwpLedgerLogistics.setUrl("");
|
|
|
- kwpLedgerLogistics.setRemark(logisticsReq.getRemark());
|
|
|
- kwpLedgerLogistics.setStatus(LedgerEnum.SAVE.getStatus());
|
|
|
- kwpLedgerLogistics.setCreateBy(0L);//todo
|
|
|
- kwpLedgerLogistics.setCreateTime(LocalDateTime.now());
|
|
|
- kwpLedgerLogistics.setUpdateBy(0L);
|
|
|
- kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
|
|
|
- kwpLedgerLogistics.setDelFlag(0);
|
|
|
- logisticsMapper.insert(kwpLedgerLogistics);
|
|
|
- /*插入对账关联物流运单*/
|
|
|
- List<Long> ids = logisticsReq.getIds();
|
|
|
- for (Long id : ids) {
|
|
|
- KwpLedgerLogisticsOrder kwpLedgerLogisticsOrder = new KwpLedgerLogisticsOrder();
|
|
|
- kwpLedgerLogisticsOrder.setId(new IdWorker(1).nextId());
|
|
|
- kwpLedgerLogisticsOrder.setLLedgerId(kwpLedgerLogistics.getId());
|
|
|
- kwpLedgerLogisticsOrder.setLOrderId(id);
|
|
|
- kwpLedgerLogisticsOrder.setRemark("");
|
|
|
- kwpLedgerLogisticsOrder.setStatus(0);
|
|
|
- logisticsOrderMapper.insert(kwpLedgerLogisticsOrder);
|
|
|
- }
|
|
|
- logisticsTrackService.saveTrack(kwpLedgerLogistics.getId(), "", LedgerTrackEnum.SAVE);
|
|
|
- return "保存成功";
|
|
|
+ logisticsReq.setGenerateTime(null);
|
|
|
+ logisticsReq.setStatus(LedgerEnum.SAVE.getStatus());
|
|
|
+ Long aLong = saveDraft(logisticsReq);
|
|
|
+ logisticsTrackService.saveTrack(aLong, "", LedgerTrackEnum.SAVE);
|
|
|
+ return "草稿保存成功";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -181,6 +298,10 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
if (Objects.isNull(kwpLedgerLogistics)) {
|
|
|
throw new BusinessException("对账单不存在!");
|
|
|
}
|
|
|
+ backCheck(kwpLedgerLogistics.getStatus());
|
|
|
+ kwpLedgerLogistics.setStatus(LedgerEnum.BACK.getStatus());
|
|
|
+ kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
|
|
|
+ logisticsMapper.updateById(kwpLedgerLogistics);
|
|
|
return logisticsTrackService.saveTrack(ledgerReq.getId(), ledgerReq.getRemark(), LedgerTrackEnum.REJECT);
|
|
|
}
|
|
|
|
|
|
@@ -191,11 +312,13 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
* @param confirmReq
|
|
|
* @return
|
|
|
*/
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Integer confirmOrder(LedgerConfirmReq confirmReq) {
|
|
|
KwpLedgerLogistics kwpLedgerLogistics = logisticsMapper.selectById(confirmReq.getId());
|
|
|
if (Objects.isNull(kwpLedgerLogistics)) {
|
|
|
throw new BusinessException("对账单不存在!");
|
|
|
}
|
|
|
+ confirmCheck(kwpLedgerLogistics.getStatus());
|
|
|
kwpLedgerLogistics.setStatus(LedgerEnum.LEDGERED.getStatus());
|
|
|
kwpLedgerLogistics.setAuditPhone(confirmReq.getAuditPhone());
|
|
|
kwpLedgerLogistics.setAuditUser(confirmReq.getAuditUser());
|
|
|
@@ -219,6 +342,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
}
|
|
|
successCheck(kwpLedgerLogistics.getStatus());
|
|
|
|
|
|
+ kwpLedgerLogistics.setReceiptTime(ledgerReq.getReceiptTime());
|
|
|
kwpLedgerLogistics.setStatus(LedgerEnum.SUCCESS.getStatus());
|
|
|
kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
|
|
|
logisticsMapper.updateById(kwpLedgerLogistics);
|
|
|
@@ -227,16 +351,16 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
kwpSettlementLogistics.setId(new IdWorker(1).nextId());
|
|
|
kwpSettlementLogistics.setEntId(0L);//todo
|
|
|
kwpSettlementLogistics.setLLedgerId(kwpLedgerLogistics.getId());
|
|
|
- kwpSettlementLogistics.setSlOrderNo(String.valueOf(new IdWorker(1).nextId()));//todo
|
|
|
+ kwpSettlementLogistics.setSlOrderNo(OrderGenerateUtils.generateOrderNo("SL"));
|
|
|
kwpSettlementLogistics.setName(kwpLedgerLogistics.getName());//取物流对账单名称
|
|
|
kwpSettlementLogistics.setTotalPrice(kwpLedgerLogistics.getTotalPrice());
|
|
|
kwpSettlementLogistics.setActualPrice(kwpLedgerLogistics.getActualPrice());
|
|
|
- kwpSettlementLogistics.setReceiptTime(LocalDateTime.now());
|
|
|
kwpSettlementLogistics.setRemark("");
|
|
|
kwpSettlementLogistics.setAuditUser(kwpLedgerLogistics.getAuditUser());
|
|
|
kwpSettlementLogistics.setAuditPhone(kwpLedgerLogistics.getAuditPhone());
|
|
|
kwpSettlementLogistics.setSuccessUser(ledgerReq.getSuccessUser());
|
|
|
kwpSettlementLogistics.setSuccessPhone(ledgerReq.getSuccessPhone());
|
|
|
+ kwpSettlementLogistics.setReceiptTime(ledgerReq.getReceiptTime());
|
|
|
kwpSettlementLogistics.setStatus(0);
|
|
|
kwpSettlementLogistics.setCreateBy(0L);
|
|
|
kwpSettlementLogistics.setCreateTime(LocalDateTime.now());
|
|
|
@@ -249,4 +373,24 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
logisticsTrackService.saveTrack(ledgerReq.getId(), "", LedgerTrackEnum.SUCCESS);
|
|
|
return "对账完成";
|
|
|
}
|
|
|
+
|
|
|
+ public List<LedgerCountVo> orderCount() {
|
|
|
+ Map<String, Long> map = logisticsMapper.countOrder();
|
|
|
+ LedgerCountVo ledgerCountVo;
|
|
|
+ List<LedgerCountVo> res = new ArrayList<>();
|
|
|
+ for (LedgerEnum value : LedgerEnum.values()) {
|
|
|
+ ledgerCountVo = new LedgerCountVo();
|
|
|
+ ledgerCountVo.setCount(map.get(String.valueOf(value.getStatus())));
|
|
|
+ ledgerCountVo.setLabel(value.getDesc());
|
|
|
+ ledgerCountVo.setStatus(value.getStatus());
|
|
|
+ res.add(ledgerCountVo);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ public List<LedgerLogisticsDto> selectList(List<Long> ids) {
|
|
|
+ List<LedgerLogisticsDto> ledgerLogisticsDto = logisticsMapper.selectIds(ids);
|
|
|
+ changeDict(ledgerLogisticsDto);
|
|
|
+ return ledgerLogisticsDto;
|
|
|
+ }
|
|
|
}
|