|
|
@@ -13,6 +13,7 @@ import com.sckw.core.model.constant.NumberConstant;
|
|
|
import com.sckw.core.model.enums.CarWaybillEnum;
|
|
|
import com.sckw.core.model.enums.LogisticsOrderEnum;
|
|
|
import com.sckw.core.utils.CollectionUtils;
|
|
|
+import com.sckw.core.utils.DateUtils;
|
|
|
import com.sckw.core.utils.IdWorker;
|
|
|
import com.sckw.core.utils.StringUtils;
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
|
@@ -31,11 +32,13 @@ import com.sckw.stream.model.SckwBusSum;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.model.dto.res.SysDictResDto;
|
|
|
import com.sckw.transport.api.dubbo.TransportRemoteService;
|
|
|
-import com.sckw.transport.api.model.dto.*;
|
|
|
+import com.sckw.transport.api.model.dto.AcceptCarriageLogisticsOrderDto;
|
|
|
+import com.sckw.transport.api.model.dto.AccountCheckingBindDTO;
|
|
|
+import com.sckw.transport.api.model.dto.RWaybillOrderDto;
|
|
|
import com.sckw.transport.api.model.param.ContractSignLogisticsParam;
|
|
|
import com.sckw.transport.api.model.param.LogisticsOrderParam;
|
|
|
+import com.sckw.transport.api.model.param.UpdateOrderStatusDto;
|
|
|
import com.sckw.transport.api.model.vo.KwtLogisticsOrderVO;
|
|
|
-import com.sckw.transport.api.model.vo.LogisticsOrderVO;
|
|
|
import com.sckw.transport.api.model.vo.RTruckMonitorVo;
|
|
|
import com.sckw.transport.api.model.vo.RWaybillOrderVo;
|
|
|
import com.sckw.transport.dao.*;
|
|
|
@@ -54,7 +57,6 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -750,4 +752,54 @@ public class TransportServiceImpl implements TransportRemoteService {
|
|
|
findLogisticsOrderChild(orderIds, StringUtil.join(idList, Global.COMMA));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 物流订单发起对账状态变更
|
|
|
+ *
|
|
|
+ * @param params 请求参数
|
|
|
+ */
|
|
|
+ @Transactional
|
|
|
+ public HttpResult logisticsOrderInitiateReconciliationUpdateStatus(UpdateOrderStatusDto params) {
|
|
|
+ List<Long> orderIds = params.getOrderIds();
|
|
|
+ for (Long orderId : orderIds) {
|
|
|
+ KwtLogisticsOrder kwtLogisticsOrder = logisticsOrderMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrder>()
|
|
|
+ .eq(KwtLogisticsOrder::getId, orderId));
|
|
|
+ Integer code = params.getLogisticsOrderStatus().getCode();
|
|
|
+ if (LogisticsOrderEnum.HAVE_ALREADY_SETTLED.getCode() == kwtLogisticsOrder.getStatus()) {
|
|
|
+ return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, "已结算,不能进行对账");
|
|
|
+ }
|
|
|
+ if (LogisticsOrderEnum.HAVE_FINISHED.getCode() != kwtLogisticsOrder.getStatus()) {
|
|
|
+ return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, "订单并未完成,不能进行对账");
|
|
|
+ }
|
|
|
+ if (LogisticsOrderEnum.HAVE_RECONCILED.getCode() != code) {
|
|
|
+ return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, "订单状态错误");
|
|
|
+ }
|
|
|
+ logisticsOrderMapper.update(null, new LambdaUpdateWrapper<KwtLogisticsOrder>()
|
|
|
+ .eq(KwtLogisticsOrder::getId, orderId)
|
|
|
+ .set(KwtLogisticsOrder::getStatus, code)
|
|
|
+ );
|
|
|
+ KwtLogisticsOrderTrack orderTrack = logisticsOrderTrackMapper.selectOne(new LambdaQueryWrapper<KwtLogisticsOrderTrack>()
|
|
|
+ .eq(KwtLogisticsOrderTrack::getLOrderId, orderId)
|
|
|
+ .eq(KwtLogisticsOrderTrack::getStatus, code)
|
|
|
+ .eq(KwtLogisticsOrderTrack::getDelFlag, 0)
|
|
|
+ );
|
|
|
+ if (orderTrack != null) {
|
|
|
+ orderTrack.setStatus(code);
|
|
|
+ orderTrack.setUpdateBy(params.getUpdateBy());
|
|
|
+ orderTrack.setUpdateTime(DateUtils.formatDate(params.getUpdateTime()));
|
|
|
+ } else {
|
|
|
+ KwtLogisticsOrderTrack track = new KwtLogisticsOrderTrack();
|
|
|
+ track.setId(new IdWorker(NumberConstant.ONE).nextId());
|
|
|
+ track.setLOrderId(orderId);
|
|
|
+ track.setStatus(code);
|
|
|
+ track.setCreateBy(params.getUpdateById());
|
|
|
+ track.setCreateTime(DateUtils.formatDate(params.getUpdateTime()));
|
|
|
+ track.setUpdateBy(params.getUpdateById());
|
|
|
+ track.setUpdateTime(DateUtils.formatDate(params.getUpdateTime()));
|
|
|
+ track.setDelFlag(0);
|
|
|
+ logisticsOrderTrackMapper.insert(track);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return HttpResult.ok();
|
|
|
+ }
|
|
|
}
|