feat: 成品出库查询、导出
This commit is contained in:
@@ -0,0 +1,174 @@
|
||||
package org.nl.b_lms.pdm.subpackagerelation.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/5
|
||||
*/
|
||||
@Data
|
||||
@TableName("pdm_bi_subpackagerelationrecord")
|
||||
public class PdmBiSubpackagerelationrecord extends Model<PdmBiSubpackagerelationrecord> {
|
||||
|
||||
private static final long serialVersionUID = -7739291296662381393L;
|
||||
|
||||
/** 记录标识 */
|
||||
@TableId(value = "record_id", type = IdType.NONE)
|
||||
private String record_id;
|
||||
|
||||
/** 子卷包装标识 */
|
||||
private String workorder_id;
|
||||
|
||||
/** 木箱唯一码 */
|
||||
private String package_box_sn;
|
||||
|
||||
/** 箱内子卷数量 */
|
||||
private BigDecimal quanlity_in_box;
|
||||
|
||||
/** 木箱自身重量 */
|
||||
private BigDecimal box_weight;
|
||||
|
||||
/** 保质期 */
|
||||
private String quality_guaran_period;
|
||||
|
||||
/** 销售订单及行号 */
|
||||
private String sale_order_name;
|
||||
|
||||
/** 客户编号 */
|
||||
private String customer_name;
|
||||
|
||||
/** 客户名称 */
|
||||
private String customer_description;
|
||||
|
||||
/** 产品编码 */
|
||||
private String product_name;
|
||||
|
||||
/** 产品描述 */
|
||||
private String product_description;
|
||||
|
||||
/** 入库日期 */
|
||||
private String date_of_FG_inbound;
|
||||
|
||||
/** 子卷号 */
|
||||
private String container_name;
|
||||
|
||||
/** 产品规格(幅宽) */
|
||||
private String width;
|
||||
|
||||
/** 产品厚度 */
|
||||
private String thickness;
|
||||
|
||||
/** 单位面积质量 */
|
||||
private BigDecimal mass_per_unit_area;
|
||||
|
||||
/** 净重 */
|
||||
private BigDecimal net_weight;
|
||||
|
||||
/** 长度 */
|
||||
private BigDecimal length;
|
||||
|
||||
/** 制造完成日期 */
|
||||
private String date_of_production;
|
||||
|
||||
/** 计划外分切的子卷 */
|
||||
private String is_un_plan_production;
|
||||
|
||||
/** 子卷的物性值1 */
|
||||
private String un_plan_product_property1;
|
||||
|
||||
/** 子卷的物性值2 */
|
||||
private String un_plan_product_property2;
|
||||
|
||||
/** 子卷的物性值3 */
|
||||
private String un_plan_product_property3;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 创建人 */
|
||||
private String create_id;
|
||||
|
||||
/** 创建人姓名 */
|
||||
private String create_name;
|
||||
|
||||
/** 创建时间 */
|
||||
private String create_time;
|
||||
|
||||
/** 状态 */
|
||||
private String status;
|
||||
|
||||
/** 是否需要重打外包装标签 */
|
||||
private String isRePrintPackageBoxLabel;
|
||||
|
||||
/** 是否需要拆包重打子卷标签 */
|
||||
private String isUnPackBox;
|
||||
|
||||
/** 木箱料号 */
|
||||
private String box_type;
|
||||
|
||||
/** SAP批次 */
|
||||
private String sap_pcsn;
|
||||
|
||||
/** 来源交货单 */
|
||||
private String vbeln;
|
||||
|
||||
/** 来源交货单行 */
|
||||
private String posnr;
|
||||
|
||||
/** 长 */
|
||||
private String box_length;
|
||||
|
||||
/** 宽 */
|
||||
private String box_width;
|
||||
|
||||
/** 高 */
|
||||
private String box_high;
|
||||
|
||||
/** 销售订单描述 */
|
||||
private String sale_order_description;
|
||||
|
||||
/** 客户要求规格幅宽 */
|
||||
private String width_standard;
|
||||
|
||||
/** 物料标准厚度 */
|
||||
private String thickness_request;
|
||||
|
||||
/** 实际木箱自身重量 */
|
||||
private BigDecimal real_weight;
|
||||
|
||||
/** 包装关系类型 */
|
||||
private String sub_type;
|
||||
|
||||
/** 客户需求抗拉下限 */
|
||||
private String demand_limit;
|
||||
|
||||
/** 内控标准抗拉下限 */
|
||||
private String standard_limit;
|
||||
|
||||
/** 生产实际抗拉值 */
|
||||
private String actual_value;
|
||||
|
||||
/** 解绑删除标识 */
|
||||
private String need_delete;
|
||||
|
||||
/** 单据编号 */
|
||||
private String bill_code;
|
||||
|
||||
/** 单据标识 */
|
||||
private String bill_id;
|
||||
|
||||
/** 单据类型 */
|
||||
private String bill_type;
|
||||
|
||||
/** 创建时间 */
|
||||
private String insert_time;
|
||||
|
||||
/** 出入库单类型 */
|
||||
private String io_type;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package org.nl.b_lms.pdm.subpackagerelation.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelationrecord;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/5
|
||||
*/
|
||||
public interface PdmBiSubpackagerelationrecordMapper extends BaseMapper<PdmBiSubpackagerelationrecord> {
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?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.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationrecordMapper">
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.b_lms.pdm.subpackagerelation.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelationrecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/5
|
||||
*/
|
||||
public interface IPdmBiSubpackagerelationrecordService extends IService<PdmBiSubpackagerelationrecord> {
|
||||
/**
|
||||
* 根据子卷号获取
|
||||
* @param pcsns
|
||||
* @return
|
||||
*/
|
||||
List<PdmBiSubpackagerelationrecord> getAllByPcsn(List<String> pcsns);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.nl.b_lms.pdm.subpackagerelation.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelationrecord;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationrecordMapper;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IPdmBiSubpackagerelationrecordService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/5
|
||||
*/
|
||||
@Service
|
||||
public class PdmBiSubpackagerelationrecordServiceImpl extends ServiceImpl<PdmBiSubpackagerelationrecordMapper, PdmBiSubpackagerelationrecord> implements IPdmBiSubpackagerelationrecordService {
|
||||
@Override
|
||||
public List<PdmBiSubpackagerelationrecord> getAllByPcsn(List<String> pcsns) {
|
||||
LambdaQueryWrapper<PdmBiSubpackagerelationrecord> lam = new LambdaQueryWrapper<>();
|
||||
lam.eq(PdmBiSubpackagerelationrecord::getIo_type, "0")
|
||||
.in(PdmBiSubpackagerelationrecord::getContainer_name, pcsns)
|
||||
.orderByAsc(PdmBiSubpackagerelationrecord::getInsert_time);
|
||||
return list(lam);
|
||||
}
|
||||
}
|
||||
@@ -6,12 +6,13 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.stat.service.dto.InBillPageParam;
|
||||
import org.nl.wms.stat.service.dto.OutBillPageParam;
|
||||
import org.nl.wms.stat.service.vo.InBillPageVo;
|
||||
import org.nl.wms.stat.service.vo.OutBillPageVo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -62,5 +63,20 @@ public interface IStIvtIostorinvdisService extends IService<StIvtIostorinvdis> {
|
||||
* @return
|
||||
*/
|
||||
List<InBillPageVo> getInBillDatas(InBillPageParam paramMap);
|
||||
|
||||
/**
|
||||
* 成品出库分页查询
|
||||
* @param paramMap 参数
|
||||
* @param page 分页数据
|
||||
* @return
|
||||
*/
|
||||
IPage<OutBillPageVo> getOutBillPage(OutBillPageParam paramMap, PageQuery page);
|
||||
|
||||
/**
|
||||
* 出库库存导出数据
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
List<OutBillPageVo> getOutBillData(OutBillPageParam paramMap);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,9 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinvdis;
|
||||
import org.nl.wms.stat.service.dto.InBillPageParam;
|
||||
import org.nl.wms.stat.service.dto.OutBillPageParam;
|
||||
import org.nl.wms.stat.service.vo.InBillPageVo;
|
||||
import org.nl.wms.stat.service.vo.OutBillPageVo;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -78,4 +80,13 @@ public interface StIvtIostorinvdisMapper extends BaseMapper<StIvtIostorinvdis> {
|
||||
List<InBillPageVo> getInBillData(@Param("paramMap") InBillPageParam paramMap);
|
||||
|
||||
List<InBillPageVo> getInBillAllData(@Param("paramMap") InBillPageParam paramMap);
|
||||
/**
|
||||
* 查询成品出库全部分页数据
|
||||
* @param pages
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
IPage<OutBillPageVo> selectOutBillPageLeftJoin(IPage<OutBillPageVo> pages, OutBillPageParam paramMap);
|
||||
|
||||
List<OutBillPageVo> getOutBillData(@Param("paramMap") OutBillPageParam paramMap);
|
||||
}
|
||||
|
||||
@@ -815,6 +815,254 @@
|
||||
mst.iostorinv_id,
|
||||
dis.box_no
|
||||
</select>
|
||||
<select id="selectOutBillPageLeftJoin" resultType="org.nl.wms.stat.service.vo.OutBillPageVo">
|
||||
SELECT
|
||||
mst.stor_name,
|
||||
mst.input_time,
|
||||
mst.bill_type,
|
||||
mst.confirm_time,
|
||||
mst.estimated_freight,
|
||||
mst.input_optname,
|
||||
mst.remark,
|
||||
dtl.vbeln,
|
||||
base.cust_name,
|
||||
dis.sect_name,
|
||||
dis.box_no,
|
||||
dis.qty_unit_name,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
c.pcsn,
|
||||
sub.sap_pcsn,
|
||||
sub.net_weight,
|
||||
sub.customer_name,
|
||||
sub.customer_description,
|
||||
sub.sale_order_name,
|
||||
cust.sales_owner,
|
||||
sub.width,
|
||||
sub.thickness,
|
||||
sub.mass_per_unit_area,
|
||||
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,
|
||||
stor.stor_name AS in_stor_name
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
MAX( a.iostorinvdis_id ) AS iostorinvdis_id,
|
||||
a.pcsn
|
||||
FROM
|
||||
st_ivt_iostorinvdis a
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '1'
|
||||
AND b.bill_status = '99'
|
||||
AND b.is_delete = '0'
|
||||
<if test="paramMap.bill_types != null and !paramMap.bill_types.isEmpty()">
|
||||
AND b.bill_type IN
|
||||
<foreach collection="paramMap.bill_types" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.stor_id != null and paramMap.stor_id != ''">
|
||||
AND b.stor_id = #{paramMap.stor_id}
|
||||
</if>
|
||||
<if test="paramMap.pcsns != null and !paramMap.pcsns.isEmpty()">
|
||||
AND a.pcsn IN
|
||||
<foreach collection="paramMap.pcsns" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
|
||||
AND b.confirm_time <![CDATA[ >= ]]> #{paramMap.begin_time}
|
||||
</if>
|
||||
<if test="paramMap.end_time != null and paramMap.end_time != ''">
|
||||
AND b.confirm_time <![CDATA[ <= ]]> #{paramMap.end_time}
|
||||
</if>
|
||||
GROUP BY
|
||||
a.pcsn
|
||||
) AS c
|
||||
inner JOIN st_ivt_iostorinvdis dis ON dis.iostorinvdis_id = c.iostorinvdis_id
|
||||
inner JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
inner JOIN st_ivt_iostorinvdtl dtl ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id
|
||||
LEFT JOIN md_cs_transportationbase base ON base.cust_code = mst.trans_code
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dis.material_id
|
||||
LEFT JOIN st_ivt_bsrealstorattr stor ON stor.stor_id = mst.out_stor_id
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
record.bill_code,
|
||||
record.container_name,
|
||||
record.package_box_sn,
|
||||
record.sap_pcsn,
|
||||
max(record.customer_name) as customer_name,
|
||||
max(record.customer_description) as customer_description,
|
||||
max(record.width) as width,
|
||||
max(record.thickness) as thickness,
|
||||
max(record.mass_per_unit_area) as mass_per_unit_area,
|
||||
max(record.net_weight) as net_weight,
|
||||
max(record.sale_order_name) as sale_order_name,
|
||||
max(record.bill_id) as bill_id,
|
||||
COUNT( * ) AS num
|
||||
FROM
|
||||
pdm_bi_subpackagerelationrecord record
|
||||
where 1=1
|
||||
<if test="paramMap.with != null and paramMap.with != ''">
|
||||
AND CONCAT(record.width,'*',record.thickness) = #{paramMap.with}
|
||||
</if>
|
||||
<if test="paramMap.customer_name != null and paramMap.customer_name != ''">
|
||||
AND (record.customer_name LIKE #{paramMap.customer_name} OR record.customer_description LIKE
|
||||
#{paramMap.customer_name})
|
||||
</if>
|
||||
GROUP BY
|
||||
record.bill_code,
|
||||
record.container_name,
|
||||
record.sap_pcsn,
|
||||
record.package_box_sn) sub ON (sub.container_name = dis.pcsn AND sub.package_box_sn = dis.box_no AND sub.bill_id
|
||||
= mst.iostorinv_id)
|
||||
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
|
||||
WHERE 1=1
|
||||
ORDER BY mst.input_time DESC,dis.box_no
|
||||
</select>
|
||||
<select id="getOutBillData" resultType="org.nl.wms.stat.service.vo.OutBillPageVo">
|
||||
SELECT
|
||||
mst.stor_name,
|
||||
mst.input_time,
|
||||
mst.bill_type,
|
||||
mst.confirm_time,
|
||||
mst.estimated_freight,
|
||||
mst.input_optname,
|
||||
mst.remark,
|
||||
dtl.vbeln,
|
||||
base.cust_name,
|
||||
dis.sect_name,
|
||||
dis.box_no,
|
||||
dis.qty_unit_name,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
c.pcsn,
|
||||
sub.sap_pcsn,
|
||||
sub.net_weight,
|
||||
sub.customer_name,
|
||||
sub.customer_description,
|
||||
sub.sale_order_name,
|
||||
cust.sales_owner,
|
||||
sub.width,
|
||||
sub.thickness,
|
||||
sub.mass_per_unit_area,
|
||||
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,
|
||||
stor.stor_name AS in_stor_name
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
MAX( a.iostorinvdis_id ) AS iostorinvdis_id,
|
||||
a.pcsn
|
||||
FROM
|
||||
st_ivt_iostorinvdis a
|
||||
LEFT JOIN st_ivt_iostorinv b ON a.iostorinv_id = b.iostorinv_id
|
||||
WHERE
|
||||
b.io_type = '1'
|
||||
AND b.bill_status = '99'
|
||||
AND b.is_delete = '0'
|
||||
<if test="paramMap.bill_types != null and !paramMap.bill_types.isEmpty()">
|
||||
AND b.bill_type IN
|
||||
<foreach collection="paramMap.bill_types" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.stor_id != null and paramMap.stor_id != ''">
|
||||
AND b.stor_id = #{paramMap.stor_id}
|
||||
</if>
|
||||
<if test="paramMap.pcsns != null and !paramMap.pcsns.isEmpty()">
|
||||
AND a.pcsn IN
|
||||
<foreach collection="paramMap.pcsns" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
|
||||
AND b.confirm_time <![CDATA[ >= ]]> #{paramMap.begin_time}
|
||||
</if>
|
||||
<if test="paramMap.end_time != null and paramMap.end_time != ''">
|
||||
AND b.confirm_time <![CDATA[ <= ]]> #{paramMap.end_time}
|
||||
</if>
|
||||
GROUP BY
|
||||
a.pcsn
|
||||
) AS c
|
||||
inner JOIN st_ivt_iostorinvdis dis ON dis.iostorinvdis_id = c.iostorinvdis_id
|
||||
inner JOIN st_ivt_iostorinv mst ON mst.iostorinv_id = dis.iostorinv_id
|
||||
inner JOIN st_ivt_iostorinvdtl dtl ON dtl.iostorinvdtl_id = dis.iostorinvdtl_id
|
||||
LEFT JOIN md_cs_transportationbase base ON base.cust_code = mst.trans_code
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dis.material_id
|
||||
LEFT JOIN st_ivt_bsrealstorattr stor ON stor.stor_id = mst.out_stor_id
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
record.bill_code,
|
||||
record.container_name,
|
||||
record.package_box_sn,
|
||||
record.sap_pcsn,
|
||||
max(record.customer_name) as customer_name,
|
||||
max(record.customer_description) as customer_description,
|
||||
max(record.width) as width,
|
||||
max(record.thickness) as thickness,
|
||||
max(record.mass_per_unit_area) as mass_per_unit_area,
|
||||
max(record.net_weight) as net_weight,
|
||||
max(record.sale_order_name) as sale_order_name,
|
||||
max(record.bill_id) as bill_id,
|
||||
COUNT( * ) AS num
|
||||
FROM
|
||||
pdm_bi_subpackagerelationrecord record
|
||||
where 1=1
|
||||
<if test="paramMap.with != null and paramMap.with != ''">
|
||||
AND CONCAT(record.width,'*',record.thickness) = #{paramMap.with}
|
||||
</if>
|
||||
<if test="paramMap.customer_name != null and paramMap.customer_name != ''">
|
||||
AND (record.customer_name LIKE #{paramMap.customer_name} OR record.customer_description LIKE
|
||||
#{paramMap.customer_name})
|
||||
</if>
|
||||
GROUP BY
|
||||
record.bill_code,
|
||||
record.container_name,
|
||||
record.sap_pcsn,
|
||||
record.package_box_sn) sub ON (sub.container_name = dis.pcsn AND sub.package_box_sn = dis.box_no AND sub.bill_id
|
||||
= mst.iostorinv_id)
|
||||
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
|
||||
WHERE 1=1
|
||||
limit 0,50000
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.b_lms.storage_manage.ios.service.iostorInv.impl;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -20,7 +21,9 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.stat.service.dto.InBillPageParam;
|
||||
import org.nl.wms.stat.service.dto.OutBillPageParam;
|
||||
import org.nl.wms.stat.service.vo.InBillPageVo;
|
||||
import org.nl.wms.stat.service.vo.OutBillPageVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -214,4 +217,74 @@ public class StIvtIostorinvdisServiceImpl extends ServiceImpl<StIvtIostorinvdisM
|
||||
return stIvtIostorinvdisMapper.getInBillAllData(paramMap);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<OutBillPageVo> getOutBillPage(OutBillPageParam paramMap, PageQuery page) {
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(paramMap.getPcsn())){
|
||||
// 判断是否有空格
|
||||
boolean matches = paramMap.getPcsn().matches(".*\\s.*");
|
||||
List<String> pcsnList = new ArrayList<>();
|
||||
|
||||
if (matches) {
|
||||
String[] pcsns = paramMap.getPcsn().split(" ");
|
||||
for (int i = 0; i < pcsns.length; i++) {
|
||||
pcsnList.add(pcsns[i]);
|
||||
}
|
||||
} else {
|
||||
pcsnList.add(paramMap.getPcsn());
|
||||
}
|
||||
paramMap.setPcsns(pcsnList);
|
||||
}
|
||||
// 处理时间
|
||||
if (ObjectUtil.isNotEmpty(paramMap.getBegin_time()) && ObjectUtil.isNotEmpty(paramMap.getEnd_time())) {
|
||||
String begin_time_today = paramMap.getBegin_time().substring(0, 10);
|
||||
String end_time_today = paramMap.getEnd_time().substring(0, 10);
|
||||
// 开始时间
|
||||
String today_begin_time = begin_time_today + " 08:00:00";
|
||||
// 结束时间:19:59:59
|
||||
DateTime parse = DateUtil.parse(end_time_today);
|
||||
String substring = DateUtil.offsetDay(parse, 1).toString().substring(0, 10);
|
||||
String today_end_time = substring + " 07:59:59";
|
||||
paramMap.setBegin_time(today_begin_time);
|
||||
paramMap.setEnd_time(today_end_time);
|
||||
}
|
||||
IPage<OutBillPageVo> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
pages = stIvtIostorinvdisMapper.selectOutBillPageLeftJoin(pages, paramMap);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OutBillPageVo> getOutBillData(OutBillPageParam paramMap) {
|
||||
// 空格查询
|
||||
if (StrUtil.isNotEmpty(paramMap.getPcsn())){
|
||||
// 判断是否有空格
|
||||
boolean matches = paramMap.getPcsn().matches(".*\\s.*");
|
||||
List<String> pcsnList = new ArrayList<>();
|
||||
|
||||
if (matches) {
|
||||
String[] pcsns = paramMap.getPcsn().split(" ");
|
||||
for (int i = 0; i < pcsns.length; i++) {
|
||||
pcsnList.add(pcsns[i]);
|
||||
}
|
||||
} else {
|
||||
pcsnList.add(paramMap.getPcsn());
|
||||
}
|
||||
paramMap.setPcsns(pcsnList);
|
||||
}
|
||||
// 处理时间
|
||||
if (ObjectUtil.isNotEmpty(paramMap.getBegin_time()) && ObjectUtil.isNotEmpty(paramMap.getEnd_time())) {
|
||||
String begin_time_today = paramMap.getBegin_time().substring(0, 10);
|
||||
String end_time_today = paramMap.getEnd_time().substring(0, 10);
|
||||
// 开始时间
|
||||
String today_begin_time = begin_time_today + " 08:00:00";
|
||||
// 结束时间:19:59:59
|
||||
DateTime parse = DateUtil.parse(end_time_today);
|
||||
String substring = DateUtil.offsetDay(parse, 1).toString().substring(0, 10);
|
||||
String today_end_time = substring + " 07:59:59";
|
||||
paramMap.setBegin_time(today_begin_time);
|
||||
paramMap.setEnd_time(today_end_time);
|
||||
}
|
||||
return stIvtIostorinvdisMapper.getOutBillData(paramMap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,57 +39,18 @@ public class InBillQueryController {
|
||||
return new ResponseEntity<>(inBillQueryService.queryAll(whereJson, page, product_area), HttpStatus.OK);
|
||||
}
|
||||
|
||||
// @GetMapping(value = "/query2")
|
||||
// @Log("查询")
|
||||
//
|
||||
// public ResponseEntity<Object> query2(@RequestParam Map whereJson, Pageable page, String[] product_area, String[] stor_id) {
|
||||
// return new ResponseEntity<>(inBillQueryService.queryAll2(whereJson, page, product_area, stor_id), HttpStatus.OK);
|
||||
// }
|
||||
|
||||
// 已修改
|
||||
@GetMapping(value = "/query2")
|
||||
@Log("查询")
|
||||
public ResponseEntity<Object> query2(InBillPageParam whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(inBillQueryService.getPage2(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增")
|
||||
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody JSONObject dto) {
|
||||
inBillQueryService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改")
|
||||
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody JSONObject dto) {
|
||||
inBillQueryService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除")
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
inBillQueryService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("导出数据")
|
||||
|
||||
@GetMapping(value = "/download")
|
||||
public void download(@RequestParam Map map, HttpServletResponse response, String[] product_area) throws IOException {
|
||||
inBillQueryService.download(map, response, product_area);
|
||||
}
|
||||
|
||||
// @Log("导出数据2")
|
||||
// @GetMapping(value = "/download2")
|
||||
// public void download2(@RequestParam Map map, HttpServletResponse response, String[] product_area,String[] stor_id) throws IOException {
|
||||
// inBillQueryService.download2(map, response, product_area,stor_id);
|
||||
// }
|
||||
|
||||
@GetMapping(value = "/download2")
|
||||
@Log("导出成品入库数据")
|
||||
public void downloadInBillTable(HttpServletResponse response, InBillPageParam whereJson, PageQuery page) throws IOException {
|
||||
|
||||
@@ -4,8 +4,11 @@ package org.nl.wms.stat.rest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.wms.stat.service.OutBillQueryService;
|
||||
import org.nl.wms.stat.service.dto.OutBillPageParam;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -32,53 +35,25 @@ public class OutBillQueryController {
|
||||
|
||||
@GetMapping
|
||||
@Log("查询")
|
||||
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page, String[] bill_types) {
|
||||
return new ResponseEntity<>(outBillQueryService.queryAll(whereJson, page, bill_types), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/query2")
|
||||
@Log("新查询")
|
||||
|
||||
public ResponseEntity<Object> query2(@RequestParam Map whereJson, Pageable page, String[] bill_types) {
|
||||
return new ResponseEntity<>(outBillQueryService.queryAll2(whereJson, page, bill_types), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增")
|
||||
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody JSONObject dto) {
|
||||
outBillQueryService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改")
|
||||
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody JSONObject dto) {
|
||||
outBillQueryService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除")
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
outBillQueryService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
public ResponseEntity<Object> query2(OutBillPageParam paramMap, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(outBillQueryService.getPage2(paramMap, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("导出数据")
|
||||
|
||||
@GetMapping(value = "/download")
|
||||
public void download(@RequestParam Map map, HttpServletResponse response, String[] bill_types) throws IOException {
|
||||
outBillQueryService.download(map, response, bill_types);
|
||||
}
|
||||
|
||||
@Log("导出数据2")
|
||||
|
||||
@GetMapping(value = "/download2")
|
||||
public void download2(@RequestParam Map map, HttpServletResponse response, String[] bill_types) throws IOException {
|
||||
outBillQueryService.download2(map, response, bill_types);
|
||||
public void downloadOutBillData(OutBillPageParam paramMap, HttpServletResponse response) throws IOException {
|
||||
outBillQueryService.downloadOutBillData(paramMap, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package org.nl.wms.stat.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.stat.service.dto.OutBillPageParam;
|
||||
import org.nl.wms.stat.service.vo.OutBillPageVo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -59,4 +63,8 @@ public interface OutBillQueryService {
|
||||
void download(Map map, HttpServletResponse response, String[] bill_types) throws IOException;
|
||||
|
||||
void download2(Map map, HttpServletResponse response, String[] bill_types) throws IOException;
|
||||
}
|
||||
|
||||
IPage<OutBillPageVo> getPage2(OutBillPageParam paramMap, PageQuery page);
|
||||
|
||||
void downloadOutBillData(OutBillPageParam paramMap, HttpServletResponse response);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.wms.stat.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出库库存分页查询参数
|
||||
*
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/5
|
||||
*/
|
||||
@Data
|
||||
public class OutBillPageParam implements Serializable {
|
||||
private String stor_id;
|
||||
private List<String> bill_types;
|
||||
private String begin_time;
|
||||
private String end_time;
|
||||
private String with;
|
||||
private String customer_name;
|
||||
private String pcsn;
|
||||
private List<String> pcsns;
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import java.util.Map;
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/4
|
||||
*/
|
||||
public enum BillTypeEnum {
|
||||
public enum InBillTypeEnum {
|
||||
PRODUCTION_IN("0001", "生产入库"),
|
||||
RETURN_IN("0002", "退货入库"),
|
||||
SCRAP_IN("0003", "报废入库"),
|
||||
@@ -16,7 +16,8 @@ public enum BillTypeEnum {
|
||||
UNPACKING_IN("0005", "拆箱入库"),
|
||||
RECHECK_IN("0006", "返检入库"),
|
||||
TRIMMING_IN("0007", "改切入库"),
|
||||
MANUAL_IN("0009", "手工入库");
|
||||
MANUAL_IN("0009", "手工入库")
|
||||
;
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
@@ -24,16 +25,16 @@ public enum BillTypeEnum {
|
||||
/**
|
||||
* 静态映射表用于快速查找
|
||||
*/
|
||||
private static final Map<String, BillTypeEnum> CODE_MAP = new HashMap<>();
|
||||
private static final Map<String, InBillTypeEnum> CODE_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
// 初始化时将所有枚举值放入映射表
|
||||
for (BillTypeEnum type : values()) {
|
||||
for (InBillTypeEnum type : values()) {
|
||||
CODE_MAP.put(type.code, type);
|
||||
}
|
||||
}
|
||||
|
||||
BillTypeEnum(String code, String name) {
|
||||
InBillTypeEnum(String code, String name) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
}
|
||||
@@ -52,7 +53,7 @@ public enum BillTypeEnum {
|
||||
* @return 对应的业务类型名称,如果未找到返回null
|
||||
*/
|
||||
public static String getNameByCode(String code) {
|
||||
BillTypeEnum type = CODE_MAP.get(code);
|
||||
InBillTypeEnum type = CODE_MAP.get(code);
|
||||
return type != null ? type.getName() : "";
|
||||
}
|
||||
|
||||
@@ -61,7 +62,7 @@ public enum BillTypeEnum {
|
||||
* @param code 类型编码
|
||||
* @return 对应的枚举实例,如果未找到返回null
|
||||
*/
|
||||
public static BillTypeEnum getByCode(String code) {
|
||||
public static InBillTypeEnum getByCode(String code) {
|
||||
return CODE_MAP.get(code);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package org.nl.wms.stat.service.enums;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 出库类型枚举
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/6
|
||||
*/
|
||||
public enum OutBillTypeEnum {
|
||||
;
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
|
||||
/**
|
||||
* 静态映射表用于快速查找
|
||||
*/
|
||||
private static final Map<String, OutBillTypeEnum> CODE_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
// 初始化时将所有枚举值放入映射表
|
||||
for (OutBillTypeEnum type : values()) {
|
||||
CODE_MAP.put(type.code, type);
|
||||
}
|
||||
}
|
||||
|
||||
OutBillTypeEnum(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) {
|
||||
OutBillTypeEnum type = getByCode(code);
|
||||
return type != null ? type.getName() : "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据code获取完整的枚举实例
|
||||
* @param code 类型编码
|
||||
* @return 对应的枚举实例,如果未找到返回null
|
||||
*/
|
||||
public static OutBillTypeEnum getByCode(String code) {
|
||||
return CODE_MAP.get(code);
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.stat.service.InBillQueryService;
|
||||
import org.nl.wms.stat.service.dto.InBillPageParam;
|
||||
import org.nl.wms.stat.service.enums.BillTypeEnum;
|
||||
import org.nl.wms.stat.service.enums.InBillTypeEnum;
|
||||
import org.nl.wms.stat.service.vo.InBillPageVo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -580,7 +580,7 @@ public class InBillQueryServiceImpl implements InBillQueryService {
|
||||
}
|
||||
// 业务类型
|
||||
String bill_type1 = billPageVo.getBill_type();
|
||||
mp.put("业务类型", BillTypeEnum.getNameByCode(bill_type1));
|
||||
mp.put("业务类型", InBillTypeEnum.getNameByCode(bill_type1));
|
||||
mp.put("客户编码", billPageVo.getCustomer_name());
|
||||
mp.put("客户名称", billPageVo.getCust_name());
|
||||
mp.put("业务员", billPageVo.getSales_owner());
|
||||
|
||||
@@ -2,16 +2,20 @@ package org.nl.wms.stat.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelationrecord;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IPdmBiSubpackagerelationrecordService;
|
||||
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvdisService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.FileUtil;
|
||||
@@ -20,16 +24,19 @@ import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.stat.service.OutBillQueryService;
|
||||
import org.nl.wms.stat.service.dto.OutBillPageParam;
|
||||
import org.nl.wms.stat.service.enums.OutBillTypeEnum;
|
||||
import org.nl.wms.stat.service.vo.OutBillPageVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -46,6 +53,10 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
|
||||
@Autowired
|
||||
private IpdmBiSubpackagerelationService ipdmBiSubpackagerelationService;
|
||||
@Resource
|
||||
private IStIvtIostorinvdisService iostorinvdisService;
|
||||
@Resource
|
||||
private IPdmBiSubpackagerelationrecordService subpackagerelationrecordService;
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page, String[] bill_types) {
|
||||
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
||||
@@ -467,4 +478,148 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
new FileUtil().downloadExcelIO(list,col,response);
|
||||
// FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<OutBillPageVo> getPage2(OutBillPageParam paramMap, PageQuery page) {
|
||||
IPage<OutBillPageVo> pages = iostorinvdisService.getOutBillPage(paramMap, page);
|
||||
// 查询此子卷转单之前的销售订单号
|
||||
List<OutBillPageVo> pageRecords = pages.getRecords();
|
||||
// 获取所有子卷号
|
||||
List<String> pcsns = pageRecords.stream()
|
||||
.map(OutBillPageVo::getPcsn)
|
||||
.collect(Collectors.toList());
|
||||
if (pcsns.size() == 0) {
|
||||
return pages;
|
||||
}
|
||||
List<PdmBiSubpackagerelationrecord> recodes = subpackagerelationrecordService.getAllByPcsn(pcsns);
|
||||
pages.getRecords().forEach(bill -> {
|
||||
PdmBiSubpackagerelationrecord subpackagerelationrecord = recodes.stream()
|
||||
.filter(r -> r.getContainer_name().equals(bill.getPcsn()))
|
||||
.min(Comparator.comparing(PdmBiSubpackagerelationrecord::getInsert_time))
|
||||
.orElse(null);
|
||||
bill.setOld_sale_order_name(ObjectUtil.isEmpty(subpackagerelationrecord)
|
||||
? bill.getSale_order_name()
|
||||
: subpackagerelationrecord.getSale_order_name());
|
||||
});
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadOutBillData(OutBillPageParam paramMap, HttpServletResponse response) {
|
||||
List<OutBillPageVo> outBillPageVos = iostorinvdisService.getOutBillData(paramMap);
|
||||
// 获取所有子卷号
|
||||
List<String> pcsns = outBillPageVos.stream()
|
||||
.map(OutBillPageVo::getPcsn)
|
||||
.collect(Collectors.toList());
|
||||
ConcurrentLinkedDeque<List<JSONObject>> deque = new ConcurrentLinkedDeque<>();
|
||||
Lists.partition(pcsns,500).stream()
|
||||
.map((Function<List<String>, CompletableFuture>) o->CompletableFuture.runAsync(() -> {
|
||||
List<JSONObject> subList = ipdmBiSubpackagerelationService.recordQuery(o);
|
||||
deque.add(subList);
|
||||
})).parallel().forEach(CompletableFuture::join);
|
||||
List<JSONObject> datas = new ArrayList<>();
|
||||
for (List<JSONObject> jsonObjects : deque) {
|
||||
datas.addAll(jsonObjects);
|
||||
}
|
||||
List<Map<String, String>> list = new ArrayList<>();
|
||||
for (int i = 0; i < outBillPageVos.size(); i++) {
|
||||
OutBillPageVo outBillPageVo = outBillPageVos.get(i);
|
||||
Map<String, String> mp = new LinkedHashMap<>();
|
||||
// 查询第一次入库的源销售订单
|
||||
JSONObject jsonSub = datas.stream()
|
||||
.filter(row -> row.getString("container_name").equals(outBillPageVo.getPcsn()))
|
||||
.min(Comparator.comparing(row -> row.getString("insert_time")))
|
||||
.orElse(null);
|
||||
|
||||
mp.put("仓库", outBillPageVo.getStor_name());
|
||||
if (ObjectUtil.isNotEmpty(outBillPageVo.getBill_type()) && "1004".equals(outBillPageVo.getBill_type())) {
|
||||
mp.put("移入仓库", outBillPageVo.getIn_stor_name());
|
||||
}
|
||||
mp.put("库区", outBillPageVo.getSect_name());
|
||||
mp.put("生产区域", outBillPageVo.getPcsn().substring(0, 2));
|
||||
mp.put("业务类型", OutBillTypeEnum.getNameByCode(outBillPageVo.getBill_type()));
|
||||
mp.put("交货单号", outBillPageVo.getVbeln());
|
||||
mp.put("物流公司", outBillPageVo.getCust_name());
|
||||
mp.put("运费", outBillPageVo.getEstimated_freight());
|
||||
mp.put("木箱号", outBillPageVo.getBox_no());
|
||||
mp.put("物料编码", outBillPageVo.getMaterial_code());
|
||||
mp.put("物料名称", outBillPageVo.getMaterial_name());
|
||||
mp.put("子卷号", outBillPageVo.getPcsn());
|
||||
mp.put("sap批次", outBillPageVo.getSap_pcsn());
|
||||
mp.put("净重", outBillPageVo.getNet_weight());
|
||||
mp.put("单位", outBillPageVo.getQty_unit_name());
|
||||
mp.put("管件类型", outBillPageVo.getPaper_type());
|
||||
mp.put("管件编码", outBillPageVo.getPaper_code());
|
||||
mp.put("管件描述", outBillPageVo.getPaper_name());
|
||||
mp.put("客户编码", outBillPageVo.getCustomer_name());
|
||||
mp.put("发货客户名称", outBillPageVo.getCustomer_description());
|
||||
mp.put("销售订单", outBillPageVo.getSale_order_name());
|
||||
mp.put("行号", "");
|
||||
mp.put("原销售订单", outBillPageVo.getSale_order_name());
|
||||
mp.put("原行号", "");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(outBillPageVo.getSale_order_name())) {
|
||||
try {
|
||||
mp.put("销售订单", outBillPageVo.getSale_order_name().substring(0, outBillPageVo.getSale_order_name().indexOf("-")));
|
||||
mp.put("行号", outBillPageVo.getSale_order_name().substring(outBillPageVo.getSale_order_name().indexOf("-") + 1, outBillPageVo.getSale_order_name().length()));
|
||||
} catch (Exception e) {
|
||||
mp.put("销售订单", outBillPageVo.getSale_order_name());
|
||||
mp.put("行号", "");
|
||||
}
|
||||
}
|
||||
// 原销售订单
|
||||
if (ObjectUtil.isEmpty(jsonSub)) {
|
||||
if (ObjectUtil.isNotEmpty(outBillPageVo.getSale_order_name())) {
|
||||
try {
|
||||
mp.put("原销售订单", outBillPageVo.getSale_order_name().substring(0, outBillPageVo.getSale_order_name().indexOf("-")));
|
||||
mp.put("原行号", outBillPageVo.getSale_order_name().substring(outBillPageVo.getSale_order_name().indexOf("-") + 1, outBillPageVo.getSale_order_name().length()));
|
||||
} catch (Exception e) {
|
||||
mp.put("原销售订单", outBillPageVo.getSale_order_name());
|
||||
mp.put("原行号", "");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ObjectUtil.isNotEmpty(jsonSub.getString("sale_order_name"))) {
|
||||
try {
|
||||
mp.put("原销售订单", jsonSub.getString("sale_order_name").substring(0, jsonSub.getString("sale_order_name").indexOf("-")));
|
||||
mp.put("原行号", jsonSub.getString("sale_order_name").substring(jsonSub.getString("sale_order_name").indexOf("-") + 1, jsonSub.getString("sale_order_name").length()));
|
||||
} catch (Exception e) {
|
||||
mp.put("原销售订单", jsonSub.getString("sale_order_name"));
|
||||
mp.put("原行号", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
mp.put("业务员", outBillPageVo.getSales_owner());
|
||||
mp.put("出库日期", outBillPageVo.getInput_time());
|
||||
mp.put("产品规格", String.format("%.0f", getWidthValue(outBillPageVo.getWidth())));
|
||||
mp.put("产品厚度", outBillPageVo.getThickness());
|
||||
mp.put("单位面积", outBillPageVo.getMass_per_unit_area());
|
||||
mp.put("制单人", outBillPageVo.getInput_optname());
|
||||
mp.put("备注", outBillPageVo.getRemark());
|
||||
list.add(mp);
|
||||
}
|
||||
Set<String> set = list.get(0).keySet();
|
||||
int colIndex = 0;
|
||||
String[] col = new String[set.size()];
|
||||
for (String s : set) {
|
||||
col[colIndex]=s;
|
||||
colIndex++;
|
||||
}
|
||||
new FileUtil().downloadExcelIO(list,col,response);
|
||||
}
|
||||
|
||||
private static double getWidthValue(String widthStr) {
|
||||
double widthValue = 0.0;
|
||||
if (widthStr != null && !widthStr.trim().isEmpty()) {
|
||||
try {
|
||||
// 移除逗号并解析为Double
|
||||
String cleanedStr = widthStr.replaceAll(",", "");
|
||||
widthValue = Double.parseDouble(cleanedStr);
|
||||
} catch (NumberFormatException e) {
|
||||
// 解析失败时使用默认值(或根据业务需求处理)
|
||||
widthValue = 0.0;
|
||||
}
|
||||
}
|
||||
return widthValue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.nl.wms.stat.service.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/5
|
||||
*/
|
||||
@Data
|
||||
public class OutBillPageVo implements Serializable {
|
||||
private String stor_name;
|
||||
private String input_time;
|
||||
private String bill_type;
|
||||
private String confirm_time;
|
||||
private String estimated_freight;
|
||||
private String input_optname;
|
||||
private String remark;
|
||||
private String vbeln;
|
||||
private String cust_name;
|
||||
private String sect_name;
|
||||
private String box_no;
|
||||
private String qty_unit_name;
|
||||
private String material_code;
|
||||
private String material_name;
|
||||
private String pcsn;
|
||||
private String sap_pcsn;
|
||||
private String net_weight;
|
||||
private String customer_name;
|
||||
private String customer_description;
|
||||
private String sale_order_name;
|
||||
private String sales_owner;
|
||||
private String width;
|
||||
private String thickness;
|
||||
private String mass_per_unit_area;
|
||||
private String old_sale_order_name;
|
||||
private String paper_type;
|
||||
private String paper_code;
|
||||
private String paper_name;
|
||||
private String in_stor_name;
|
||||
}
|
||||
Reference in New Issue
Block a user