From 0284f8fc0f4247a067fe651ec899f9d2ebc33bba Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Thu, 11 Sep 2025 11:37:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E7=AE=97=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/IwsCostPushServiceImpl.java | 16 ++++++------ .../SltAgreementInfoController.java | 6 ++--- .../settlement/domain/SltAgreementInfo.java | 2 +- .../domain/dto/PeriodCostQueryDto.java | 2 +- .../settlement/domain/vo/SltInfoVo.java | 2 +- .../mapper/SltAgreementInfoMapper.java | 2 +- .../service/ISltAgreementInfoService.java | 2 +- .../impl/SltAgreementInfoServiceImpl.java | 25 +++++++++++++------ .../material/task/mapper/TmTaskMapper.java | 2 +- 9 files changed, 35 insertions(+), 24 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java index ae2d3a13..c6411175 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/impl/IwsCostPushServiceImpl.java @@ -157,23 +157,23 @@ public class IwsCostPushServiceImpl implements IwsCostPushService { List unsettlementEquipmentLeaseCosts = sltAgreementInfoService.selectPeriodCostSummary(new PeriodCostQueryDto() .setAgreementIds(unsettlementAgreementList.stream().map(IwsCostPushBean::getAgreementId).collect(Collectors.toList())) .setStartDate(firstDate).setEndDate(lastDate) - .setSltManageType((byte) 1) + .setSltManageType(1) ); List unsettlementEquipmentLeaseCostsDetails = sltAgreementInfoService.selectPeriodCostList(new PeriodCostQueryDto() .setAgreementIds(unsettlementAgreementList.stream().map(IwsCostPushBean::getAgreementId).collect(Collectors.toList())) .setStartDate(firstDate).setEndDate(lastDate) - .setSltManageType((byte) 1) + .setSltManageType(1) ); // 计算未结算协议 ---- (安全工器具)租赁费用info列表及details明细 List unsettlementSafetyEquipmentLeaseCosts = sltAgreementInfoService.selectPeriodCostSummary(new PeriodCostQueryDto() .setAgreementIds(safetyUnsettlementAgreementList.stream().map(IwsCostPushBean::getAgreementId).collect(Collectors.toList())) .setStartDate(firstDate).setEndDate(lastDate) - .setSltManageType((byte) 2) + .setSltManageType(2) ); List unsettlementSafetyEquipmentLeaseCostsDetails = sltAgreementInfoService.selectPeriodCostList(new PeriodCostQueryDto() .setAgreementIds(safetyUnsettlementAgreementList.stream().map(IwsCostPushBean::getAgreementId).collect(Collectors.toList())) .setStartDate(firstDate).setEndDate(lastDate) - .setSltManageType((byte) 2) + .setSltManageType(2) ); /// ------------------ 未结算协议费用计算结束 -------------------- @@ -190,14 +190,14 @@ public class IwsCostPushServiceImpl implements IwsCostPushService { .setAgreementIds(settlementAgreementList.stream().map(IwsCostPushBean::getAgreementId).collect(Collectors.toList())) .setStartTime(firstDate) .setEndTime(lastDate) - .setSettlementType((byte) 1) + .setSettlementType(1) ); // 获取已结算协议 ---- (工器具)本月租赁的区间费用明细 settlementEquipmentCostsDetails = sltAgreementInfoService.selectPeriodCostList(new PeriodCostQueryDto() .setAgreementIds(settlementAgreementList.stream().map(IwsCostPushBean::getAgreementId).collect(Collectors.toList())) .setSettlementStatus("2") .setStartDate(firstDate).setEndDate(lastDate) - .setSltManageType((byte) 1) + .setSltManageType(1) ); // 把区间计算的租赁费用覆盖已结算的用作展示 for (SltAgreementInfo item : settlementEquipmentCosts) { @@ -221,7 +221,7 @@ public class IwsCostPushServiceImpl implements IwsCostPushService { .setAgreementIds(safetySettlementAgreementList.stream().map(IwsCostPushBean::getAgreementId).collect(Collectors.toList())) .setStartTime(firstDate) .setEndTime(lastDate) - .setSettlementType((byte) 2) + .setSettlementType(2) ); // 获取已结算协议 ---- (安全工器具)的本月租赁区间费用明细 settlementSafetyEquipmentCostsDetails = sltAgreementInfoService.selectPeriodCostList(new PeriodCostQueryDto() @@ -229,7 +229,7 @@ public class IwsCostPushServiceImpl implements IwsCostPushService { .setSettlementStatus("2") .setStartDate(firstDate) .setEndDate(lastDate) - .setSltManageType((byte) 2) + .setSltManageType(2) ); // 把区间计算的租赁费用覆盖已结算的用作展示 for (SltAgreementInfo item : settlementSafetyEquipmentCosts) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java index 6c8d197a..322fad8f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java @@ -104,7 +104,7 @@ public class SltAgreementInfoController extends BaseController { ListPagingUtil paginated = ListPagingUtil.paging(pageIndex, pageSize, list); // 新增外层计算-- 计算当前分页数据的各条目费用 if (CollectionUtils.isNotEmpty(paginated.getRows())) { - byte loginUserHasSettlementPermission = sltAgreementInfoService.checkLoginUserHasSettlementPermission(); + int loginUserHasSettlementPermission = sltAgreementInfoService.checkLoginUserHasSettlementPermission(); for (Object row : paginated.getRows()) { if (row instanceof SltAgreementInfo) { ((SltAgreementInfo) row).setSettlementType(loginUserHasSettlementPermission); @@ -150,7 +150,7 @@ public class SltAgreementInfoController extends BaseController { return AjaxResult.error("请选择协议"); } if (list.get(0).getSettlementType() == null || list.get(0).getSettlementType() < 1) { - Byte settlementType = sltAgreementInfoService.checkLoginUserHasSettlementPermission(); + int settlementType = sltAgreementInfoService.checkLoginUserHasSettlementPermission(); // 设置结算权限 list.forEach(info -> info.setSettlementType(settlementType)); } else { @@ -1539,7 +1539,7 @@ public class SltAgreementInfoController extends BaseController { log.info("查询到未结算协议数量: {}", list.size()); // ----------- 给查询出来的协议设置权限控制(例如只查询工器具) --------------- - Byte settlementType = sltAgreementInfoService.checkLoginUserHasSettlementPermission(); + int settlementType = sltAgreementInfoService.checkLoginUserHasSettlementPermission(); // --------- 拿到list中所有的agreementId存成集合,给每个info赋值 ------------------ List agreementIdsArray = list.stream() diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java index 6625804a..af390ea5 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/SltAgreementInfo.java @@ -130,7 +130,7 @@ public class SltAgreementInfo extends BaseEntity { private Date sltTime; /** 结算类型 1工器具 2安全工器具 */ - private Byte settlementType; + private Integer settlementType; /** $column.columnComment */ @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/dto/PeriodCostQueryDto.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/dto/PeriodCostQueryDto.java index b3d37d6f..8e80ae16 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/dto/PeriodCostQueryDto.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/dto/PeriodCostQueryDto.java @@ -59,7 +59,7 @@ public class PeriodCostQueryDto { private String projectName; @ApiModelProperty(value = "结算管理类型 1工器具 2安全工器具") - private Byte sltManageType; + private Integer sltManageType; @ApiModelProperty(value = "数据所属组织ID") private Long companyId; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java index 38ed1ae0..f2a30b1b 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/domain/vo/SltInfoVo.java @@ -128,7 +128,7 @@ public class SltInfoVo { /** * 结算物资类型 1工器具 2安全工器具 */ - private Byte settlementType; + private Integer settlementType; @ApiModelProperty(value = "申请时间") @JsonFormat(pattern = "yyyy-MM-dd") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java index 20167f8b..de23086a 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/mapper/SltAgreementInfoMapper.java @@ -37,7 +37,7 @@ public interface SltAgreementInfoMapper { * @param agreementId 协议id * @return 条数 */ - int selectTheSettledCountByAgreementIdType(@Param("sltType") Byte sltType, @Param("agreementId") Long agreementId); + int selectTheSettledCountByAgreementIdType(@Param("sltType") Integer sltType, @Param("agreementId") Long agreementId); /** * 查询结算信息列表 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java index 7288a04e..d30d407f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/ISltAgreementInfoService.java @@ -53,7 +53,7 @@ public interface ISltAgreementInfoService { * 检查登陆用户是否有结算权限 * @return 管理的结算类型码 */ - byte checkLoginUserHasSettlementPermission(); + int checkLoginUserHasSettlementPermission(); List getSltExam(SltAgreementInfo bean); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java index 81eb1ffc..a44fc045 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/service/impl/SltAgreementInfoServiceImpl.java @@ -66,10 +66,10 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { private static final String SAFETY_EQUIPMENT_COST_USERS = "safety_equipment_cost_users"; // 工器具结算类型settlement_type键值 - private static final Byte EQUIPMENT_SETTLEMENT_TYPE = (byte) GlobalConstants.INT_1; + private static final int EQUIPMENT_SETTLEMENT_TYPE = GlobalConstants.INT_1; // 安全工器具结算类型settlement_type键值 - private static final Byte SAFETY_EQUIPMENT_SETTLEMENT_TYPE = (byte) GlobalConstants.INT_2; + private static final int SAFETY_EQUIPMENT_SETTLEMENT_TYPE = GlobalConstants.INT_2; @Autowired private SltAgreementInfoMapper sltAgreementInfoMapper; @@ -623,12 +623,12 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { @Transactional(rollbackFor = Exception.class) public int submitCosts(@NotNull(message = "结算信息不能为空") SltInfoVo sltInfoVo) { // 检查登录用户是否有结算权限 - byte loginUserSettlementTypePermission = this.checkLoginUserHasSettlementPermission(); + int loginUserSettlementTypePermission = this.checkLoginUserHasSettlementPermission(); sltInfoVo.setSettlementType(loginUserSettlementTypePermission); if (sltInfoVo.getSettlementType() == null) { throw new ServiceException("结算类型错误,结算权限码为空"); } - if (!sltInfoVo.getSettlementType().equals(EQUIPMENT_SETTLEMENT_TYPE) && !sltInfoVo.getSettlementType().equals(SAFETY_EQUIPMENT_SETTLEMENT_TYPE)) { + if (sltInfoVo.getSettlementType()!=EQUIPMENT_SETTLEMENT_TYPE && sltInfoVo.getSettlementType()!=SAFETY_EQUIPMENT_SETTLEMENT_TYPE) { throw new ServiceException("结算类型错误,结算权限码不合法!"); } try { @@ -769,7 +769,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { * @return 结算类型值 */ @Override - public byte checkLoginUserHasSettlementPermission() { + public int checkLoginUserHasSettlementPermission() { // 查询当前登陆用户信息 Long theLoginUserId = SecurityUtils.getLoginUser().getSysUser().getUserId(); @@ -800,7 +800,18 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { */ @Override public List getSltList(SltAgreementInfo bean) { - return sltAgreementInfoMapper.getSltList(bean); + List list = sltAgreementInfoMapper.getSltList(bean); + if (CollectionUtils.isNotEmpty(list)) { + for (SltAgreementInfo row : list){ + SltInfoVo sltInfoVo = null; + sltInfoVo = getSltInfo(row); + if (sltInfoVo != null) { + row.setCosts(sum(sltInfoVo.getLeaseCost(), sltInfoVo.getRepairCost(), sltInfoVo.getScrapCost(), sltInfoVo.getLoseCost())); + } + } + } + + return list; } /** @@ -1153,7 +1164,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService { try { if (queryDto.getSltManageType() == null) { // 查询当前登陆用户的结算管理权限 - Byte settlementType = this.checkLoginUserHasSettlementPermission(); + int settlementType = this.checkLoginUserHasSettlementPermission(); queryDto.setSltManageType(settlementType); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java index da02583c..6febcee6 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/task/mapper/TmTaskMapper.java @@ -110,7 +110,7 @@ public interface TmTaskMapper { * @param agreementId * @return */ - TmTask selectTaskById(@Param("agreementId") Long agreementId, @Param("settlementType") Byte settlementType); + TmTask selectTaskById(@Param("agreementId") Long agreementId, @Param("settlementType") Integer settlementType); /** * 根据协议id查询申请时间