diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java
index f1f8a01c..fde66852 100644
--- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java
+++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyDetails.java
@@ -6,9 +6,11 @@ import lombok.Data;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
+import java.math.BigDecimal;
+
/**
* 领料任务详细对象 lease_apply_details
- *
+ *
* @author xsheng
* @date 2024-10-16
*/
@@ -44,28 +46,28 @@ public class LeaseApplyDetails extends BaseEntity {
/** 库存数量 */
@ApiModelProperty(value = "库存数量")
- private String storageNum;
+ private BigDecimal storageNum;
/** 预领料数 */
@Excel(name = "预领料数")
@ApiModelProperty(value = "预领料数")
- private Long preNum;
+ private BigDecimal preNum;
/** 审批数量 */
@Excel(name = "审批数量")
@ApiModelProperty(value = "审批数量")
- private Long auditNum;
+ private BigDecimal auditNum;
/** 已领数量 */
@Excel(name = "已领数量")
@ApiModelProperty(value = "已领数量")
- private Long alNum;
+ private BigDecimal alNum;
/**
* 此数量是剩余需要出库的数量(preNum - alNum)
*/
@ApiModelProperty(value = "剩余最大出库数量")
- private Integer outNum;
+ private BigDecimal outNum;
/**
* 装备管理方式(0编号 1计数)
@@ -85,7 +87,7 @@ public class LeaseApplyDetails extends BaseEntity {
private String keyword;
- public LeaseApplyDetails(Long id, Long parentId, Long typeId, Long preNum, Long auditNum, Long alNum, String status, Long companyId) {
+ public LeaseApplyDetails(Long id, Long parentId, Long typeId, BigDecimal preNum, BigDecimal auditNum, BigDecimal alNum, String status, Long companyId) {
this.id = id;
this.parentId = parentId;
this.typeId = typeId;
diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java
index 1c993bf3..d42f23c3 100644
--- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java
+++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseApplyInfo.java
@@ -1,5 +1,6 @@
package com.bonus.material.lease.domain;
+import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@@ -10,10 +11,11 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
+import org.apache.poi.hpsf.Decimal;
/**
* 领料任务对象 lease_apply_info
- *
+ *
* @author xsheng
* @date 2024-10-16
*/
@@ -196,10 +198,10 @@ public class LeaseApplyInfo extends BaseEntity {
* 预领料合计数
*/
@ApiModelProperty(value = "预领料合计数")
- private Integer preCountNum;
+ private BigDecimal preCountNum;
@ApiModelProperty(value = "已出库数量")
- private Integer alNum;
+ private BigDecimal alNum;
@ApiModelProperty(value = "开始时间")
private String startTime;
diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseOutDetails.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseOutDetails.java
index f67467dd..61206639 100644
--- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseOutDetails.java
+++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/domain/LeaseOutDetails.java
@@ -5,10 +5,13 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
+import org.apache.poi.hpsf.Decimal;
+
+import java.math.BigDecimal;
/**
* 领料出库详细对象 lease_out_details
- *
+ *
* @author xsheng
* @date 2024-10-16
*/
@@ -40,7 +43,7 @@ public class LeaseOutDetails extends BaseEntity {
/** 预领料数 */
@Excel(name = "预领料数")
@ApiModelProperty(value = "预领料数")
- private Long outNum;
+ private BigDecimal outNum;
/** 出库类型 */
@Excel(name = "出库类型")
@@ -66,7 +69,7 @@ public class LeaseOutDetails extends BaseEntity {
private Integer manageType;
@ApiModelProperty(value = "数量出库-出库数量")
- private Long inputNum;
+ private BigDecimal inputNum;
@ApiModelProperty(value = "0工程1长期")
private String leaseType;
diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java
index c2cbbb94..2d4d7618 100644
--- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java
+++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/lease/service/impl/LeaseOutDetailsServiceImpl.java
@@ -32,7 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
/**
* 领料出库详细Service业务层处理
- *
+ *
* @author xsheng
* @date 2024-10-16
*/
@@ -67,7 +67,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
TmTaskAgreementMapper tmTaskAgreementMapper;
/**
* 查询领料出库详细
- *
+ *
* @param id 领料出库详细主键
* @return 领料出库详细
*/
@@ -78,7 +78,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
/**
* 查询领料出库详细列表
- *
+ *
* @param leaseOutDetails 领料出库详细
* @return 领料出库详细
*/
@@ -89,7 +89,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
/**
* 新增领料出库详细
- *
+ *
* @param leaseOutDetailsList 领料出库详细
* @return 结果
*/
@@ -106,7 +106,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
/**
* 修改领料出库详细
- *
+ *
* @param leaseOutDetails 领料出库详细
* @return 结果
*/
@@ -122,7 +122,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
/**
* 批量删除领料出库详细
- *
+ *
* @param ids 需要删除的领料出库详细主键
* @return 结果
*/
@@ -133,7 +133,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
/**
* 删除领料出库详细信息
- *
+ *
* @param id 领料出库详细主键
* @return 结果
*/
@@ -157,7 +157,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
boolean isEnough = checkStorageIsEnough(record);
//record.setPreStoreNum(getStorageNum(record));
if (isEnough) {
- if ((record.getManageType() == MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId()) && record.getInputNum() != null) {
+ if ((record.getManageType().equals(MaTypeManageTypeEnum.NUMBER_DEVICE.getTypeId())) && record.getInputNum() != null) {
record.setOutNum(record.getInputNum());
}
@@ -234,20 +234,20 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
}
private int checkStorageNum(LeaseOutDetails record) {
- double outNum = 0.1;
+ BigDecimal outNum = BigDecimal.valueOf(0);
if (StringUtils.isNull(record)) {
return 0;
}
- if (record.getOutNum() == null || record.getOutNum() < outNum) {
- record.setOutNum(0L);
+ if (record.getOutNum() == null ) {
+ record.setOutNum(BigDecimal.valueOf(0L));
}
//判断(ma_type 设备规格表)中的库存够不够出库的
Type maType = typeMapper.selectByTypeId(record);
if (maType != null) {
if ("0".equals(maType.getManageType())) {
int count = typeMapper.getCountOfCodeMachine(record);
- if (BigDecimal.valueOf(count).compareTo(BigDecimal.valueOf(record.getOutNum())) < 0) {
+ if (BigDecimal.valueOf(count).compareTo(record.getOutNum()) < 0) {
return 0;
}
} else if ("1".equals(maType.getManageType())) {
@@ -284,9 +284,9 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
int res = 0;
SltAgreementInfo sltAgreementInfo = sltAgreementInfoMapper.getSltAgreementInfo(record);
if (sltAgreementInfo != null) {
- Long num = sltAgreementInfo.getNum();
- Long outNum = record.getOutNum();
- sltAgreementInfo.setNum(num + outNum);
+ BigDecimal num = sltAgreementInfo.getNum();
+ BigDecimal outNum = record.getOutNum();
+ sltAgreementInfo.setNum(num.add(outNum));
res = sltAgreementInfoMapper.updSltInfo(sltAgreementInfo);
} else {
String agreementId = tmTaskAgreementMapper.getAgreementId(taskId);
diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java
index 0e5661b4..bbb4b6f8 100644
--- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java
+++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/Type.java
@@ -13,6 +13,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity;
+import org.apache.poi.hpsf.Decimal;
/**
* 物资类型对象 ma_type
@@ -75,7 +76,7 @@ public class Type extends BaseEntity {
/** 实时库存 */
@Excel(name = "实时库存")
@ApiModelProperty(value = "实时库存")
- private Long storageNum;
+ private BigDecimal storageNum;
/** 是否扣费 */
@ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费")
@@ -102,6 +103,17 @@ public class Type extends BaseEntity {
@Excel(name = "计量单位")
private String unitName;
+ /** 计量单位名称值0整型1小数 */
+ @ApiModelProperty(value = "计量单位名称0整型1小数")
+ @Excel(name = "计量单位0整型1小数")
+ private String unitValue;
+
+ /** 排序 */
+ @ApiModelProperty(value = "排序")
+ @Excel(name = "排序")
+ private int sortNum;
+
+
/** 管理方式(0编号 1计数) */
@Excel(name = "管理方式(0编号 1计数)", readConverterExp = "0=编号,1=计数")
@ApiModelProperty(value = "管理方式(0编号 1计数)")
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 b26105d9..48cac3fb 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
@@ -11,7 +11,7 @@ import com.bonus.common.core.web.domain.BaseEntity;
/**
* 结算信息对象 slt_agreement_info
- *
+ *
* @author xsheng
* @date 2024-10-16
*/
@@ -68,7 +68,7 @@ public class SltAgreementInfo extends BaseEntity {
/** 领料数量 */
@Excel(name = "领料数量")
@ApiModelProperty(value = "领料数量")
- private Long num;
+ private BigDecimal num;
private Integer backNum;
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 50e1c312..f942c48a 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
@@ -21,7 +21,7 @@ import javax.annotation.Resource;
/**
* 结算信息Service业务层处理
- *
+ *
* @author xsheng
* @date 2024-10-16
*/
@@ -35,7 +35,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/**
* 查询结算信息
- *
+ *
* @param id 结算信息主键
* @return 结算信息
*/
@@ -46,7 +46,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/**
* 查询结算信息列表
- *
+ *
* @param sltAgreementInfo 结算信息
* @return 结算信息
*/
@@ -82,7 +82,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/**
* 新增结算信息
- *
+ *
* @param sltAgreementInfo 结算信息
* @return 结果
*/
@@ -98,7 +98,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/**
* 修改结算信息
- *
+ *
* @param sltAgreementInfo 结算信息
* @return 结果
*/
@@ -114,7 +114,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/**
* 批量删除结算信息
- *
+ *
* @param ids 需要删除的结算信息主键
* @return 结果
*/
@@ -125,7 +125,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/**
* 删除结算信息信息
- *
+ *
* @param id 结算信息主键
* @return 结果
*/
@@ -145,13 +145,13 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
bean.setLeasePrice(BigDecimal.valueOf(0.00));
}
if (bean.getNum() == null) {
- bean.setNum(0L);
+ bean.setNum(BigDecimal.valueOf(0L));
}
if (bean.getLeaseDay() == null) {
bean.setLeaseDay(0L);
}
BigDecimal leasePrice = bean.getLeasePrice();
- BigDecimal num = new BigDecimal(bean.getNum());
+ BigDecimal num = bean.getNum();
BigDecimal leaseDays = new BigDecimal(bean.getLeaseDay());
BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays);
bean.setCosts(costs);
@@ -191,10 +191,10 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
bean.setBuyPrice(BigDecimal.valueOf(0.00));
}
if (bean.getNum() == null) {
- bean.setNum(0L);
+ bean.setNum(BigDecimal.valueOf(0L));
}
BigDecimal buyPrice = bean.getBuyPrice();
- BigDecimal num = new BigDecimal(bean.getNum());
+ BigDecimal num = bean.getNum();
BigDecimal costs = buyPrice.multiply(num);
//计算总金额
/*BigDecimal costs = BigDecimal.ZERO;
@@ -220,10 +220,10 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
bean.setBuyPrice(BigDecimal.valueOf(0.00));
}
if (bean.getNum() == null) {
- bean.setNum(0L);
+ bean.setNum(BigDecimal.valueOf(0L));
}
BigDecimal buyPrice = bean.getBuyPrice();
- BigDecimal num = new BigDecimal(bean.getNum());
+ BigDecimal num = bean.getNum();
// 原价 x 数量
BigDecimal costs = buyPrice.multiply(num);
//计算租赁费用
diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml
index 0872e2fa..eac5c29b 100644
--- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml
+++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml
@@ -17,6 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
@@ -51,6 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
@@ -156,7 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"