From 89c6bc6d6a7e4e7c97d9cbb3ed47c26ece881dfb Mon Sep 17 00:00:00 2001 From: mashuai Date: Wed, 22 Oct 2025 19:22:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MaterialLeaseInfoController.java | 5 +- .../vo/MaterialRetainedEquipmentInfo.java | 2 +- .../clz/mapper/MaterialLeaseInfoMapper.java | 7 + .../impl/MaterialLeaseInfoServiceImpl.java | 10 +- .../impl/MaterialMachineServiceImpl.java | 4 +- .../domain/ExpectationsEntity.java | 2 +- .../mapper/ExpectationsMapper.java | 15 ++ .../service/impl/ExpectationsServiceImpl.java | 8 + .../material/clz/MaterialLeaseInfoMapper.xml | 23 +++ .../material/clz/MaterialMachineMapper.xml | 6 +- .../expectations/ExpectationsMapper.xml | 179 +++++++++++++----- 11 files changed, 201 insertions(+), 60 deletions(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/controller/MaterialLeaseInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/controller/MaterialLeaseInfoController.java index e0bd8843..c7e63afd 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/controller/MaterialLeaseInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/controller/MaterialLeaseInfoController.java @@ -113,9 +113,10 @@ public class MaterialLeaseInfoController extends BaseController { @ApiOperation(value = "查询总站点领料详情数据") @GetMapping("/getDetailsList") public AjaxResult getDetailsList(MaterialLeaseApplyInfo leaseApplyInfo) { - startPage(); + Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); + Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); List list = materialLeaseInfoService.getDetailsList(leaseApplyInfo); - return AjaxResult.success(getDataTable(list)); + return AjaxResult.success(ListPagingUtil.paging(pageIndex, pageSize, list)); } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/MaterialRetainedEquipmentInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/MaterialRetainedEquipmentInfo.java index b5e99b60..ef0d2879 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/MaterialRetainedEquipmentInfo.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/domain/vo/MaterialRetainedEquipmentInfo.java @@ -102,7 +102,7 @@ public class MaterialRetainedEquipmentInfo { private BigDecimal buyPrice; @ApiModelProperty(value = "原值") - //@Excel(name = "原值(万元)", cellType = Excel.ColumnType.NUMERIC,align = HorizontalAlignment.RIGHT) + @Excel(name = "原值(万元)", cellType = Excel.ColumnType.NUMERIC,align = HorizontalAlignment.RIGHT) private BigDecimal totalPrice; @ApiModelProperty(value = "五年以内成新率") diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/mapper/MaterialLeaseInfoMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/mapper/MaterialLeaseInfoMapper.java index a71d7584..e8a84fde 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/mapper/MaterialLeaseInfoMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/mapper/MaterialLeaseInfoMapper.java @@ -491,4 +491,11 @@ public interface MaterialLeaseInfoMapper { * @return */ LeaseApplyInfo selectPublishInfo(Long parentId); + + /** + * 获取领用数据 + * @param leaseApplyInfo + * @return + */ + List getPublishList(MaterialLeaseApplyInfo leaseApplyInfo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialLeaseInfoServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialLeaseInfoServiceImpl.java index c39649a2..161ffe26 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialLeaseInfoServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialLeaseInfoServiceImpl.java @@ -326,7 +326,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService { .collect(Collectors.toList()); } - // 查询所有未结算的工程 + /* // 查询所有未结算的工程 List projectIdList = mapper.getUnsettledProId(); // 使用 HashSet 来加速查找过程 Set unsettledProjectIds = new HashSet<>(projectIdList); @@ -340,7 +340,7 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService { if (proId == null || !unsettledProjectIds.contains(proId)) { iterator.remove(); } - } + }*/ } return sortedList; } @@ -548,7 +548,11 @@ public class MaterialLeaseInfoServiceImpl implements MaterialLeaseInfoService { */ @Override public List getDetailsList(MaterialLeaseApplyInfo leaseApplyInfo) { - return materialLeaseInfoMapper.getDetailsList(leaseApplyInfo); + List list = materialLeaseInfoMapper.getDetailsList(leaseApplyInfo); + if (CollectionUtils.isEmpty(list)) { + list = materialLeaseInfoMapper.getPublishList(leaseApplyInfo); + } + return list; } /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java index f6e44953..d2e52ea1 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/clz/service/impl/MaterialMachineServiceImpl.java @@ -1014,7 +1014,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService { info.setRopeNum(inRopeNum.add(useRopeNum).add(useRopeNumSub)); // 投入费用(万元) info.setTotalPrice(totalPrice); - /*// 租赁费用(万元) + // 租赁费用(万元) List leaseInfoList = materialMachineMapper.getLeaseInfo(bean); if (CollectionUtils.isNotEmpty(leaseInfoList)) { rentPrice = leaseInfoList.stream() @@ -1025,7 +1025,7 @@ public class MaterialMachineServiceImpl implements MaterialMachineService { .setScale(3, RoundingMode.HALF_UP); } else { info.setRentPrice(BigDecimal.ZERO); - }*/ + } info.setRentPrice(rentPrice); return info; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/domain/ExpectationsEntity.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/domain/ExpectationsEntity.java index d167bf65..47fe7d26 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/domain/ExpectationsEntity.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/domain/ExpectationsEntity.java @@ -55,7 +55,7 @@ public class ExpectationsEntity { private int aboutToExpireCount; /** - * 超期类别 + * 超期类别(0 超期,1 临期) */ private String status; /** diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/mapper/ExpectationsMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/mapper/ExpectationsMapper.java index 6f719fe9..00746d2d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/mapper/ExpectationsMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/mapper/ExpectationsMapper.java @@ -27,4 +27,19 @@ public interface ExpectationsMapper { List getListDetails(ExpectationsEntity entity); + + /** + * 在用设备量 + * @param entity + * @return + */ + @MapKey("name") + Map getUseCountExpectations(ExpectationsEntity entity); + + /** + * 在用设备列表 + * @param entity + * @return + */ + List getUserList(ExpectationsEntity entity); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java index 8910922c..10e3aa17 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java @@ -31,6 +31,10 @@ public class ExpectationsServiceImpl implements ExpectationsService { public List getExpectationsList(ExpectationsEntity entity) { try { List expectationsList = mapper.getExpectationsList(entity); + if (entity != null && "2".equals(entity.getUseStatus())) { + //在用设备列表 + expectationsList = mapper.getUserList(entity); + } return ObjectUtils.isNotEmpty(expectationsList) ? expectationsList : Collections.emptyList(); } catch (Exception e) { log.error(e.getMessage()); @@ -48,6 +52,10 @@ public class ExpectationsServiceImpl implements ExpectationsService { public AjaxResult getCountExpectations(ExpectationsEntity entity) { try { Map countExpectations = mapper.getCountExpectations(entity); + if (entity != null && "2".equals(entity.getUseStatus())) { + //在用设备量 + countExpectations = mapper.getUseCountExpectations(entity); + } return ObjectUtils.isNotEmpty(countExpectations) ? AjaxResult.success(countExpectations) : AjaxResult.error(); }catch (Exception e) { log.error(e.getMessage()); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml index 9d3c6d59..28219431 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialLeaseInfoMapper.xml @@ -1758,4 +1758,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" parent_id = #{parentId} LIMIT 1 + + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialMachineMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialMachineMapper.xml index 559748f7..0673feb0 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialMachineMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/clz/MaterialMachineMapper.xml @@ -2597,7 +2597,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sai.type_id AS typeId, lai.code AS code, sai.ma_id AS maId, - bp.pro_name AS proName + bp.pro_name AS proName, + CASE WHEN + lai.direct_id IS NULL + THEN '1' ELSE '0' + END AS directFlag FROM slt_agreement_info sai LEFT JOIN ma_type mt ON mt.type_id = sai.type_id diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml index 4cb997ce..8c783cbb 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml @@ -6,25 +6,136 @@ + + + + + + + + + AND mm.next_check_time < CURDATE() + + + AND mm.next_check_time >= CURDATE() + AND mm.next_check_time < DATE_ADD(CURDATE(), INTERVAL 30 DAY) + + + + + + + + - -