From 0901a311a04423333cacaa4a5fca0191de78683f Mon Sep 17 00:00:00 2001 From: skjia <106962133@qq.com> Date: Fri, 4 Jul 2025 15:30:07 +0800 Subject: [PATCH] =?UTF-8?q?jsk=20=20=20=E6=A0=B9=E6=8D=AE=E6=9C=BA?= =?UTF-8?q?=E5=85=B7=E7=B1=BB=E5=9E=8B=E6=9F=A5=E8=AF=A2=E6=9C=BA=E5=85=B7?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B/=E5=BE=80=E6=9D=A5=E5=8D=95=E4=BD=8D/?= =?UTF-8?q?=E5=8D=8F=E8=AE=AE=E5=8F=B7=E6=9F=A5=E8=AF=A2=E6=9C=BA=E5=85=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=20=E6=A0=B9=E6=8D=AE=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=A2=86=E7=94=A8=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IwsCostPushController.java | 43 +++ .../material/push/domain/IwsCostPushBean.java | 21 ++ .../push/mapper/IwsCostPushMapper.java | 28 ++ .../push/service/IwsCostPushService.java | 16 ++ .../service/impl/IwsCostPushServiceImpl.java | 100 +++++++ .../material/push/IwsCostPushMapper.xml | 269 +++++++++++++++++- 6 files changed, 476 insertions(+), 1 deletion(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java index 1c30213e..a4d72d3f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/controller/IwsCostPushController.java @@ -5,6 +5,8 @@ import com.bonus.common.core.utils.poi.ExcelUtil; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.common.core.web.page.TableDataInfo; +import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo; +import com.bonus.material.clz.domain.vo.lease.LeaseTotalInfo; import com.bonus.material.push.domain.IwsCostPushBean; import com.bonus.material.push.domain.vo.IwsCostPushExportVo; import com.bonus.material.push.service.IwsCostPushService; @@ -216,4 +218,45 @@ public class IwsCostPushController extends BaseController { return iwsCostPushService.computeTheMonthCost(obj); } + /** + * 根据工程查询领用信息 + * @author jsk + * @param info + * @return + */ + @ApiOperation(value = "根据工程查询领用信息") + @GetMapping("/getProLeaseInfo") + public AjaxResult getProLeaseInfo(IwsCostPushBean info) { + startPage(); + List list = iwsCostPushService.getProLeaseInfo(info); + return AjaxResult.success(getDataTable(list)); + } + + /** + * 根据机具类型查询机具列表接口 + * @author jsk + * @param info + * @return + */ + @ApiOperation(value = "根据机具类型查询机具列表接口") + @GetMapping("/getDeviceInfoPageByMaType") + public AjaxResult getEquipmentListByType(IwsCostPushBean info) { + startPage(); + List list = iwsCostPushService.getEquipmentListByType(info); + return AjaxResult.success(getDataTable(list)); + } + + /** + * 根据工程/往来单位/协议号查询机具信息 + * @author jsk + * @param info + * @return + */ + @ApiOperation(value = "根据工程/往来单位/协议号查询机具信息") + @GetMapping("/getDeviceInfoPageByAgreementProject") + public AjaxResult getEquipmentListByAgreementCode(IwsCostPushBean info) { + startPage(); + List list = iwsCostPushService.getEquipmentListByAgreementCode(info); + return AjaxResult.success(getDataTable(list)); + } } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java index 4da58e34..d010cbbb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/domain/IwsCostPushBean.java @@ -28,6 +28,7 @@ public class IwsCostPushBean implements Serializable { private String id; + private Long parentId; // 协议号 @Excel(name = "协议号", sort = 1) private String agreementCode; @@ -146,4 +147,24 @@ public class IwsCostPushBean implements Serializable { // 是否删除 false未删除 true已删除 private boolean delFlag = false; + + @ApiModelProperty(value = "预领料数") + private BigDecimal preNum; + + @ApiModelProperty(value = "待出库数量") + private BigDecimal pendingNum; + + @ApiModelProperty(value = "出库数量") + @Excel(name = "出库数量") + private BigDecimal outNum; + // 工程id数组 + private String[] projectIds; + + private String deviceName; + private String deviceModel; + private String deviceStatus; + private String maType; + + private String maTypeName; + private String maModelName; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/mapper/IwsCostPushMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/mapper/IwsCostPushMapper.java index d6decbd8..9258930f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/mapper/IwsCostPushMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/mapper/IwsCostPushMapper.java @@ -1,5 +1,7 @@ package com.bonus.material.push.mapper; +import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo; +import com.bonus.material.clz.domain.vo.lease.LeaseTotalInfo; import com.bonus.material.push.domain.IwsCostPushBean; import org.apache.ibatis.annotations.Mapper; @@ -45,4 +47,30 @@ public interface IwsCostPushMapper { * @param record 协议信息及条件 */ List getPaidSltBaseInfo(IwsCostPushBean record); + + /** + * @author jsk + *根据工程查询领用信息 + */ + List getProLeaseInfo(IwsCostPushBean record); + /** + * 工器具领料记录总数 + * @param leaseTotalInfo + * @return + */ + IwsCostPushBean getTotalInfo(IwsCostPushBean leaseTotalInfo); + + /** + * 工器具领料记录总数 + * @param leaseTotalInfo + * @return + */ + List getEquipmentListByType(IwsCostPushBean leaseTotalInfo); + + /** + * 工器具领料记录总数 + * @param leaseTotalInfo + * @return + */ + List getEquipmentListByAgreementCode(IwsCostPushBean leaseTotalInfo); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/IwsCostPushService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/IwsCostPushService.java index f0c8938d..09581a06 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/IwsCostPushService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/push/service/IwsCostPushService.java @@ -1,6 +1,7 @@ package com.bonus.material.push.service; import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo; import com.bonus.material.push.domain.IwsCostPushBean; import java.util.List; @@ -33,4 +34,19 @@ public interface IwsCostPushService { * 根据协议ID及月份查询当月租赁费用明细 */ List getLeaseCostsByAgreementIdAndMonth(IwsCostPushBean record); + + /** + * 根据工程查询领用信息 + */ + List getProLeaseInfo(IwsCostPushBean record); + + /** + * 根据机具类型查询机具列表接口 + */ + List getEquipmentListByType(IwsCostPushBean record); + + /** + * 根据工程/往来单位/协议号查询机具信息 + */ + List getEquipmentListByAgreementCode(IwsCostPushBean record); } 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 80f7a95a..3f98ec1c 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 @@ -4,6 +4,8 @@ import com.alibaba.nacos.common.utils.CollectionUtils; import com.bonus.common.biz.config.DateTimeHelper; import com.bonus.common.core.utils.StringUtils; import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo; +import com.bonus.material.clz.domain.vo.lease.LeaseTotalInfo; import com.bonus.material.push.domain.IwsCostPushBean; import com.bonus.material.push.mapper.IwsCostPushMapper; import com.bonus.material.push.service.IwsCostPushService; @@ -315,4 +317,102 @@ public class IwsCostPushServiceImpl implements IwsCostPushService { return daysBetween; } + + /** + * @author jsk + *根据工程查询领用信息 + */ + @Override + public List getProLeaseInfo(IwsCostPushBean info) { + List list=new ArrayList<>(); + try{ + BigDecimal preNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal outNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal pendingNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + info.setProjectId(String.join(",", info.getProjectIds())); + list=iwsCostPushMapper.getProLeaseInfo(info); + if (!org.springframework.util.CollectionUtils.isEmpty(list)) { + for (IwsCostPushBean leaseTotalInfo : list) { + // 根据typeId和parentId查询领料数量 + IwsCostPushBean totalInfo = iwsCostPushMapper.getTotalInfo(leaseTotalInfo); + if (totalInfo != null) { + leaseTotalInfo.setPreNum(totalInfo.getPreNum()); + leaseTotalInfo.setPendingNum(leaseTotalInfo.getPreNum().subtract(leaseTotalInfo.getOutNum())); + } + preNum = preNum.add(leaseTotalInfo.getPreNum()); + outNum = outNum.add(leaseTotalInfo.getOutNum()); + pendingNum = pendingNum.add(leaseTotalInfo.getPendingNum()); + } + } + }catch (Exception e){ + e.printStackTrace(); + } + return list; + } + + /** + * 根据机具类型查询机具列表接口 + * @param bean + * @return + */ + @Override + public List getEquipmentListByType(IwsCostPushBean bean) { + BigDecimal totalPrice = BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP); + BigDecimal totalStoreNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalUsNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalRepairNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalRepairInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalAllNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + try{ + bean.setProjectId(String.join(",", bean.getProjectIds())); + }catch (Exception e){} + List recordList = iwsCostPushMapper.getEquipmentListByType(bean); + if (CollectionUtils.isNotEmpty(recordList)) { + for (MaterialRetainedEquipmentInfo retainedEquipmentInfo : recordList) { + totalStoreNum = totalStoreNum.add(retainedEquipmentInfo.getStoreNum()); + totalUsNum = totalUsNum.add(retainedEquipmentInfo.getUsNum()); + totalAllNum = totalAllNum.add(retainedEquipmentInfo.getAllNum()); + BigDecimal equipmentPrice = retainedEquipmentInfo.getAllNum() + .multiply(retainedEquipmentInfo.getBuyPrice()) + .divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP); + totalPrice = totalPrice.add(equipmentPrice); + retainedEquipmentInfo.setTotalPrice(equipmentPrice); + } + } + return recordList; + } + + /** + * 根据工程/往来单位/协议号查询机具信息 + * @param bean + * @return + */ + @Override + public List getEquipmentListByAgreementCode(IwsCostPushBean bean) { + BigDecimal totalPrice = BigDecimal.ZERO.setScale(2, RoundingMode.HALF_UP); + BigDecimal totalStoreNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalUsNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalRepairNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalRepairInputNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + BigDecimal totalAllNum = BigDecimal.ZERO.setScale(3, RoundingMode.HALF_UP); + try{ + bean.setProjectId(String.join(",", bean.getProjectIds())); + }catch (Exception e){} + List recordList = iwsCostPushMapper.getEquipmentListByAgreementCode(bean); + if (CollectionUtils.isNotEmpty(recordList)) { + for (MaterialRetainedEquipmentInfo retainedEquipmentInfo : recordList) { + totalStoreNum = totalStoreNum.add(retainedEquipmentInfo.getStoreNum()); + totalUsNum = totalUsNum.add(retainedEquipmentInfo.getUsNum()); + totalAllNum = totalAllNum.add(retainedEquipmentInfo.getAllNum()); + BigDecimal equipmentPrice = retainedEquipmentInfo.getAllNum() + .multiply(retainedEquipmentInfo.getBuyPrice()) + .divide(new BigDecimal(10000), 2, RoundingMode.HALF_UP); + totalPrice = totalPrice.add(equipmentPrice); + retainedEquipmentInfo.setTotalPrice(equipmentPrice); + } + } + return recordList; + } } diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/IwsCostPushMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/IwsCostPushMapper.xml index 354dba26..826071c9 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/push/IwsCostPushMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/push/IwsCostPushMapper.xml @@ -128,4 +128,271 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) - \ No newline at end of file + + + + + + + + +