|
|
@@ -2,8 +2,10 @@ package com.sckw.payment.service;
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
+import com.sckw.core.common.enums.NumberConstant;
|
|
|
import com.sckw.core.common.enums.enums.DictTypeEnum;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
+import com.sckw.core.model.constant.Global;
|
|
|
import com.sckw.core.model.page.PageRes;
|
|
|
import com.sckw.core.model.vo.TableTop;
|
|
|
import com.sckw.core.utils.CollectionUtils;
|
|
|
@@ -16,7 +18,11 @@ 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.*;
|
|
|
+import com.sckw.payment.model.constant.SettlementEnum;
|
|
|
+import com.sckw.payment.model.dto.ILedger;
|
|
|
+import com.sckw.payment.model.dto.LedgerCarrierDto;
|
|
|
+import com.sckw.payment.model.dto.LedgerLogisticsDto;
|
|
|
+import com.sckw.payment.model.dto.LedgerShipperDto;
|
|
|
import com.sckw.payment.model.vo.req.*;
|
|
|
import com.sckw.payment.model.vo.res.LedgerLogisticsDetailVo;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
@@ -29,7 +35,6 @@ import jakarta.annotation.Resource;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
-import org.jetbrains.annotations.NotNull;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -135,18 +140,23 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
logisticsReq.setGenerateTime(LocalDateTime.now());
|
|
|
logisticsReq.setStatus(LedgerEnum.TO_LEDGER.getStatus());
|
|
|
Long aLong = saveDraft(logisticsReq);
|
|
|
- logisticsTrackService.saveTrack(aLong, "", LedgerTrackEnum.TO_LEDGER);
|
|
|
+ logisticsTrackService.saveTrack(aLong, Global.EMPTY_STRING, LedgerTrackEnum.TO_LEDGER);
|
|
|
} else {
|
|
|
removeDraft(Long.parseLong(id));
|
|
|
logisticsReq.setGenerateTime(LocalDateTime.now());
|
|
|
logisticsReq.setStatus(LedgerEnum.TO_LEDGER.getStatus());
|
|
|
Long aLong = saveDraft(logisticsReq);
|
|
|
- logisticsTrackService.saveTrack(aLong, "", LedgerTrackEnum.TO_LEDGER);
|
|
|
+ logisticsTrackService.saveTrack(aLong, Global.EMPTY_STRING, LedgerTrackEnum.TO_LEDGER);
|
|
|
|
|
|
}
|
|
|
return "保存对账单成功";
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 删除物流对账单相关联的其它数据
|
|
|
+ *
|
|
|
+ * @param id 物流对账单id
|
|
|
+ */
|
|
|
private void removeDraft(Long id) {
|
|
|
//删除 kwp_ledger_logistics_order
|
|
|
logisticsOrderService.remove(id);
|
|
|
@@ -156,6 +166,12 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
logisticsUnitService.remove(id);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 物流对账单保存草稿
|
|
|
+ *
|
|
|
+ * @param logisticsSendReq 物流对账单新增参数
|
|
|
+ * @return
|
|
|
+ */
|
|
|
private Long saveDraft(LogisticsSendReq logisticsSendReq) {
|
|
|
KwpLedgerLogistics kwpLedgerLogistics = new KwpLedgerLogistics();
|
|
|
kwpLedgerLogistics.setId(Objects.isNull(logisticsSendReq.getIdLong()) ? new IdWorker(1).nextId() : logisticsSendReq.getIdLong());
|
|
|
@@ -173,15 +189,16 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
kwpLedgerLogistics.setExTaxPrice(logisticsSendReq.getTotalPrice());//todo-xcq 不含税金额计算方式:订单含税金额总和/1.13(税率)
|
|
|
kwpLedgerLogistics.setSettlePrice(logisticsSendReq.getSettlePrice());
|
|
|
kwpLedgerLogistics.setActualPrice(new BigDecimal("0.0"));
|
|
|
- kwpLedgerLogistics.setAuditUser("");
|
|
|
- kwpLedgerLogistics.setAuditPhone("");
|
|
|
+ kwpLedgerLogistics.setAuditUser(Global.EMPTY_STRING);
|
|
|
+ kwpLedgerLogistics.setAuditPhone(Global.EMPTY_STRING);
|
|
|
kwpLedgerLogistics.setReceiptTime(null);
|
|
|
kwpLedgerLogistics.setOrderCount(logisticsSendReq.getIdList().size());
|
|
|
- kwpLedgerLogistics.setUrl("");
|
|
|
+ kwpLedgerLogistics.setUrl(Global.EMPTY_STRING);
|
|
|
kwpLedgerLogistics.setGenerateTime(logisticsSendReq.getGenerateTime());
|
|
|
- kwpLedgerLogistics.setRemark("");
|
|
|
+ kwpLedgerLogistics.setRemark(Global.EMPTY_STRING);
|
|
|
kwpLedgerLogistics.setStatus(logisticsSendReq.getStatus());
|
|
|
- kwpLedgerLogistics.setDelFlag(0);
|
|
|
+ kwpLedgerLogistics.setDelFlag(Global.UN_DELETED);
|
|
|
+ //id为空,新增对账单
|
|
|
if (Objects.isNull(logisticsSendReq.getId())) {
|
|
|
kwpLedgerLogistics.setCreateBy(LoginUserHolder.getUserId());
|
|
|
kwpLedgerLogistics.setCreateTime(LocalDateTime.now());
|
|
|
@@ -190,16 +207,18 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
kwpLedgerLogistics.setLLedgerNo(OrderGenerateUtils.generateOrderNo("LL"));
|
|
|
logisticsMapper.insert(kwpLedgerLogistics);
|
|
|
} else {
|
|
|
+ //校验是否可以修改对账单
|
|
|
KwpLedgerLogistics ledgerLogistics = logisticsMapper.selectById(logisticsSendReq.getIdLong());
|
|
|
orderCheck(ledgerLogistics);
|
|
|
updateCheck(ledgerLogistics.getStatus());
|
|
|
+ //修改对账单
|
|
|
kwpLedgerLogistics.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
|
|
|
logisticsMapper.updateById(kwpLedgerLogistics);
|
|
|
}
|
|
|
/*保存物流订单关联数据*/
|
|
|
List<Long> ids = logisticsSendReq.getIdList();
|
|
|
- //todo-xcq 校验当前订单是否已存在绑定的对账单
|
|
|
+ //验当前订单是否已存在绑定的对账单
|
|
|
logisticsOrderService.check(ids);
|
|
|
List<KwtLogisticsOrderVO> acceptCarriageOrderDetail = transportDubboService.getAcceptCarriageOrderDetail(logisticsSendReq.getIdsList());
|
|
|
if (CollectionUtils.isEmpty(acceptCarriageOrderDetail) || acceptCarriageOrderDetail.size() < ids.size()) {
|
|
|
@@ -207,17 +226,17 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
}
|
|
|
List<KwpLedgerLogisticsOrder> collect = acceptCarriageOrderDetail.stream().map(a -> {
|
|
|
KwpLedgerLogisticsOrder logisticsOrder = new KwpLedgerLogisticsOrder();
|
|
|
- logisticsOrder.setId(new IdWorker(1).nextId());
|
|
|
+ logisticsOrder.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
logisticsOrder.setLLedgerId(kwpLedgerLogistics.getId());
|
|
|
logisticsOrder.setLOrderId(a.getId());
|
|
|
logisticsOrder.setLOrderNo(a.getLOrderNo());
|
|
|
- logisticsOrder.setRemark("");
|
|
|
- logisticsOrder.setStatus(0);
|
|
|
+ logisticsOrder.setRemark(Global.EMPTY_STRING);
|
|
|
+ logisticsOrder.setStatus(NumberConstant.ZERO);
|
|
|
logisticsOrder.setCreateBy(LoginUserHolder.getUserId());
|
|
|
logisticsOrder.setCreateTime(LocalDateTime.now());
|
|
|
logisticsOrder.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
logisticsOrder.setUpdateTime(LocalDateTime.now());
|
|
|
- logisticsOrder.setDelFlag(0);
|
|
|
+ logisticsOrder.setDelFlag(Global.UN_DELETED);
|
|
|
return logisticsOrder;
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
@@ -233,7 +252,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
|
|
|
List<KwpLedgerLogisticsUnit> logisticsUnits = new ArrayList<>();
|
|
|
KwpLedgerLogisticsUnit kwpLedgerLogisticsUnit = new KwpLedgerLogisticsUnit();
|
|
|
- kwpLedgerLogisticsUnit.setId(new IdWorker(1).nextId());
|
|
|
+ kwpLedgerLogisticsUnit.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
kwpLedgerLogisticsUnit.setLLedgerId(kwpLedgerLogistics.getId());
|
|
|
kwpLedgerLogisticsUnit.setLLedgerNo(kwpLedgerLogistics.getLLedgerNo());
|
|
|
kwpLedgerLogisticsUnit.setUnitType(LogisticsUnitType.SHIPPER);
|
|
|
@@ -242,13 +261,13 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
kwpLedgerLogisticsUnit.setFirmName(entCacheResDto.getFirmName());
|
|
|
kwpLedgerLogisticsUnit.setContacts(entCacheResDto.getContacts());
|
|
|
kwpLedgerLogisticsUnit.setPhone(entCacheResDto.getPhone());
|
|
|
- kwpLedgerLogisticsUnit.setRemark("");
|
|
|
- kwpLedgerLogisticsUnit.setStatus(0);
|
|
|
+ kwpLedgerLogisticsUnit.setRemark(Global.EMPTY_STRING);
|
|
|
+ kwpLedgerLogisticsUnit.setStatus(NumberConstant.ZERO);
|
|
|
kwpLedgerLogisticsUnit.setCreateBy(LoginUserHolder.getUserId());
|
|
|
kwpLedgerLogisticsUnit.setCreateTime(LocalDateTime.now());
|
|
|
kwpLedgerLogisticsUnit.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
kwpLedgerLogisticsUnit.setUpdateTime(LocalDateTime.now());
|
|
|
- kwpLedgerLogisticsUnit.setDelFlag(0);
|
|
|
+ kwpLedgerLogisticsUnit.setDelFlag(Global.UN_DELETED);
|
|
|
|
|
|
logisticsUnits.add(kwpLedgerLogisticsUnit);
|
|
|
Long entId = LoginUserHolder.getEntId();
|
|
|
@@ -258,7 +277,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
entCacheResDto1 = new EntCacheResDto();
|
|
|
}
|
|
|
KwpLedgerLogisticsUnit carrierUnit = new KwpLedgerLogisticsUnit();
|
|
|
- carrierUnit.setId(new IdWorker(1).nextId());
|
|
|
+ carrierUnit.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
carrierUnit.setLLedgerId(kwpLedgerLogistics.getId());
|
|
|
carrierUnit.setLLedgerNo(kwpLedgerLogistics.getLLedgerNo());
|
|
|
carrierUnit.setUnitType(LogisticsUnitType.CARRIER);
|
|
|
@@ -267,13 +286,13 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
carrierUnit.setFirmName(entCacheResDto1.getFirmName());
|
|
|
carrierUnit.setContacts(entCacheResDto1.getContacts());
|
|
|
carrierUnit.setPhone(entCacheResDto1.getPhone());
|
|
|
- carrierUnit.setRemark("");
|
|
|
- carrierUnit.setStatus(0);
|
|
|
+ carrierUnit.setRemark(Global.EMPTY_STRING);
|
|
|
+ carrierUnit.setStatus(NumberConstant.ZERO);
|
|
|
carrierUnit.setCreateBy(LoginUserHolder.getUserId());
|
|
|
carrierUnit.setCreateTime(LocalDateTime.now());
|
|
|
carrierUnit.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
carrierUnit.setUpdateTime(LocalDateTime.now());
|
|
|
- carrierUnit.setDelFlag(0);
|
|
|
+ carrierUnit.setDelFlag(Global.UN_DELETED);
|
|
|
|
|
|
logisticsUnits.add(carrierUnit);
|
|
|
logisticsUnitService.saveList(logisticsUnits);
|
|
|
@@ -283,7 +302,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
/**
|
|
|
* 保存物流对账单草稿
|
|
|
*
|
|
|
- * @param logisticsReq
|
|
|
+ * @param logisticsReq 物流对账单保存的参数
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@@ -291,7 +310,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
logisticsReq.setGenerateTime(null);
|
|
|
logisticsReq.setStatus(LedgerEnum.SAVE.getStatus());
|
|
|
Long aLong = saveDraft(logisticsReq);
|
|
|
- logisticsTrackService.saveTrack(aLong, "", LedgerTrackEnum.SAVE);
|
|
|
+ logisticsTrackService.saveTrack(aLong, Global.EMPTY_STRING, LedgerTrackEnum.SAVE);
|
|
|
return "草稿保存成功";
|
|
|
}
|
|
|
|
|
|
@@ -301,15 +320,16 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
* @param id 物流对账单id
|
|
|
* @return
|
|
|
*/
|
|
|
- public Integer remove(Long id) {
|
|
|
+ public String remove(Long id) {
|
|
|
KwpLedgerLogistics kwpLedgerLogistics = logisticsMapper.selectById(id);
|
|
|
if (Objects.isNull(kwpLedgerLogistics)) {
|
|
|
throw new BusinessException("对账单不存在!");
|
|
|
}
|
|
|
deleteCheck(kwpLedgerLogistics.getStatus());
|
|
|
- kwpLedgerLogistics.setDelFlag(1);
|
|
|
+ kwpLedgerLogistics.setDelFlag(Global.DELETED);
|
|
|
logisticsMapper.updateById(kwpLedgerLogistics);
|
|
|
- return logisticsTrackService.saveTrack(id, "", LedgerTrackEnum.DELETE);
|
|
|
+ logisticsTrackService.saveTrack(id, Global.EMPTY_STRING, LedgerTrackEnum.DELETE);
|
|
|
+ return "删除成功";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -318,7 +338,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
* @param id 物流对账单id
|
|
|
* @return
|
|
|
*/
|
|
|
- public Integer backOrder(Long id) {
|
|
|
+ public String backOrder(Long id) {
|
|
|
KwpLedgerLogistics kwpLedgerLogistics = logisticsMapper.selectById(id);
|
|
|
if (Objects.isNull(kwpLedgerLogistics)) {
|
|
|
throw new BusinessException("对账单不存在!");
|
|
|
@@ -329,7 +349,8 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
kwpLedgerLogistics.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
|
|
|
logisticsMapper.updateById(kwpLedgerLogistics);
|
|
|
- return logisticsTrackService.saveTrack(id, "", LedgerTrackEnum.REVOKE);
|
|
|
+ logisticsTrackService.saveTrack(id, Global.EMPTY_STRING, LedgerTrackEnum.REVOKE);
|
|
|
+ return "撤回成功";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -351,7 +372,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
* @param ledgerReq 驳回参数
|
|
|
* @return
|
|
|
*/
|
|
|
- public Integer doBack(LedgerReq ledgerReq) {
|
|
|
+ public String doBack(LedgerReq ledgerReq) {
|
|
|
KwpLedgerLogistics kwpLedgerLogistics = logisticsMapper.selectById(ledgerReq.getIdLong());
|
|
|
if (Objects.isNull(kwpLedgerLogistics)) {
|
|
|
throw new BusinessException("对账单不存在!");
|
|
|
@@ -361,18 +382,19 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
kwpLedgerLogistics.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
|
|
|
logisticsMapper.updateById(kwpLedgerLogistics);
|
|
|
- return logisticsTrackService.saveTrack(ledgerReq.getIdLong(), ledgerReq.getRemark(), LedgerTrackEnum.REJECT);
|
|
|
+ logisticsTrackService.saveTrack(ledgerReq.getIdLong(), ledgerReq.getRemark(), LedgerTrackEnum.REJECT);
|
|
|
+ return "驳回成功";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 对账确认
|
|
|
* 订单变更为已对账
|
|
|
*
|
|
|
- * @param confirmReq
|
|
|
+ * @param confirmReq 对账确认请求参数
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public Integer confirmOrder(LedgerConfirmReq confirmReq) {
|
|
|
+ public String confirmOrder(LedgerConfirmReq confirmReq) {
|
|
|
KwpLedgerLogistics kwpLedgerLogistics = logisticsMapper.selectById(confirmReq.getIdLong());
|
|
|
orderCheck(kwpLedgerLogistics);
|
|
|
confirmCheck(kwpLedgerLogistics.getStatus());
|
|
|
@@ -383,13 +405,14 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());
|
|
|
kwpLedgerLogistics.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
logisticsMapper.updateById(kwpLedgerLogistics);
|
|
|
- return logisticsTrackService.saveTrack(confirmReq.getIdLong(), "", LedgerTrackEnum.CONFIRM);
|
|
|
+ logisticsTrackService.saveTrack(confirmReq.getIdLong(), Global.EMPTY_STRING, LedgerTrackEnum.CONFIRM);
|
|
|
+ return "对账确认成功";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 对账完成
|
|
|
*
|
|
|
- * @param ledgerReq
|
|
|
+ * @param ledgerReq 对账完成参数
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
@@ -398,7 +421,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
orderCheck(kwpLedgerLogistics);
|
|
|
|
|
|
successCheck(kwpLedgerLogistics.getStatus());
|
|
|
-
|
|
|
+ //更新对账单状态
|
|
|
kwpLedgerLogistics.setReceiptTime(LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN));
|
|
|
kwpLedgerLogistics.setStatus(LedgerEnum.SUCCESS.getStatus());
|
|
|
kwpLedgerLogistics.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
@@ -406,40 +429,43 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
logisticsMapper.updateById(kwpLedgerLogistics);
|
|
|
//生成结算单
|
|
|
KwpSettlementLogistics kwpSettlementLogistics = new KwpSettlementLogistics();
|
|
|
- kwpSettlementLogistics.setId(new IdWorker(1).nextId());
|
|
|
+ kwpSettlementLogistics.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
kwpSettlementLogistics.setEntId(LoginUserHolder.getEntId());
|
|
|
kwpSettlementLogistics.setLLedgerId(kwpLedgerLogistics.getId());
|
|
|
kwpSettlementLogistics.setSlOrderNo(OrderGenerateUtils.generateOrderNo("SL"));
|
|
|
kwpSettlementLogistics.setName(kwpLedgerLogistics.getName());//取物流对账单名称
|
|
|
kwpSettlementLogistics.setTotalPrice(kwpLedgerLogistics.getTotalPrice());
|
|
|
kwpSettlementLogistics.setActualPrice(kwpLedgerLogistics.getActualPrice());
|
|
|
- kwpSettlementLogistics.setRemark("");
|
|
|
+ kwpSettlementLogistics.setRemark(Global.EMPTY_STRING);
|
|
|
kwpSettlementLogistics.setAuditUser(kwpLedgerLogistics.getAuditUser());
|
|
|
kwpSettlementLogistics.setAuditPhone(kwpLedgerLogistics.getAuditPhone());
|
|
|
kwpSettlementLogistics.setSuccessUser(ledgerReq.getSuccessUser());
|
|
|
kwpSettlementLogistics.setSuccessPhone(ledgerReq.getSuccessPhone());
|
|
|
kwpSettlementLogistics.setReceiptTime(LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN));
|
|
|
- kwpSettlementLogistics.setStatus(1);//1-待结算
|
|
|
+ kwpSettlementLogistics.setStatus(SettlementEnum.WAITING_PAYMENT.getStatus());//1-待结算
|
|
|
kwpSettlementLogistics.setCreateBy(LoginUserHolder.getUserId());
|
|
|
kwpSettlementLogistics.setCreateTime(LocalDateTime.now());
|
|
|
kwpSettlementLogistics.setUpdateBy(LoginUserHolder.getUserId());
|
|
|
kwpSettlementLogistics.setUpdateTime(LocalDateTime.now());
|
|
|
- kwpSettlementLogistics.setDelFlag(0);
|
|
|
+ kwpSettlementLogistics.setDelFlag(Global.UN_DELETED);
|
|
|
|
|
|
settlementLogisticsService.save(kwpSettlementLogistics);
|
|
|
|
|
|
- logisticsTrackService.saveTrack(ledgerReq.getIdLong(), "", LedgerTrackEnum.SUCCESS);
|
|
|
+ logisticsTrackService.saveTrack(ledgerReq.getIdLong(), Global.EMPTY_STRING, LedgerTrackEnum.SUCCESS);
|
|
|
return "对账完成";
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 按类型统计表头的数据
|
|
|
+ *
|
|
|
* @param unitType 1-托运方 2-承运方
|
|
|
- * @return
|
|
|
+ * @return 统计数据
|
|
|
*/
|
|
|
public List<TableTop> orderCount(LogisticsReq logisticsReq, Integer unitType) {
|
|
|
logisticsReq.setEntId(LoginUserHolder.getEntId());
|
|
|
Map<String, Long> map = logisticsMapper.countOrder(logisticsReq, unitType);
|
|
|
TableTop ledgerCountVo;
|
|
|
+ /*统计数据转换*/
|
|
|
List<TableTop> res = new ArrayList<>();
|
|
|
for (LedgerEnum value : LedgerEnum.values()) {
|
|
|
ledgerCountVo = new TableTop();
|
|
|
@@ -452,10 +478,10 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 托运方
|
|
|
+ * 托运方 查询物流对账单
|
|
|
*
|
|
|
- * @param ids
|
|
|
- * @return
|
|
|
+ * @param ids 对账单id列表
|
|
|
+ * @return 物流对账单列表
|
|
|
*/
|
|
|
public List<ILedger> selectShipperList(List<Long> ids) {
|
|
|
List<LedgerShipperDto> ledgerLogisticsDto = logisticsMapper.selectShipperIds(ids);
|
|
|
@@ -465,10 +491,10 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 承运方
|
|
|
+ * 承运方 查询物流对账单
|
|
|
*
|
|
|
- * @param ids
|
|
|
- * @return
|
|
|
+ * @param ids 对账单id列表
|
|
|
+ * @return 物流对账单列表
|
|
|
*/
|
|
|
public List<ILedger> selectCarrierList(List<Long> ids) {
|
|
|
List<LedgerCarrierDto> ledgerLogisticsDto = logisticsMapper.selectCarrierIds(ids);
|
|
|
@@ -477,6 +503,12 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
return ledgerLogistics;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据物流订单id查询对账单详情
|
|
|
+ *
|
|
|
+ * @param id 物流对账单id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public LedgerLogisticsDetailVo queryUpdate(Long id) {
|
|
|
LedgerLogisticsDto ledgerLogisticsDto = logisticsMapper.selectId(id, LogisticsUnitType.SHIPPER);
|
|
|
orderCheck(ledgerLogisticsDto);
|
|
|
@@ -484,14 +516,27 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
return getLedgerLogisticsDetailVo(ledgerLogisticsDto);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 查询物流对账单详情
|
|
|
+ *
|
|
|
+ * @param id 物流对账单id
|
|
|
+ * @param unitType 企业单位类型
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public LedgerLogisticsDetailVo queryDetail(Long id, Integer unitType) {
|
|
|
LedgerLogisticsDto ledgerLogisticsDto = logisticsMapper.selectId(id, unitType);
|
|
|
orderCheck(ledgerLogisticsDto);
|
|
|
return getLedgerLogisticsDetailVo(ledgerLogisticsDto);
|
|
|
}
|
|
|
|
|
|
- @NotNull
|
|
|
+ /**
|
|
|
+ * 转换物流对账单详情数据
|
|
|
+ *
|
|
|
+ * @param ledgerLogisticsDto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
private LedgerLogisticsDetailVo getLedgerLogisticsDetailVo(LedgerLogisticsDto ledgerLogisticsDto) {
|
|
|
+ /*获取物流对账单关联的物流订单*/
|
|
|
List<KwpLedgerLogisticsOrder> kwpLedgerLogisticsOrders = logisticsOrderService.queryList(ledgerLogisticsDto.getId());
|
|
|
LedgerLogisticsDetailVo ledgerLogisticsDetailVo = new LedgerLogisticsDetailVo();
|
|
|
ledgerLogisticsDetailVo.setId(ledgerLogisticsDto.getId());
|
|
|
@@ -505,7 +550,7 @@ public class KwpLedgerLogisticsService extends AbsLedger {
|
|
|
ledgerLogisticsDetailVo.setStartTime(ledgerLogisticsDto.getStartTime());
|
|
|
ledgerLogisticsDetailVo.setEndTime(ledgerLogisticsDto.getEndTime());
|
|
|
ledgerLogisticsDetailVo.setRemark(ledgerLogisticsDto.getRemark());
|
|
|
-
|
|
|
+ /*查询物流订单详情*/
|
|
|
List<LogisticsOrderVO> acceptCarriageOrderList = transportDubboService.getAcceptCarriageOrderList(kwpLedgerLogisticsOrders.stream().map(a -> Long.toString(a.getLOrderId())).collect(Collectors.toList()));
|
|
|
ledgerLogisticsDetailVo.setOrderList(acceptCarriageOrderList);
|
|
|
return ledgerLogisticsDetailVo;
|