mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-26 11:51:55 +08:00
新增DataSelect组件
This commit is contained in:
@@ -398,7 +398,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 30,
|
||||
#foreach ($column in $columns)
|
||||
#if($column.query)
|
||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||
|
||||
@@ -377,7 +377,7 @@ const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
pageSize: 30,
|
||||
#foreach ($column in $columns)
|
||||
#if($column.query)
|
||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
||||
|
||||
@@ -1,83 +1,83 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.api.domain.SysDictType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典表 数据层
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysDictTypeMapper
|
||||
{
|
||||
public interface SysDictTypeMapper {
|
||||
/**
|
||||
* 根据条件分页查询字典类型
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型信息
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
public List<SysDictType> selectDictTypeList(SysDictType dictType);
|
||||
List<SysDictType> selectDictTypeList(SysDictType dictType);
|
||||
|
||||
/**
|
||||
* 根据所有字典类型
|
||||
*
|
||||
*
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
public List<SysDictType> selectDictTypeAll();
|
||||
List<SysDictType> selectDictTypeAll();
|
||||
|
||||
/**
|
||||
* 根据字典类型ID查询信息
|
||||
*
|
||||
*
|
||||
* @param dictId 字典类型ID
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeById(Long dictId);
|
||||
SysDictType selectDictTypeById(Long dictId);
|
||||
|
||||
/**
|
||||
* 根据字典类型查询信息
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeByType(String dictType);
|
||||
SysDictType selectDictTypeByType(String dictType);
|
||||
|
||||
/**
|
||||
* 通过字典ID删除字典信息
|
||||
*
|
||||
*
|
||||
* @param dictId 字典ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictTypeById(Long dictId);
|
||||
int deleteDictTypeById(Long dictId);
|
||||
|
||||
/**
|
||||
* 批量删除字典类型信息
|
||||
*
|
||||
*
|
||||
* @param dictIds 需要删除的字典ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDictTypeByIds(Long[] dictIds);
|
||||
int deleteDictTypeByIds(Long[] dictIds);
|
||||
|
||||
/**
|
||||
* 新增字典类型信息
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictType(SysDictType dictType);
|
||||
int insertDictType(SysDictType dictType);
|
||||
|
||||
/**
|
||||
* 修改字典类型信息
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictType(SysDictType dictType);
|
||||
int updateDictType(SysDictType dictType);
|
||||
|
||||
/**
|
||||
* 校验字典类型称是否唯一
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
public SysDictType checkDictTypeUnique(String dictType);
|
||||
SysDictType checkDictTypeUnique(String dictType);
|
||||
}
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.api.domain.SysDictData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典 业务层
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ISysDictDataService
|
||||
{
|
||||
public interface ISysDictDataService {
|
||||
/**
|
||||
* 根据条件分页查询字典数据
|
||||
*
|
||||
*
|
||||
* @param dictData 字典数据信息
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData);
|
||||
List<SysDictData> selectDictDataList(SysDictData dictData);
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
public String selectDictLabel(String dictType, String dictValue);
|
||||
String selectDictLabel(String dictType, String dictValue);
|
||||
|
||||
/**
|
||||
* 根据字典数据ID查询信息
|
||||
*
|
||||
*
|
||||
* @param dictCode 字典数据ID
|
||||
* @return 字典数据
|
||||
*/
|
||||
public SysDictData selectDictDataById(Long dictCode);
|
||||
SysDictData selectDictDataById(Long dictCode);
|
||||
|
||||
/**
|
||||
* 批量删除字典数据信息
|
||||
*
|
||||
*
|
||||
* @param dictCodes 需要删除的字典数据ID
|
||||
*/
|
||||
public void deleteDictDataByIds(Long[] dictCodes);
|
||||
void deleteDictDataByIds(Long[] dictCodes);
|
||||
|
||||
/**
|
||||
* 新增保存字典数据信息
|
||||
*
|
||||
*
|
||||
* @param dictData 字典数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictData(SysDictData dictData);
|
||||
int insertDictData(SysDictData dictData);
|
||||
|
||||
/**
|
||||
* 修改保存字典数据信息
|
||||
*
|
||||
*
|
||||
* @param dictData 字典数据信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictData(SysDictData dictData);
|
||||
int updateDictData(SysDictData dictData);
|
||||
}
|
||||
|
||||
@@ -1,98 +1,98 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.api.domain.SysDictData;
|
||||
import com.ruoyi.system.api.domain.SysDictType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典 业务层
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ISysDictTypeService
|
||||
{
|
||||
public interface ISysDictTypeService {
|
||||
/**
|
||||
* 根据条件分页查询字典类型
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型信息
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
public List<SysDictType> selectDictTypeList(SysDictType dictType);
|
||||
List<SysDictType> selectDictTypeList(SysDictType dictType);
|
||||
|
||||
/**
|
||||
* 根据所有字典类型
|
||||
*
|
||||
*
|
||||
* @return 字典类型集合信息
|
||||
*/
|
||||
public List<SysDictType> selectDictTypeAll();
|
||||
List<SysDictType> selectDictTypeAll();
|
||||
|
||||
/**
|
||||
* 根据字典类型查询字典数据
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
public List<SysDictData> selectDictDataByType(String dictType);
|
||||
List<SysDictData> selectDictDataByType(String dictType);
|
||||
|
||||
/**
|
||||
* 根据字典类型ID查询信息
|
||||
*
|
||||
*
|
||||
* @param dictId 字典类型ID
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeById(Long dictId);
|
||||
SysDictType selectDictTypeById(Long dictId);
|
||||
|
||||
/**
|
||||
* 根据字典类型查询信息
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeByType(String dictType);
|
||||
SysDictType selectDictTypeByType(String dictType);
|
||||
|
||||
/**
|
||||
* 批量删除字典信息
|
||||
*
|
||||
*
|
||||
* @param dictIds 需要删除的字典ID
|
||||
*/
|
||||
public void deleteDictTypeByIds(Long[] dictIds);
|
||||
void deleteDictTypeByIds(Long[] dictIds);
|
||||
|
||||
/**
|
||||
* 加载字典缓存数据
|
||||
*/
|
||||
public void loadingDictCache();
|
||||
void loadingDictCache();
|
||||
|
||||
/**
|
||||
* 清空字典缓存数据
|
||||
*/
|
||||
public void clearDictCache();
|
||||
void clearDictCache();
|
||||
|
||||
/**
|
||||
* 重置字典缓存数据
|
||||
*/
|
||||
public void resetDictCache();
|
||||
void resetDictCache();
|
||||
|
||||
/**
|
||||
* 新增保存字典类型信息
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDictType(SysDictType dictType);
|
||||
int insertDictType(SysDictType dictType);
|
||||
|
||||
/**
|
||||
* 修改保存字典类型信息
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictType(SysDictType dictType);
|
||||
int updateDictType(SysDictType dictType);
|
||||
|
||||
/**
|
||||
* 校验字典类型称是否唯一
|
||||
*
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 结果
|
||||
*/
|
||||
public boolean checkDictTypeUnique(SysDictType dictType);
|
||||
boolean checkDictTypeUnique(SysDictType dictType);
|
||||
}
|
||||
|
||||
@@ -1,105 +1,108 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.SysDictTypeMapper">
|
||||
|
||||
<resultMap type="SysDictType" id="SysDictTypeResult">
|
||||
<id property="dictId" column="dict_id" />
|
||||
<result property="dictName" column="dict_name" />
|
||||
<result property="dictType" column="dict_type" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictTypeVo">
|
||||
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
|
||||
from sys_dict_type
|
||||
<resultMap type="com.ruoyi.system.api.domain.SysDictType" id="SysDictTypeResult">
|
||||
<id property="dictId" column="dict_id"/>
|
||||
<result property="dictName" column="dict_name"/>
|
||||
<result property="dictType" column="dict_type"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDictTypeVo">
|
||||
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
|
||||
from sys_dict_type
|
||||
</sql>
|
||||
|
||||
<select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
<where>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
AND dict_name like concat('%', #{dictName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type like concat('%', #{dictType}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_id = #{dictId}
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType}
|
||||
</select>
|
||||
|
||||
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType} limit 1
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictTypeById" parameterType="Long">
|
||||
delete from sys_dict_type where dict_id = #{dictId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictTypeByIds" parameterType="Long">
|
||||
delete from sys_dict_type where dict_id in
|
||||
<foreach collection="array" item="dictId" open="(" separator="," close=")">
|
||||
#{dictId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectDictTypeList" parameterType="com.ruoyi.system.api.domain.SysDictType"
|
||||
resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
<where>
|
||||
<if test="dictName != null and dictName != ''">
|
||||
AND dict_name like concat('%', #{dictName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="dictType != null and dictType != ''">
|
||||
AND dict_type like concat('%', #{dictType}, '%')
|
||||
</if>
|
||||
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
|
||||
</if>
|
||||
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
|
||||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_id = #{dictId}
|
||||
</select>
|
||||
|
||||
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType}
|
||||
</select>
|
||||
|
||||
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType} limit 1
|
||||
</select>
|
||||
|
||||
<delete id="deleteDictTypeById" parameterType="Long">
|
||||
delete
|
||||
from sys_dict_type
|
||||
where dict_id = #{dictId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDictTypeByIds" parameterType="Long">
|
||||
delete from sys_dict_type where dict_id in
|
||||
<foreach collection="array" item="dictId" open="(" separator="," close=")">
|
||||
#{dictId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictType" parameterType="com.ruoyi.system.api.domain.SysDictTypeSysDictType">
|
||||
update sys_dict_type
|
||||
<set>
|
||||
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictType" parameterType="com.ruoyi.system.api.domain.SysDictTypeSysDictType">
|
||||
insert into sys_dict_type(
|
||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="dictName != null and dictName != ''">#{dictName},</if>
|
||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="updateDictType" parameterType="SysDictType">
|
||||
update sys_dict_type
|
||||
<set>
|
||||
<if test="dictName != null and dictName != ''">dict_name = #{dictName},</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type = #{dictType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
<insert id="insertDictType" parameterType="SysDictType">
|
||||
insert into sys_dict_type(
|
||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="dictName != null and dictName != ''">#{dictName},</if>
|
||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
@@ -1,16 +1,17 @@
|
||||
package com.ruoyi.wms.controller.stock;
|
||||
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.wms.domain.BaseStock;
|
||||
import com.ruoyi.wms.service.stock.IBaseStockService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -23,6 +24,7 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping("/BaseStock")
|
||||
public class BaseStockController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IBaseStockService baseStockService;
|
||||
|
||||
@@ -37,31 +39,29 @@ public class BaseStockController extends BaseController {
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
//TODO 如果要启用导出功能,需要在domain实体类的字段上添加注解:@com.ruoyi.common.core.annotation.Excel(name = "字段名")
|
||||
/*
|
||||
/**
|
||||
* 导出基本库存列表
|
||||
*/
|
||||
// @RequiresPermissions("wms:BaseStock:export")
|
||||
// @Log(title = "基本库存", businessType = BusinessType.EXPORT)
|
||||
// @PostMapping("/export")
|
||||
// public void export(HttpServletResponse response, BaseStock baseStock)
|
||||
// {
|
||||
// List<BaseStock> list = baseStockService.selectBaseStockList(baseStock);
|
||||
// if (list.isEmpty()) {
|
||||
// responseJsonWarn(response, "没有数据可以导出");
|
||||
// return;
|
||||
// }
|
||||
// ExcelUtil<BaseStock> util = new ExcelUtil<>(BaseStock.class);
|
||||
// util.exportExcel(response, list, "基本库存数据");
|
||||
// }
|
||||
@RequiresPermissions("wms:BaseStock:export")
|
||||
@Log(title = "基本库存", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseStock baseStock) {
|
||||
List<BaseStock> list = baseStockService.selectBaseStockList(baseStock);
|
||||
if (list.isEmpty()) {
|
||||
responseJsonWarn(response, "没有数据可以导出");
|
||||
return;
|
||||
}
|
||||
ExcelUtil<BaseStock> util = new ExcelUtil<>(BaseStock.class);
|
||||
util.exportExcel(response, list, "基本库存数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取基本库存详细信息
|
||||
*/
|
||||
@RequiresPermissions("wms:BaseStock:query")
|
||||
@GetMapping(value = "/{whsCd}")
|
||||
public AjaxResult getInfo(@PathVariable("whsCd") String whsCd) {
|
||||
return success(baseStockService.selectBaseStockByWhsCd(whsCd));
|
||||
@PostMapping(value = "/getInfo")
|
||||
public AjaxResult getInfo(@RequestBody BaseStock form) {
|
||||
return success(baseStockService.selectBaseStockByPK(form.getWhsCd(), form.getStgBinCd(), form.getItemCd(), form.getLotNo(), form.getSubLotNo()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.ruoyi.wms.controller.stock;
|
||||
|
||||
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.web.page.TableDataInfo;
|
||||
import com.ruoyi.common.log.annotation.Log;
|
||||
import com.ruoyi.common.log.enums.BusinessType;
|
||||
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||
import com.ruoyi.wms.domain.InvTransHis;
|
||||
import com.ruoyi.wms.service.stock.IInvTransHisService;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 入出库履历Controller
|
||||
*
|
||||
* @author ryas
|
||||
* created on 2024-02-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/InvTransHis")
|
||||
public class InvTransHisController extends BaseController {
|
||||
@Autowired
|
||||
private IInvTransHisService invTransHisService;
|
||||
|
||||
/**
|
||||
* 查询入出库履历列表
|
||||
*/
|
||||
@RequiresPermissions("wms:InvTransHis:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(InvTransHis invTransHis) {
|
||||
startPage();
|
||||
List<InvTransHis> list = invTransHisService.selectInvTransHisList(invTransHis);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出入出库履历列表
|
||||
*/
|
||||
@RequiresPermissions("wms:InvTransHis:export")
|
||||
@Log(title = "入出库履历", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, InvTransHis invTransHis) {
|
||||
List<InvTransHis> list = invTransHisService.selectInvTransHisList(invTransHis);
|
||||
if (list.isEmpty()) {
|
||||
responseJsonWarn(response, "没有数据可以导出");
|
||||
return;
|
||||
}
|
||||
ExcelUtil<InvTransHis> util = new ExcelUtil<>(InvTransHis.class);
|
||||
util.exportExcel(response, list, "入出库履历数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入出库履历详细信息
|
||||
*/
|
||||
@RequiresPermissions("wms:InvTransHis:query")
|
||||
@GetMapping(value = "/{invTransNo}")
|
||||
public AjaxResult getInfo(@PathVariable("invTransNo") String invTransNo) {
|
||||
return success(invTransHisService.selectInvTransHisByInvTransNo(invTransNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除入出库履历
|
||||
*/
|
||||
@RequiresPermissions("wms:InvTransHis:remove")
|
||||
@Log(title = "入出库履历", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{invTransNos}")
|
||||
public AjaxResult remove(@PathVariable String[] invTransNos) {
|
||||
return toAjax(invTransHisService.deleteInvTransHisByInvTransNos(invTransNos));
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.wms.domain;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -65,26 +66,31 @@ public class BaseStock extends ExtBaseEntity implements Serializable {
|
||||
/**
|
||||
* 仓库代码
|
||||
*/
|
||||
@Excel(name = "仓库代码", sort = 1)
|
||||
private String whsCd;
|
||||
|
||||
/**
|
||||
* 货架号
|
||||
*/
|
||||
@Excel(name = "货架号", sort = 2)
|
||||
private String stgBinCd;
|
||||
|
||||
/**
|
||||
* 物品代码
|
||||
*/
|
||||
@Excel(name = "物品代码", sort = 3)
|
||||
private String itemCd;
|
||||
|
||||
/**
|
||||
* 批号
|
||||
*/
|
||||
@Excel(name = "批号", sort = 4)
|
||||
private String lotNo;
|
||||
|
||||
/**
|
||||
* 子批号
|
||||
*/
|
||||
@Excel(name = "子批号", sort = 5)
|
||||
private String subLotNo;
|
||||
|
||||
/**
|
||||
@@ -95,26 +101,31 @@ public class BaseStock extends ExtBaseEntity implements Serializable {
|
||||
/**
|
||||
* 标准单位数量
|
||||
*/
|
||||
@Excel(name = "标准单位数量", sort = 6)
|
||||
private BigDecimal stdUnitQty;
|
||||
|
||||
/**
|
||||
* 包装单位数量
|
||||
*/
|
||||
@Excel(name = "包装单位数量", sort = 7)
|
||||
private BigDecimal pkgUnitQty;
|
||||
|
||||
/**
|
||||
* 序列号
|
||||
*/
|
||||
@Excel(name = "序列号", sort = 8)
|
||||
private String serialNo;
|
||||
|
||||
/**
|
||||
* 托盘ID
|
||||
*/
|
||||
@Excel(name = "托盘ID", sort = 9)
|
||||
private String palletId;
|
||||
|
||||
/**
|
||||
* 父托盘ID
|
||||
*/
|
||||
@Excel(name = "父托盘ID", sort = 10)
|
||||
private String parentPalletId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
package com.ruoyi.wms.domain;
|
||||
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
@@ -17,10 +21,47 @@ import java.math.BigDecimal;
|
||||
* @author ryas
|
||||
* created on 2024-02-22
|
||||
*/
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class InvTransHis extends ExtBaseEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
//==================== ↓↓↓↓↓↓ 非表字段 ↓↓↓↓↓↓ ====================
|
||||
|
||||
/**
|
||||
* 创建者用户名
|
||||
*/
|
||||
private String createByUser;
|
||||
|
||||
/**
|
||||
* 标准单位代码
|
||||
*/
|
||||
private String stdUnitCd;
|
||||
|
||||
/**
|
||||
* 标准单位名称
|
||||
*/
|
||||
private String stdUnitName;
|
||||
|
||||
/**
|
||||
* 包装单位代码
|
||||
*/
|
||||
private String pkgUnitCd;
|
||||
|
||||
/**
|
||||
* 包装单位名称
|
||||
*/
|
||||
private String pkgUnitName;
|
||||
|
||||
//==================== ↓↓↓↓↓↓ 表字段 ↓↓↓↓↓↓ ====================
|
||||
|
||||
/**
|
||||
* 入出库履历号
|
||||
*/
|
||||
@Excel(name = "入出库履历号", sort = 1)
|
||||
private String invTransNo;
|
||||
|
||||
/**
|
||||
@@ -128,215 +169,4 @@ public class InvTransHis extends ExtBaseEntity implements Serializable {
|
||||
*/
|
||||
private String remark5;
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String getInvTransNo() {
|
||||
return invTransNo;
|
||||
}
|
||||
|
||||
public void setInvTransNo(String invTransNo) {
|
||||
this.invTransNo = invTransNo == null ? null : invTransNo.trim();
|
||||
}
|
||||
|
||||
public Integer getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(Integer deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
public Integer getInvTransType() {
|
||||
return invTransType;
|
||||
}
|
||||
|
||||
public void setInvTransType(Integer invTransType) {
|
||||
this.invTransType = invTransType;
|
||||
}
|
||||
|
||||
public String getWhsCd() {
|
||||
return whsCd;
|
||||
}
|
||||
|
||||
public void setWhsCd(String whsCd) {
|
||||
this.whsCd = whsCd == null ? null : whsCd.trim();
|
||||
}
|
||||
|
||||
public String getStgBinCd() {
|
||||
return stgBinCd;
|
||||
}
|
||||
|
||||
public void setStgBinCd(String stgBinCd) {
|
||||
this.stgBinCd = stgBinCd == null ? null : stgBinCd.trim();
|
||||
}
|
||||
|
||||
public String getPalletId() {
|
||||
return palletId;
|
||||
}
|
||||
|
||||
public void setPalletId(String palletId) {
|
||||
this.palletId = palletId == null ? null : palletId.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getStdUnitQty() {
|
||||
return stdUnitQty;
|
||||
}
|
||||
|
||||
public void setStdUnitQty(BigDecimal stdUnitQty) {
|
||||
this.stdUnitQty = stdUnitQty;
|
||||
}
|
||||
|
||||
public BigDecimal getPkgUnitQty() {
|
||||
return pkgUnitQty;
|
||||
}
|
||||
|
||||
public void setPkgUnitQty(BigDecimal pkgUnitQty) {
|
||||
this.pkgUnitQty = pkgUnitQty;
|
||||
}
|
||||
|
||||
public String getTransOrderNo() {
|
||||
return transOrderNo;
|
||||
}
|
||||
|
||||
public void setTransOrderNo(String transOrderNo) {
|
||||
this.transOrderNo = transOrderNo == null ? null : transOrderNo.trim();
|
||||
}
|
||||
|
||||
public String getTransOrderDetlNo() {
|
||||
return transOrderDetlNo;
|
||||
}
|
||||
|
||||
public void setTransOrderDetlNo(String transOrderDetlNo) {
|
||||
this.transOrderDetlNo = transOrderDetlNo == null ? null : transOrderDetlNo.trim();
|
||||
}
|
||||
|
||||
public String getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setOperator(String operator) {
|
||||
this.operator = operator == null ? null : operator.trim();
|
||||
}
|
||||
|
||||
public String getBusinessCls() {
|
||||
return businessCls;
|
||||
}
|
||||
|
||||
public void setBusinessCls(String businessCls) {
|
||||
this.businessCls = businessCls == null ? null : businessCls.trim();
|
||||
}
|
||||
|
||||
public String getItemCd() {
|
||||
return itemCd;
|
||||
}
|
||||
|
||||
public void setItemCd(String itemCd) {
|
||||
this.itemCd = itemCd == null ? null : itemCd.trim();
|
||||
}
|
||||
|
||||
public String getLotNo() {
|
||||
return lotNo;
|
||||
}
|
||||
|
||||
public void setLotNo(String lotNo) {
|
||||
this.lotNo = lotNo == null ? null : lotNo.trim();
|
||||
}
|
||||
|
||||
public String getSubLotNo() {
|
||||
return subLotNo;
|
||||
}
|
||||
|
||||
public void setSubLotNo(String subLotNo) {
|
||||
this.subLotNo = subLotNo == null ? null : subLotNo.trim();
|
||||
}
|
||||
|
||||
public String getSerialNo() {
|
||||
return serialNo;
|
||||
}
|
||||
|
||||
public void setSerialNo(String serialNo) {
|
||||
this.serialNo = serialNo == null ? null : serialNo.trim();
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason == null ? null : reason.trim();
|
||||
}
|
||||
|
||||
public String getRemark1() {
|
||||
return remark1;
|
||||
}
|
||||
|
||||
public void setRemark1(String remark1) {
|
||||
this.remark1 = remark1 == null ? null : remark1.trim();
|
||||
}
|
||||
|
||||
public String getRemark2() {
|
||||
return remark2;
|
||||
}
|
||||
|
||||
public void setRemark2(String remark2) {
|
||||
this.remark2 = remark2 == null ? null : remark2.trim();
|
||||
}
|
||||
|
||||
public String getRemark3() {
|
||||
return remark3;
|
||||
}
|
||||
|
||||
public void setRemark3(String remark3) {
|
||||
this.remark3 = remark3 == null ? null : remark3.trim();
|
||||
}
|
||||
|
||||
public String getRemark4() {
|
||||
return remark4;
|
||||
}
|
||||
|
||||
public void setRemark4(String remark4) {
|
||||
this.remark4 = remark4 == null ? null : remark4.trim();
|
||||
}
|
||||
|
||||
public String getRemark5() {
|
||||
return remark5;
|
||||
}
|
||||
|
||||
public void setRemark5(String remark5) {
|
||||
this.remark5 = remark5 == null ? null : remark5.trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", invTransNo=").append(invTransNo);
|
||||
sb.append(", deptId=").append(deptId);
|
||||
sb.append(", invTransType=").append(invTransType);
|
||||
sb.append(", whsCd=").append(whsCd);
|
||||
sb.append(", stgBinCd=").append(stgBinCd);
|
||||
sb.append(", palletId=").append(palletId);
|
||||
sb.append(", stdUnitQty=").append(stdUnitQty);
|
||||
sb.append(", pkgUnitQty=").append(pkgUnitQty);
|
||||
sb.append(", transOrderNo=").append(transOrderNo);
|
||||
sb.append(", transOrderDetlNo=").append(transOrderDetlNo);
|
||||
sb.append(", operator=").append(operator);
|
||||
sb.append(", businessCls=").append(businessCls);
|
||||
sb.append(", itemCd=").append(itemCd);
|
||||
sb.append(", lotNo=").append(lotNo);
|
||||
sb.append(", subLotNo=").append(subLotNo);
|
||||
sb.append(", serialNo=").append(serialNo);
|
||||
sb.append(", reason=").append(reason);
|
||||
sb.append(", remark1=").append(remark1);
|
||||
sb.append(", remark2=").append(remark2);
|
||||
sb.append(", remark3=").append(remark3);
|
||||
sb.append(", remark4=").append(remark4);
|
||||
sb.append(", remark5=").append(remark5);
|
||||
sb.append(", serialVersionUID=").append(serialVersionUID);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.wms.mapper.stock;
|
||||
|
||||
import com.ruoyi.wms.domain.InvTransHis;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Alan Scipio
|
||||
* created on 2024/2/23
|
||||
*/
|
||||
public interface InvTransHisExtMapper {
|
||||
|
||||
List<InvTransHis> selectPageList(InvTransHis invTransHis);
|
||||
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.ruoyi.wms.service.stock;
|
||||
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import com.ruoyi.wms.domain.BaseStock;
|
||||
import com.ruoyi.wms.mapper.stock.BaseStockDynamicSqlSupport;
|
||||
import com.ruoyi.wms.mapper.stock.BaseStockExtMapper;
|
||||
import com.ruoyi.wms.mapper.stock.BaseStockMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -21,8 +20,11 @@ import java.util.Optional;
|
||||
*/
|
||||
@Service
|
||||
public class BaseStockServiceImpl implements IBaseStockService {
|
||||
|
||||
@Autowired
|
||||
private BaseStockMapper baseStockMapper;
|
||||
@Resource
|
||||
private BaseStockExtMapper baseStockExtMapper;
|
||||
|
||||
/**
|
||||
* 查询基本库存
|
||||
@@ -31,8 +33,14 @@ public class BaseStockServiceImpl implements IBaseStockService {
|
||||
* @return 基本库存
|
||||
*/
|
||||
@Override
|
||||
public BaseStock selectBaseStockByWhsCd(String whsCd) {
|
||||
Optional<BaseStock> result = baseStockMapper.selectOne(dsl -> dsl.where(BaseStockDynamicSqlSupport.whsCd, SqlBuilder.isEqualTo(whsCd)));
|
||||
public BaseStock selectBaseStockByPK(String whsCd, String stgBinCd, String itemCd, String lotNo, String subLotNo) {
|
||||
Optional<BaseStock> result = baseStockMapper.selectOne(dsl ->
|
||||
dsl.where(BaseStockDynamicSqlSupport.whsCd, SqlBuilder.isEqualTo(whsCd))
|
||||
.and(BaseStockDynamicSqlSupport.stgBinCd, SqlBuilder.isEqualTo(stgBinCd))
|
||||
.and(BaseStockDynamicSqlSupport.itemCd, SqlBuilder.isEqualTo(itemCd))
|
||||
.and(BaseStockDynamicSqlSupport.lotNo, SqlBuilder.isEqualTo(lotNo))
|
||||
.and(BaseStockDynamicSqlSupport.subLotNo, SqlBuilder.isEqualTo(subLotNo))
|
||||
);
|
||||
return result.orElse(null);
|
||||
}
|
||||
|
||||
@@ -44,17 +52,7 @@ public class BaseStockServiceImpl implements IBaseStockService {
|
||||
*/
|
||||
@Override
|
||||
public List<BaseStock> selectBaseStockList(BaseStock baseStock) {
|
||||
SelectStatementProvider provider = SqlBuilder.select(BaseStockMapper.selectList)
|
||||
.from(BaseStockDynamicSqlSupport.baseStock)
|
||||
.where(BaseStockDynamicSqlSupport.deleteFlag, SqlBuilder.isEqualTo(ExtBaseEntity.NOT_DELETE))
|
||||
.and(BaseStockDynamicSqlSupport.whsCd, SqlBuilder.isEqualToWhenPresent(baseStock.getWhsCd()))
|
||||
.and(BaseStockDynamicSqlSupport.stgBinCd, SqlBuilder.isEqualToWhenPresent(baseStock.getStgBinCd()))
|
||||
.and(BaseStockDynamicSqlSupport.itemCd, SqlBuilder.isLikeWhenPresent(baseStock.getItemCd() == null ? null : "%" + baseStock.getItemCd() + "%"))
|
||||
.and(BaseStockDynamicSqlSupport.lotNo, SqlBuilder.isLikeWhenPresent(baseStock.getLotNo() == null ? null : "%" + baseStock.getLotNo() + "%"))
|
||||
.orderBy(BaseStockDynamicSqlSupport.whsCd)
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return baseStockMapper.selectMany(provider);
|
||||
return baseStockExtMapper.selectPageList(baseStock);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,13 +11,14 @@ import java.util.List;
|
||||
* created on 2024-02-22
|
||||
*/
|
||||
public interface IBaseStockService {
|
||||
|
||||
/**
|
||||
* 查询基本库存
|
||||
*
|
||||
* @param whsCd 基本库存主键
|
||||
* @return 基本库存
|
||||
*/
|
||||
BaseStock selectBaseStockByWhsCd(String whsCd);
|
||||
BaseStock selectBaseStockByPK(String whsCd, String stgBinCd, String itemCd, String lotNo, String subLotNo);
|
||||
|
||||
/**
|
||||
* 查询基本库存列表
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.ruoyi.wms.service.stock;
|
||||
|
||||
import com.ruoyi.wms.domain.InvTransHis;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 入出库履历Service接口
|
||||
*
|
||||
* @author ryas
|
||||
* created on 2024-02-23
|
||||
*/
|
||||
public interface IInvTransHisService {
|
||||
/**
|
||||
* 查询入出库履历
|
||||
*
|
||||
* @param invTransNo 入出库履历主键
|
||||
* @return 入出库履历
|
||||
*/
|
||||
InvTransHis selectInvTransHisByInvTransNo(String invTransNo);
|
||||
|
||||
/**
|
||||
* 查询入出库履历列表
|
||||
*
|
||||
* @param invTransHis 入出库履历
|
||||
* @return 入出库履历集合
|
||||
*/
|
||||
List<InvTransHis> selectInvTransHisList(InvTransHis invTransHis);
|
||||
|
||||
/**
|
||||
* 批量删除入出库履历
|
||||
*
|
||||
* @param invTransNos 需要删除的入出库履历主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteInvTransHisByInvTransNos(String[] invTransNos);
|
||||
|
||||
/**
|
||||
* 删除入出库履历信息
|
||||
*
|
||||
* @param invTransNo 入出库履历主键
|
||||
* @return 结果
|
||||
*/
|
||||
int deleteInvTransHisByInvTransNo(String invTransNo);
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.ruoyi.wms.service.stock;
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import com.ruoyi.common.security.utils.SecurityUtilsExt;
|
||||
import com.ruoyi.wms.domain.InvTransHis;
|
||||
import com.ruoyi.wms.mapper.stock.InvTransHisDynamicSqlSupport;
|
||||
import com.ruoyi.wms.mapper.stock.InvTransHisExtMapper;
|
||||
import com.ruoyi.wms.mapper.stock.InvTransHisMapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 入出库履历Service业务层处理
|
||||
*
|
||||
* @author ryas
|
||||
* created on 2024-02-23
|
||||
*/
|
||||
@Service
|
||||
public class InvTransHisServiceImpl implements IInvTransHisService {
|
||||
|
||||
@Resource
|
||||
private InvTransHisMapper invTransHisMapper;
|
||||
@Resource
|
||||
private InvTransHisExtMapper invTransHisExtMapper;
|
||||
|
||||
/**
|
||||
* 查询入出库履历
|
||||
*
|
||||
* @param invTransNo 入出库履历主键
|
||||
* @return 入出库履历
|
||||
*/
|
||||
@Override
|
||||
public InvTransHis selectInvTransHisByInvTransNo(String invTransNo) {
|
||||
Optional<InvTransHis> result = invTransHisMapper.selectOne(dsl -> dsl.where(InvTransHisDynamicSqlSupport.invTransNo, SqlBuilder.isEqualTo(invTransNo)));
|
||||
return result.orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询入出库履历列表
|
||||
*
|
||||
* @param invTransHis 入出库履历
|
||||
* @return 入出库履历
|
||||
*/
|
||||
@Override
|
||||
public List<InvTransHis> selectInvTransHisList(InvTransHis invTransHis) {
|
||||
return invTransHisExtMapper.selectPageList(invTransHis);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除入出库履历
|
||||
*
|
||||
* @param invTransNos 需要删除的入出库履历主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteInvTransHisByInvTransNos(String[] invTransNos) {
|
||||
String userId = SecurityUtilsExt.getUserIdStr();
|
||||
UpdateStatementProvider provider = SqlBuilder.update(InvTransHisDynamicSqlSupport.invTransHis)
|
||||
.set(InvTransHisDynamicSqlSupport.deleteFlag).equalTo(ExtBaseEntity.DELETED)
|
||||
.set(InvTransHisDynamicSqlSupport.updateTime).equalTo(DateUtils.getNowDate())
|
||||
.set(InvTransHisDynamicSqlSupport.updateBy).equalTo(userId)
|
||||
.where(InvTransHisDynamicSqlSupport.invTransNo, SqlBuilder.isIn(invTransNos))
|
||||
.build()
|
||||
.render(RenderingStrategies.MYBATIS3);
|
||||
return invTransHisMapper.update(provider);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除入出库履历信息
|
||||
*
|
||||
* @param invTransNo 入出库履历主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteInvTransHisByInvTransNo(String invTransNo) {
|
||||
InvTransHis record = new InvTransHis();
|
||||
record.setInvTransNo(invTransNo);
|
||||
record.setDeleteFlag(ExtBaseEntity.DELETED);
|
||||
record.setUpdateTime(DateUtils.getNowDate());
|
||||
return invTransHisMapper.updateByPrimaryKey(record);
|
||||
}
|
||||
}
|
||||
@@ -54,12 +54,12 @@
|
||||
item.STD_UNIT_CD,
|
||||
item.PKG_UNIT_CD,
|
||||
stdUnit.UNIT_NAME as STD_UNIT_NAME,
|
||||
pkgUnit.UNIT_NAME as PKG_UNIT_NAME,
|
||||
pkgUnit.UNIT_NAME as PKG_UNIT_NAME
|
||||
from WMS_B_BASE_STOCK t
|
||||
left join WMS_M_WAREHOUSE_INFO whs on t.WHS_CD = whs.WHS_CD and whs.DELETE_FLAG = 0
|
||||
left join WMS_M_ITEM_INFO item on t.ITEM_CD = item.ITEM_CD and item.DELETE_FLAG = 0
|
||||
left join WMS_M_ITEM_UNIT_INFO stdUnit on item.STD_UNIT_CD = stdUnit.UNIT_CD and stdUnit.DELETE_FLAG = 0
|
||||
left join WMS_M_ITEM_UNIT_INFO pkgUnit on item.PKG_UNIT_CD = pkgUnit.UNIT_CD and pkgUnit.DELETE_FLAG = 0
|
||||
left join WMS_M_UNIT_INFO stdUnit on item.STD_UNIT_CD = stdUnit.UNIT_CODE and stdUnit.DELETE_FLAG = 0
|
||||
left join WMS_M_UNIT_INFO pkgUnit on item.PKG_UNIT_CD = pkgUnit.UNIT_CODE and pkgUnit.DELETE_FLAG = 0
|
||||
<where>
|
||||
and t.DELETE_FLAG = 0
|
||||
<if test="whsCd != null and whsCd != ''">
|
||||
@@ -0,0 +1,100 @@
|
||||
<?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.ruoyi.wms.mapper.stock.InvTransHisExtMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.wms.domain.InvTransHis" id="InvTransHisResult">
|
||||
<result property="deptId" column="DEPT_ID"/>
|
||||
<result property="invTransNo" column="INV_TRANS_NO"/>
|
||||
<result property="invTransType" column="INV_TRANS_TYPE"/>
|
||||
<result property="whsCd" column="WHS_CD"/>
|
||||
<result property="stgBinCd" column="STG_BIN_CD"/>
|
||||
<result property="palletId" column="PALLET_ID"/>
|
||||
<result property="stdUnitQty" column="STD_UNIT_QTY"/>
|
||||
<result property="pkgUnitQty" column="PKG_UNIT_QTY"/>
|
||||
<result property="transOrderNo" column="TRANS_ORDER_NO"/>
|
||||
<result property="transOrderDetlNo" column="TRANS_ORDER_DETL_NO"/>
|
||||
<result property="operator" column="OPERATOR"/>
|
||||
<result property="businessCls" column="BUSINESS_CLS"/>
|
||||
<result property="itemCd" column="ITEM_CD"/>
|
||||
<result property="lotNo" column="LOT_NO"/>
|
||||
<result property="subLotNo" column="SUB_LOT_NO"/>
|
||||
<result property="serialNo" column="SERIAL_NO"/>
|
||||
<result property="reason" column="REASON"/>
|
||||
<result property="remark1" column="REMARK_1"/>
|
||||
<result property="remark2" column="REMARK_2"/>
|
||||
<result property="remark3" column="REMARK_3"/>
|
||||
<result property="remark4" column="REMARK_4"/>
|
||||
<result property="remark5" column="REMARK_5"/>
|
||||
<result property="updateCount" column="UPDATE_COUNT"/>
|
||||
<result property="deleteFlag" column="DELETE_FLAG"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createByUser" column="create_by_name"/>
|
||||
<result property="stdUnitCd" column="STD_UNIT_CD"/>
|
||||
<result property="pkgUnitCd" column="PKG_UNIT_CD"/>
|
||||
<result property="stdUnitName" column="STD_UNIT_NAME"/>
|
||||
<result property="pkgUnitName" column="PKG_UNIT_NAME"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectPageList" parameterType="com.ruoyi.wms.domain.InvTransHis" resultMap="InvTransHisResult">
|
||||
select
|
||||
t.DEPT_ID,
|
||||
t.INV_TRANS_NO,
|
||||
t.INV_TRANS_TYPE,
|
||||
t.WHS_CD,
|
||||
t.STG_BIN_CD,
|
||||
t.ITEM_CD,
|
||||
t.LOT_NO,
|
||||
t.SUB_LOT_NO,
|
||||
t.STD_UNIT_QTY,
|
||||
t.PKG_UNIT_QTY,
|
||||
t.SERIAL_NO,
|
||||
t.PALLET_ID,
|
||||
t.UPDATE_COUNT,
|
||||
t.DELETE_FLAG,
|
||||
t.OPERATOR,
|
||||
t.BUSINESS_CLS,
|
||||
t.REASON,
|
||||
t.TRANS_ORDER_DETL_NO,
|
||||
t.TRANS_ORDER_NO,
|
||||
t.create_by,
|
||||
t.create_time,
|
||||
t.update_by,
|
||||
t.update_time,
|
||||
whs.WHS_NAME,
|
||||
item.ITEM_NAME,
|
||||
item.STD_UNIT_CD,
|
||||
item.PKG_UNIT_CD,
|
||||
stdUnit.UNIT_NAME as STD_UNIT_NAME,
|
||||
pkgUnit.UNIT_NAME as PKG_UNIT_NAME,
|
||||
userCreate.user_name as create_by_name
|
||||
from WMS_B_INV_TRANS_HIS t
|
||||
left join WMS_M_WAREHOUSE_INFO whs on t.WHS_CD = whs.WHS_CD and whs.DELETE_FLAG = 0
|
||||
left join WMS_M_ITEM_INFO item on t.ITEM_CD = item.ITEM_CD and item.DELETE_FLAG = 0
|
||||
left join WMS_M_UNIT_INFO stdUnit on item.STD_UNIT_CD = stdUnit.UNIT_CODE and stdUnit.DELETE_FLAG = 0
|
||||
left join WMS_M_UNIT_INFO pkgUnit on item.PKG_UNIT_CD = pkgUnit.UNIT_CODE and pkgUnit.DELETE_FLAG = 0
|
||||
left join sys_user userCreate on t.create_by = userCreate.user_id
|
||||
<where>
|
||||
and t.DELETE_FLAG = 0
|
||||
<if test="invTransType != null">
|
||||
and t.INV_TRANS_TYPE = #{invTransType}
|
||||
</if>
|
||||
<if test="whsCd != null and whsCd != ''">
|
||||
and t.WHS_CD = #{whsCd}
|
||||
</if>
|
||||
<if test="stgBinCd != null and stgBinCd != ''">
|
||||
and t.STG_BIN_CD = #{stgBinCd}
|
||||
</if>
|
||||
<if test="itemCd != null and itemCd != ''">
|
||||
and t.ITEM_CD like concat('%', #{itemCd}, '%')
|
||||
</if>
|
||||
<if test="lotNo != null and lotNo != ''">
|
||||
and t.LOT_NO like concat('%', #{lotNo}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user