代码格式化样式

This commit is contained in:
秦鸿展
2026-02-23 14:23:18 +08:00
parent b274923993
commit c110ab5dcc
@@ -67,8 +67,9 @@ public class LeaseApplicationService {
private StorageSectionApplicationService storageSectionApplicationService; private StorageSectionApplicationService storageSectionApplicationService;
@Autowired @Autowired
private IShipperLeaseDetailsService shipperLeaseDetailsService; private IShipperLeaseDetailsService shipperLeaseDetailsService;
@Autowired
private SystemServiceFeign systemServiceFeign;
/** /**
* 分页查询租赁管理列表 * 分页查询租赁管理列表
@@ -77,23 +78,24 @@ public class LeaseApplicationService {
public List<LeasePO> queryList(LeaseDO leaseDO) { public List<LeasePO> queryList(LeaseDO leaseDO) {
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
//前端传organizationId = 2827的时候查询所有组织的数据 //前端传organizationId = 2827的时候查询所有组织的数据
Long frontendOrganizationId = leaseDO.getOrganizationId(); if (loginUser != null) {
if (frontendOrganizationId != null && frontendOrganizationId == 2827L) { Long frontendOrganizationId = leaseDO.getOrganizationId();
// 前端传递2827时,查询所有组织的数据,将organizationId设置为null if (frontendOrganizationId != null && frontendOrganizationId == 2827L) {
leaseDO.setOrganizationId(null); // 前端传递2827时,查询所有组织的数据,将organizationId设置为null
} else { leaseDO.setOrganizationId(null);
// 其他情况,只查询当前登录用户所属组织的数据 } else {
if (loginUser != null && loginUser.getUserPo() != null) { // 其他情况,只查询当前登录用户所属组织的数据
Long userOrganizationId = loginUser.getUserPo().getOrganizationId(); if (loginUser != null && loginUser.getUserPo() != null) {
if (userOrganizationId != null) { Long userOrganizationId = loginUser.getUserPo().getOrganizationId();
leaseDO.setOrganizationId(userOrganizationId); if (userOrganizationId != null) {
leaseDO.setOrganizationId(userOrganizationId);
}
} }
} }
} }
return leaseDomainService.queryList(leaseDO); return leaseDomainService.queryList(leaseDO);
} }
/** /**
* 新增租赁管理 * 新增租赁管理
*/ */
@@ -113,12 +115,9 @@ public class LeaseApplicationService {
return leaseDomainService.insert(leaseDO); return leaseDomainService.insert(leaseDO);
} }
@Autowired
private SystemServiceFeign systemServiceFeign;
private void setWarehouseInfo(LeaseDO leaseDO) { private void setWarehouseInfo(LeaseDO leaseDO) {
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(leaseDO.getWarehouseId()); AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(leaseDO.getWarehouseId());
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){ if (!"200".equals(String.valueOf(ajaxResult.get("code")))) {
throw new ServiceException("获取仓库信息失败"); throw new ServiceException("获取仓库信息失败");
} }
WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class); WarehouseFeignPO warehouseFeignPO = com.alibaba.fastjson.JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), WarehouseFeignPO.class);
@@ -158,19 +157,18 @@ public class LeaseApplicationService {
/** /**
* 获取租赁管理详细信息 * 获取租赁管理详细信息
*/ */
public LeasePO getInfo(Long leaseId) public LeasePO getInfo(Long leaseId) {
{
return leaseDomainService.getInfo(leaseId); return leaseDomainService.getInfo(leaseId);
} }
/** /**
* @param leaseIds
* @return Boolean
* @description 批量作废租赁 * @description 批量作废租赁
* @author ZhouGY * @author ZhouGY
* @date 2024/5/13 9:46 * @date 2024/5/13 9:46
* @param leaseIds
* @return Boolean
*/ */
public Boolean nullifyByIds(List<Long> leaseIds){ public Boolean nullifyByIds(List<Long> leaseIds) {
return leaseDomainService.nullifyByIds(leaseIds); return leaseDomainService.nullifyByIds(leaseIds);
} }
@@ -185,7 +183,7 @@ public class LeaseApplicationService {
// 计算前一天的日期,将时间设置为当天的0点0分0秒,只保留日期部分 // 计算前一天的日期,将时间设置为当天的0点0分0秒,只保留日期部分
final Date yesterday = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -1)); final Date yesterday = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -1));
LeaseDO leaseDO = new LeaseDO(); LeaseDO leaseDO = new LeaseDO();
leaseDO.setTime(yesterday); leaseDO.setTime(yesterday);
//查询有效期内的租赁 //查询有效期内的租赁
List<LeasePO> leasePOS = queryList(leaseDO); List<LeasePO> leasePOS = queryList(leaseDO);
@@ -206,9 +204,9 @@ public class LeaseApplicationService {
// 构建已存在数据的Map,key为:业务日期+货主ID+仓库ID+租赁类型 // 构建已存在数据的Map,key为:业务日期+货主ID+仓库ID+租赁类型
Map<String, ShipperLeaseDetailsPO> existingMap = existingList.stream() Map<String, ShipperLeaseDetailsPO> existingMap = existingList.stream()
.collect(Collectors.toMap( .collect(Collectors.toMap(
item -> buildKey(yesterday, item.getShipperId(), item.getWarehouseId(), item.getLeaseType()), item -> buildKey(yesterday, item.getShipperId(), item.getWarehouseId(), item.getLeaseType()),
item -> item, item -> item,
(existing, replacement) -> existing // 如果有重复key,保留第一个 (existing, replacement) -> existing // 如果有重复key,保留第一个
)); ));
// 处理整租 // 处理整租
@@ -293,7 +291,7 @@ public class LeaseApplicationService {
); );
//获取总面积 //获取总面积
BigDecimal totalArea = BigDecimal.ZERO; BigDecimal totalArea = BigDecimal.ZERO;
StorageSectionDO storageSectionDO = new StorageSectionDO(); StorageSectionDO storageSectionDO = new StorageSectionDO();
storageSectionDO.setWarehouseId(shipperLeaseDetailsDO.getWarehouseId()); storageSectionDO.setWarehouseId(shipperLeaseDetailsDO.getWarehouseId());
storageSectionDO.setOpeningUp(1); storageSectionDO.setOpeningUp(1);
List<StorageSectionPO> storageSectionPOS = storageSectionApplicationService.queryList(storageSectionDO); List<StorageSectionPO> storageSectionPOS = storageSectionApplicationService.queryList(storageSectionDO);
@@ -311,9 +309,9 @@ public class LeaseApplicationService {
BigDecimal fractionalLeaseArea = BigDecimal.ZERO; BigDecimal fractionalLeaseArea = BigDecimal.ZERO;
//计算整租和散租 //计算整租和散租
for (ShipperLeaseDetailsPO shipperLeaseDetail : shipperLeaseDetails) { for (ShipperLeaseDetailsPO shipperLeaseDetail : shipperLeaseDetails) {
if (shipperLeaseDetail.getLeaseType().equals("整租")){ if (shipperLeaseDetail.getLeaseType().equals("整租")) {
entireLeaseArea = entireLeaseArea.add(shipperLeaseDetail.getLeaseArea()); entireLeaseArea = entireLeaseArea.add(shipperLeaseDetail.getLeaseArea());
}else { } else {
fractionalLeaseArea = fractionalLeaseArea.add(shipperLeaseDetail.getLeaseArea()); fractionalLeaseArea = fractionalLeaseArea.add(shipperLeaseDetail.getLeaseArea());
} }
warehouseOccupancyRate.setWarehouseName(shipperLeaseDetail.getWarehouseName()); warehouseOccupancyRate.setWarehouseName(shipperLeaseDetail.getWarehouseName());