提交 0ddd63bc authored 作者: liruixin's avatar liruixin

Merge remote-tracking branch 'origin/v5.7_break_contract_reverse_20231020' into…

Merge remote-tracking branch 'origin/v5.7_break_contract_reverse_20231020' into v5.7_break_contract_reverse_20231020
......@@ -6,6 +6,7 @@ import com.clx.performance.param.pc.owner.FrozenAccountParam;
import com.clx.performance.param.pc.owner.ThawAccountParam;
import com.clx.performance.param.pc.owner.UpdateStatusParam;
import com.clx.performance.vo.feign.OrderGoodsFeignVO;
import com.clx.performance.vo.pc.OwnerAccountAllVO;
import com.msl.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -84,4 +85,7 @@ public interface PerformanceFeign {
@GetMapping(value = {"clx-performance/feign/orderChild/selectInTransitOrderChild"})
Result<Boolean> selectInTransitOrderChild(@RequestParam("orderNo") String orderNo);
@GetMapping(value = {"clx-performance/feign/owner/accountInfo"})
Result<OwnerAccountAllVO> accountInfo(@RequestParam Long userNo);
}
package com.clx.performance.vo.pc;
import lombok.Data;
@Data
public class OwnerAccountAllVO {
private OwnerAccountVO marginAccount;
private OwnerAccountVO prepaidFreightAccount;
}
......@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.json.JSONUtil;
import com.clx.order.enums.OrderEnum;
import com.clx.order.feign.OrderFeign;
import com.clx.order.param.feign.RollbackOrderWeightParam;
import com.clx.performance.dao.OrderChildDao;
import com.clx.performance.dao.OrderGoodsDao;
import com.clx.performance.enums.*;
......@@ -18,6 +19,7 @@ import com.msl.common.result.Result;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.HashMap;
......@@ -157,51 +159,38 @@ public class OrderCancelComponent {
}
}
// public void backFillTonnage(OrderGoods orderGoods, BigDecimal weight) {
// if (orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.CANCEL.getCode())
// || orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.COMPLETED.getCode())
// ) {
//
// //返回到货单
// orderGoodsDao.updateOrderGoodsSetResidueWeightAndAlreadyWeight(weight,weight, orderGoods.getId());
//
// if (!orderGoods.getTruckDemand().equals(TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode())) {
// for (OrderGoods orderGoods : orderGoodsList) {
// truckDemandMap.put(orderGoods.getTruckDemand(),
// truckDemandMap.get(orderGoods.getTruckDemand())
// .add(orderGoods.getResidueTransportWeight()));
// }
// } else {
// for (OrderGoods orderGoods : orderGoodsList) {
// vehicleUsageMap.put(orderGoods.getVehicleUsage(),
// vehicleUsageMap.get(orderGoods.getVehicleUsage())
// .add(orderGoods.getResidueTransportWeight()));
// }
// }
// rollbackOrderWeightParam = new Ro
// //归还吨数
// if (!orderGoods.getTruckDemand().equals(TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode())) {
// rollbackOrderWeightParam.setOrderNo(orderNo);
// if (truckDemand.equals(TruckDemandEnum.TruckType.PLATFORM_CAR.getCode())) {
// rollbackOrderWeightParam.setResidueWeight(truckDemandMap.get(truckDemand));
// rollbackOrderWeightParam.setOwnResidueCarryWeight(BigDecimal.ZERO);
// rollbackOrderWeightParam.setPlatformResidueCarryWeight(truckDemandMap.get(truckDemand));
// }
// if (truckDemand.equals(TruckDemandEnum.TruckType.OWNER_CAR.getCode())) {
// rollbackOrderWeightParam.setResidueWeight(truckDemandMap.get(truckDemand));
// rollbackOrderWeightParam.setOwnResidueCarryWeight(truckDemandMap.get(truckDemand));
// rollbackOrderWeightParam.setPlatformResidueCarryWeight(BigDecimal.ZERO);
// }
// } else {
// BigDecimal platformResidueSum = vehicleUsageMap.get(1);
// BigDecimal ownResidueSum = vehicleUsageMap.get(2);
// BigDecimal residueSum = platformResidueSum.add(ownResidueSum);
// rollbackOrderWeightParam.setOrderNo(orderNo);
// rollbackOrderWeightParam.setResidueWeight(residueSum);
// rollbackOrderWeightParam.setPlatformResidueCarryWeight(platformResidueSum);
// rollbackOrderWeightParam.setOwnResidueCarryWeight(ownResidueSum);
// }
//
// }
// }
@Transactional(rollbackFor = Exception.class)
public void backFillTonnage(OrderGoods orderGoods, BigDecimal weight) {
if (orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.CANCEL.getCode())
|| orderGoods.getOrderGoodsStatus().equals(OrderGoodsStatusEnum.Status.COMPLETED.getCode())
) {
Integer truckDemand = orderGoods.getTruckDemand();
//返回到货单
orderGoodsDao.updateOrderGoodsSetResidueWeightAndAlreadyWeight(weight,weight, orderGoods.getId());
RollbackOrderWeightParam rollbackOrderWeightParam = new RollbackOrderWeightParam();
rollbackOrderWeightParam.setOrderNo(orderGoods.getOrderNo());
BigDecimal residueWeight = orderGoods.getResidueTransportWeight().add(weight);
rollbackOrderWeightParam.setResidueWeight(residueWeight);
//归还吨数
if (!truckDemand.equals(TruckDemandEnum.TruckType.PLATFORM_ANY_CAR.getCode())) {
if (truckDemand.equals(TruckDemandEnum.TruckType.PLATFORM_CAR.getCode())) {
rollbackOrderWeightParam.setOwnResidueCarryWeight(BigDecimal.ZERO);
rollbackOrderWeightParam.setPlatformResidueCarryWeight(residueWeight);
}else if (truckDemand.equals(TruckDemandEnum.TruckType.OWNER_CAR.getCode())) {
rollbackOrderWeightParam.setOwnResidueCarryWeight(residueWeight);
rollbackOrderWeightParam.setPlatformResidueCarryWeight(BigDecimal.ZERO);
}
} else {
rollbackOrderWeightParam.setPlatformResidueCarryWeight(residueWeight);
rollbackOrderWeightParam.setOwnResidueCarryWeight(residueWeight);
}
Result<Object> result = orderFeign.rollbackOrderWeight(rollbackOrderWeightParam);
if (!result.succeed()) {
throw new ServiceSystemException(PerformanceResultEnum.HTTP_ERROR, "远程调用更新订单余量失败");
}
}
}
}
......@@ -63,8 +63,7 @@ public class AppGoodsOrderController {
@ApiOperation(value = "司机端无接单位置上报", notes = "<br>By:胡宇帆")
@GetMapping("/getCancelOrderGoods")
public Result<List<OrderGoods>> getCancelOrderGoods() {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
return Result.ok(orderGoodsTruckBindService.getCancelOrderGoods(loginUserInfo.getUserNo()));
public Result<List<OrderGoods>> getCancelOrderGoods(@RequestParam(value = "userNo") Long userNo) {
return Result.ok(orderGoodsTruckBindService.getCancelOrderGoods(userNo));
}
}
......@@ -4,16 +4,14 @@ import cn.hutool.json.JSONUtil;
import com.clx.performance.param.pc.owner.FrozenAccountParam;
import com.clx.performance.param.pc.owner.ThawAccountParam;
import com.clx.performance.service.OwnerAccountService;
import com.clx.performance.vo.pc.OwnerAccountAllVO;
import com.msl.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
......@@ -40,4 +38,10 @@ public class OwnerAccountFeignController {
ownerAccountService.ownerAccountThaw(param);
return Result.ok();
}
@ApiOperation(value = "查询用户预付运费和保证金账户", notes = "<br>By:胡宇帆")
@GetMapping("/accountInfo")
public Result<OwnerAccountAllVO> accountInfo(@RequestParam Long userNo) {
return Result.ok(ownerAccountService.accountInfo(userNo));
}
}
......@@ -56,9 +56,9 @@ public class OwnerAccountController {
@ApiOperation(value = "账户信息", notes = "<br>By:胡宇帆")
@GetMapping("/accountInfo")
@UnitCovert(param = false)
public Result<Map> accountInfo() {
public Result<OwnerAccountAllVO> accountInfo() {
UserSessionData loginUserInfo = TokenUtil.getLoginUserInfo();
Map<String,OwnerAccountVO> result = ownerAccountService.accountInfo(loginUserInfo.getUserNo());
OwnerAccountAllVO result = ownerAccountService.accountInfo(loginUserInfo.getUserNo());
return Result.ok(result);
}
......
......@@ -9,6 +9,7 @@ import com.clx.performance.param.pc.*;
import com.clx.performance.param.pc.owner.CreteAccountParam;
import com.clx.performance.param.pc.owner.FrozenAccountParam;
import com.clx.performance.param.pc.owner.ThawAccountParam;
import com.clx.performance.vo.pc.OwnerAccountAllVO;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import com.clx.performance.vo.pc.OwnerAccountVO;
import com.clx.user.param.pc.owner.UpdateOwnerBindCardFeignParam;
......@@ -25,7 +26,7 @@ public interface OwnerAccountService {
IPage<OwnerAccountRunningWaterRecordVO> prepaidFreightAccountPageList(PagePlatformPrepaidFreightAccountParam param);
Map<String,OwnerAccountVO> accountInfo(Long ownerUserNo);
OwnerAccountAllVO accountInfo(Long ownerUserNo);
Long accountTopUp(OwnerTopUpParam param);
......
......@@ -572,7 +572,6 @@ public class OrderCancelServiceImpl implements OrderCancelService {
rollbackOrderWeightParam.setPlatformResidueCarryWeight(platformResidueSum);
rollbackOrderWeightParam.setOwnResidueCarryWeight(ownResidueSum);
}
orderFeign.rollbackOrderWeight(rollbackOrderWeightParam);
break;
case 3: //取消未拉运+未到达货源地吨数
......
......@@ -23,6 +23,7 @@ import com.clx.performance.utils.excel.ExcelData;
import com.clx.performance.utils.excel.ExcelField;
import com.clx.performance.utils.excel.ExcelSheet;
import com.clx.performance.utils.excel.ExcelUtil;
import com.clx.performance.vo.pc.OwnerAccountAllVO;
import com.clx.performance.vo.pc.OwnerAccountRunningWaterRecordVO;
import com.clx.performance.vo.pc.OwnerAccountVO;
import com.clx.user.enums.driver.DriverTruckEnum;
......@@ -85,14 +86,14 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
}
@Override
public Map<String, OwnerAccountVO> accountInfo(Long ownerUserNo) {
Map<String, OwnerAccountVO> result = new HashMap<>(2);
public OwnerAccountAllVO accountInfo(Long ownerUserNo) {
OwnerAccountAllVO result = new OwnerAccountAllVO();
List<OwnerAccountVO> list = ownerAccountStruct.convertList(ownerAccountDao.accountInfo(ownerUserNo));
for (OwnerAccountVO ownerAccountVO : list) {
if (OwnerAccountEnum.AccountTypeStatus.MARGIN_ACCOUNT.getCode().equals(ownerAccountVO.getAccountType())) {
result.put("marginAccount", ownerAccountVO);
result.setMarginAccount(ownerAccountVO);
} else {
result.put("prepaidFreightAccount", ownerAccountVO);
result.setPrepaidFreightAccount(ownerAccountVO);
}
}
return result;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论