优化页面,修正入库逻辑

This commit is contained in:
zgw
2025-12-22 16:44:13 +08:00
parent 34e931cf37
commit 9fc1cc53e9
10 changed files with 697 additions and 576 deletions

View File

@@ -1,54 +1,53 @@
<?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.bas.cargoSpace.mapper.BasCargoSpaceMapper">
<resultMap type="com.ruoyi.bas.cargoSpace.domain.BasCargoSpace" id="BasCargoSpaceResult">
<result property="cargoSpaceId" column="cargo_space_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseName" column="warehouse_name" />
<result property="roadwayId" column="roadway_id" />
<result property="cargoAreaId" column="cargo_area_id" />
<result property="theType" column="the_type" />
<result property="theTypeName" column="the_type_name" />
<result property="cargoSpaceName" column="cargo_space_name" />
<result property="thePlatoon" column="the_platoon" />
<result property="theColumn" column="the_column" />
<result property="theFloor" column="the_floor" />
<result property="status" column="status" />
<result property="locked" column="locked" />
<result property="trayCode" column="tray_code" />
<result property="cargoHight" column="cargo_hight" />
<result property="issDouble" column="iss_double" />
<result property="groupCodingNo" column="group_coding_no" />
<result property="groupCoding" column="group_coding" />
<result property="cargoSpaceLogo" column="cargo_space_logo" />
<result property="thisCargoArea" column="this_cargo_area" />
<result property="cargoSpaceId" column="cargo_space_id"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="warehouseName" column="warehouse_name"/>
<result property="roadwayId" column="roadway_id"/>
<result property="cargoAreaId" column="cargo_area_id"/>
<result property="theType" column="the_type"/>
<result property="theTypeName" column="the_type_name"/>
<result property="cargoSpaceName" column="cargo_space_name"/>
<result property="thePlatoon" column="the_platoon"/>
<result property="theColumn" column="the_column"/>
<result property="theFloor" column="the_floor"/>
<result property="status" column="status"/>
<result property="locked" column="locked"/>
<result property="trayCode" column="tray_code"/>
<result property="cargoHight" column="cargo_hight"/>
<result property="issDouble" column="iss_double"/>
<result property="groupCodingNo" column="group_coding_no"/>
<result property="groupCoding" column="group_coding"/>
<result property="cargoSpaceLogo" column="cargo_space_logo"/>
<result property="thisCargoArea" column="this_cargo_area"/>
</resultMap>
<sql id="selectBasCargoSpaceVo">
select
bcs.cargo_space_id,
bcs.warehouse_id,
bcs.roadway_id,
bcs.cargo_area_id,
bcs.the_type,
bcs.the_type_name,
bcs.cargo_space_name,
bcs.the_platoon,
bcs.the_column,
bcs.the_floor,
bcs.status,
bcs.locked,
bcs.tray_code,
bcs.cargo_hight,
bcs.iss_double,
bcs.group_coding_no,
bcs.group_coding,
bcs.cargo_space_logo,
bcs.this_cargo_area,
bw.warehouse_name
select bcs.cargo_space_id,
bcs.warehouse_id,
bcs.roadway_id,
bcs.cargo_area_id,
bcs.the_type,
bcs.the_type_name,
bcs.cargo_space_name,
bcs.the_platoon,
bcs.the_column,
bcs.the_floor,
bcs.status,
bcs.locked,
bcs.tray_code,
bcs.cargo_hight,
bcs.iss_double,
bcs.group_coding_no,
bcs.group_coding,
bcs.cargo_space_logo,
bcs.this_cargo_area,
bw.warehouse_name
from bas_cargo_space bcs
left join bas_warehouse bw on bcs.warehouse_id = bw.warehouse_id
@@ -57,58 +56,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectBasCargoSpaceList" resultMap="BasCargoSpaceResult">
<include refid="selectBasCargoSpaceVo"/>
<where>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and bcs.cargo_space_id like concat('%', #{cargoSpaceId}, '%')</if>
<if test="warehouseId != null and warehouseId != ''"> and bcs.warehouse_id = #{warehouseId}</if>
<if test="roadwayId != null and roadwayId != ''"> and bcs.roadway_id = #{roadwayId}</if>
<if test="cargoAreaId != null and cargoAreaId != ''"> and bcs.cargo_area_id = #{cargoAreaId}</if>
<if test="theType != null and theType != ''"> and bcs.the_type = #{theType}</if>
<if test="theTypeName != null and theTypeName != ''"> and bcs.the_type_name like concat('%', #{theTypeName}, '%')</if>
<if test="cargoSpaceName != null and cargoSpaceName != ''"> and bcs.cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
<if test="thePlatoon != null "> and bcs.the_platoon = #{thePlatoon}</if>
<if test="theColumn != null "> and bcs.the_column = #{theColumn}</if>
<if test="theFloor != null "> and bcs.the_floor = #{theFloor}</if>
<if test="status != null and status != ''"> and bcs.status = #{status}</if>
<if test="locked != null and locked != ''"> and bcs.locked = #{locked}</if>
<if test="trayCode != null and trayCode != ''"> and bcs.tray_code like concat('%', #{trayCode}, '%')</if>
<if test="cargoHight != null and cargoHight != ''"> and bcs.cargo_hight = #{cargoHight}</if>
<if test="issDouble != null and issDouble != ''"> and bcs.iss_double = #{issDouble}</if>
<if test="groupCodingNo != null and groupCodingNo != ''"> and bcs.group_coding_no = #{groupCodingNo}</if>
<if test="groupCoding != null and groupCoding != ''"> and bcs.group_coding = #{groupCoding}</if>
<if test="cargoSpaceLogo != null and cargoSpaceLogo != ''"> and bcs.cargo_space_logo = #{cargoSpaceLogo}</if>
<if test="thisCargoArea != null and thisCargoArea != ''"> and bcs.this_cargo_area = #{thisCargoArea}</if>
<if test="cargoSpaceId != null and cargoSpaceId != ''">and bcs.cargo_space_id like concat('%',
#{cargoSpaceId}, '%')
</if>
<if test="warehouseId != null and warehouseId != ''">and bcs.warehouse_id = #{warehouseId}</if>
<if test="roadwayId != null and roadwayId != ''">and bcs.roadway_id = #{roadwayId}</if>
<if test="cargoAreaId != null and cargoAreaId != ''">and bcs.cargo_area_id = #{cargoAreaId}</if>
<if test="theType != null and theType != ''">and bcs.the_type = #{theType}</if>
<if test="theTypeName != null and theTypeName != ''">and bcs.the_type_name like concat('%', #{theTypeName},
'%')
</if>
<if test="cargoSpaceName != null and cargoSpaceName != ''">and bcs.cargo_space_name like concat('%',
#{cargoSpaceName}, '%')
</if>
<if test="thePlatoon != null ">and bcs.the_platoon = #{thePlatoon}</if>
<if test="theColumn != null ">and bcs.the_column = #{theColumn}</if>
<if test="theFloor != null ">and bcs.the_floor = #{theFloor}</if>
<if test="status != null and status != ''">and bcs.status = #{status}</if>
<if test="locked != null and locked != ''">and bcs.locked = #{locked}</if>
<if test="trayCode != null and trayCode != ''">and bcs.tray_code like concat('%', #{trayCode}, '%')</if>
<if test="cargoHight != null and cargoHight != ''">and bcs.cargo_hight = #{cargoHight}</if>
<if test="issDouble != null and issDouble != ''">and bcs.iss_double = #{issDouble}</if>
<if test="groupCodingNo != null and groupCodingNo != ''">and bcs.group_coding_no = #{groupCodingNo}</if>
<if test="groupCoding != null and groupCoding != ''">and bcs.group_coding = #{groupCoding}</if>
<if test="cargoSpaceLogo != null and cargoSpaceLogo != ''">and bcs.cargo_space_logo = #{cargoSpaceLogo}
</if>
<if test="thisCargoArea != null and thisCargoArea != ''">and bcs.this_cargo_area = #{thisCargoArea}</if>
<if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">
${params.warehouseDataScope}
</if>
</where>
order by case when bcs.status='1' then 0 else 1 end asc, bcs.the_platoon asc, bcs.the_column asc, bcs.the_floor asc
order by case when bcs.status='1' then 0 else 1 end asc, bcs.the_platoon asc, bcs.the_column asc, bcs.the_floor
asc
</select>
<select id="selectBasCargoSpaceListByGroupCodingNo" parameterType="string" resultMap="BasCargoSpaceResult">
<include refid="selectBasCargoSpaceVo"/>
<where>
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and bcs.cargo_space_id like concat('%', #{cargoSpaceId}, '%')</if>
<if test="warehouseId != null and warehouseId != ''"> and bcs.warehouse_id = #{warehouseId}</if>
<if test="roadwayId != null and roadwayId != ''"> and bcs.roadway_id = #{roadwayId}</if>
<if test="cargoAreaId != null and cargoAreaId != ''"> and bcs.cargo_area_id = #{cargoAreaId}</if>
<if test="theType != null and theType != ''"> and bcs.the_type = #{theType}</if>
<if test="theTypeName != null and theTypeName != ''"> and bcs.the_type_name like concat('%', #{theTypeName}, '%')</if>
<if test="cargoSpaceName != null and cargoSpaceName != ''"> and bcs.cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
<if test="thePlatoon != null "> and bcs.the_platoon = #{thePlatoon}</if>
<if test="theColumn != null "> and bcs.the_column = #{theColumn}</if>
<if test="theFloor != null "> and bcs.the_floor = #{theFloor}</if>
<if test="status != null and status != ''"> and bcs.status = #{status}</if>
<if test="locked != null and locked != ''"> and bcs.locked = #{locked}</if>
<if test="trayCode != null and trayCode != ''"> and bcs.tray_code like concat('%', #{trayCode}, '%')</if>
<if test="cargoHight != null and cargoHight != ''"> and bcs.cargo_hight = #{cargoHight}</if>
<if test="issDouble != null and issDouble != ''"> and bcs.iss_double = #{issDouble}</if>
<if test="groupCodingNo != null and groupCodingNo != ''"> and bcs.group_coding_no = #{groupCodingNo}</if>
<if test="groupCoding != null and groupCoding != ''"> and bcs.group_coding = #{groupCoding}</if>
<if test="cargoSpaceLogo != null and cargoSpaceLogo != ''"> and bcs.cargo_space_logo = #{cargoSpaceLogo}</if>
<if test="thisCargoArea != null and thisCargoArea != ''"> and bcs.this_cargo_area = #{thisCargoArea}</if>
<!-- <if test="params.warehouseDataScope != null and params.warehouseDataScope !=''">-->
<!-- ${params.warehouseDataScope}-->
<!-- </if>-->
</where>
where
group_coding_no = #{groupCodingNo}
order by group_coding desc
</select>
@@ -140,7 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="groupCoding != null">group_coding,</if>
<if test="cargoSpaceLogo != null">cargo_space_logo,</if>
<if test="thisCargoArea != null">this_cargo_area,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
<if test="warehouseId != null and warehouseId != ''">#{warehouseId},</if>
@@ -161,7 +146,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="groupCoding != null">#{groupCoding},</if>
<if test="cargoSpaceLogo != null">#{cargoSpaceLogo},</if>
<if test="thisCargoArea != null">#{thisCargoArea},</if>
</trim>
</trim>
</insert>
<update id="updateBasCargoSpace" parameterType="BasCargoSpace">
@@ -191,14 +176,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="lockedCargoSpace">
update bas_cargo_space
set locked = #{locked}
where group_coding_no in (
select group_coding_no from bas_cargo_space where cargo_space_id = #{cargoSpaceId}
)
and group_coding > #{groupCoding}
where group_coding_no in (select group_coding_no from bas_cargo_space where cargo_space_id = #{cargoSpaceId})
and group_coding > #{groupCoding}
</update>
<delete id="deleteBasCargoSpaceByCargoSpaceId" parameterType="String">
delete from bas_cargo_space where cargo_space_id = #{cargoSpaceId}
delete
from bas_cargo_space
where cargo_space_id = #{cargoSpaceId}
</delete>
<delete id="deleteBasCargoSpaceByCargoSpaceIds" parameterType="String">
@@ -209,9 +194,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select id="selectStatusCount" resultType="java.util.Map">
SELECT
status,
COUNT(*) as count
SELECT status,
COUNT(*) as count
FROM bas_cargo_space
GROUP BY status
</select>
@@ -219,7 +203,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT TOP 1 cargo_space_id as cargoSpaceId
FROM bas_cargo_space
WHERE status = '1'
and locked = 'N'
and locked = 'N'
<if test="warehouseId != null">
and warehouse_id = #{warehouseId}
</if>
@@ -255,24 +239,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
left join bas_stock bs on bs.cargo_space_id = bcs.cargo_space_id
left join bas_product bp on bp.product_id = bs.product_id
where br.out_locked = 'N'
<if test="warehouseId != null and warehouseId != ''"> and bcs.warehouse_id = #{warehouseId}</if>
<if test="roadwayId != null and roadwayId != ''"> and bcs.roadway_id = #{roadwayId}</if>
<if test="cargoAreaId != null and cargoAreaId != ''"> and bcs.cargo_area_id = #{cargoAreaId}</if>
<if test="theType != null and theType != ''"> and bcs.the_type = #{theType}</if>
<if test="theTypeName != null and theTypeName != ''"> and bcs.the_type_name like concat('%', #{theTypeName}, '%')</if>
<if test="cargoSpaceName != null and cargoSpaceName != ''"> and bcs.cargo_space_name like concat('%', #{cargoSpaceName}, '%')</if>
<if test="thePlatoon != null "> and bcs.the_platoon = #{thePlatoon}</if>
<if test="theColumn != null "> and bcs.the_column = #{theColumn}</if>
<if test="theFloor != null "> and bcs.the_floor = #{theFloor}</if>
<if test="status != null and status != ''"> and bcs.status = #{status}</if>
<if test="locked != null and locked != ''"> and bcs.locked = #{locked}</if>
<if test="trayCode != null and trayCode != ''"> and bcs.tray_code like concat('%', #{trayCode}, '%')</if>
<if test="cargoHight != null and cargoHight != ''"> and bcs.cargo_hight = #{cargoHight}</if>
<if test="issDouble != null and issDouble != ''"> and bcs.iss_double = #{issDouble}</if>
<if test="groupCodingNo != null and groupCodingNo != ''"> and bcs.group_coding_no = #{groupCodingNo}</if>
<if test="groupCoding != null and groupCoding != ''"> and bcs.group_coding = #{groupCoding}</if>
<if test="cargoSpaceLogo != null and cargoSpaceLogo != ''"> and bcs.cargo_space_logo = #{cargoSpaceLogo}</if>
<if test="spare7 != null and spare7 != ''"> and bs.spare7 = #{spare7}</if>
<if test="stockStatus != null and stockStatus != ''"> and bs.stock_status = #{stockStatus}</if>
<if test="warehouseId != null and warehouseId != ''">and bcs.warehouse_id = #{warehouseId}</if>
<if test="roadwayId != null and roadwayId != ''">and bcs.roadway_id = #{roadwayId}</if>
<if test="cargoAreaId != null and cargoAreaId != ''">and bcs.cargo_area_id = #{cargoAreaId}</if>
<if test="theType != null and theType != ''">and bcs.the_type = #{theType}</if>
<if test="theTypeName != null and theTypeName != ''">and bcs.the_type_name like concat('%', #{theTypeName},
'%')
</if>
<if test="cargoSpaceName != null and cargoSpaceName != ''">and bcs.cargo_space_name like concat('%',
#{cargoSpaceName}, '%')
</if>
<if test="thePlatoon != null ">and bcs.the_platoon = #{thePlatoon}</if>
<if test="theColumn != null ">and bcs.the_column = #{theColumn}</if>
<if test="theFloor != null ">and bcs.the_floor = #{theFloor}</if>
<if test="status != null and status != ''">and bcs.status = #{status}</if>
<if test="locked != null and locked != ''">and bcs.locked = #{locked}</if>
<if test="trayCode != null and trayCode != ''">and bcs.tray_code like concat('%', #{trayCode}, '%')</if>
<if test="cargoHight != null and cargoHight != ''">and bcs.cargo_hight = #{cargoHight}</if>
<if test="issDouble != null and issDouble != ''">and bcs.iss_double = #{issDouble}</if>
<if test="groupCodingNo != null and groupCodingNo != ''">and bcs.group_coding_no = #{groupCodingNo}</if>
<if test="groupCoding != null and groupCoding != ''">and bcs.group_coding = #{groupCoding}</if>
<if test="cargoSpaceLogo != null and cargoSpaceLogo != ''">and bcs.cargo_space_logo = #{cargoSpaceLogo}</if>
<if test="spare7 != null and spare7 != ''">and bs.spare7 = #{spare7}</if>
<if test="stockStatus != null and stockStatus != ''">and bs.stock_status = #{stockStatus}</if>
</select>
</mapper>