|
@@ -37,12 +37,12 @@ import com.sckw.transport.api.model.dto.AccountCheckingBindDTO;
|
|
|
import com.sckw.transport.api.model.dto.RWaybillOrderDto;
|
|
import com.sckw.transport.api.model.dto.RWaybillOrderDto;
|
|
|
import com.sckw.transport.api.model.param.ContractSignLogisticsParam;
|
|
import com.sckw.transport.api.model.param.ContractSignLogisticsParam;
|
|
|
import com.sckw.transport.api.model.param.LogisticsOrderParam;
|
|
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.KwtLogisticsOrderVO;
|
|
|
import com.sckw.transport.api.model.vo.RTruckMonitorVo;
|
|
import com.sckw.transport.api.model.vo.RTruckMonitorVo;
|
|
|
import com.sckw.transport.api.model.vo.RWaybillOrderVo;
|
|
import com.sckw.transport.api.model.vo.RWaybillOrderVo;
|
|
|
import com.sckw.transport.dao.*;
|
|
import com.sckw.transport.dao.*;
|
|
|
import com.sckw.transport.model.*;
|
|
import com.sckw.transport.model.*;
|
|
|
-import com.sckw.transport.api.model.param.UpdateOrderStatusDto;
|
|
|
|
|
import com.sckw.transport.model.vo.WaybillCountVo;
|
|
import com.sckw.transport.model.vo.WaybillCountVo;
|
|
|
import com.sckw.transport.service.KwtCommonService;
|
|
import com.sckw.transport.service.KwtCommonService;
|
|
|
import jakarta.annotation.Resource;
|
|
import jakarta.annotation.Resource;
|
|
@@ -756,44 +756,47 @@ public class TransportServiceImpl implements TransportRemoteService {
|
|
|
*
|
|
*
|
|
|
* @param params 请求参数
|
|
* @param params 请求参数
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @Transactional
|
|
|
public HttpResult logisticsOrderInitiateReconciliationUpdateStatus(UpdateOrderStatusDto params) {
|
|
public HttpResult logisticsOrderInitiateReconciliationUpdateStatus(UpdateOrderStatusDto params) {
|
|
|
- Long orderId = params.getOrderId();
|
|
|
|
|
- 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);
|
|
|
|
|
|
|
+ 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();
|
|
return HttpResult.ok();
|
|
|
}
|
|
}
|