feat: 成品库存查询报表、导出、超期导入、修改
This commit is contained in:
@@ -0,0 +1,102 @@
|
|||||||
|
package org.nl.b_lms.storage_manage.st.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓位库存表
|
||||||
|
*
|
||||||
|
* @Author: lyd
|
||||||
|
* @Date: 2025/6/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("st_ivt_structivt")
|
||||||
|
public class StIvtStructivt {
|
||||||
|
/**
|
||||||
|
* 库存记录标识
|
||||||
|
*/
|
||||||
|
@TableId(value = "stockrecord_id", type = IdType.NONE)
|
||||||
|
private String stockrecord_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓位标识
|
||||||
|
*/
|
||||||
|
private String struct_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓位编码
|
||||||
|
*/
|
||||||
|
private String struct_code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓位名称
|
||||||
|
*/
|
||||||
|
private String struct_name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下料区域标识
|
||||||
|
*/
|
||||||
|
private String region_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 物料标识
|
||||||
|
*/
|
||||||
|
private String material_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 品质类型
|
||||||
|
*/
|
||||||
|
private String quality_scode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批次
|
||||||
|
*/
|
||||||
|
private String pcsn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可用数
|
||||||
|
*/
|
||||||
|
private BigDecimal canuse_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 冻结数
|
||||||
|
*/
|
||||||
|
private BigDecimal frozen_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库存数
|
||||||
|
*/
|
||||||
|
private BigDecimal ivt_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 待入数
|
||||||
|
*/
|
||||||
|
private BigDecimal warehousing_qty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计量单位标识
|
||||||
|
*/
|
||||||
|
private String qtyUnit_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 入库时间
|
||||||
|
*/
|
||||||
|
private String instorage_time;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 销售单标识
|
||||||
|
*/
|
||||||
|
private String sale_id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,5 +4,13 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||||||
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface StIvtBsrealstorattrMapper extends BaseMapper<StIvtBsrealstorattr> {
|
public interface StIvtBsrealstorattrMapper extends BaseMapper<StIvtBsrealstorattr> {
|
||||||
|
/**
|
||||||
|
* 获取用户的仓库id
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> getStoreIdsForUser(String userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,7 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.nl.b_lms.storage_manage.st.dao.mapper.StIvtBsrealstorattrMapper">
|
<mapper namespace="org.nl.b_lms.storage_manage.st.dao.mapper.StIvtBsrealstorattrMapper">
|
||||||
|
|
||||||
|
<select id="getStoreIdsForUser" resultType="java.lang.String">
|
||||||
|
SELECT stor_id FROM st_ivt_userstor WHERE user_id = #{userId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.nl.b_lms.storage_manage.st.dao.mapper;
|
package org.nl.b_lms.storage_manage.st.dao.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.StIvtSectattr;
|
import org.nl.b_lms.storage_manage.st.dao.StIvtSectattr;
|
||||||
|
|
||||||
public interface StIvtSectattrMapper extends BaseMapper<StIvtSectattr> {
|
public interface StIvtSectattrMapper extends BaseMapper<StIvtSectattr> {
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package org.nl.b_lms.storage_manage.st.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivt;
|
||||||
|
import org.nl.wms.basedata.st.service.dto.ProductStoreDownDto;
|
||||||
|
import org.nl.wms.basedata.st.service.dto.ProductStoreParam;
|
||||||
|
import org.nl.wms.basedata.st.service.vo.ProductStoreVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: lyd
|
||||||
|
* @Date: 2025/6/5
|
||||||
|
*/
|
||||||
|
public interface StIvtStructivtMapper extends BaseMapper<StIvtStructivt> {
|
||||||
|
IPage<ProductStoreVo> selectProductStorePageLeftJoin(IPage<ProductStoreVo> pages, ProductStoreParam paramMap);
|
||||||
|
|
||||||
|
List<ProductStoreDownDto> productStructData(@Param("paramMap") ProductStoreParam paramMap);
|
||||||
|
}
|
||||||
@@ -0,0 +1,479 @@
|
|||||||
|
<?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="org.nl.b_lms.storage_manage.st.dao.mapper.StIvtStructivtMapper">
|
||||||
|
|
||||||
|
<select id="selectProductStorePageLeftJoin" resultType="org.nl.wms.basedata.st.service.vo.ProductStoreVo">
|
||||||
|
SELECT
|
||||||
|
a.sale_id,
|
||||||
|
a.package_box_sn,
|
||||||
|
a.paper_name,
|
||||||
|
a.paper_type,
|
||||||
|
a.ivt_qty,
|
||||||
|
a.quanlity_in_box,
|
||||||
|
a.remark,
|
||||||
|
a.stock_age,
|
||||||
|
a.joint_type,
|
||||||
|
a.sect_code,
|
||||||
|
a.stockrecord_id,
|
||||||
|
a.quality_scode,
|
||||||
|
a.sub_type,
|
||||||
|
a.warehousing_qty,
|
||||||
|
a.storagevehicle_code,
|
||||||
|
a.struct_id,
|
||||||
|
a.region_name,
|
||||||
|
a.paper_code,
|
||||||
|
a.struct_code,
|
||||||
|
a.material_name,
|
||||||
|
a.qty_unit_id,
|
||||||
|
a.canuse_qty,
|
||||||
|
a.region_id,
|
||||||
|
a.produce_age,
|
||||||
|
a.confirm_time,
|
||||||
|
a.unit_name,
|
||||||
|
a.instorage_time,
|
||||||
|
a.stor_name,
|
||||||
|
a.sect_id,
|
||||||
|
a.struct_name,
|
||||||
|
a.material_id,
|
||||||
|
a.pcsn,
|
||||||
|
a.sect_name,
|
||||||
|
a.sap_pcsn,
|
||||||
|
a.box_weight,
|
||||||
|
a.frozen_qty,
|
||||||
|
a.sale_order_name,
|
||||||
|
a.material_code
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
ivt.*,
|
||||||
|
sub.sap_pcsn,
|
||||||
|
sub.package_box_sn,
|
||||||
|
sub.quanlity_in_box,
|
||||||
|
sub.sale_order_name,
|
||||||
|
sub.box_weight,
|
||||||
|
case when plan.paper_tube_or_FRP = '1' then '纸管' when plan.paper_tube_or_FRP = '2' then 'FRP管' end AS
|
||||||
|
paper_type,
|
||||||
|
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_material when plan.paper_tube_or_FRP = '2' then
|
||||||
|
plan.FRP_material end AS paper_code,
|
||||||
|
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_description when plan.paper_tube_or_FRP = '2' then
|
||||||
|
plan.FRP_description end AS paper_name,
|
||||||
|
CASE
|
||||||
|
WHEN SUBSTRING( sub.container_name, 1, 2 ) = 'BB' THEN
|
||||||
|
CASE
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ > ]]> '150' AND DATEDIFF( NOW(), sub.date_of_production
|
||||||
|
) <![CDATA[ <= ]]> '180' THEN '2'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ <= ]]> '180' THEN '1'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ > ]]> '180' THEN '3'
|
||||||
|
END
|
||||||
|
|
||||||
|
WHEN SUBSTRING( sub.container_name, 1, 2 ) <![CDATA[ <> ]]> 'BB' THEN
|
||||||
|
CASE
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '60' AND DATEDIFF( NOW(), sub.date_of_production )
|
||||||
|
<![CDATA[ <= ]]> '90' THEN '2'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ <= ]]> '90' THEN '1'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) > '90' THEN '3'
|
||||||
|
END
|
||||||
|
END AS sub_type,
|
||||||
|
DATEDIFF( NOW(), dis.confirm_time ) AS stock_age,
|
||||||
|
DATEDIFF( NOW(), sub.date_of_production ) AS produce_age,
|
||||||
|
sub.joint_type,
|
||||||
|
dis.confirm_time
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
StructIvt.*,
|
||||||
|
attr.sect_id,
|
||||||
|
attr.sect_code,
|
||||||
|
attr.sect_name,
|
||||||
|
attr.stor_name,
|
||||||
|
attr.storagevehicle_code,
|
||||||
|
mater.material_code,
|
||||||
|
mater.material_name,
|
||||||
|
unit.unit_name,
|
||||||
|
region.region_name
|
||||||
|
FROM
|
||||||
|
ST_IVT_StructIvt StructIvt
|
||||||
|
inner JOIN st_ivt_structattr attr ON StructIvt.struct_id = attr.struct_id
|
||||||
|
inner JOIN st_ivt_sectattr sect ON sect.sect_id = attr.sect_id
|
||||||
|
inner JOIN md_me_materialbase mater ON mater.material_id = StructIvt.material_id
|
||||||
|
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = StructIvt.qty_unit_id
|
||||||
|
LEFT JOIN SCH_BASE_Region region ON region.region_id = StructIvt.region_id
|
||||||
|
WHERE 1 = 1
|
||||||
|
<if test="paramMap.in_stor_id != null and !paramMap.in_stor_id.isEmpty()">
|
||||||
|
AND attr.stor_id IN
|
||||||
|
<foreach collection="paramMap.in_stor_id" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.struct != null and paramMap.struct != ''">
|
||||||
|
AND (
|
||||||
|
StructIvt.struct_code LIKE '%${paramMap.struct}%' or
|
||||||
|
StructIvt.struct_name LIKE '%${paramMap.struct}%'
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.material != null and paramMap.material != ''">
|
||||||
|
AND (
|
||||||
|
mater.material_code LIKE '%${paramMap.material}%' or
|
||||||
|
mater.material_name LIKE '%${paramMap.material}%'
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.pcsn != null and paramMap.pcsn != ''">
|
||||||
|
AND StructIvt.pcsn LIKE '%${paramMap.pcsn}%'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.quality_scode != null and paramMap.quality_scode != ''">
|
||||||
|
AND StructIvt.quality_scode = #{paramMap.quality_scode}
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.is_virtual == '0'">
|
||||||
|
AND sect.sect_type_attr <![CDATA[ <> ]]> '09'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.is_virtual == '1'">
|
||||||
|
AND sect.sect_type_attr = '09'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.stor_id != null and paramMap.stor_id != ''">
|
||||||
|
AND attr.stor_id = #{paramMap.stor_id}
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.sect_id != null and paramMap.sect_id != ''">
|
||||||
|
AND attr.sect_id = #{paramMap.sect_id}
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.ivt_status == 'canuse_qty'">
|
||||||
|
AND StructIvt.canuse_qty <![CDATA[ > ]]> 0
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.ivt_status == 'warehousing_qty'">
|
||||||
|
AND StructIvt.warehousing_qty <![CDATA[ > ]]> 0
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.ivt_status == 'frozen_qty'">
|
||||||
|
AND StructIvt.frozen_qty <![CDATA[ > ]]> 0
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.control == '0'">
|
||||||
|
AND attr.lock_type <![CDATA[ <> ]]> '88'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.control == '1'">
|
||||||
|
AND attr.lock_type = '88'
|
||||||
|
</if>
|
||||||
|
|
||||||
|
) ivt
|
||||||
|
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = ivt.pcsn AND ivt.storagevehicle_code =
|
||||||
|
sub.package_box_sn
|
||||||
|
LEFT JOIN (SELECT
|
||||||
|
container_name,
|
||||||
|
MAX(paper_tube_or_FRP) AS paper_tube_or_FRP,
|
||||||
|
MAX(paper_tube_material) AS paper_tube_material,
|
||||||
|
MAX(paper_tube_description) AS paper_tube_description,
|
||||||
|
MAX(paper_tube_model) AS paper_tube_model,
|
||||||
|
MAX(FRP_material) AS FRP_material,
|
||||||
|
MAX(FRP_description) AS FRP_description,
|
||||||
|
MAX(FRP_model) AS FRP_model
|
||||||
|
FROM
|
||||||
|
pdm_bi_slittingproductionplan plan1
|
||||||
|
WHERE
|
||||||
|
plan1.is_delete = '0'
|
||||||
|
GROUP BY container_name) plan ON plan.container_name = sub.container_name
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
(
|
||||||
|
CASE
|
||||||
|
WHEN MAX(mst.bill_type) = '0001' THEN MIN( mst.confirm_time )
|
||||||
|
ELSE MAX( mst.confirm_time )
|
||||||
|
END
|
||||||
|
) AS confirm_time,
|
||||||
|
dis.pcsn
|
||||||
|
FROM
|
||||||
|
st_ivt_iostorinvdis dis
|
||||||
|
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||||
|
WHERE
|
||||||
|
mst.io_type = '0'
|
||||||
|
AND mst.bill_type IN ('0001','0006','0007')
|
||||||
|
AND mst.is_delete = '0'
|
||||||
|
GROUP BY
|
||||||
|
dis.pcsn
|
||||||
|
) dis ON dis.pcsn = ivt.pcsn
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
<if test="paramMap.product_area != null and !paramMap.product_area.isEmpty()">
|
||||||
|
AND LEFT(sub.container_name,2) IN
|
||||||
|
<foreach collection="paramMap.product_area" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
OR SUBSTRING(sub.container_name,2,2) IN
|
||||||
|
<foreach collection="paramMap.product_area" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.sap_pcsn != null and paramMap.sap_pcsn != ''">
|
||||||
|
AND sub.sap_pcsn LIKE '%${paramMap.sap_pcsn}%'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.package_box_sn != null and paramMap.package_box_sn != ''">
|
||||||
|
AND sub.package_box_sn LIKE '%${paramMap.package_box_sn}%'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.sale_order_name != null and paramMap.sale_order_name != ''">
|
||||||
|
AND sub.sale_order_name LIKE '%${paramMap.sale_order_name}%'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.ivt_flag != null and !paramMap.ivt_flag.isEmpty()">
|
||||||
|
AND IFNULL(sub.sub_type,'') IN
|
||||||
|
<foreach collection="paramMap.ivt_flag" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
) a
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="paramMap.sub_type != null and paramMap.sub_type != ''">
|
||||||
|
AND a.sub_type = #{paramMap.sub_type}
|
||||||
|
</if>
|
||||||
|
ORDER BY a.instorage_time DESC, a.package_box_sn
|
||||||
|
</select>
|
||||||
|
<select id="productStructData" resultType="org.nl.wms.basedata.st.service.dto.ProductStoreDownDto">
|
||||||
|
SELECT
|
||||||
|
a.sale_id,
|
||||||
|
a.paper_name,
|
||||||
|
a.thickness,
|
||||||
|
a.ivt_qty,
|
||||||
|
a.customer_description,
|
||||||
|
a.mass_per_unit_area,
|
||||||
|
a.net_weight,
|
||||||
|
a.joint_type,
|
||||||
|
a.sect_code,
|
||||||
|
a.stockrecord_id,
|
||||||
|
a.date_of_production,
|
||||||
|
a.quality_scode,
|
||||||
|
a.warehousing_qty,
|
||||||
|
a.paper_code,
|
||||||
|
a.isreprintpackageboxlabel,
|
||||||
|
a.qty_unit_id,
|
||||||
|
a.region_id,
|
||||||
|
a.thickness_request,
|
||||||
|
a.unit_name,
|
||||||
|
a.un_plan_product_property1,
|
||||||
|
a.un_plan_product_property2,
|
||||||
|
a.un_plan_product_property3,
|
||||||
|
a.pcsn,
|
||||||
|
a.sap_pcsn,
|
||||||
|
a.frozen_qty,
|
||||||
|
a.sale_order_name,
|
||||||
|
a.package_box_sn,
|
||||||
|
a.width_standard,
|
||||||
|
a.is_un_plan_production,
|
||||||
|
a.quanlity_in_box,
|
||||||
|
a.remark,
|
||||||
|
a.stock_age,
|
||||||
|
a.sub_type,
|
||||||
|
a.storagevehicle_code,
|
||||||
|
a.isunpackbox,
|
||||||
|
a.struct_id,
|
||||||
|
a.region_name,
|
||||||
|
a.lock_type,
|
||||||
|
a.struct_code,
|
||||||
|
a.material_name,
|
||||||
|
a.sales_owner,
|
||||||
|
a.canuse_qty,
|
||||||
|
a.length,
|
||||||
|
a.produce_age,
|
||||||
|
a.confirm_time,
|
||||||
|
a.paper_type,
|
||||||
|
a.instorage_time,
|
||||||
|
a.stor_name,
|
||||||
|
a.sect_id,
|
||||||
|
a.width,
|
||||||
|
a.struct_name,
|
||||||
|
a.material_id,
|
||||||
|
a.sect_name,
|
||||||
|
a.customer_name,
|
||||||
|
a.box_weight,
|
||||||
|
a.material_code
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
ivt.*,
|
||||||
|
sub.sap_pcsn,
|
||||||
|
sub.sale_order_name,
|
||||||
|
sub.customer_name,
|
||||||
|
sub.customer_description,
|
||||||
|
sub.date_of_production,
|
||||||
|
sub.width,
|
||||||
|
sub.thickness,
|
||||||
|
sub.mass_per_unit_area,
|
||||||
|
sub.net_weight,
|
||||||
|
sub.length,
|
||||||
|
sub.package_box_sn,
|
||||||
|
sub.quanlity_in_box,
|
||||||
|
sub.is_un_plan_production,
|
||||||
|
sub.un_plan_product_property1,
|
||||||
|
sub.un_plan_product_property2,
|
||||||
|
sub.un_plan_product_property3,
|
||||||
|
cust.sales_owner,
|
||||||
|
sub.isUnPackBox,
|
||||||
|
sub.isRePrintPackageBoxLabel,
|
||||||
|
sub.width_standard,
|
||||||
|
sub.thickness_request,
|
||||||
|
sub.box_weight,
|
||||||
|
case when plan.paper_tube_or_FRP = '1' then '纸管' when plan.paper_tube_or_FRP = '2' then 'FRP管' end AS
|
||||||
|
paper_type,
|
||||||
|
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_material when plan.paper_tube_or_FRP = '2' then
|
||||||
|
plan.FRP_material end AS paper_code,
|
||||||
|
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_description when plan.paper_tube_or_FRP = '2' then
|
||||||
|
plan.FRP_description end AS paper_name,
|
||||||
|
CASE
|
||||||
|
WHEN SUBSTRING( sub.container_name, 1, 2 ) = 'BB' THEN
|
||||||
|
CASE
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ > ]]> '150' AND DATEDIFF( NOW(), sub.date_of_production
|
||||||
|
) <![CDATA[ <= ]]> '180' THEN '2'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ <= ]]> '180' THEN '1'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ > ]]> '180' THEN '3'
|
||||||
|
END
|
||||||
|
|
||||||
|
WHEN SUBSTRING( sub.container_name, 1, 2 ) <![CDATA[ <> ]]> 'BB' THEN
|
||||||
|
CASE
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ > ]]> '60' AND DATEDIFF( NOW(), sub.date_of_production
|
||||||
|
) <![CDATA[ <= ]]> '90' THEN '2'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ <= ]]> '90' THEN '1'
|
||||||
|
WHEN DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ > ]]> '90' THEN '3'
|
||||||
|
END
|
||||||
|
END AS sub_type,
|
||||||
|
DATEDIFF( NOW(), dis.confirm_time ) AS stock_age,
|
||||||
|
DATEDIFF( NOW(), sub.date_of_production ) AS produce_age,
|
||||||
|
sub.joint_type,
|
||||||
|
dis.confirm_time
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
StructIvt.*,
|
||||||
|
attr.sect_id,
|
||||||
|
attr.sect_code,
|
||||||
|
attr.sect_name,
|
||||||
|
attr.stor_name,
|
||||||
|
attr.lock_type,
|
||||||
|
attr.storagevehicle_code,
|
||||||
|
mater.material_code,
|
||||||
|
mater.material_name,
|
||||||
|
unit.unit_name,
|
||||||
|
region.region_name
|
||||||
|
FROM
|
||||||
|
ST_IVT_StructIvt StructIvt
|
||||||
|
inner JOIN st_ivt_structattr attr ON StructIvt.struct_id = attr.struct_id
|
||||||
|
inner JOIN st_ivt_sectattr sect ON sect.sect_id = attr.sect_id
|
||||||
|
inner JOIN md_me_materialbase mater ON mater.material_id = StructIvt.material_id
|
||||||
|
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = StructIvt.qty_unit_id
|
||||||
|
LEFT JOIN SCH_BASE_Region region ON region.region_id = StructIvt.region_id
|
||||||
|
WHERE 1 = 1
|
||||||
|
<if test="paramMap.in_stor_id != null and !paramMap.in_stor_id.isEmpty()">
|
||||||
|
AND attr.stor_id IN
|
||||||
|
<foreach collection="paramMap.in_stor_id" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.struct != null and paramMap.struct != ''">
|
||||||
|
AND (
|
||||||
|
StructIvt.struct_code LIKE '%${paramMap.struct}%' or
|
||||||
|
StructIvt.struct_name LIKE '%${paramMap.struct}%'
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.material != null and paramMap.material != ''">
|
||||||
|
AND (
|
||||||
|
mater.material_code LIKE '%${paramMap.material}%' or
|
||||||
|
mater.material_name LIKE '%${paramMap.material}%'
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.pcsn != null and paramMap.pcsn != ''">
|
||||||
|
AND StructIvt.pcsn LIKE '%${paramMap.pcsn}%'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.quality_scode != null and paramMap.quality_scode != ''">
|
||||||
|
AND StructIvt.quality_scode = #{paramMap.quality_scode}
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.is_virtual == '0'">
|
||||||
|
AND sect.sect_type_attr <![CDATA[ <> ]]> '09'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.is_virtual == '1'">
|
||||||
|
AND sect.sect_type_attr = '09'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.stor_id != null and paramMap.stor_id != ''">
|
||||||
|
AND attr.stor_id = #{paramMap.stor_id}
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.sect_id != null and paramMap.sect_id != ''">
|
||||||
|
AND attr.sect_id = #{paramMap.sect_id}
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.ivt_status == 'canuse_qty'">
|
||||||
|
AND StructIvt.canuse_qty <![CDATA[ > ]]> 0
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.ivt_status == 'warehousing_qty'">
|
||||||
|
AND StructIvt.warehousing_qty <![CDATA[ > ]]> 0
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.ivt_status == 'frozen_qty'">
|
||||||
|
AND StructIvt.frozen_qty <![CDATA[ > ]]> 0
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.control == '0'">
|
||||||
|
AND attr.lock_type <![CDATA[ <> ]]> '88'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.control == '1'">
|
||||||
|
AND attr.lock_type = '88'
|
||||||
|
</if>
|
||||||
|
) ivt
|
||||||
|
LEFT JOIN pdm_bi_subpackagerelation sub ON sub.container_name = ivt.pcsn AND ivt.storagevehicle_code =
|
||||||
|
sub.package_box_sn
|
||||||
|
LEFT JOIN md_cs_customerbase cust ON cust.cust_code = sub.customer_name
|
||||||
|
LEFT JOIN (SELECT
|
||||||
|
container_name,
|
||||||
|
MAX(paper_tube_or_FRP) AS paper_tube_or_FRP,
|
||||||
|
MAX(paper_tube_material) AS paper_tube_material,
|
||||||
|
MAX(paper_tube_description) AS paper_tube_description,
|
||||||
|
MAX(paper_tube_model) AS paper_tube_model,
|
||||||
|
MAX(FRP_material) AS FRP_material,
|
||||||
|
MAX(FRP_description) AS FRP_description,
|
||||||
|
MAX(FRP_model) AS FRP_model
|
||||||
|
FROM
|
||||||
|
pdm_bi_slittingproductionplan plan1
|
||||||
|
WHERE
|
||||||
|
plan1.is_delete = '0'
|
||||||
|
GROUP BY container_name) plan ON plan.container_name = sub.container_name
|
||||||
|
LEFT JOIN (
|
||||||
|
SELECT
|
||||||
|
(
|
||||||
|
CASE
|
||||||
|
WHEN MAX(mst.bill_type) = '0001' THEN MIN( mst.confirm_time )
|
||||||
|
ELSE MAX( mst.confirm_time )
|
||||||
|
END
|
||||||
|
) AS confirm_time,
|
||||||
|
dis.pcsn
|
||||||
|
FROM
|
||||||
|
st_ivt_iostorinvdis dis
|
||||||
|
LEFT JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||||
|
WHERE
|
||||||
|
mst.io_type = '0'
|
||||||
|
AND mst.bill_type IN ('0001','0006','0007')
|
||||||
|
AND mst.is_delete = '0'
|
||||||
|
GROUP BY
|
||||||
|
dis.pcsn
|
||||||
|
) dis ON dis.pcsn = ivt.pcsn
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
<if test="paramMap.product_area != null and !paramMap.product_area.isEmpty()">
|
||||||
|
AND LEFT(sub.container_name,2) IN
|
||||||
|
<foreach collection="paramMap.product_area" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
OR SUBSTRING(sub.container_name,2,2) IN
|
||||||
|
<foreach collection="paramMap.product_area" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.sap_pcsn != null and paramMap.sap_pcsn != ''">
|
||||||
|
AND sub.sap_pcsn LIKE '%${paramMap.sap_pcsn}%'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.package_box_sn != null and paramMap.package_box_sn != ''">
|
||||||
|
AND sub.package_box_sn LIKE '%${paramMap.package_box_sn}%'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.sale_order_name != null and paramMap.sale_order_name != ''">
|
||||||
|
AND sub.sale_order_name LIKE '%${paramMap.sale_order_name}%'
|
||||||
|
</if>
|
||||||
|
<if test="paramMap.ivt_flag != null and !paramMap.ivt_flag.isEmpty()">
|
||||||
|
AND IFNULL(sub.sub_type,'') IN
|
||||||
|
<foreach collection="paramMap.ivt_flag" item="code" separator="," open="(" close=")">
|
||||||
|
#{code}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
) a
|
||||||
|
WHERE 1=1
|
||||||
|
<if test="paramMap.sub_type != null and paramMap.sub_type != ''">
|
||||||
|
AND a.sub_type = #{paramMap.sub_type}
|
||||||
|
</if>
|
||||||
|
order by a.instorage_time desc,a.package_box_sn
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -3,5 +3,13 @@ package org.nl.b_lms.storage_manage.st.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
||||||
|
|
||||||
public interface StIvtBsrealstorattrService extends IService<StIvtBsrealstorattr> {
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface StIvtBsrealstorattrService extends IService<StIvtBsrealstorattr> {
|
||||||
|
/**
|
||||||
|
* 获取用户对应的仓库数据
|
||||||
|
* @param userId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<String> getStoreForUser(String userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,10 @@ package org.nl.b_lms.storage_manage.st.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.StIvtSectattr;
|
||||||
|
|
||||||
|
|
||||||
public interface StIvtSectattrService extends IService<StIvtBsrealstorattr> {
|
public interface StIvtSectattrService extends IService<StIvtSectattr> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,13 @@ package org.nl.b_lms.storage_manage.st.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface StIvtStructattrService extends IService<StIvtStructattr> {
|
public interface StIvtStructattrService extends IService<StIvtStructattr> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仓位下拉
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<StIvtStructattr> getStructAttrSelectList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package org.nl.b_lms.storage_manage.st.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivt;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.basedata.st.service.dto.ProductStoreDownDto;
|
||||||
|
import org.nl.wms.basedata.st.service.dto.ProductStoreParam;
|
||||||
|
import org.nl.wms.basedata.st.service.vo.ProductStoreVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: lyd
|
||||||
|
* @Date: 2025/6/5
|
||||||
|
*/
|
||||||
|
public interface StIvtStructivtService extends IService<StIvtStructivt> {
|
||||||
|
/**
|
||||||
|
* 成品库存分页查询
|
||||||
|
* @param queryParam
|
||||||
|
* @param page
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<ProductStoreVo> getProductStorePage(ProductStoreParam queryParam, PageQuery page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成品库存导出数据
|
||||||
|
* @param queryParam
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ProductStoreDownDto> productStructData(ProductStoreParam queryParam);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过子卷号获取
|
||||||
|
* @param containerName
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
StIvtStructivt getStructByContainerName(String containerName);
|
||||||
|
}
|
||||||
@@ -1,9 +1,25 @@
|
|||||||
package org.nl.b_lms.storage_manage.st.service.impl;
|
package org.nl.b_lms.storage_manage.st.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.StIvtSectattr;
|
import org.nl.b_lms.storage_manage.st.dao.StIvtBsrealstorattr;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtBsrealstorattrMapper;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtSectattrMapper;
|
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtSectattrMapper;
|
||||||
|
import org.nl.b_lms.storage_manage.st.service.StIvtBsrealstorattrService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
public class StIvtBsrealstorattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, StIvtSectattr> implements IService<StIvtSectattr> {
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class StIvtBsrealstorattrServiceImpl extends ServiceImpl<StIvtBsrealstorattrMapper, StIvtBsrealstorattr> implements StIvtBsrealstorattrService {
|
||||||
|
@Autowired
|
||||||
|
private StIvtBsrealstorattrMapper bsrealstorattrMapper;
|
||||||
|
@Override
|
||||||
|
public List<String> getStoreForUser(String userId) {
|
||||||
|
if (ObjectUtil.isEmpty(userId)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return bsrealstorattrMapper.getStoreIdsForUser(userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
package org.nl.b_lms.storage_manage.st.service.impl;
|
package org.nl.b_lms.storage_manage.st.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.StIvtSectattr;
|
import org.nl.b_lms.storage_manage.st.dao.StIvtSectattr;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtSectattrMapper;
|
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtSectattrMapper;
|
||||||
|
import org.nl.b_lms.storage_manage.st.service.StIvtSectattrService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, StIvtSectattr> implements IService<StIvtSectattr> {
|
public class StIvtSectattrServiceImpl extends ServiceImpl<StIvtSectattrMapper, StIvtSectattr> implements StIvtSectattrService {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,23 @@
|
|||||||
package org.nl.b_lms.storage_manage.st.service.impl;
|
package org.nl.b_lms.storage_manage.st.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||||
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtStructattrMapper;
|
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtStructattrMapper;
|
||||||
|
import org.nl.b_lms.storage_manage.st.service.StIvtStructattrService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMapper, StIvtStructattr> implements IService<StIvtStructattr> {
|
public class StIvtStructattrServiceImpl extends ServiceImpl<StIvtStructattrMapper, StIvtStructattr> implements StIvtStructattrService {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<StIvtStructattr> getStructAttrSelectList() {
|
||||||
|
LambdaQueryWrapper<StIvtStructattr> lam = new QueryWrapper<StIvtStructattr>().lambda();
|
||||||
|
lam.eq(StIvtStructattr::getIs_delete, "0");
|
||||||
|
return list(lam);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package org.nl.b_lms.storage_manage.st.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivt;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.mapper.StIvtStructivtMapper;
|
||||||
|
import org.nl.b_lms.storage_manage.st.service.StIvtBsrealstorattrService;
|
||||||
|
import org.nl.b_lms.storage_manage.st.service.StIvtStructivtService;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.basedata.st.service.dto.ProductStoreDownDto;
|
||||||
|
import org.nl.wms.basedata.st.service.dto.ProductStoreParam;
|
||||||
|
import org.nl.wms.basedata.st.service.vo.ProductStoreVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: lyd
|
||||||
|
* @Date: 2025/6/5
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class StIvtStructivtServiceImpl extends ServiceImpl<StIvtStructivtMapper, StIvtStructivt> implements StIvtStructivtService {
|
||||||
|
@Autowired
|
||||||
|
private StIvtStructivtMapper stIvtStructivtMapper;
|
||||||
|
@Autowired
|
||||||
|
private StIvtBsrealstorattrService bsrealstorattrService;
|
||||||
|
@Override
|
||||||
|
public IPage<ProductStoreVo> getProductStorePage(ProductStoreParam queryParam, PageQuery page) {
|
||||||
|
//获取人员对应的仓库
|
||||||
|
List<String> storIds = bsrealstorattrService.getStoreForUser(SecurityUtils.getCurrentUserId());
|
||||||
|
queryParam.setIn_stor_id(storIds);
|
||||||
|
IPage<ProductStoreVo> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
|
pages = stIvtStructivtMapper.selectProductStorePageLeftJoin(pages, queryParam);
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProductStoreDownDto> productStructData(ProductStoreParam queryParam) {
|
||||||
|
//获取人员对应的仓库
|
||||||
|
List<String> storIds = bsrealstorattrService.getStoreForUser(SecurityUtils.getCurrentUserId());
|
||||||
|
queryParam.setIn_stor_id(storIds);
|
||||||
|
return stIvtStructivtMapper.productStructData(queryParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StIvtStructivt getStructByContainerName(String containerName) {
|
||||||
|
return getOne(new LambdaQueryWrapper<StIvtStructivt>().eq(StIvtStructivt::getPcsn, containerName));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,8 +5,11 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
|||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.TableDataInfo;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.modules.logging.annotation.Log;
|
import org.nl.modules.logging.annotation.Log;
|
||||||
import org.nl.wms.basedata.st.service.StructivtService;
|
import org.nl.wms.basedata.st.service.StructivtService;
|
||||||
|
import org.nl.wms.basedata.st.service.dto.ProductStoreParam;
|
||||||
import org.nl.wms.basedata.st.service.dto.StructivtDto;
|
import org.nl.wms.basedata.st.service.dto.StructivtDto;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -21,6 +24,7 @@ import java.io.IOException;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 成品库存查询
|
||||||
* @author geng by
|
* @author geng by
|
||||||
* @date 2022-06-02
|
* @date 2022-06-02
|
||||||
**/
|
**/
|
||||||
@@ -33,36 +37,33 @@ public class StructivtController {
|
|||||||
|
|
||||||
private final StructivtService structivtService;
|
private final StructivtService structivtService;
|
||||||
|
|
||||||
|
// @GetMapping
|
||||||
|
// @Log("查询库存管理")
|
||||||
|
// public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page, String[] product_area, String[] ivt_flag) {
|
||||||
|
// return new ResponseEntity<>(structivtService.queryAll(whereJson, page, product_area, ivt_flag), HttpStatus.OK);
|
||||||
|
//
|
||||||
|
// }
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询库存管理")
|
@Log("查询库存管理")
|
||||||
|
public ResponseEntity<Object> query(ProductStoreParam queryParam, PageQuery page) {
|
||||||
//@PreAuthorize("@el.check('structivt:list')")
|
return new ResponseEntity<>(TableDataInfo.build(structivtService.getProductStorePage(queryParam, page)), HttpStatus.OK);
|
||||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page, String[] product_area, String[] ivt_flag) {
|
|
||||||
return new ResponseEntity<>(structivtService.queryAll(whereJson, page, product_area, ivt_flag), HttpStatus.OK);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
// @PostMapping
|
||||||
@Log("新增库存管理")
|
// @Log("新增库存管理")
|
||||||
|
// public ResponseEntity<Object> create(@Validated @RequestBody StructivtDto dto) {
|
||||||
//@PreAuthorize("@el.check('structivt:add')")
|
// structivtService.create(dto);
|
||||||
public ResponseEntity<Object> create(@Validated @RequestBody StructivtDto dto) {
|
// return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
structivtService.create(dto);
|
// }
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
//
|
||||||
}
|
// @PutMapping
|
||||||
|
// @Log("修改库存管理")
|
||||||
@PutMapping
|
// public ResponseEntity<Object> update(@Validated @RequestBody StructivtDto dto) {
|
||||||
@Log("修改库存管理")
|
// structivtService.update(dto);
|
||||||
|
// return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
//@PreAuthorize("@el.check('structivt:edit')")
|
// }
|
||||||
public ResponseEntity<Object> update(@Validated @RequestBody StructivtDto dto) {
|
|
||||||
structivtService.update(dto);
|
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Log("删除库存管理")
|
@Log("删除库存管理")
|
||||||
|
|
||||||
//@PreAuthorize("@el.check('structivt:del')")
|
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||||
structivtService.deleteAll(ids);
|
structivtService.deleteAll(ids);
|
||||||
@@ -71,33 +72,31 @@ public class StructivtController {
|
|||||||
|
|
||||||
@GetMapping("/getStruct")
|
@GetMapping("/getStruct")
|
||||||
@Log("查询仓位下拉")
|
@Log("查询仓位下拉")
|
||||||
|
|
||||||
//@PreAuthorize("@el.check('structivt:list')")
|
|
||||||
public ResponseEntity<Object> getStruct() {
|
public ResponseEntity<Object> getStruct() {
|
||||||
return new ResponseEntity<>(structivtService.getStruct(), HttpStatus.OK);
|
return new ResponseEntity<>(structivtService.getStruct(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/getStructById")
|
@PostMapping("/getStructById")
|
||||||
@Log("根据仓位id查询仓位信息")
|
@Log("根据仓位id查询仓位信息")
|
||||||
|
|
||||||
//@PreAuthorize("@el.check('structivt:list')")
|
|
||||||
public ResponseEntity<Object> getStructById(@RequestBody JSONObject param) {
|
public ResponseEntity<Object> getStructById(@RequestBody JSONObject param) {
|
||||||
return new ResponseEntity<>(structivtService.getStructById(param), HttpStatus.OK);
|
return new ResponseEntity<>(structivtService.getStructById(param), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/getUnits")
|
@GetMapping("/getUnits")
|
||||||
@Log("查询计量单位下拉")
|
@Log("查询计量单位下拉")
|
||||||
|
|
||||||
//@PreAuthorize("@el.check('structivt:list')")
|
|
||||||
public ResponseEntity<Object> getUnits() {
|
public ResponseEntity<Object> getUnits() {
|
||||||
return new ResponseEntity<>(structivtService.getUnits(), HttpStatus.OK);
|
return new ResponseEntity<>(structivtService.getUnits(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Log("导出数据")
|
||||||
|
// @GetMapping(value = "/download")
|
||||||
|
// public void download(@RequestParam Map map, HttpServletResponse response, String[] product_area, String[] ivt_flag) throws IOException {
|
||||||
|
// structivtService.download(map, response, product_area, ivt_flag);
|
||||||
|
// }
|
||||||
@Log("导出数据")
|
@Log("导出数据")
|
||||||
|
|
||||||
@GetMapping(value = "/download")
|
@GetMapping(value = "/download")
|
||||||
public void download(@RequestParam Map map, HttpServletResponse response, String[] product_area, String[] ivt_flag) throws IOException {
|
public void download(ProductStoreParam queryParam, HttpServletResponse response) throws IOException {
|
||||||
structivtService.download(map, response, product_area, ivt_flag);
|
structivtService.downloadProductStructData(queryParam, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
|
|||||||
@@ -2,7 +2,11 @@ package org.nl.wms.basedata.st.service;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.wms.basedata.st.service.dto.ProductStoreParam;
|
||||||
import org.nl.wms.basedata.st.service.dto.StructivtDto;
|
import org.nl.wms.basedata.st.service.dto.StructivtDto;
|
||||||
|
import org.nl.wms.basedata.st.service.vo.ProductStoreVo;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@@ -85,4 +89,19 @@ public interface StructivtService {
|
|||||||
void save(JSONObject whereJson);
|
void save(JSONObject whereJson);
|
||||||
|
|
||||||
void importExcel(MultipartFile file, HttpServletRequest request);
|
void importExcel(MultipartFile file, HttpServletRequest request);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
* @param queryParam
|
||||||
|
* @param page
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
IPage<ProductStoreVo> getProductStorePage(ProductStoreParam queryParam, PageQuery page);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出数据
|
||||||
|
* @param queryParam
|
||||||
|
* @param response
|
||||||
|
*/
|
||||||
|
void downloadProductStructData(ProductStoreParam queryParam, HttpServletResponse response) throws IOException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package org.nl.wms.basedata.st.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成品库存导出实体
|
||||||
|
*
|
||||||
|
* @Author: lyd
|
||||||
|
* @Date: 2025/6/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProductStoreDownDto {
|
||||||
|
private String sale_id;
|
||||||
|
private String paper_name;
|
||||||
|
private String thickness;
|
||||||
|
private BigDecimal ivt_qty;
|
||||||
|
private String customer_description;
|
||||||
|
private String mass_per_unit_area;
|
||||||
|
private String net_weight;
|
||||||
|
private String joint_type;
|
||||||
|
private String sect_code;
|
||||||
|
private String stockrecord_id;
|
||||||
|
private String date_of_production;
|
||||||
|
private String quality_scode;
|
||||||
|
private BigDecimal warehousing_qty;
|
||||||
|
private String paper_code;
|
||||||
|
private String isreprintpackageboxlabel;
|
||||||
|
private String qty_unit_id;
|
||||||
|
private String region_id;
|
||||||
|
private String thickness_request;
|
||||||
|
private String unit_name;
|
||||||
|
private String un_plan_product_property1;
|
||||||
|
private String un_plan_product_property2;
|
||||||
|
private String un_plan_product_property3;
|
||||||
|
private String pcsn;
|
||||||
|
private String sap_pcsn;
|
||||||
|
private BigDecimal frozen_qty;
|
||||||
|
private String sale_order_name;
|
||||||
|
private String package_box_sn;
|
||||||
|
private String width_standard;
|
||||||
|
private String is_un_plan_production;
|
||||||
|
private String quanlity_in_box;
|
||||||
|
private String remark;
|
||||||
|
private String stock_age;
|
||||||
|
private String sub_type;
|
||||||
|
private String storagevehicle_code;
|
||||||
|
private String isunpackbox;
|
||||||
|
private String struct_id;
|
||||||
|
private String region_name;
|
||||||
|
private String lock_type;
|
||||||
|
private String struct_code;
|
||||||
|
private String material_name;
|
||||||
|
private String sales_owner;
|
||||||
|
private BigDecimal canuse_qty;
|
||||||
|
private BigDecimal length;
|
||||||
|
private String produce_age;
|
||||||
|
private String confirm_time;
|
||||||
|
private String paper_type;
|
||||||
|
private String instorage_time;
|
||||||
|
private String stor_name;
|
||||||
|
private String sect_id;
|
||||||
|
private String width;
|
||||||
|
private String struct_name;
|
||||||
|
private String material_id;
|
||||||
|
private String sect_name;
|
||||||
|
private String customer_name;
|
||||||
|
private BigDecimal box_weight;
|
||||||
|
private String material_code;
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package org.nl.wms.basedata.st.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成品库存请求参数
|
||||||
|
*
|
||||||
|
* @Author: lyd
|
||||||
|
* @Date: 2025/6/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProductStoreParam {
|
||||||
|
private String sect_id;
|
||||||
|
private String stor_id;
|
||||||
|
private String struct;
|
||||||
|
private String material;
|
||||||
|
private String package_box_sn;
|
||||||
|
private String pcsn;
|
||||||
|
private String sap_pcsn;
|
||||||
|
private String sale_order_name;
|
||||||
|
private String ivt_status;
|
||||||
|
private List<String> product_area;
|
||||||
|
private String is_virtual;
|
||||||
|
private String sub_type;
|
||||||
|
private List<String> ivt_flag;
|
||||||
|
private String quality_scode;
|
||||||
|
private String control;
|
||||||
|
/** 当前用户所能看到的仓库权限 */
|
||||||
|
private List<String> in_stor_id;
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
package org.nl.wms.basedata.st.service.enums;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 超期原因
|
||||||
|
* @Author: lyd
|
||||||
|
* @Date: 2025/6/5
|
||||||
|
*/
|
||||||
|
public enum OverdueReasonEnum {
|
||||||
|
CUSTOMER_REASONS("1", "客户原因"),
|
||||||
|
REASONS_FOR_PRODUCTION_QUALITY("2", "生产质量原因"),
|
||||||
|
MARKET_REASONS("3", "市场原因")
|
||||||
|
;
|
||||||
|
private final String code;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 静态映射表用于快速查找
|
||||||
|
*/
|
||||||
|
private static final Map<String, OverdueReasonEnum> CODE_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
// 初始化时将所有枚举值放入映射表
|
||||||
|
for (OverdueReasonEnum type : values()) {
|
||||||
|
CODE_MAP.put(type.code, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
OverdueReasonEnum(String code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code获取对应的业务类型名称
|
||||||
|
*
|
||||||
|
* @param code 类型编码
|
||||||
|
* @return 对应的业务类型名称,如果未找到返回null
|
||||||
|
*/
|
||||||
|
public static String getNameByCode(String code) {
|
||||||
|
OverdueReasonEnum type = CODE_MAP.get(code);
|
||||||
|
return type != null ? type.getName() : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code获取完整的枚举实例
|
||||||
|
*
|
||||||
|
* @param code 类型编码
|
||||||
|
* @return 对应的枚举实例,如果未找到返回null
|
||||||
|
*/
|
||||||
|
public static OverdueReasonEnum getByCode(String code) {
|
||||||
|
return CODE_MAP.get(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package org.nl.wms.basedata.st.service.enums;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: lyd
|
||||||
|
* @Date: 2025/6/5
|
||||||
|
*/
|
||||||
|
public enum SubTypeEnum {
|
||||||
|
NORMAL("1", "正常"),
|
||||||
|
NEAR_EXPIRATION_DATE("2", "临期"),
|
||||||
|
OVERDUE("3", "超期")
|
||||||
|
;
|
||||||
|
private final String code;
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 静态映射表用于快速查找
|
||||||
|
*/
|
||||||
|
private static final Map<String, SubTypeEnum> CODE_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
static {
|
||||||
|
// 初始化时将所有枚举值放入映射表
|
||||||
|
for (SubTypeEnum type : values()) {
|
||||||
|
CODE_MAP.put(type.code, type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SubTypeEnum(String code, String name) {
|
||||||
|
this.code = code;
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code获取对应的业务类型名称
|
||||||
|
*
|
||||||
|
* @param code 类型编码
|
||||||
|
* @return 对应的业务类型名称,如果未找到返回null
|
||||||
|
*/
|
||||||
|
public static String getNameByCode(String code) {
|
||||||
|
SubTypeEnum type = CODE_MAP.get(code);
|
||||||
|
return type != null ? type.getName() : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code获取完整的枚举实例
|
||||||
|
*
|
||||||
|
* @param code 类型编码
|
||||||
|
* @return 对应的枚举实例,如果未找到返回null
|
||||||
|
*/
|
||||||
|
public static SubTypeEnum getByCode(String code) {
|
||||||
|
return CODE_MAP.get(code);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,12 +8,16 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.poi.excel.ExcelReader;
|
import cn.hutool.poi.excel.ExcelReader;
|
||||||
import cn.hutool.poi.excel.ExcelUtil;
|
import cn.hutool.poi.excel.ExcelUtil;
|
||||||
import com.alibaba.excel.EasyExcel;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivt;
|
||||||
|
import org.nl.b_lms.storage_manage.st.service.StIvtStructivtService;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.common.utils.FileUtil;
|
import org.nl.modules.common.utils.FileUtil;
|
||||||
@@ -22,7 +26,12 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
|||||||
import org.nl.modules.wql.util.WqlUtil;
|
import org.nl.modules.wql.util.WqlUtil;
|
||||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||||
import org.nl.wms.basedata.st.service.StructivtService;
|
import org.nl.wms.basedata.st.service.StructivtService;
|
||||||
|
import org.nl.wms.basedata.st.service.dto.ProductStoreDownDto;
|
||||||
|
import org.nl.wms.basedata.st.service.dto.ProductStoreParam;
|
||||||
import org.nl.wms.basedata.st.service.dto.StructivtDto;
|
import org.nl.wms.basedata.st.service.dto.StructivtDto;
|
||||||
|
import org.nl.wms.basedata.st.service.enums.OverdueReasonEnum;
|
||||||
|
import org.nl.wms.basedata.st.service.enums.SubTypeEnum;
|
||||||
|
import org.nl.wms.basedata.st.service.vo.ProductStoreVo;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -44,6 +53,7 @@ import java.util.*;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class StructivtServiceImpl implements StructivtService {
|
public class StructivtServiceImpl implements StructivtService {
|
||||||
private final ClassstandardService classstandardService;
|
private final ClassstandardService classstandardService;
|
||||||
|
private final StIvtStructivtService ivtStructivtService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page, String[] product_area, String[] ivt_flag) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page, String[] product_area, String[] ivt_flag) {
|
||||||
@@ -352,10 +362,10 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void save(JSONObject whereJson) {
|
public void save(JSONObject whereJson) {
|
||||||
JSONObject jsonObject = new JSONObject();
|
LambdaUpdateWrapper<StIvtStructivt> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||||
jsonObject.put("remark", whereJson.getString("remark"));
|
lambdaUpdateWrapper.set(StIvtStructivt::getRemark, whereJson.getString("remark"))
|
||||||
|
.eq(StIvtStructivt::getStockrecord_id, whereJson.getString("stockrecord_id"));
|
||||||
WQLObject.getWQLObject("st_ivt_structivt").update(jsonObject, "stockrecord_id = '" + whereJson.getString("stockrecord_id") + "'");
|
ivtStructivtService.update(lambdaUpdateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -379,13 +389,70 @@ public class StructivtServiceImpl implements StructivtService {
|
|||||||
if (StrUtil.isEmpty(container_name) || StrUtil.isEmpty(remark)) {
|
if (StrUtil.isEmpty(container_name) || StrUtil.isEmpty(remark)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
StIvtStructivt ivtStructivt = ivtStructivtService.getStructByContainerName(container_name);
|
||||||
JSONObject ivt_jo = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0);
|
if (ObjectUtil.isEmpty(ivtStructivt)) {
|
||||||
if (ObjectUtil.isEmpty(ivt_jo)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ivt_jo.put("remark", remark);
|
ivtStructivt.setRemark(remark);
|
||||||
WQLObject.getWQLObject("st_ivt_structivt").update(ivt_jo);
|
ivtStructivtService.updateById(ivtStructivt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<ProductStoreVo> getProductStorePage(ProductStoreParam queryParam, PageQuery page) {
|
||||||
|
return ivtStructivtService.getProductStorePage(queryParam, page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void downloadProductStructData(ProductStoreParam queryParam, HttpServletResponse response) throws IOException {
|
||||||
|
List<ProductStoreDownDto> productStoreDownDtoList = ivtStructivtService.productStructData(queryParam);
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
for (int i = 0; i < productStoreDownDtoList.size(); i++) {
|
||||||
|
ProductStoreDownDto productStoreDownDto = productStoreDownDtoList.get(i);
|
||||||
|
Map<String, Object> mp = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
mp.put("仓库", productStoreDownDto.getStor_name());
|
||||||
|
mp.put("库区", productStoreDownDto.getSect_name());
|
||||||
|
mp.put("仓位编码", productStoreDownDto.getStruct_code());
|
||||||
|
mp.put("仓位名称", productStoreDownDto.getStruct_name());
|
||||||
|
mp.put("木箱码", productStoreDownDto.getPackage_box_sn());
|
||||||
|
mp.put("物料编码", productStoreDownDto.getMaterial_code());
|
||||||
|
mp.put("物料名称", productStoreDownDto.getMaterial_name());
|
||||||
|
mp.put("子卷号", productStoreDownDto.getPcsn());
|
||||||
|
mp.put("sap批次", productStoreDownDto.getSap_pcsn());
|
||||||
|
mp.put("重量", productStoreDownDto.getCanuse_qty());
|
||||||
|
mp.put("单位", productStoreDownDto.getUnit_name());
|
||||||
|
mp.put("客户编码", productStoreDownDto.getCustomer_name());
|
||||||
|
mp.put("客户名称", productStoreDownDto.getCustomer_description());
|
||||||
|
mp.put("销售订单", productStoreDownDto.getSale_order_name());
|
||||||
|
mp.put("业务员", productStoreDownDto.getSales_owner());
|
||||||
|
mp.put("入库日期", productStoreDownDto.getConfirm_time());
|
||||||
|
mp.put("生产日期", productStoreDownDto.getDate_of_production());
|
||||||
|
mp.put("子卷状态", SubTypeEnum.getNameByCode(productStoreDownDto.getSub_type()));
|
||||||
|
mp.put("库龄", productStoreDownDto.getStock_age());
|
||||||
|
mp.put("生产时长", productStoreDownDto.getProduce_age());
|
||||||
|
mp.put("产品规格(幅宽)", String.format("%.0f", Double.parseDouble(ObjectUtil.isNotEmpty(productStoreDownDto.getWidth()) ? productStoreDownDto.getWidth() : "0.0")));
|
||||||
|
mp.put("产品厚度", productStoreDownDto.getThickness());
|
||||||
|
mp.put("单位面积重量", productStoreDownDto.getMass_per_unit_area());
|
||||||
|
mp.put("净重", productStoreDownDto.getNet_weight());
|
||||||
|
mp.put("毛重", productStoreDownDto.getBox_weight());
|
||||||
|
mp.put("长度", productStoreDownDto.getLength());
|
||||||
|
mp.put("接头数", productStoreDownDto.getJoint_type());
|
||||||
|
mp.put("计划外分切的子卷", productStoreDownDto.getIs_un_plan_production());
|
||||||
|
mp.put("子卷的物性值1", productStoreDownDto.getUn_plan_product_property1());
|
||||||
|
mp.put("子卷的物性值2", productStoreDownDto.getUn_plan_product_property2());
|
||||||
|
mp.put("子卷的物性值3", productStoreDownDto.getUn_plan_product_property3());
|
||||||
|
mp.put("超期原因", OverdueReasonEnum.getNameByCode(productStoreDownDto.getRemark()));
|
||||||
|
mp.put("是否管控", productStoreDownDto.getLock_type().equals("88") ? "是" : "否");
|
||||||
|
mp.put("是否需要重打外包装标签", productStoreDownDto.getIsreprintpackageboxlabel());
|
||||||
|
mp.put("是否需要拆包重打子卷标签", productStoreDownDto.getIsunpackbox());
|
||||||
|
mp.put("客户要求规格幅宽", productStoreDownDto.getWidth_standard());
|
||||||
|
mp.put("物料标准厚度", productStoreDownDto.getThickness_request());
|
||||||
|
mp.put("管件类型", productStoreDownDto.getPaper_type());
|
||||||
|
mp.put("管件编码", productStoreDownDto.getPaper_code());
|
||||||
|
mp.put("管件描述", productStoreDownDto.getPaper_name());
|
||||||
|
list.add(mp);
|
||||||
|
}
|
||||||
|
FileUtil.downloadExcel(list, response);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package org.nl.wms.basedata.st.service.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.nl.b_lms.storage_manage.st.dao.StIvtStructivt;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成品库存vo
|
||||||
|
* @Author: lyd
|
||||||
|
* @Date: 2025/6/5
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProductStoreVo extends StIvtStructivt implements Serializable {
|
||||||
|
private String sale_id;
|
||||||
|
private String package_box_sn;
|
||||||
|
private String paper_name;
|
||||||
|
private String paper_type;
|
||||||
|
private BigDecimal ivt_qty;
|
||||||
|
private Integer quanlity_in_box;
|
||||||
|
private String remark;
|
||||||
|
private String stock_age;
|
||||||
|
private String joint_type;
|
||||||
|
private String sect_code;
|
||||||
|
private String stockrecord_id;
|
||||||
|
private String quality_scode;
|
||||||
|
private String sub_type;
|
||||||
|
private BigDecimal warehousing_qty;
|
||||||
|
private String storagevehicle_code;
|
||||||
|
private String struct_id;
|
||||||
|
private String region_name;
|
||||||
|
private String paper_code;
|
||||||
|
private String struct_code;
|
||||||
|
private String material_name;
|
||||||
|
private String qty_unit_id;
|
||||||
|
private BigDecimal canuse_qty;
|
||||||
|
private String region_id;
|
||||||
|
private String produce_age;
|
||||||
|
private String confirm_time;
|
||||||
|
private String unit_name;
|
||||||
|
private String instorage_time;
|
||||||
|
private String stor_name;
|
||||||
|
private String sect_id;
|
||||||
|
private String struct_name;
|
||||||
|
private String material_id;
|
||||||
|
private String pcsn;
|
||||||
|
private String sect_name;
|
||||||
|
private String sap_pcsn;
|
||||||
|
private BigDecimal box_weight;
|
||||||
|
private BigDecimal frozen_qty;
|
||||||
|
private String sale_order_name;
|
||||||
|
private String material_code;
|
||||||
|
}
|
||||||
@@ -20,6 +20,7 @@ import java.io.IOException;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 入库查询
|
||||||
* @author Liuxy
|
* @author Liuxy
|
||||||
* @date 2023-04-07
|
* @date 2023-04-07
|
||||||
**/
|
**/
|
||||||
@@ -34,7 +35,6 @@ public class InBillQueryController {
|
|||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询")
|
@Log("查询")
|
||||||
|
|
||||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page, String[] product_area) {
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page, String[] product_area) {
|
||||||
return new ResponseEntity<>(inBillQueryService.queryAll(whereJson, page, product_area), HttpStatus.OK);
|
return new ResponseEntity<>(inBillQueryService.queryAll(whereJson, page, product_area), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import java.io.IOException;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 出库查询
|
||||||
* @author Liuxy
|
* @author Liuxy
|
||||||
* @date 2023-04-07
|
* @date 2023-04-07
|
||||||
**/
|
**/
|
||||||
|
|||||||
Reference in New Issue
Block a user