1.4.2 恢复WMS删除文件
parent
17b03a251f
commit
8d36ef07d7
@ -0,0 +1,80 @@
|
||||
package com.hw.wms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hw.wms.domain.WmsWarehouseMaterial;
|
||||
|
||||
/**
|
||||
* 仓库可储存物料信息Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-09
|
||||
*/
|
||||
public interface WmsWarehouseMaterialMapper {
|
||||
/**
|
||||
* 查询仓库可储存物料信息
|
||||
*
|
||||
* @param warehouseId 仓库可储存物料信息主键
|
||||
* @return 仓库可储存物料信息
|
||||
*/
|
||||
public WmsWarehouseMaterial selectWmsWarehouseMaterialByWarehouseId(Long warehouseId);
|
||||
|
||||
/**
|
||||
* 查询仓库可储存物料信息列表
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 仓库可储存物料信息集合
|
||||
*/
|
||||
public List<WmsWarehouseMaterial> selectWmsWarehouseMaterialList(WmsWarehouseMaterial wmsWarehouseMaterial);
|
||||
|
||||
/**
|
||||
* 新增仓库可储存物料信息
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmsWarehouseMaterial(WmsWarehouseMaterial wmsWarehouseMaterial);
|
||||
|
||||
/**
|
||||
* 修改仓库可储存物料信息
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmsWarehouseMaterial(WmsWarehouseMaterial wmsWarehouseMaterial);
|
||||
|
||||
/**
|
||||
* 删除仓库可储存物料信息
|
||||
*
|
||||
* @param warehouseId 仓库可储存物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmsWarehouseMaterialByWarehouseMaterialId(Long warehouseId);
|
||||
|
||||
/**
|
||||
* 批量删除仓库可储存物料信息
|
||||
*
|
||||
* @param warehouseIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmsWarehouseMaterialByWarehouseMaterialIds(Long[] warehouseIds);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询仓库可储存物料信息列表,Join material
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 仓库可储存物料信息集合
|
||||
*/
|
||||
public List<WmsWarehouseMaterial> selectWmsWarehouseMaterialJoinList(WmsWarehouseMaterial wmsWarehouseMaterial);
|
||||
|
||||
/**
|
||||
* 批量新增仓库物料配置信息
|
||||
*
|
||||
* @param warehouseMaterialList 仓库物料列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchInsertWarehouseMaterial(List<WmsWarehouseMaterial> warehouseMaterialList);
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package com.hw.wms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.wms.domain.WmsWarehouseMaterial;
|
||||
|
||||
/**
|
||||
* 仓库可储存物料信息Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-09
|
||||
*/
|
||||
public interface IWmsWarehouseMaterialService
|
||||
{
|
||||
/**
|
||||
* 查询仓库可储存物料信息
|
||||
*
|
||||
* @param warehouseId 仓库可储存物料信息主键
|
||||
* @return 仓库可储存物料信息
|
||||
*/
|
||||
public WmsWarehouseMaterial selectWmsWarehouseMaterialByWarehouseId(Long warehouseId);
|
||||
|
||||
/**
|
||||
* 查询仓库可储存物料信息列表
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 仓库可储存物料信息集合
|
||||
*/
|
||||
public List<WmsWarehouseMaterial> selectWmsWarehouseMaterialList(WmsWarehouseMaterial wmsWarehouseMaterial);
|
||||
|
||||
/**
|
||||
* 新增仓库可储存物料信息
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertWmsWarehouseMaterial(WmsWarehouseMaterial wmsWarehouseMaterial);
|
||||
|
||||
/**
|
||||
* 修改仓库可储存物料信息
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateWmsWarehouseMaterial(WmsWarehouseMaterial wmsWarehouseMaterial);
|
||||
|
||||
/**
|
||||
* 批量删除仓库可储存物料信息
|
||||
*
|
||||
* @param warehouseMaterialIds 需要删除的仓库可储存物料信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmsWarehouseMaterialByWarehouseMaterialIds(Long[] warehouseMaterialIds);
|
||||
|
||||
/**
|
||||
* 删除仓库可储存物料信息信息
|
||||
*
|
||||
* @param warehouseMaterialId 仓库可储存物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteWmsWarehouseMaterialByWarehouseMaterialId(Long warehouseMaterialId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询仓库可储存物料信息列表,join material
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 仓库可储存物料信息
|
||||
*/
|
||||
public List<WmsWarehouseMaterial> selectWmsWarehouseMaterialJoinList(WmsWarehouseMaterial wmsWarehouseMaterial);
|
||||
|
||||
/**
|
||||
* 批量新增仓库配置物料信息
|
||||
*
|
||||
* @param warehouseId 仓库ID
|
||||
* @param materialIds 物料组
|
||||
*/
|
||||
public void batchInsertWarehouseMaterial(Long warehouseId, Long[] materialIds);
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
package com.hw.wms.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.hw.common.core.constant.WmsConstants;
|
||||
import com.hw.common.core.utils.DateUtils;
|
||||
import com.hw.common.core.utils.StringUtils;
|
||||
import com.hw.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hw.wms.mapper.WmsWarehouseMaterialMapper;
|
||||
import com.hw.wms.domain.WmsWarehouseMaterial;
|
||||
import com.hw.wms.service.IWmsWarehouseMaterialService;
|
||||
|
||||
/**
|
||||
* 仓库可储存物料信息Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-09
|
||||
*/
|
||||
@Service
|
||||
public class WmsWarehouseMaterialServiceImpl implements IWmsWarehouseMaterialService {
|
||||
@Autowired
|
||||
private WmsWarehouseMaterialMapper wmsWarehouseMaterialMapper;
|
||||
|
||||
/**
|
||||
* 查询仓库可储存物料信息
|
||||
*
|
||||
* @param warehouseId 仓库可储存物料信息主键
|
||||
* @return 仓库可储存物料信息
|
||||
*/
|
||||
@Override
|
||||
public WmsWarehouseMaterial selectWmsWarehouseMaterialByWarehouseId(Long warehouseId) {
|
||||
return wmsWarehouseMaterialMapper.selectWmsWarehouseMaterialByWarehouseId(warehouseId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库可储存物料信息列表
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 仓库可储存物料信息
|
||||
*/
|
||||
@Override
|
||||
public List<WmsWarehouseMaterial> selectWmsWarehouseMaterialList(WmsWarehouseMaterial wmsWarehouseMaterial) {
|
||||
return wmsWarehouseMaterialMapper.selectWmsWarehouseMaterialList(wmsWarehouseMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仓库可储存物料信息
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertWmsWarehouseMaterial(WmsWarehouseMaterial wmsWarehouseMaterial) {
|
||||
wmsWarehouseMaterial.setCreateTime(DateUtils.getNowDate());
|
||||
return wmsWarehouseMaterialMapper.insertWmsWarehouseMaterial(wmsWarehouseMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库可储存物料信息
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateWmsWarehouseMaterial(WmsWarehouseMaterial wmsWarehouseMaterial) {
|
||||
return wmsWarehouseMaterialMapper.updateWmsWarehouseMaterial(wmsWarehouseMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除仓库可储存物料信息
|
||||
*
|
||||
* @param wmsWarehouseMaterialIds 需要删除的仓库可储存物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmsWarehouseMaterialByWarehouseMaterialIds(Long[] wmsWarehouseMaterialIds) {
|
||||
return wmsWarehouseMaterialMapper.deleteWmsWarehouseMaterialByWarehouseMaterialIds(wmsWarehouseMaterialIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库可储存物料信息信息
|
||||
*
|
||||
* @param warehouseMaterialId 仓库可储存物料信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteWmsWarehouseMaterialByWarehouseMaterialId(Long warehouseMaterialId) {
|
||||
return wmsWarehouseMaterialMapper.deleteWmsWarehouseMaterialByWarehouseMaterialId(warehouseMaterialId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询仓库可储存物料信息列表,join material
|
||||
*
|
||||
* @param wmsWarehouseMaterial 仓库可储存物料信息
|
||||
* @return 仓库可储存物料信息
|
||||
*/
|
||||
@Override
|
||||
public List<WmsWarehouseMaterial> selectWmsWarehouseMaterialJoinList(WmsWarehouseMaterial wmsWarehouseMaterial) {
|
||||
return wmsWarehouseMaterialMapper.selectWmsWarehouseMaterialJoinList(wmsWarehouseMaterial);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量新增仓库配置物料信息
|
||||
*
|
||||
* @param warehouseId 仓库ID
|
||||
* @param materialIds 物料组
|
||||
*/
|
||||
@Override
|
||||
public void batchInsertWarehouseMaterial(Long warehouseId, Long[] materialIds) {
|
||||
if (StringUtils.isNotEmpty(materialIds)) {
|
||||
String userName = SecurityUtils.getUsername();
|
||||
Date currentDate = new Date();
|
||||
// 新增仓库的物料配置信息
|
||||
List<WmsWarehouseMaterial> list = new ArrayList<WmsWarehouseMaterial>();
|
||||
for (Long materialId : materialIds) {
|
||||
WmsWarehouseMaterial warehouseMaterial = new WmsWarehouseMaterial();
|
||||
warehouseMaterial.setWarehouseId(warehouseId);
|
||||
warehouseMaterial.setStorageType(WmsConstants.WMS_WAREHOUSE_MATERIAL_STORAGE_TYPE_MATERIAL);
|
||||
warehouseMaterial.setStorageId(materialId);
|
||||
warehouseMaterial.setCreateBy(userName);
|
||||
warehouseMaterial.setCreateTime(currentDate);
|
||||
list.add(warehouseMaterial);
|
||||
}
|
||||
wmsWarehouseMaterialMapper.batchInsertWarehouseMaterial(list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.hw.wms.mapper.WmsWarehouseMaterialMapper">
|
||||
|
||||
<resultMap type="WmsWarehouseMaterial" id="WmsWarehouseMaterialResult">
|
||||
<result property="warehouseMaterialId" column="warehouse_material_id" />
|
||||
<result property="warehouseId" column="warehouse_id" />
|
||||
<result property="locationCode" column="location_code" />
|
||||
<result property="storageType" column="storage_type" />
|
||||
<result property="storageId" column="storage_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectWmsWarehouseMaterialVo">
|
||||
select warehouse_id, location_code, storage_type, storage_id, create_time, create_by from wms_warehouse_material
|
||||
</sql>
|
||||
|
||||
<select id="selectWmsWarehouseMaterialList" parameterType="WmsWarehouseMaterial" resultMap="WmsWarehouseMaterialResult">
|
||||
<include refid="selectWmsWarehouseMaterialVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectWmsWarehouseMaterialByWarehouseId" parameterType="Long" resultMap="WmsWarehouseMaterialResult">
|
||||
<include refid="selectWmsWarehouseMaterialVo"/>
|
||||
where warehouse_id = #{warehouseId}
|
||||
</select>
|
||||
|
||||
<insert id="insertWmsWarehouseMaterial" parameterType="WmsWarehouseMaterial">
|
||||
insert into wms_warehouse_material
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="locationCode != null">location_code,</if>
|
||||
<if test="storageType != null">storage_type,</if>
|
||||
<if test="storageId != null">storage_id,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="locationCode != null">#{locationCode},</if>
|
||||
<if test="storageType != null">#{storageType},</if>
|
||||
<if test="storageId != null">#{storageId},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateWmsWarehouseMaterial" parameterType="WmsWarehouseMaterial">
|
||||
update wms_warehouse_material
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="locationCode != null">location_code = #{locationCode},</if>
|
||||
<if test="storageType != null">storage_type = #{storageType},</if>
|
||||
<if test="storageId != null">storage_id = #{storageId},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
</trim>
|
||||
where warehouse_id = #{warehouseId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteWmsWarehouseMaterialByWarehouseMaterialId" parameterType="Long">
|
||||
delete from wms_warehouse_material where warehouse_material_id = #{warehouseMaterialId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteWmsWarehouseMaterialByWarehouseMaterialIds" parameterType="String">
|
||||
delete from wms_warehouse_material where warehouse_material_id in
|
||||
<foreach item="warehouseMaterialId" collection="array" open="(" separator="," close=")">
|
||||
#{warehouseMaterialId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectWmsWarehouseMaterialJoinList" parameterType="WmsWarehouseMaterial" resultMap="WmsWarehouseMaterialResult">
|
||||
select wwm.warehouse_material_id,wwm.warehouse_id, wwm.location_code, wwm.storage_type, wwm.storage_id, wwm.create_time, wwm.create_by,
|
||||
mbm.material_code,mbm.material_name
|
||||
from wms_warehouse_material wwm left join mes_base_material_info mbm on wwm.storage_id=mbm.material_id and wwm.storage_type='1'
|
||||
<where>
|
||||
<if test="warehouseId != null "> and warehouse_id = #{warehouseId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="batchInsertWarehouseMaterial">
|
||||
insert into wms_warehouse_material(warehouse_id, storage_type,storage_id,create_time,create_by) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
(#{item.warehouseId},#{item.storageType},#{item.storageId},#{item.createTime},#{item.createBy})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue