Merge remote-tracking branch 'origin/master'

This commit is contained in:
liang.chao 2025-09-05 09:33:58 +08:00
commit e5792c3e27
16 changed files with 92 additions and 47 deletions

View File

@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -44,7 +45,7 @@ public class InputRecordInfo {
private String unit; private String unit;
@ApiModelProperty(value = "入库数量") @ApiModelProperty(value = "入库数量")
@Excel(name = "入库数量") @Excel(name = "入库数量", align = HorizontalAlignment.RIGHT)
private BigDecimal inputNum; private BigDecimal inputNum;
@ApiModelProperty(value = "入库人员") @ApiModelProperty(value = "入库人员")

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -67,7 +68,7 @@ public class OutRecordInfo {
private String unit; private String unit;
@ApiModelProperty(value = "出库数量") @ApiModelProperty(value = "出库数量")
@Excel(name = "出库数量") @Excel(name = "出库数量", align = HorizontalAlignment.RIGHT)
private BigDecimal outNum; private BigDecimal outNum;
@ApiModelProperty(value = "出库人员") @ApiModelProperty(value = "出库人员")

View File

@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -69,23 +70,23 @@ public class ProjUsingRecord {
private String unit; private String unit;
@ApiModelProperty(value = "领用数量") @ApiModelProperty(value = "领用数量")
@Excel(name = "领用数量") @Excel(name = "领用数量", align = HorizontalAlignment.RIGHT)
private BigDecimal leaseNum; private BigDecimal leaseNum;
@ApiModelProperty(value = "归还数量") @ApiModelProperty(value = "归还数量")
@Excel(name = "归还数量") @Excel(name = "归还数量", align = HorizontalAlignment.RIGHT)
private BigDecimal backNum; private BigDecimal backNum;
@ApiModelProperty(value = "在用数量") @ApiModelProperty(value = "在用数量")
@Excel(name = "在用数量") @Excel(name = "在用数量", align = HorizontalAlignment.RIGHT)
private BigDecimal usNum; private BigDecimal usNum;
@ApiModelProperty(value = "在用总价值(元)") @ApiModelProperty(value = "在用总价值(元)")
@Excel(name = "在用总价值(元)") @Excel(name = "在用总价值(元)", align = HorizontalAlignment.RIGHT)
private BigDecimal usPrice; private BigDecimal usPrice;
@ApiModelProperty(value = "投入总价值(元)") @ApiModelProperty(value = "投入总价值(元)")
@Excel(name = "投入总价值(元)") @Excel(name = "投入总价值(元)", align = HorizontalAlignment.RIGHT)
private BigDecimal totalPrice; private BigDecimal totalPrice;
@ApiModelProperty(value = "关键字") @ApiModelProperty(value = "关键字")

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -35,11 +36,11 @@ public class PurchaseInputInfo {
private String typeModelName; private String typeModelName;
@ApiModelProperty(value = "新购待入库数量") @ApiModelProperty(value = "新购待入库数量")
@Excel(name = "新购待入库数量") @Excel(name = "新购待入库数量", align = HorizontalAlignment.RIGHT)
private BigDecimal inputNum; private BigDecimal inputNum;
@ApiModelProperty(value = "购置单价") @ApiModelProperty(value = "购置单价")
@Excel(name = "原值(元)") @Excel(name = "原值(元)", align = HorizontalAlignment.RIGHT)
private BigDecimal buyPrice; private BigDecimal buyPrice;
@ApiModelProperty(value = "设备编码") @ApiModelProperty(value = "设备编码")

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -32,11 +33,11 @@ public class RepairInputRecord {
private String typeModelName; private String typeModelName;
@ApiModelProperty(value = "修饰待入库数量") @ApiModelProperty(value = "修饰待入库数量")
@Excel(name = "修饰待入库数量") @Excel(name = "修饰待入库数量", align = HorizontalAlignment.RIGHT)
private BigDecimal repairInputNum; private BigDecimal repairInputNum;
@ApiModelProperty(value = "购置单价") @ApiModelProperty(value = "购置单价")
@Excel(name = "原值(元)") @Excel(name = "原值(元)", align = HorizontalAlignment.RIGHT)
private BigDecimal buyPrice; private BigDecimal buyPrice;
@ApiModelProperty(value = "设备编码") @ApiModelProperty(value = "设备编码")

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -32,11 +33,11 @@ public class RepairStorageInfo {
private String typeModelName; private String typeModelName;
@ApiModelProperty(value = "在修数量") @ApiModelProperty(value = "在修数量")
@Excel(name = "在修数量") @Excel(name = "在修数量", align = HorizontalAlignment.RIGHT)
private BigDecimal repairNum; private BigDecimal repairNum;
@ApiModelProperty(value = "购置单价") @ApiModelProperty(value = "购置单价")
@Excel(name = "原值(元)") @Excel(name = "原值(元)", align = HorizontalAlignment.RIGHT)
private BigDecimal buyPrice; private BigDecimal buyPrice;
@ApiModelProperty(value = "设备编码") @ApiModelProperty(value = "设备编码")

View File

@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -58,60 +59,60 @@ public class RetainedEquipmentInfo {
private String unit; private String unit;
@ApiModelProperty(value = "在库数量") @ApiModelProperty(value = "在库数量")
@Excel(name = "在库数量") @Excel(name = "在库数量", align = HorizontalAlignment.RIGHT)
private BigDecimal storeNum; private BigDecimal storeNum;
@ApiModelProperty(value = "在用数量") @ApiModelProperty(value = "在用数量")
@Excel(name = "在用数量") @Excel(name = "在用数量", align = HorizontalAlignment.RIGHT)
private BigDecimal usNum; private BigDecimal usNum;
@ApiModelProperty(value = "在修数量") @ApiModelProperty(value = "在修数量")
@Excel(name = "在修数量") @Excel(name = "在修数量", align = HorizontalAlignment.RIGHT)
private BigDecimal repairNum; private BigDecimal repairNum;
@ApiModelProperty(value = "新购待入库") @ApiModelProperty(value = "新购待入库")
@Excel(name = "新购待入库数量") @Excel(name = "新购待入库数量", align = HorizontalAlignment.RIGHT)
private BigDecimal inputNum; private BigDecimal inputNum;
@ApiModelProperty(value = "修试后待入库") @ApiModelProperty(value = "修试后待入库")
@Excel(name = "修试后待入库数量") @Excel(name = "修试后待入库数量", align = HorizontalAlignment.RIGHT)
private BigDecimal repairInputNum; private BigDecimal repairInputNum;
@ApiModelProperty(value = "待报废数量") @ApiModelProperty(value = "待报废数量")
@Excel(name = "待报废数量") @Excel(name = "待报废数量", align = HorizontalAlignment.RIGHT)
private BigDecimal pendingScrapNum; private BigDecimal pendingScrapNum;
@ApiModelProperty(value = "已审核报废数量") @ApiModelProperty(value = "已审核报废数量")
@Excel(name = "已审核报废数量") @Excel(name = "已审核报废数量", align = HorizontalAlignment.RIGHT)
private BigDecimal scrapNum; private BigDecimal scrapNum;
@ApiModelProperty(value = "总保有量") @ApiModelProperty(value = "总保有量")
@Excel(name = "总保有数量") @Excel(name = "总保有数量", align = HorizontalAlignment.RIGHT)
private BigDecimal allNum; private BigDecimal allNum;
@ApiModelProperty(value = "购置单价") @ApiModelProperty(value = "购置单价")
private BigDecimal buyPrice; private BigDecimal buyPrice;
@ApiModelProperty(value = "投入总价值") @ApiModelProperty(value = "投入总价值")
@Excel(name = "总保有量资产(万元)") @Excel(name = "总保有量资产(万元)", align = HorizontalAlignment.RIGHT)
private BigDecimal totalPrice; private BigDecimal totalPrice;
@ApiModelProperty(value = "五年以内成新率") @ApiModelProperty(value = "五年以内成新率")
@Excel(name = "五年以内成新率") //@Excel(name = "五年以内成新率")
private String fiveReplacementRate; private String fiveReplacementRate;
@ApiModelProperty(value = "五年以内设备数量") @ApiModelProperty(value = "五年以内设备数量")
private BigDecimal fiveReplacementNum; private BigDecimal fiveReplacementNum;
@ApiModelProperty(value = "五年至十年成新率") @ApiModelProperty(value = "五年至十年成新率")
@Excel(name = "五年至十年成新率") //@Excel(name = "五年至十年成新率")
private String tenReplacementRate; private String tenReplacementRate;
@ApiModelProperty(value = "五年至十年设备数量") @ApiModelProperty(value = "五年至十年设备数量")
private BigDecimal tenReplacementNum; private BigDecimal tenReplacementNum;
@ApiModelProperty(value = "十年以上成新率") @ApiModelProperty(value = "十年以上成新率")
@Excel(name = "十年以上成新率") //@Excel(name = "十年以上成新率")
private String tenPlusReplacementRate; private String tenPlusReplacementRate;
@ApiModelProperty(value = "十年以上设备数量") @ApiModelProperty(value = "十年以上设备数量")

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -32,11 +33,11 @@ public class ScrapAuditInfo {
private String typeModelName; private String typeModelName;
@ApiModelProperty(value = "报废数量") @ApiModelProperty(value = "报废数量")
@Excel(name = "报废数量") @Excel(name = "报废数量", align = HorizontalAlignment.RIGHT)
private BigDecimal scrapNum; private BigDecimal scrapNum;
@ApiModelProperty(value = "购置单价") @ApiModelProperty(value = "购置单价")
@Excel(name = "原值(元)") @Excel(name = "原值(元)", align = HorizontalAlignment.RIGHT)
private BigDecimal buyPrice; private BigDecimal buyPrice;
@ApiModelProperty(value = "设备编码") @ApiModelProperty(value = "设备编码")

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -32,11 +33,11 @@ public class StorageInfo {
private String typeModelName; private String typeModelName;
@ApiModelProperty(value = "入库数量") @ApiModelProperty(value = "入库数量")
@Excel(name = "入库数量") @Excel(name = "入库数量", align = HorizontalAlignment.RIGHT)
private BigDecimal storeNum; private BigDecimal storeNum;
@ApiModelProperty(value = "购置单价") @ApiModelProperty(value = "购置单价")
@Excel(name = "原值(元)") @Excel(name = "原值(元)", align = HorizontalAlignment.RIGHT)
private BigDecimal buyPrice; private BigDecimal buyPrice;
@ApiModelProperty(value = "设备编码") @ApiModelProperty(value = "设备编码")

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -35,11 +36,11 @@ public class UseStorageInfo {
private String typeModelName; private String typeModelName;
@ApiModelProperty(value = "在用数量") @ApiModelProperty(value = "在用数量")
@Excel(name = "在用数量") @Excel(name = "在用数量", align = HorizontalAlignment.RIGHT)
private BigDecimal usNum; private BigDecimal usNum;
@ApiModelProperty(value = "购置单价") @ApiModelProperty(value = "购置单价")
@Excel(name = "原值(元)") @Excel(name = "原值(元)", align = HorizontalAlignment.RIGHT)
private BigDecimal buyPrice; private BigDecimal buyPrice;
@ApiModelProperty(value = "设备编码") @ApiModelProperty(value = "设备编码")
@ -64,7 +65,7 @@ public class UseStorageInfo {
private String code; private String code;
@ApiModelProperty(value = "工程名称") @ApiModelProperty(value = "工程名称")
@Excel(name = "工程名称") @Excel(name = "工程名称", width = 30)
private String projectName; private String projectName;
@ApiModelProperty(value = "关键字") @ApiModelProperty(value = "关键字")

View File

@ -238,4 +238,11 @@ public interface TypeMapper {
* @param type * @param type
*/ */
int addStockNum(Type type); int addStockNum(Type type);
/**
* 获取编码库存
* @param type
* @return
*/
BigDecimal getMaCodeNum(Type type);
} }

View File

@ -239,18 +239,22 @@ public class TypeServiceImpl implements ITypeService {
int result = 0; int result = 0;
// 根据typeId查询物资名称和规格型号 // 根据typeId查询物资名称和规格型号
Type info = typeMapper.selectTypeByTypeId(type.getTypeId()); Type info = typeMapper.selectTypeByTypeId(type.getTypeId());
BigDecimal storageNum = BigDecimal.ZERO;;
// 查询库存 // 查询库存
BigDecimal storageNum = typeMapper.getStorageNumByTypeId(type); if (info != null) {
if ("1".equals(info.getManageType())) {
storageNum = typeMapper.getStorageNumByTypeId(type);
} else {
storageNum = typeMapper.getMaCodeNum(type);
}
}
type.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName()); type.setCreateBy(SecurityUtils.getLoginUser().getSysUser().getNickName());
type.setPreStoreNum(storageNum); type.setPreStoreNum(storageNum);
type.setMaterialName(info.getMaterialName()); type.setMaterialName(info.getMaterialName());
type.setTypeName(info.getTypeName()); type.setTypeName(info.getTypeName());
// 插入修改记录 // 插入修改记录
if ("1".equals(type.getStyle())) { if ("1".equals(type.getStyle())) {
// 检查库存是否充足
if (type.getOutNum() != null && storageNum.compareTo(type.getOutNum()) < 0) {
throw new RuntimeException("库存不足,当前库存: " + storageNum + ", 需要出库: " + type.getOutNum());
}
result = typeMapper.updateMaTypeStockNum(type); result = typeMapper.updateMaTypeStockNum(type);
if (result > 0) { if (result > 0) {
type.setStorageNum(type.getPreStoreNum().subtract(type.getOutNum())); type.setStorageNum(type.getPreStoreNum().subtract(type.getOutNum()));

View File

@ -874,7 +874,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sai_agg.type_id, sai_agg.type_id,
sai_agg.ma_id, sai_agg.ma_id,
bp.pro_id, bp.pro_id,
sai_agg.lease_id sai_agg.lease_id,
sai_agg.agreement_id
</select> </select>
<select id="getRepairRecordList" resultType="com.bonus.material.basic.domain.RepairStorageInfo"> <select id="getRepairRecordList" resultType="com.bonus.material.basic.domain.RepairStorageInfo">

View File

@ -344,7 +344,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
lai.is_confirm AS isConfirm, lai.is_confirm AS isConfirm,
lai.confirm_remark AS confirmRemark, lai.confirm_remark AS confirmRemark,
mt3.type_id AS firstId, mt3.type_id AS firstId,
lpd.create_time AS releaseTime lpd.create_time AS releaseTime,
lpd.parent_id AS parentId
FROM FROM
lease_publish_details lpd lease_publish_details lpd
LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id
@ -368,7 +369,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
AND lpd.project_id = bai.project_id AND lpd.project_id = bai.project_id
left join sys_user su on lpd.create_by = su.user_id left join sys_user su on lpd.create_by = su.user_id
<if test="userId != null"> <if test="userId != null">
JOIN ma_type_keeper mtk ON mtk.type_id = lpd.type_id AND mtk.user_id = #{userId} JOIN ma_type_keeper mtk ON mtk.type_id = lpd.new_type AND mtk.user_id = #{userId}
</if> </if>
where 1 = 1 where 1 = 1
<if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">

View File

@ -703,19 +703,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sai.id, sai.id,
bu.unit_name AS leaseUnit, bu.unit_name AS leaseUnit,
bp.pro_name AS leaseProject, bp.pro_name AS leaseProject,
sai.start_time AS leaseTime, lai.create_time AS leaseTime,
IF( sai.status = 1, bu.unit_name,"") AS backUnit, IF( sai.status = 1, bu.unit_name,"") AS backUnit,
IF( sai.status = 1, bp.pro_name ,"") AS backProject, IF( sai.status = 1, bp.pro_name ,"") AS backProject,
IF( sai.status = 1, sai.end_time ,"") AS backTime, IF( sai.status = 1, bai.create_time ,"") AS backTime,
sai.status sai.status
FROM FROM
slt_agreement_info sai slt_agreement_info sai
LEFT JOIN bm_agreement_info bai on sai.agreement_id = bai.agreement_id LEFT JOIN bm_agreement_info ba on sai.agreement_id = ba.agreement_id
LEFT JOIN bm_unit bu on bai.unit_id = bu.unit_id LEFT JOIN bm_unit bu on ba.unit_id = bu.unit_id
LEFT JOIN bm_project bp on bai.project_id = bp.pro_id LEFT JOIN bm_project bp on ba.project_id = bp.pro_id
LEFT JOIN lease_apply_info lai ON sai.lease_id = lai.id
LEFT JOIN back_apply_info bai ON bai.id = sai.back_id
WHERE sai.ma_id = #{maId} WHERE sai.ma_id = #{maId}
ORDER BY sai.ID desc ORDER BY lai.create_time desc
limit 1 limit 1
</select> </select>

View File

@ -1106,4 +1106,25 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE WHERE
type_id = #{typeId} type_id = #{typeId}
</select> </select>
<select id="getMaCodeNum" resultType="java.math.BigDecimal">
SELECT
CASE mt.manage_type
WHEN 0 THEN
IFNULL(subquery0.num, 0)
ELSE
IFNULL(mt.storage_num, 0)
END as num
FROM ma_type mt
left join (SELECT mt.type_id,
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
count(mm.ma_id) num
FROM ma_machine mm
LEFT JOIN ma_type mt ON mt.type_id = mm.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
WHERE mm.ma_code is not null and mm.ma_status in (1)
GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id
WHERE mt.del_flag = '0' and mt.type_id = #{typeId}
</select>
</mapper> </mapper>