代码格式化样式

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;
@Autowired
private IShipperLeaseDetailsService shipperLeaseDetailsService;
private IShipperLeaseDetailsService shipperLeaseDetailsService;
@Autowired
private SystemServiceFeign systemServiceFeign;
/**
* 分页查询租赁管理列表
@@ -77,23 +78,24 @@ public class LeaseApplicationService {
public List<LeasePO> queryList(LeaseDO leaseDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
//前端传organizationId = 2827的时候查询所有组织的数据
Long frontendOrganizationId = leaseDO.getOrganizationId();
if (frontendOrganizationId != null && frontendOrganizationId == 2827L) {
// 前端传递2827时,查询所有组织的数据,将organizationId设置为null
leaseDO.setOrganizationId(null);
} else {
// 其他情况,只查询当前登录用户所属组织的数据
if (loginUser != null && loginUser.getUserPo() != null) {
Long userOrganizationId = loginUser.getUserPo().getOrganizationId();
if (userOrganizationId != null) {
leaseDO.setOrganizationId(userOrganizationId);
if (loginUser != null) {
Long frontendOrganizationId = leaseDO.getOrganizationId();
if (frontendOrganizationId != null && frontendOrganizationId == 2827L) {
// 前端传递2827时,查询所有组织的数据,将organizationId设置为null
leaseDO.setOrganizationId(null);
} else {
// 其他情况,只查询当前登录用户所属组织的数据
if (loginUser != null && loginUser.getUserPo() != null) {
Long userOrganizationId = loginUser.getUserPo().getOrganizationId();
if (userOrganizationId != null) {
leaseDO.setOrganizationId(userOrganizationId);
}
}
}
}
return leaseDomainService.queryList(leaseDO);
}
/**
* 新增租赁管理
*/
@@ -113,12 +115,9 @@ public class LeaseApplicationService {
return leaseDomainService.insert(leaseDO);
}
@Autowired
private SystemServiceFeign systemServiceFeign;
private void setWarehouseInfo(LeaseDO leaseDO) {
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("获取仓库信息失败");
}
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);
}
/**
* @param leaseIds
* @return Boolean
* @description 批量作废租赁
* @author ZhouGY
* @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);
}
@@ -185,7 +183,7 @@ public class LeaseApplicationService {
// 计算前一天的日期,将时间设置为当天的0点0分0秒,只保留日期部分
final Date yesterday = DateUtil.beginOfDay(DateUtil.offsetDay(new Date(), -1));
LeaseDO leaseDO = new LeaseDO();
LeaseDO leaseDO = new LeaseDO();
leaseDO.setTime(yesterday);
//查询有效期内的租赁
List<LeasePO> leasePOS = queryList(leaseDO);
@@ -206,9 +204,9 @@ public class LeaseApplicationService {
// 构建已存在数据的Map,key为:业务日期+货主ID+仓库ID+租赁类型
Map<String, ShipperLeaseDetailsPO> existingMap = existingList.stream()
.collect(Collectors.toMap(
item -> buildKey(yesterday, item.getShipperId(), item.getWarehouseId(), item.getLeaseType()),
item -> item,
(existing, replacement) -> existing // 如果有重复key,保留第一个
item -> buildKey(yesterday, item.getShipperId(), item.getWarehouseId(), item.getLeaseType()),
item -> item,
(existing, replacement) -> existing // 如果有重复key,保留第一个
));
// 处理整租
@@ -293,7 +291,7 @@ public class LeaseApplicationService {
);
//获取总面积
BigDecimal totalArea = BigDecimal.ZERO;
StorageSectionDO storageSectionDO = new StorageSectionDO();
StorageSectionDO storageSectionDO = new StorageSectionDO();
storageSectionDO.setWarehouseId(shipperLeaseDetailsDO.getWarehouseId());
storageSectionDO.setOpeningUp(1);
List<StorageSectionPO> storageSectionPOS = storageSectionApplicationService.queryList(storageSectionDO);
@@ -311,9 +309,9 @@ public class LeaseApplicationService {
BigDecimal fractionalLeaseArea = BigDecimal.ZERO;
//计算整租和散租
for (ShipperLeaseDetailsPO shipperLeaseDetail : shipperLeaseDetails) {
if (shipperLeaseDetail.getLeaseType().equals("整租")){
if (shipperLeaseDetail.getLeaseType().equals("整租")) {
entireLeaseArea = entireLeaseArea.add(shipperLeaseDetail.getLeaseArea());
}else {
} else {
fractionalLeaseArea = fractionalLeaseArea.add(shipperLeaseDetail.getLeaseArea());
}
warehouseOccupancyRate.setWarehouseName(shipperLeaseDetail.getWarehouseName());