|
|
@@ -88,7 +88,7 @@ public class AssetServiceImpl extends BaseServiceImpl<AssetMapper, AssetEntity>
|
|
|
// 仪器设置的算法:当前时间为2025年01月-2024年5月,差额为9个月,因为折旧从次月开始,所以已使用月数为8个月(即9-1=8),再将使用寿命-已使用月份数=0时,即已足额折旧。
|
|
|
// 无形资产:当月即摊销,不需要-1
|
|
|
|
|
|
- long ysysm = cn.hutool.core.date.DateUtil.betweenMonth(DateUtil.parse(asset.getYearAndMonth(), DateUtil.PATTERN_YYYYMM), asset.getKssj(), false);
|
|
|
+ long ysysm = cn.hutool.core.date.DateUtil.betweenMonth(DateUtil.parse(asset.getYearAndMonth(), DateUtil.PATTERN_YYYYMM), asset.getKssj(), true);
|
|
|
// 这里
|
|
|
if (!isFixedAsset(asset.getZclb())) {
|
|
|
ysysm++;
|
|
|
@@ -321,22 +321,6 @@ public class AssetServiceImpl extends BaseServiceImpl<AssetMapper, AssetEntity>
|
|
|
if (!isFixedAsset(asset.getZclb())) {
|
|
|
asset.setGl("/");
|
|
|
}
|
|
|
-// 正常状态、停用状态,可修改资产数据。其他情况不能修改。假设在修改资产时,正好出现使用寿命-已使用月份数=0时,即已足额折旧状态时,就显示为已足额折旧状态了,不可以再次修改了。
|
|
|
-// 修改资产时,系统需要二次确认。
|
|
|
-// if (Func.equals(dbAsset.getStatus(), AssetStatusEnum.正常.getCode()) || Func.equals(dbAsset.getStatus(), AssetStatusEnum.停用.getCode())) {
|
|
|
-//// 仪器设置的算法:当前时间为2025年01月-2024年5月,差额为9个月,因为折旧从次月开始,所以已使用月数为8个月(即9-1=8),再将使用寿命-已使用月份数=0时,即已足额折旧。
|
|
|
-//// 无形资产:当月即摊销,不需要-1
|
|
|
-// long ysysm = cn.hutool.core.date.DateUtil.betweenMonth(DateUtil.parse(asset.getYearAndMonth(), DateUtil.PATTERN_YYYYMM), asset.getKssj(), false);
|
|
|
-//// 这里
|
|
|
-// if (!Func.equals("仪器设备", asset.getZclb())) {
|
|
|
-// ysysm++;
|
|
|
-// }
|
|
|
-// asset.setYsysm((int) ysysm);
|
|
|
-// }
|
|
|
-// //使用寿命-已使用月份数=0时,即已足额折旧
|
|
|
-// if (asset.getSysm() - asset.getYsysm() <= 0) {
|
|
|
-// asset.setStatus(AssetStatusEnum.已足额折旧.getCode());
|
|
|
-// }
|
|
|
return this.updateOtherMonthAsset(asset);
|
|
|
}
|
|
|
|
|
|
@@ -354,7 +338,7 @@ public class AssetServiceImpl extends BaseServiceImpl<AssetMapper, AssetEntity>
|
|
|
updateEntity.setZgs(null);
|
|
|
|
|
|
if (Func.equals(entity.getStatus(), AssetStatusEnum.正常.getCode()) || Func.equals(entity.getStatus(), AssetStatusEnum.停用.getCode())) {
|
|
|
- long ysysm = cn.hutool.core.date.DateUtil.betweenMonth(DateUtil.parse(entity.getYearAndMonth(), DateUtil.PATTERN_YYYYMM), updateEntity.getKssj(), false);
|
|
|
+ long ysysm = cn.hutool.core.date.DateUtil.betweenMonth(DateUtil.parse(entity.getYearAndMonth(), DateUtil.PATTERN_YYYYMM), asset.getKssj(), true);
|
|
|
if (!Func.equals("仪器设备", updateEntity.getZclb())) {
|
|
|
ysysm++;
|
|
|
}
|
|
|
@@ -363,6 +347,7 @@ public class AssetServiceImpl extends BaseServiceImpl<AssetMapper, AssetEntity>
|
|
|
//使用寿命-已使用月份数=0时,即已足额折旧
|
|
|
if (updateEntity.getSysm() - updateEntity.getYsysm() <= 0) {
|
|
|
updateEntity.setStatus(AssetStatusEnum.已足额折旧.getCode());
|
|
|
+ updateEntity.setYsysm(Math.min(asset.getSysm(), updateEntity.getYsysm()));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -429,26 +414,7 @@ public class AssetServiceImpl extends BaseServiceImpl<AssetMapper, AssetEntity>
|
|
|
if (Func.isNull(asset.getId())) {
|
|
|
throw new ServiceException("参数id不能为空");
|
|
|
}
|
|
|
-// if (!List.of(AssetStatusEnum.改造.getCode(), AssetStatusEnum.停用.getCode()).contains(asset.getStatus())) {
|
|
|
-// throw new ServiceException("状态为改造/停用的资产,可进行恢复操作");
|
|
|
-// }
|
|
|
-
|
|
|
asset.setStatus(AssetStatusEnum.正常.getCode());
|
|
|
-// if (Func.isNull(asset.getYsysm())) {
|
|
|
-// //使用寿命-已使用月份数=0时,即已足额折旧
|
|
|
-//// 仪器设置的算法:当前时间为2025年01月-2024年5月,差额为9个月,因为折旧从次月开始,所以已使用月数为8个月(即9-1=8),再将使用寿命-已使用月份数=0时,即已足额折旧。
|
|
|
-//// 无形资产:当月即摊销,不需要-1
|
|
|
-// long ysysm = cn.hutool.core.date.DateUtil.betweenMonth(cn.hutool.core.date.DateUtil.date(), asset.getKssj(), false);
|
|
|
-//// 这里
|
|
|
-// if (!isFixedAsset(asset.getZclb())) {
|
|
|
-// ysysm++;
|
|
|
-// }
|
|
|
-// asset.setYsysm((int) ysysm);
|
|
|
-// }
|
|
|
-// if (asset.getSysm() - asset.getYsysm() <= 0) {
|
|
|
-// asset.setStatus(AssetStatusEnum.已足额折旧.getCode());
|
|
|
-// }
|
|
|
-// return this.updateById(asset);
|
|
|
return updateOtherMonthAsset(asset);
|
|
|
}
|
|
|
|