Commit 3f752650 by yubin

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	ruoyi-inventory/src/main/java/com/ruoyi/inventory/domain/Inventory.java
parents 118fc04a 3341c88b
......@@ -313,6 +313,7 @@ export default {
pageNum: 1,
pageSize: 10,
materialId: null,
sapNo: null,
orderId: null,
orderTypeId: null,
systemNo: null,
......@@ -377,8 +378,9 @@ export default {
/** 查询入库列表 */
getList() {
this.loading = true
inbound_details(this.queryParams).then(response => {
console.log(this.queryParams)
console.log(response.rows)
this.inboundList = response.rows
this.total = response.total
this.loading = false
......
......@@ -391,8 +391,8 @@
</el-descriptions-item>
<el-descriptions-item label="入库日期">{{ detailForm.inboundDate || '-' }}</el-descriptions-item>
<!-- <el-descriptions-item label="负责人">{{ detailForm.opUserName || '-' }}</el-descriptions-item> -->
<el-descriptions-item label="计划量">{{ detailForm.totalPlannedQuantity || '-' }}</el-descriptions-item>
<el-descriptions-item label="实际量">{{ detailForm.totalActualQuantity || '-' }}</el-descriptions-item>
<!-- <el-descriptions-item label="计划量">{{ detailForm.totalPlannedQuantity || '-' }}</el-descriptions-item>
<el-descriptions-item label="实际量">{{ detailForm.totalActualQuantity || '-' }}</el-descriptions-item> -->
<!-- <el-descriptions-item label="总件数">{{ detailForm.totalPackages || '-' }}</el-descriptions-item> -->
<!-- <el-descriptions-item label="仓库ID">{{ detailForm.warehouseId || '-' }}</el-descriptions-item> -->
<el-descriptions-item label="备注" :span="2">
......@@ -904,6 +904,7 @@ export default {
...item,
inventoryType: row.orderTypeId,
warehousesId: item.warehouseId,
inventoryStatus: 1,
ownerId: row.ownerId,
quantity: item.actualQuantity,
unitWeight: item.unitWeight
......@@ -936,8 +937,8 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids.length
this.$confirm((row.orderId ? '是否确认删除入库单编号为"' + row.orderId + '"的数据项?' : '是否确认删除选中的' + ids + '条入库单'), '提示', {
const ids = row.id || this.ids
this.$confirm((row.orderId ? '是否确认删除入库单编号为"' + row.orderId + '"的数据项?' : '是否确认删除选中的' + ids.length + '条入库单'), '提示', {
type: 'warning'
}).then(() => {
return delInbound(ids)
......
......@@ -161,7 +161,7 @@
</el-table-column>
<el-table-column label="规格型号" align="center" prop="specification" />
<el-table-column label="计量单位" align="center" prop="materialUnit" />
<el-table-column label="单位重量" align="center" prop="unitWeight" />
<el-table-column label="重量" align="center" prop="unitWeight" />
<el-table-column label="包装重量" align="center" prop="packageWeight" />
<el-table-column label="总重量" align="center" prop="totalWeight" />
<el-table-column label="体积" align="center" prop="volume" />
......@@ -320,12 +320,12 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="包装重量" prop="packageWeight">
<el-input v-model="form.packageWeight" placeholder="请输入包装重量" />
</el-form-item>
<el-form-item label="计量单位" prop="materialUnit">
<el-input v-model="form.materialUnit" placeholder="请输入计量单位" />
</el-form-item>
<el-form-item label="包装重量" prop="packageWeight">
<el-input v-model="form.packageWeight" placeholder="请输入包装重量" />
</el-form-item>
<el-form-item label="体积" prop="volume">
<el-input v-model="form.volume" placeholder="请输入体积" />
</el-form-item>
......@@ -480,6 +480,7 @@ export default {
loading: true
}
},
async created() {
await Promise.all([
this.getCategoryTreeData(),
......@@ -691,8 +692,8 @@ export default {
shelfLifeDays: null,
storageTemperature: null,
specialRequirements: null,
isBatchManaged: 0,
isSerialManaged: 0,
isBatchManaged: 1,
isSerialManaged: 1,
minStockLevel: null,
maxStockLevel: null,
isUsed: 1,
......
......@@ -119,7 +119,21 @@ public class InboundOrderItemsController extends BaseController
}
/**
* 统计入库单物料明细
*/
@PreAuthorize("@ss.hasPermi('inventory:inbound_items:list')")
@GetMapping("/details")
public TableDataInfo itemDetails(InboundDetailsVO inboundDetailsVO) throws Exception
{
startPage();
System.out.println(inboundDetailsVO);
List<InboundDetailsVO> list = inboundOrderItemsService.selectInboundDetailsVOBySapNo(inboundDetailsVO);
return getDataTable(list);
}
/**
* 导入入库单物料明细
* (暂无用,入库导入功能统一写在inbound主表类中)
*/
@PreAuthorize("@ss.hasPermi('inventory:inbound_items:import')")
@Log(title = "物料信息导入", businessType = BusinessType.IMPORT)
......@@ -132,17 +146,4 @@ public class InboundOrderItemsController extends BaseController
String message = inboundOrderItemsService.importInboundOrderItems(inboundOrderItems, updateSupport, operName);
return success(message);
}
/**
* 统计入库单物料明细
*/
@PreAuthorize("@ss.hasPermi('inventory:inbound_items:list')")
@GetMapping("/details")
public TableDataInfo itemDetails(InboundDetailsVO inboundDetailsVO) throws Exception
{
startPage();
System.out.println(inboundDetailsVO);
List<InboundDetailsVO> list = inboundOrderItemsService.selectInboundDetailsVOBySapNo(inboundDetailsVO);
return getDataTable(list);
}
}
......@@ -178,198 +178,4 @@ public class Inventory extends BaseEntity
/** 特殊存储要求 */
// @Excel(name = "特殊存储要求")
private String specialRequirements;
public String getOwnerId()
{
return ownerId;
}
public void setQuantity(Long quantity)
{
this.quantity = quantity;
}
public Long getQuantity()
{
return quantity;
}
public void setLockedQuantity(Long lockedQuantity)
{
this.lockedQuantity = lockedQuantity;
}
public Long getLockedQuantity()
{
return lockedQuantity;
}
public void setUnitWeight(Long unitWeight)
{
this.unitWeight = unitWeight;
}
public Long getUnitWeight()
{
return unitWeight;
}
public void setTotalWeight(Long totalWeight)
{
this.totalWeight = totalWeight;
}
public Long getTotalWeight()
{
return totalWeight;
}
public void setTotalVolume(Long totalVolume)
{
this.totalVolume = totalVolume;
}
public Long getTotalVolume()
{
return totalVolume;
}
public void setProductionDate(Date productionDate)
{
this.productionDate = productionDate;
}
public Date getProductionDate()
{
return productionDate;
}
public void setExpirationDate(Date expirationDate)
{
this.expirationDate = expirationDate;
}
public Date getExpirationDate()
{
return expirationDate;
}
public void setInventoryStatus(Long inventoryStatus)
{
this.inventoryStatus = inventoryStatus;
}
public Long getInventoryStatus()
{
return inventoryStatus;
}
public void setLastInboundTime(Date lastInboundTime)
{
this.lastInboundTime = lastInboundTime;
}
public Date getLastInboundTime()
{
return lastInboundTime;
}
public void setLastOutboundTime(Date lastOutboundTime)
{
this.lastOutboundTime = lastOutboundTime;
}
public Date getLastOutboundTime()
{
return lastOutboundTime;
}
public void setIsUsed(Long isUsed)
{
this.isUsed = isUsed;
}
public Long getIsUsed()
{
return isUsed;
}
public void setSortNo(Long sortNo)
{
this.sortNo = sortNo;
}
public Long getSortNo()
{
return sortNo;
}
public void setCreateUserCode(String createUserCode)
{
this.createUserCode = createUserCode;
}
public String getCreateUserCode()
{
return createUserCode;
}
public void setUpdateUserCode(String updateUserCode)
{
this.updateUserCode = updateUserCode;
}
public String getUpdateUserCode()
{
return updateUserCode;
}
public void setWarehousesCode(String warehousesCode)
{
this.warehousesCode = warehousesCode;
}
public String getWarehousesCode()
{
return warehousesCode;
}
public void setAlertType(String alertType)
{
this.alertType = alertType;
}
public String getAlertType()
{
return alertType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("inventoryType", getInventoryType())
.append("orderId", getOrderId())
.append("materialId", getMaterialId())
.append("batchId", getBatchId())
.append("locationId", getLocationId())
.append("ownerId", getOwnerId())
.append("quantity", getQuantity())
.append("lockedQuantity", getLockedQuantity())
.append("unitWeight", getUnitWeight())
.append("totalWeight", getTotalWeight())
.append("totalVolume", getTotalVolume())
.append("productionDate", getProductionDate())
.append("expirationDate", getExpirationDate())
.append("inventoryStatus", getInventoryStatus())
.append("lastInboundTime", getLastInboundTime())
.append("lastOutboundTime", getLastOutboundTime())
.append("isUsed", getIsUsed())
.append("sortNo", getSortNo())
.append("createTime", getCreateTime())
.append("createUserCode", getCreateUserCode())
.append("updateTime", getUpdateTime())
.append("updateUserCode", getUpdateUserCode())
.toString();
}
}
......@@ -67,7 +67,8 @@ public class InboundOrderItemsServiceImpl implements IInboundOrderItemsService
public int insertInboundOrderItems(InboundOrderItems inboundOrderItems)
{
inboundOrderItems.setCreateTime(DateUtils.getNowDate());
inboundOrderItems.setCreateBy(SecurityUtils.getUsername());
inboundOrderItems.setCreateUserCode(SecurityUtils.getUsername());
return inboundOrderItemsMapper.insertInboundOrderItems(inboundOrderItems);
}
......@@ -81,6 +82,8 @@ public class InboundOrderItemsServiceImpl implements IInboundOrderItemsService
public int updateInboundOrderItems(InboundOrderItems inboundOrderItems)
{
inboundOrderItems.setUpdateTime(DateUtils.getNowDate());
inboundOrderItems.setUpdateBy(SecurityUtils.getUsername());
inboundOrderItems.setUpdateUserCode(SecurityUtils.getUsername());
return inboundOrderItemsMapper.updateInboundOrderItems(inboundOrderItems);
}
......
......@@ -7,6 +7,7 @@ import java.util.stream.Collectors;
import com.ruoyi.inventory.domain.vo.InboundMaterialTotalVO;
import com.ruoyi.inventory.mapper.MaterialsMapper;
import org.apache.commons.lang3.SystemUtils;
import org.springframework.util.CollectionUtils;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
......@@ -75,6 +76,8 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
public int insertInboundOrders(InboundOrders inboundOrders)
{
inboundOrders.setCreateTime(DateUtils.getNowDate());
inboundOrders.setCreateUserCode(SystemUtils.getUserName());
inboundOrders.setCreateBy(SystemUtils.getUserName());
int rows = inboundOrdersMapper.insertInboundOrders(inboundOrders);
insertInboundOrderItems(inboundOrders);
return rows;
......@@ -90,8 +93,10 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
@Override
public int updateInboundOrders(InboundOrders inboundOrders)
{
inboundOrders.setUpdateTime(DateUtils.getNowDate());
inboundOrdersMapper.deleteInboundOrderItemsByOrderId(inboundOrders.getOrderId());
inboundOrders.setUpdateTime(DateUtils.getNowDate());
inboundOrders.setUpdateUserCode(SystemUtils.getUserName());
inboundOrders.setUpdateBy(SystemUtils.getUserName());
insertInboundOrderItems(inboundOrders);
return inboundOrdersMapper.updateInboundOrders(inboundOrders);
}
......@@ -138,10 +143,14 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
List<InboundOrderItems> list = new ArrayList<InboundOrderItems>();
for (InboundOrderItems inboundOrderItems : inboundOrderItemsList)
{
inboundOrderItems.setCreateTime(DateUtils.getNowDate());
inboundOrderItems.setCreateUserCode(SystemUtils.getUserName());
inboundOrderItems.setCreateBy(SystemUtils.getUserName());
inboundOrderItems.setId(UUID.randomUUID().toString());
inboundOrderItems.setOrderId(orderId);
inboundOrderItems.setCreateTime(DateUtils.getNowDate());
inboundOrderItems.setInboundOrderId(inboundOrders.getId());
list.add(inboundOrderItems);
}
if (list.size() > 0)
......@@ -219,14 +228,15 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
"sapNo", "materialName", "plannedQuantity", "actualQuantity",
"plannedPackages", "materialUnit", "materialRemark"); // 排除子表字段
// 填充主表必填字段
mainDO.setId(UUID.randomUUID().toString());
mainDO.setOrderId(orderId);
mainDO.setCreateBy(operId);
mainDO.setCreateTime(now);
mainDO.setCreateUserCode(operId);
mainDO.setUpdateBy(operId);
mainDO.setUpdateTime(now);
mainDO.setUpdateUserCode(operId);
// mainDO.setUpdateBy(operId);
// mainDO.setUpdateTime(now);
// mainDO.setUpdateUserCode(operId);
mainDO.setId(UUID.randomUUID().toString());
mainDO.setOrderId(orderId);
mainDO.setOrderTypeId(orderType+"");
// 设置默认值
if (mainDO.getSortNo() == null) {
......@@ -248,21 +258,22 @@ public class InboundOrdersServiceImpl implements IInboundOrdersService
BeanUtils.copyProperties(vo, itemDO,
"orderId", "systemNo", "orderTypeId", "batchId"); // 排除主表字段
// 填充明细必填字段
itemDO.setCreateBy(operId);
itemDO.setCreateTime(now);
itemDO.setCreateUserCode(operId);
itemDO.setId(UUID.randomUUID().toString());
Map<String,String> sapAndId = sapAndIdMap.get(vo.getSapNo());
itemDO.setMaterialId(sapAndId.get("id"));
itemDO.setOrderId(orderId); // 关联入库单号
itemDO.setBatchId(mainDO.getBatchId());
itemDO.setInboundOrderId(mainDO.getId()); // 关联主表ID(核心!)
itemDO.setCreateBy(operId);
itemDO.setCreateTime(now);
itemDO.setCreateUserCode(operId);
itemDO.setSortNo(0L);
// 校验物料字段(示例:必填sapNo)
if (StringUtils.isBlank(vo.getSapNo())) {
throw new ServiceException(String.format("入库单号【%s】的物料SAP号为空,明细导入失败", orderId));
}
System.out.println(itemDO);
itemDOList.add(itemDO);
}
......
......@@ -82,6 +82,7 @@ public class InventoryServiceImpl implements IInventoryService
{
inventory.setCreateTime(DateUtils.getNowDate());
inventory.setCreateBy(SystemUtils.getUserName());
inventory.setCreateUserCode(SystemUtils.getUserName());
return inventoryMapper.insertInventory(inventory);
}
......@@ -89,8 +90,10 @@ public class InventoryServiceImpl implements IInventoryService
public int insertInventoryList(List<Inventory> inventoryList) {
int count = 0;
for (Inventory inventory : inventoryList) {
inventory.setLastInboundTime(DateUtils.getNowDate());
inventory.setCreateTime(DateUtils.getNowDate());
inventory.setId(UUID.randomUUID().toString());
inventory.setCreateBy(SystemUtils.getUserName());
inventory.setCreateUserCode(SystemUtils.getUserName());
count = inventoryMapper.insertInventory(inventory);
}
......
......@@ -11,6 +11,7 @@ import com.ruoyi.common.core.domain.entity.Materials;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.spring.SpringUtils;
import org.apache.commons.lang3.SystemUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.inventory.mapper.MaterialsCategoryMapper;
......@@ -151,6 +152,8 @@ public class MaterialsCategoryServiceImpl implements IMaterialsCategoryService
public int insertMaterialsCategory(MaterialsCategory materialsCategory)
{
materialsCategory.setCreateTime(DateUtils.getNowDate());
materialsCategory.setCreateUserCode(SystemUtils.getUserName());
materialsCategory.setCreateBy(SystemUtils.getUserName());
return materialsCategoryMapper.insertMaterialsCategory(materialsCategory);
}
......@@ -164,6 +167,8 @@ public class MaterialsCategoryServiceImpl implements IMaterialsCategoryService
public int updateMaterialsCategory(MaterialsCategory materialsCategory)
{
materialsCategory.setUpdateTime(DateUtils.getNowDate());
materialsCategory.setUpdateUserCode(SystemUtils.getUserName());
materialsCategory.setUpdateBy(SystemUtils.getUserName());
return materialsCategoryMapper.updateMaterialsCategory(materialsCategory);
}
......
......@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.inventory.mapper.MaterialsMapper;
import com.ruoyi.inventory.service.IMaterialsService;
import org.apache.commons.lang3.SystemUtils;
/**
* 物料Service业务层处理
......@@ -60,6 +61,8 @@ public class MaterialsServiceImpl implements IMaterialsService
public int insertMaterials(Materials materials)
{
materials.setCreateTime(DateUtils.getNowDate());
materials.setCreateUserCode(SystemUtils.getUserName());
materials.setCreateBy(SystemUtils.getUserName());
return materialsMapper.insertMaterials(materials);
}
......@@ -72,6 +75,8 @@ public class MaterialsServiceImpl implements IMaterialsService
@Override
public int updateMaterials(Materials materials)
{
materials.setUpdateUserCode(SystemUtils.getUserName());
materials.setUpdateBy(SystemUtils.getUserName());
materials.setUpdateTime(DateUtils.getNowDate());
return materialsMapper.updateMaterials(materials);
}
......@@ -114,6 +119,7 @@ public class MaterialsServiceImpl implements IMaterialsService
materials.setId(UUID.randomUUID().toString());
// 填充创建人、创建时间、修改人、修改时间
materials.setCreateBy(operId);
materials.setCreateUserCode(SystemUtils.getUserName());
materials.setCreateTime(now);
// 填充创建用户编码和更新用户编码
materials.setCreateUserCode(operId);
......
......@@ -213,7 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete id="deleteInboundOrderItemsByOrderIds" parameterType="String">
delete from inbound_order_items where order_id in
delete from inbound_order_items where inbound_order_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{orderId}
</foreach>
......
......@@ -336,6 +336,53 @@
</where>
order by w.warehouses_code, sl.location_code, material_id desc
</select>
<resultMap type="com.ruoyi.inventory.domain.vo.InventoryVo" id="InventoryVoResult">
<result property="id" column="id" />
<result property="inventoryType" column="inventory_type" />
<result property="orderId" column="order_id" />
<result property="materialId" column="material_id" />
<result property="batchId" column="batch_id" />
<result property="warehousesCode" column="warehouses_code" />
<result property="locationId" column="location_id" />
<result property="ownerId" column="owner_id" />
<result property="quantity" column="quantity" />
<result property="lockedQuantity" column="locked_quantity" />
<result property="unitWeight" column="unit_weight" />
<result property="totalWeight" column="total_weight" />
<result property="totalVolume" column="total_volume" />
<result property="productionDate" column="production_date" />
<result property="expirationDate" column="expiration_date" />
<result property="inventoryStatus" column="inventory_status" />
<result property="lastInboundTime" column="last_inbound_time" />
<result property="lastOutboundTime" column="last_outbound_time" />
<result property="isUsed" column="is_used" />
<result property="sortNo" column="sort_no" />
<result property="createTime" column="create_time" />
<result property="createUserCode" column="create_user_code" />
<result property="updateTime" column="update_time" />
<result property="updateUserCode" column="update_user_code" />
<result property="warehousesId" column="warehouses_id" />
<result property="materialName" column="material_name" />
<result property="minStockLevel" column="min_stock_level" jdbcType="BIGINT"/>
<result property="maxStockLevel" column="max_stock_level" jdbcType="BIGINT"/>
<result property="sapNo" column="sap_no" />
<result property="tsCode" column="ts_code" />
<result property="hazardId" column="hazard_id" />
<result property="specification" column="specification" />
<result property="materialUnit" column="material_unit" />
<result property="unitWeight" column="unit_weight" />
<result property="packageWeight" column="package_weight" />
<result property="totalWeight" column="total_weight" />
<result property="volume" column="volume" />
<result property="shelfLifeDays" column="shelf_life_days" />
<result property="storageTemperature" column="storage_temperature" />
<result property="specialRequirements" column="special_requirements" />
<result property="alterType" column="alterType" />
<result property="warehousesName" column="warehouses_name" />
<result property="locationName" column="location_name" />
<result property="ownerName" column="owner_name" />
</resultMap>
<select id="selectInventoryVoList" parameterType="Inventory" resultMap="InventoryVoResult">
<include refid="selectInventoryDetailVo"/>
<where>
......@@ -354,6 +401,7 @@
<select id="selectInventory" parameterType="Inventory" resultMap="InventoryResult">
<include refid="selectInventoryVo"/>
<where>
is_used = 1
<if test="inventoryType != null "> and inventory_type = #{inventoryType}</if>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="materialId != null and materialId != ''"> and material_id = #{materialId}</if>
......
......@@ -42,6 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectMaterialsList" parameterType="Materials" resultMap="MaterialsResult">
<include refid="selectMaterialsVo"/>
<where>
is_used = 1
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="sapNo != null and sapNo != ''"> and sap_no like concat('%', #{sapNo}, '%')</if>
......@@ -74,16 +75,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectMaterialsById" parameterType="String" resultMap="MaterialsResult">
<include refid="selectMaterialsVo"/>
where id = #{id}
and is_used = 1
order by sort_no asc
</select>
<select id="selectMaterialsBySapNo" parameterType="String" resultMap="MaterialsResult">
<include refid="selectMaterialsVo"/>
where sap_no = #{id}
and is_used = 1
order by sort_no asc
</select>
<select id="selectMaterialsByCategory" parameterType="String" resultMap="MaterialsResult">
<include refid="selectMaterialsVo"/>
where category_code = #{id}
and is_used = 1
order by sort_no asc
</select>
<!-- 获取物料 的 sap_no Name 做成字典-->
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论