新增计量方式数值

This commit is contained in:
bonus 2024-12-06 10:22:06 +08:00
parent bba1b7d8d3
commit 4770eb0f6f
8 changed files with 75 additions and 45 deletions

View File

@ -6,9 +6,11 @@ import lombok.Data;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import java.math.BigDecimal;
/** /**
* 领料任务详细对象 lease_apply_details * 领料任务详细对象 lease_apply_details
* *
* @author xsheng * @author xsheng
* @date 2024-10-16 * @date 2024-10-16
*/ */
@ -44,28 +46,28 @@ public class LeaseApplyDetails extends BaseEntity {
/** 库存数量 */ /** 库存数量 */
@ApiModelProperty(value = "库存数量") @ApiModelProperty(value = "库存数量")
private String storageNum; private BigDecimal storageNum;
/** 预领料数 */ /** 预领料数 */
@Excel(name = "预领料数") @Excel(name = "预领料数")
@ApiModelProperty(value = "预领料数") @ApiModelProperty(value = "预领料数")
private Long preNum; private BigDecimal preNum;
/** 审批数量 */ /** 审批数量 */
@Excel(name = "审批数量") @Excel(name = "审批数量")
@ApiModelProperty(value = "审批数量") @ApiModelProperty(value = "审批数量")
private Long auditNum; private BigDecimal auditNum;
/** 已领数量 */ /** 已领数量 */
@Excel(name = "已领数量") @Excel(name = "已领数量")
@ApiModelProperty(value = "已领数量") @ApiModelProperty(value = "已领数量")
private Long alNum; private BigDecimal alNum;
/** /**
* 此数量是剩余需要出库的数量preNum - alNum * 此数量是剩余需要出库的数量preNum - alNum
*/ */
@ApiModelProperty(value = "剩余最大出库数量") @ApiModelProperty(value = "剩余最大出库数量")
private Integer outNum; private BigDecimal outNum;
/** /**
* 装备管理方式(0编号 1计数) * 装备管理方式(0编号 1计数)
@ -85,7 +87,7 @@ public class LeaseApplyDetails extends BaseEntity {
private String keyword; 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.id = id;
this.parentId = parentId; this.parentId = parentId;
this.typeId = typeId; this.typeId = typeId;

View File

@ -1,5 +1,6 @@
package com.bonus.material.lease.domain; package com.bonus.material.lease.domain;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -10,10 +11,11 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import org.apache.poi.hpsf.Decimal;
/** /**
* 领料任务对象 lease_apply_info * 领料任务对象 lease_apply_info
* *
* @author xsheng * @author xsheng
* @date 2024-10-16 * @date 2024-10-16
*/ */
@ -196,10 +198,10 @@ public class LeaseApplyInfo extends BaseEntity {
* 预领料合计数 * 预领料合计数
*/ */
@ApiModelProperty(value = "预领料合计数") @ApiModelProperty(value = "预领料合计数")
private Integer preCountNum; private BigDecimal preCountNum;
@ApiModelProperty(value = "已出库数量") @ApiModelProperty(value = "已出库数量")
private Integer alNum; private BigDecimal alNum;
@ApiModelProperty(value = "开始时间") @ApiModelProperty(value = "开始时间")
private String startTime; private String startTime;

View File

@ -5,10 +5,13 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import org.apache.poi.hpsf.Decimal;
import java.math.BigDecimal;
/** /**
* 领料出库详细对象 lease_out_details * 领料出库详细对象 lease_out_details
* *
* @author xsheng * @author xsheng
* @date 2024-10-16 * @date 2024-10-16
*/ */
@ -40,7 +43,7 @@ public class LeaseOutDetails extends BaseEntity {
/** 预领料数 */ /** 预领料数 */
@Excel(name = "预领料数") @Excel(name = "预领料数")
@ApiModelProperty(value = "预领料数") @ApiModelProperty(value = "预领料数")
private Long outNum; private BigDecimal outNum;
/** 出库类型 */ /** 出库类型 */
@Excel(name = "出库类型") @Excel(name = "出库类型")
@ -66,7 +69,7 @@ public class LeaseOutDetails extends BaseEntity {
private Integer manageType; private Integer manageType;
@ApiModelProperty(value = "数量出库-出库数量") @ApiModelProperty(value = "数量出库-出库数量")
private Long inputNum; private BigDecimal inputNum;
@ApiModelProperty(value = "0工程1长期") @ApiModelProperty(value = "0工程1长期")
private String leaseType; private String leaseType;

View File

@ -32,7 +32,7 @@ import org.springframework.transaction.annotation.Transactional;
/** /**
* 领料出库详细Service业务层处理 * 领料出库详细Service业务层处理
* *
* @author xsheng * @author xsheng
* @date 2024-10-16 * @date 2024-10-16
*/ */
@ -67,7 +67,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
TmTaskAgreementMapper tmTaskAgreementMapper; TmTaskAgreementMapper tmTaskAgreementMapper;
/** /**
* 查询领料出库详细 * 查询领料出库详细
* *
* @param id 领料出库详细主键 * @param id 领料出库详细主键
* @return 领料出库详细 * @return 领料出库详细
*/ */
@ -78,7 +78,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
/** /**
* 查询领料出库详细列表 * 查询领料出库详细列表
* *
* @param leaseOutDetails 领料出库详细 * @param leaseOutDetails 领料出库详细
* @return 领料出库详细 * @return 领料出库详细
*/ */
@ -89,7 +89,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
/** /**
* 新增领料出库详细 * 新增领料出库详细
* *
* @param leaseOutDetailsList 领料出库详细 * @param leaseOutDetailsList 领料出库详细
* @return 结果 * @return 结果
*/ */
@ -106,7 +106,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
/** /**
* 修改领料出库详细 * 修改领料出库详细
* *
* @param leaseOutDetails 领料出库详细 * @param leaseOutDetails 领料出库详细
* @return 结果 * @return 结果
*/ */
@ -122,7 +122,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
/** /**
* 批量删除领料出库详细 * 批量删除领料出库详细
* *
* @param ids 需要删除的领料出库详细主键 * @param ids 需要删除的领料出库详细主键
* @return 结果 * @return 结果
*/ */
@ -133,7 +133,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
/** /**
* 删除领料出库详细信息 * 删除领料出库详细信息
* *
* @param id 领料出库详细主键 * @param id 领料出库详细主键
* @return 结果 * @return 结果
*/ */
@ -157,7 +157,7 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
boolean isEnough = checkStorageIsEnough(record); boolean isEnough = checkStorageIsEnough(record);
//record.setPreStoreNum(getStorageNum(record)); //record.setPreStoreNum(getStorageNum(record));
if (isEnough) { 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()); record.setOutNum(record.getInputNum());
} }
@ -234,20 +234,20 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
} }
private int checkStorageNum(LeaseOutDetails record) { private int checkStorageNum(LeaseOutDetails record) {
double outNum = 0.1; BigDecimal outNum = BigDecimal.valueOf(0);
if (StringUtils.isNull(record)) { if (StringUtils.isNull(record)) {
return 0; return 0;
} }
if (record.getOutNum() == null || record.getOutNum() < outNum) { if (record.getOutNum() == null ) {
record.setOutNum(0L); record.setOutNum(BigDecimal.valueOf(0L));
} }
//判断(ma_type 设备规格表)中的库存够不够出库的 //判断(ma_type 设备规格表)中的库存够不够出库的
Type maType = typeMapper.selectByTypeId(record); Type maType = typeMapper.selectByTypeId(record);
if (maType != null) { if (maType != null) {
if ("0".equals(maType.getManageType())) { if ("0".equals(maType.getManageType())) {
int count = typeMapper.getCountOfCodeMachine(record); 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; return 0;
} }
} else if ("1".equals(maType.getManageType())) { } else if ("1".equals(maType.getManageType())) {
@ -284,9 +284,9 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
int res = 0; int res = 0;
SltAgreementInfo sltAgreementInfo = sltAgreementInfoMapper.getSltAgreementInfo(record); SltAgreementInfo sltAgreementInfo = sltAgreementInfoMapper.getSltAgreementInfo(record);
if (sltAgreementInfo != null) { if (sltAgreementInfo != null) {
Long num = sltAgreementInfo.getNum(); BigDecimal num = sltAgreementInfo.getNum();
Long outNum = record.getOutNum(); BigDecimal outNum = record.getOutNum();
sltAgreementInfo.setNum(num + outNum); sltAgreementInfo.setNum(num.add(outNum));
res = sltAgreementInfoMapper.updSltInfo(sltAgreementInfo); res = sltAgreementInfoMapper.updSltInfo(sltAgreementInfo);
} else { } else {
String agreementId = tmTaskAgreementMapper.getAgreementId(taskId); String agreementId = tmTaskAgreementMapper.getAgreementId(taskId);

View File

@ -13,6 +13,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
import org.apache.poi.hpsf.Decimal;
/** /**
* 物资类型对象 ma_type * 物资类型对象 ma_type
@ -75,7 +76,7 @@ public class Type extends BaseEntity {
/** 实时库存 */ /** 实时库存 */
@Excel(name = "实时库存") @Excel(name = "实时库存")
@ApiModelProperty(value = "实时库存") @ApiModelProperty(value = "实时库存")
private Long storageNum; private BigDecimal storageNum;
/** 是否扣费 */ /** 是否扣费 */
@ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费") @ApiModelProperty(value = "是否扣费,0:扣费, 1:不扣费")
@ -102,6 +103,17 @@ public class Type extends BaseEntity {
@Excel(name = "计量单位") @Excel(name = "计量单位")
private String unitName; 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计数) */ /** 管理方式(0编号 1计数) */
@Excel(name = "管理方式(0编号 1计数)", readConverterExp = "0=编号,1=计数") @Excel(name = "管理方式(0编号 1计数)", readConverterExp = "0=编号,1=计数")
@ApiModelProperty(value = "管理方式(0编号 1计数)") @ApiModelProperty(value = "管理方式(0编号 1计数)")

View File

@ -11,7 +11,7 @@ import com.bonus.common.core.web.domain.BaseEntity;
/** /**
* 结算信息对象 slt_agreement_info * 结算信息对象 slt_agreement_info
* *
* @author xsheng * @author xsheng
* @date 2024-10-16 * @date 2024-10-16
*/ */
@ -68,7 +68,7 @@ public class SltAgreementInfo extends BaseEntity {
/** 领料数量 */ /** 领料数量 */
@Excel(name = "领料数量") @Excel(name = "领料数量")
@ApiModelProperty(value = "领料数量") @ApiModelProperty(value = "领料数量")
private Long num; private BigDecimal num;
private Integer backNum; private Integer backNum;

View File

@ -21,7 +21,7 @@ import javax.annotation.Resource;
/** /**
* 结算信息Service业务层处理 * 结算信息Service业务层处理
* *
* @author xsheng * @author xsheng
* @date 2024-10-16 * @date 2024-10-16
*/ */
@ -35,7 +35,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/** /**
* 查询结算信息 * 查询结算信息
* *
* @param id 结算信息主键 * @param id 结算信息主键
* @return 结算信息 * @return 结算信息
*/ */
@ -46,7 +46,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/** /**
* 查询结算信息列表 * 查询结算信息列表
* *
* @param sltAgreementInfo 结算信息 * @param sltAgreementInfo 结算信息
* @return 结算信息 * @return 结算信息
*/ */
@ -82,7 +82,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/** /**
* 新增结算信息 * 新增结算信息
* *
* @param sltAgreementInfo 结算信息 * @param sltAgreementInfo 结算信息
* @return 结果 * @return 结果
*/ */
@ -98,7 +98,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/** /**
* 修改结算信息 * 修改结算信息
* *
* @param sltAgreementInfo 结算信息 * @param sltAgreementInfo 结算信息
* @return 结果 * @return 结果
*/ */
@ -114,7 +114,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/** /**
* 批量删除结算信息 * 批量删除结算信息
* *
* @param ids 需要删除的结算信息主键 * @param ids 需要删除的结算信息主键
* @return 结果 * @return 结果
*/ */
@ -125,7 +125,7 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
/** /**
* 删除结算信息信息 * 删除结算信息信息
* *
* @param id 结算信息主键 * @param id 结算信息主键
* @return 结果 * @return 结果
*/ */
@ -145,13 +145,13 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
bean.setLeasePrice(BigDecimal.valueOf(0.00)); bean.setLeasePrice(BigDecimal.valueOf(0.00));
} }
if (bean.getNum() == null) { if (bean.getNum() == null) {
bean.setNum(0L); bean.setNum(BigDecimal.valueOf(0L));
} }
if (bean.getLeaseDay() == null) { if (bean.getLeaseDay() == null) {
bean.setLeaseDay(0L); bean.setLeaseDay(0L);
} }
BigDecimal leasePrice = bean.getLeasePrice(); BigDecimal leasePrice = bean.getLeasePrice();
BigDecimal num = new BigDecimal(bean.getNum()); BigDecimal num = bean.getNum();
BigDecimal leaseDays = new BigDecimal(bean.getLeaseDay()); BigDecimal leaseDays = new BigDecimal(bean.getLeaseDay());
BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays); BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays);
bean.setCosts(costs); bean.setCosts(costs);
@ -191,10 +191,10 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
bean.setBuyPrice(BigDecimal.valueOf(0.00)); bean.setBuyPrice(BigDecimal.valueOf(0.00));
} }
if (bean.getNum() == null) { if (bean.getNum() == null) {
bean.setNum(0L); bean.setNum(BigDecimal.valueOf(0L));
} }
BigDecimal buyPrice = bean.getBuyPrice(); BigDecimal buyPrice = bean.getBuyPrice();
BigDecimal num = new BigDecimal(bean.getNum()); BigDecimal num = bean.getNum();
BigDecimal costs = buyPrice.multiply(num); BigDecimal costs = buyPrice.multiply(num);
//计算总金额 //计算总金额
/*BigDecimal costs = BigDecimal.ZERO; /*BigDecimal costs = BigDecimal.ZERO;
@ -220,10 +220,10 @@ public class SltAgreementInfoServiceImpl implements ISltAgreementInfoService {
bean.setBuyPrice(BigDecimal.valueOf(0.00)); bean.setBuyPrice(BigDecimal.valueOf(0.00));
} }
if (bean.getNum() == null) { if (bean.getNum() == null) {
bean.setNum(0L); bean.setNum(BigDecimal.valueOf(0L));
} }
BigDecimal buyPrice = bean.getBuyPrice(); BigDecimal buyPrice = bean.getBuyPrice();
BigDecimal num = new BigDecimal(bean.getNum()); BigDecimal num = bean.getNum();
// 原价 x 数量 // 原价 x 数量
BigDecimal costs = buyPrice.multiply(num); BigDecimal costs = buyPrice.multiply(num);
//计算租赁费用 //计算租赁费用

View File

@ -17,6 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="modelCode" column="model_code" /> <result property="modelCode" column="model_code" />
<result property="unitId" column="unit_id" /> <result property="unitId" column="unit_id" />
<result property="unitName" column="unit_name" /> <result property="unitName" column="unit_name" />
<result property="unitValue" column="unit_value" />
<result property="sortNum" column="sort_num" />
<result property="manageType" column="manage_type" /> <result property="manageType" column="manage_type" />
<result property="leasePrice" column="lease_price" /> <result property="leasePrice" column="lease_price" />
<result property="effTime" column="eff_time" /> <result property="effTime" column="eff_time" />
@ -51,6 +53,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="modelCode" column="model_code" /> <result property="modelCode" column="model_code" />
<result property="unitId" column="unit_id" /> <result property="unitId" column="unit_id" />
<result property="unitName" column="unit_name" /> <result property="unitName" column="unit_name" />
<result property="unitValue" column="unit_value" />
<result property="sortNum" column="sort_num" />
<result property="manageType" column="manage_type" /> <result property="manageType" column="manage_type" />
<result property="leasePrice" column="lease_price" /> <result property="leasePrice" column="lease_price" />
<result property="effTime" column="eff_time" /> <result property="effTime" column="eff_time" />
@ -156,7 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTypeByTypeId" parameterType="Long" resultMap="TypeResult"> <select id="selectTypeByTypeId" parameterType="Long" resultMap="TypeResult">
SELECT SELECT
t.type_id,t.type_name,t.parent_id,t.storage_num,t.type_code, t.type_id,t.type_name,t.parent_id,t.storage_num,t.type_code,
t.model_code,t.unit_id,t.unit_name,t.manage_type,t.lease_price,t.eff_time, t.model_code,t.unit_id,t.unit_name,t.unit_value,t.sort_num,t.manage_type,t.lease_price,t.eff_time,
t.rent_price,t.buy_price,t.pay_ratio,t.pay_price,t.tax_ratio,t.level,t.rated_load,t.test_load, t.rent_price,t.buy_price,t.pay_ratio,t.pay_price,t.tax_ratio,t.level,t.rated_load,t.test_load,
t.holding_time,t.warn_num,t.create_by,t.create_time,t.update_by,t.update_time,t.is_plan, t.holding_time,t.warn_num,t.create_by,t.create_time,t.update_by,t.update_time,t.is_plan,
t.is_ancuo,t.remark,t.fac_model,t.intelligent_code, t.is_ancuo,t.remark,t.fac_model,t.intelligent_code,
@ -218,6 +222,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="modelCode != null">model_code,</if> <if test="modelCode != null">model_code,</if>
<if test="unitId != null">unit_id,</if> <if test="unitId != null">unit_id,</if>
<if test="unitName != null">unit_name,</if> <if test="unitName != null">unit_name,</if>
<if test="unitValue != null">unit_value,</if>
<if test="sortNum != null">sort_num,</if>
<if test="manageType != null and manageType != ''">manage_type,</if> <if test="manageType != null and manageType != ''">manage_type,</if>
<if test="leasePrice != null">lease_price,</if> <if test="leasePrice != null">lease_price,</if>
<if test="effTime != null">eff_time,</if> <if test="effTime != null">eff_time,</if>
@ -249,6 +255,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="modelCode != null">#{modelCode},</if> <if test="modelCode != null">#{modelCode},</if>
<if test="unitId != null">#{unitId},</if> <if test="unitId != null">#{unitId},</if>
<if test="unitName != null">#{unitName},</if> <if test="unitName != null">#{unitName},</if>
<if test="unitValue != null">#{unitValue},</if>
<if test="sortNum != null">#{sortNum},</if>
<if test="manageType != null and manageType != ''">#{manageType},</if> <if test="manageType != null and manageType != ''">#{manageType},</if>
<if test="leasePrice != null">#{leasePrice},</if> <if test="leasePrice != null">#{leasePrice},</if>
<if test="effTime != null">#{effTime},</if> <if test="effTime != null">#{effTime},</if>
@ -284,6 +292,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="modelCode != null">model_code = #{modelCode},</if> <if test="modelCode != null">model_code = #{modelCode},</if>
<if test="unitId != null">unit_id = #{unitId},</if> <if test="unitId != null">unit_id = #{unitId},</if>
<if test="unitName != null">unit_name = #{unitName},</if> <if test="unitName != null">unit_name = #{unitName},</if>
<if test="unitName != null">unit_name = #{unitName},</if>
<if test="unitValue != null">unit_value = #{unitValue},</if>
<if test="sortNum != null">sort_num = #{sortNum},</if>
<if test="manageType != null and manageType != ''">manage_type = #{manageType},</if> <if test="manageType != null and manageType != ''">manage_type = #{manageType},</if>
<if test="leasePrice != null">lease_price = #{leasePrice},</if> <if test="leasePrice != null">lease_price = #{leasePrice},</if>
<if test="effTime != null">eff_time = #{effTime},</if> <if test="effTime != null">eff_time = #{effTime},</if>