feat: 临期库存查询、导出
This commit is contained in:
@@ -293,10 +293,10 @@
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '0'">
|
||||
<if test="paramMap.is_virtual == 0">
|
||||
AND sect.sect_type_attr <![CDATA[ <> ]]> '09'
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '1'">
|
||||
<if test="paramMap.is_virtual == 1">
|
||||
AND sect.sect_type_attr = '09'
|
||||
</if>
|
||||
<if test="paramMap.product_area != null and !paramMap.product_area.isEmpty()">
|
||||
@@ -333,11 +333,11 @@
|
||||
<if test="paramMap.with != null and paramMap.with != ''">
|
||||
AND CONCAT( sub.thickness_request,'*',sub.width) = #{paramMap.with}
|
||||
</if>
|
||||
<if test="paramMap.classes == '1'">
|
||||
<if test="paramMap.classes == 1">
|
||||
AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'08:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '19:59:59'
|
||||
</if>
|
||||
<if test="paramMap.classes == '2'">
|
||||
<if test="paramMap.classes == 2">
|
||||
AND (DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'20:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '23:59:59'
|
||||
OR
|
||||
@@ -430,10 +430,10 @@
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '0'">
|
||||
<if test="paramMap.is_virtual == 0">
|
||||
AND sect.sect_type_attr <![CDATA[ <> ]]> '09'
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '1'">
|
||||
<if test="paramMap.is_virtual == 1">
|
||||
AND sect.sect_type_attr = '09'
|
||||
</if>
|
||||
<if test="paramMap.product_area != null and !paramMap.product_area.isEmpty()">
|
||||
@@ -464,12 +464,12 @@
|
||||
<if test="paramMap.with != null and paramMap.with != ''">
|
||||
AND CONCAT( sub.thickness_request,'*',sub.width) = #{paramMap.with}
|
||||
</if>
|
||||
<if test="paramMap.classes == '1'">
|
||||
<if test="paramMap.classes == 1">
|
||||
AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'08:00:00' AND DATE_FORMAT(
|
||||
mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '19:59:59'
|
||||
</if>
|
||||
<if test="paramMap.classes == '2'">
|
||||
<if test="paramMap.classes == 2">
|
||||
AND (DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'20:00:00' AND DATE_FORMAT(
|
||||
mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '23:59:59'
|
||||
@@ -627,10 +627,10 @@
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '0'">
|
||||
<if test="paramMap.is_virtual == 0">
|
||||
AND sect.sect_type_attr <![CDATA[ <> ]]> '09'
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '1'">
|
||||
<if test="paramMap.is_virtual == 1">
|
||||
AND sect.sect_type_attr = '09'
|
||||
</if>
|
||||
<if test="paramMap.product_area != null and !paramMap.product_area.isEmpty()">
|
||||
@@ -667,11 +667,11 @@
|
||||
<if test="paramMap.with != null and paramMap.with != ''">
|
||||
AND CONCAT( sub.thickness_request,'*',sub.width) = #{paramMap.with}
|
||||
</if>
|
||||
<if test="paramMap.classes == '1'">
|
||||
<if test="paramMap.classes == 1">
|
||||
AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'08:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '19:59:59'
|
||||
</if>
|
||||
<if test="paramMap.classes == '2'">
|
||||
<if test="paramMap.classes == 2">
|
||||
AND (DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'20:00:00' AND DATE_FORMAT( mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '23:59:59'
|
||||
OR
|
||||
@@ -764,10 +764,10 @@
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '0'">
|
||||
<if test="paramMap.is_virtual == 0">
|
||||
AND sect.sect_type_attr <![CDATA[ <> ]]> '09'
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '1'">
|
||||
<if test="paramMap.is_virtual == 1">
|
||||
AND sect.sect_type_attr = '09'
|
||||
</if>
|
||||
<if test="paramMap.product_area != null and !paramMap.product_area.isEmpty()">
|
||||
@@ -798,12 +798,12 @@
|
||||
<if test="paramMap.with != null and paramMap.with != ''">
|
||||
AND CONCAT( sub.thickness_request,'*',sub.width) = #{paramMap.with}
|
||||
</if>
|
||||
<if test="paramMap.classes == '1'">
|
||||
<if test="paramMap.classes == 1">
|
||||
AND DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'08:00:00' AND DATE_FORMAT(
|
||||
mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '19:59:59'
|
||||
</if>
|
||||
<if test="paramMap.classes == '2'">
|
||||
<if test="paramMap.classes == 2">
|
||||
AND (DATE_FORMAT( mst.confirm_time, '%H:%i:%s' ) <![CDATA[ >= ]]>'20:00:00' AND DATE_FORMAT(
|
||||
mst.confirm_time,
|
||||
'%H:%i:%s' ) <![CDATA[ <= ]]> '23:59:59'
|
||||
|
||||
@@ -4,9 +4,12 @@ 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.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 org.nl.wms.stat.service.dto.PastStructPageParam;
|
||||
import org.nl.wms.stat.service.vo.PastStructPageVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,4 +21,8 @@ public interface StIvtStructivtMapper extends BaseMapper<StIvtStructivt> {
|
||||
IPage<ProductStoreVo> selectProductStorePageLeftJoin(IPage<ProductStoreVo> pages, ProductStoreParam paramMap);
|
||||
|
||||
List<ProductStoreDownDto> productStructData(@Param("paramMap") ProductStoreParam paramMap);
|
||||
|
||||
IPage<PastStructPageVo> getPastStructPage(IPage<PastStructPageVo> pages, @Param("paramMap") PastStructPageParam paramMap);
|
||||
|
||||
List<PastStructPageVo> getPastStructDatas(@Param("paramMap") PastStructPageParam paramMap);
|
||||
}
|
||||
|
||||
@@ -123,10 +123,10 @@
|
||||
<if test="paramMap.quality_scode != null and paramMap.quality_scode != ''">
|
||||
AND StructIvt.quality_scode = #{paramMap.quality_scode}
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '0'">
|
||||
<if test="paramMap.is_virtual == 0">
|
||||
AND sect.sect_type_attr <![CDATA[ <> ]]> '09'
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '1'">
|
||||
<if test="paramMap.is_virtual == 1">
|
||||
AND sect.sect_type_attr = '09'
|
||||
</if>
|
||||
<if test="paramMap.stor_id != null and paramMap.stor_id != ''">
|
||||
@@ -144,10 +144,10 @@
|
||||
<if test="paramMap.ivt_status == 'frozen_qty'">
|
||||
AND StructIvt.frozen_qty <![CDATA[ > ]]> 0
|
||||
</if>
|
||||
<if test="paramMap.control == '0'">
|
||||
<if test="paramMap.control == 0">
|
||||
AND attr.lock_type <![CDATA[ <> ]]> '88'
|
||||
</if>
|
||||
<if test="paramMap.control == '1'">
|
||||
<if test="paramMap.control == 1">
|
||||
AND attr.lock_type = '88'
|
||||
</if>
|
||||
|
||||
@@ -378,10 +378,10 @@
|
||||
<if test="paramMap.quality_scode != null and paramMap.quality_scode != ''">
|
||||
AND StructIvt.quality_scode = #{paramMap.quality_scode}
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '0'">
|
||||
<if test="paramMap.is_virtual == 0">
|
||||
AND sect.sect_type_attr <![CDATA[ <> ]]> '09'
|
||||
</if>
|
||||
<if test="paramMap.is_virtual == '1'">
|
||||
<if test="paramMap.is_virtual == 1">
|
||||
AND sect.sect_type_attr = '09'
|
||||
</if>
|
||||
<if test="paramMap.stor_id != null and paramMap.stor_id != ''">
|
||||
@@ -399,10 +399,10 @@
|
||||
<if test="paramMap.ivt_status == 'frozen_qty'">
|
||||
AND StructIvt.frozen_qty <![CDATA[ > ]]> 0
|
||||
</if>
|
||||
<if test="paramMap.control == '0'">
|
||||
<if test="paramMap.control == 0">
|
||||
AND attr.lock_type <![CDATA[ <> ]]> '88'
|
||||
</if>
|
||||
<if test="paramMap.control == '1'">
|
||||
<if test="paramMap.control == 1">
|
||||
AND attr.lock_type = '88'
|
||||
</if>
|
||||
) ivt
|
||||
@@ -476,4 +476,194 @@
|
||||
</if>
|
||||
order by a.instorage_time desc,a.package_box_sn
|
||||
</select>
|
||||
<select id="getPastStructPage" resultType="org.nl.wms.stat.service.vo.PastStructPageVo">
|
||||
SELECT
|
||||
attr.stor_name,
|
||||
attr.sect_name,
|
||||
attr.struct_code,
|
||||
sub.package_box_sn,
|
||||
sub.quanlity_in_box,
|
||||
sub.customer_name,
|
||||
sub.customer_description,
|
||||
sub.sale_order_name,
|
||||
ivt.pcsn,
|
||||
sub.sap_pcsn,
|
||||
sub.product_name,
|
||||
sub.product_description,
|
||||
sub.width,
|
||||
sub.thickness,
|
||||
sub.mass_per_unit_area,
|
||||
ivt.canuse_qty,
|
||||
sub.length,
|
||||
sub.date_of_production,
|
||||
sub.date_of_FG_inbound,
|
||||
sub.box_weight,
|
||||
sub.quality_guaran_period,
|
||||
sub.un_plan_product_property1,
|
||||
sub.un_plan_product_property2,
|
||||
sub.un_plan_product_property3,
|
||||
sub.box_type,
|
||||
sub.box_length,
|
||||
sub.box_width,
|
||||
sub.box_high,
|
||||
sub.remark,
|
||||
DATEDIFF( NOW(), ivt.instorage_time ) AS sid_day,
|
||||
cust.sales_owner
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON ivt.pcsn = sub.container_name
|
||||
LEFT JOIN md_cs_customerbase cust ON cust.cust_code = sub.customer_name
|
||||
WHERE
|
||||
1 = 1
|
||||
AND ivt.canuse_qty > 0
|
||||
<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.material_code != null and paramMap.material_code != ''">
|
||||
AND (
|
||||
sub.product_name LIKE '%${paramMap.material_code}%' or
|
||||
sub.product_description LIKE '%${paramMap.material_code}%'
|
||||
)
|
||||
</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.container_name != null and paramMap.container_name != ''">
|
||||
AND sub.container_name LIKE '%${paramMap.container_name}%'
|
||||
</if>
|
||||
<if test="paramMap.sap_pcsn != null and paramMap.sap_pcsn != ''">
|
||||
AND sub.sap_pcsn LIKE '%${paramMap.sap_pcsn}%'
|
||||
</if>
|
||||
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
|
||||
AND sub.date_of_production <![CDATA[ >= ]]> #{paramMap.begin_time}
|
||||
</if>
|
||||
<if test="paramMap.end_time != null and paramMap.end_time != ''">
|
||||
AND sub.date_of_production <![CDATA[ <= ]]> #{paramMap.end_time}
|
||||
</if>
|
||||
<if test="paramMap.date_of_FG_inbound != null and paramMap.date_of_FG_inbound != ''">
|
||||
AND sub.date_of_FG_inbound = #{paramMap.date_of_FG_inbound}
|
||||
</if>
|
||||
<if test="paramMap.sale_order_name != null and paramMap.sale_order_name != ''">
|
||||
AND sub.sale_order_name = #{paramMap.sale_order_name}
|
||||
</if>
|
||||
<if test="paramMap.customer_name != null and paramMap.customer_name != ''">
|
||||
AND (
|
||||
sub.customer_name LIKE '%${paramMap.customer_name}%' or
|
||||
sub.customer_description LIKE '%${paramMap.customer_name}%'
|
||||
)
|
||||
</if>
|
||||
<if test="paramMap.sid_day_start != null and paramMap.sid_day_start != ''">
|
||||
AND DATEDIFF( NOW(), ivt.instorage_time ) <![CDATA[ >= ]]> #{paramMap.sid_day_start}
|
||||
</if>
|
||||
<if test="paramMap.sid_day_end != null and paramMap.sid_day_end != ''">
|
||||
AND DATEDIFF( NOW(), ivt.instorage_time ) <![CDATA[ <= ]]> #{paramMap.sid_day_end}
|
||||
</if>
|
||||
<if test="paramMap.is_sid != null and paramMap.is_sid == 0">
|
||||
AND DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ <= ]]> SUBSTRING_INDEX(sub.quality_guaran_period,'天',1)
|
||||
</if>
|
||||
<if test="paramMap.is_sid != null and paramMap.is_sid == 1">
|
||||
AND DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ >= ]]> SUBSTRING_INDEX(sub.quality_guaran_period,'天',1)
|
||||
</if>
|
||||
ORDER BY sub.package_box_sn ASC
|
||||
</select>
|
||||
<select id="getPastStructDatas" resultType="org.nl.wms.stat.service.vo.PastStructPageVo">
|
||||
SELECT
|
||||
attr.stor_name,
|
||||
attr.sect_name,
|
||||
attr.struct_code,
|
||||
sub.package_box_sn,
|
||||
sub.quanlity_in_box,
|
||||
sub.customer_name,
|
||||
sub.customer_description,
|
||||
sub.sale_order_name,
|
||||
ivt.pcsn,
|
||||
sub.sap_pcsn,
|
||||
sub.product_name,
|
||||
sub.product_description,
|
||||
sub.width,
|
||||
sub.thickness,
|
||||
sub.mass_per_unit_area,
|
||||
ivt.canuse_qty,
|
||||
sub.length,
|
||||
sub.date_of_production,
|
||||
sub.date_of_FG_inbound,
|
||||
sub.box_weight,
|
||||
sub.quality_guaran_period,
|
||||
sub.un_plan_product_property1,
|
||||
sub.un_plan_product_property2,
|
||||
sub.un_plan_product_property3,
|
||||
sub.box_type,
|
||||
sub.box_length,
|
||||
sub.box_width,
|
||||
sub.box_high,
|
||||
sub.remark,
|
||||
DATEDIFF( NOW(), ivt.instorage_time ) AS sid_day,
|
||||
cust.sales_owner
|
||||
FROM
|
||||
st_ivt_structivt ivt
|
||||
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id
|
||||
LEFT JOIN pdm_bi_subpackagerelation sub ON ivt.pcsn = sub.container_name
|
||||
LEFT JOIN md_cs_customerbase cust ON cust.cust_code = sub.customer_name
|
||||
WHERE
|
||||
1 = 1
|
||||
AND ivt.canuse_qty > 0
|
||||
<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.material_code != null and paramMap.material_code != ''">
|
||||
AND (
|
||||
sub.product_name LIKE '%${paramMap.material_code}%' or
|
||||
sub.product_description LIKE '%${paramMap.material_code}%'
|
||||
)
|
||||
</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.container_name != null and paramMap.container_name != ''">
|
||||
AND sub.container_name LIKE '%${paramMap.container_name}%'
|
||||
</if>
|
||||
<if test="paramMap.sap_pcsn != null and paramMap.sap_pcsn != ''">
|
||||
AND sub.sap_pcsn LIKE '%${paramMap.sap_pcsn}%'
|
||||
</if>
|
||||
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
|
||||
AND sub.date_of_production <![CDATA[ >= ]]> #{paramMap.begin_time}
|
||||
</if>
|
||||
<if test="paramMap.end_time != null and paramMap.end_time != ''">
|
||||
AND sub.date_of_production <![CDATA[ <= ]]> #{paramMap.end_time}
|
||||
</if>
|
||||
<if test="paramMap.date_of_FG_inbound != null and paramMap.date_of_FG_inbound != ''">
|
||||
AND sub.date_of_FG_inbound = #{paramMap.date_of_FG_inbound}
|
||||
</if>
|
||||
<if test="paramMap.sale_order_name != null and paramMap.sale_order_name != ''">
|
||||
AND sub.sale_order_name = #{paramMap.sale_order_name}
|
||||
</if>
|
||||
<if test="paramMap.customer_name != null and paramMap.customer_name != ''">
|
||||
AND (
|
||||
sub.customer_name LIKE '%${paramMap.customer_name}%' or
|
||||
sub.customer_description LIKE '%${paramMap.customer_name}%'
|
||||
)
|
||||
</if>
|
||||
<if test="paramMap.sid_day_start != null and paramMap.sid_day_start != ''">
|
||||
AND DATEDIFF( NOW(), ivt.instorage_time ) <![CDATA[ >= ]]> #{paramMap.sid_day_start}
|
||||
</if>
|
||||
<if test="paramMap.sid_day_end != null and paramMap.sid_day_end != ''">
|
||||
AND DATEDIFF( NOW(), ivt.instorage_time ) <![CDATA[ <= ]]> #{paramMap.sid_day_end}
|
||||
</if>
|
||||
<if test="paramMap.is_sid != null and paramMap.is_sid == 0">
|
||||
AND DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ <= ]]>
|
||||
SUBSTRING_INDEX(sub.quality_guaran_period,'天',1)
|
||||
</if>
|
||||
<if test="paramMap.is_sid != null and paramMap.is_sid == 1">
|
||||
AND DATEDIFF( NOW(), sub.date_of_production ) <![CDATA[ >= ]]>
|
||||
SUBSTRING_INDEX(sub.quality_guaran_period,'天',1)
|
||||
</if>
|
||||
ORDER BY sub.package_box_sn ASC
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -8,6 +8,8 @@ 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 org.nl.wms.stat.service.dto.PastStructPageParam;
|
||||
import org.nl.wms.stat.service.vo.PastStructPageVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -37,4 +39,19 @@ public interface StIvtStructivtService extends IService<StIvtStructivt> {
|
||||
* @return
|
||||
*/
|
||||
StIvtStructivt getStructByContainerName(String containerName);
|
||||
|
||||
/**
|
||||
* 临期分页查询
|
||||
* @param paramMap
|
||||
* @param page
|
||||
* @return
|
||||
*/
|
||||
IPage<PastStructPageVo> getPastStructPage(PastStructPageParam paramMap, PageQuery page);
|
||||
|
||||
/**
|
||||
* 临期导出数据
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
List<PastStructPageVo> getPastStructDatas(PastStructPageParam paramMap);
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ 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.nl.wms.stat.service.dto.PastStructPageParam;
|
||||
import org.nl.wms.stat.service.vo.PastStructPageVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -50,4 +52,16 @@ public class StIvtStructivtServiceImpl extends ServiceImpl<StIvtStructivtMapper,
|
||||
public StIvtStructivt getStructByContainerName(String containerName) {
|
||||
return getOne(new LambdaQueryWrapper<StIvtStructivt>().eq(StIvtStructivt::getPcsn, containerName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<PastStructPageVo> getPastStructPage(PastStructPageParam paramMap, PageQuery page) {
|
||||
IPage<PastStructPageVo> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
pages = stIvtStructivtMapper.getPastStructPage(pages, paramMap);
|
||||
return pages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PastStructPageVo> getPastStructDatas(PastStructPageParam paramMap) {
|
||||
return stIvtStructivtMapper.getPastStructDatas(paramMap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.PastIvtQueryService;
|
||||
import org.nl.wms.stat.service.dto.PastStructPageParam;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -17,6 +20,7 @@ import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 临期库存查询
|
||||
* @author Liuxy
|
||||
* @date 2023-04-12
|
||||
**/
|
||||
@@ -28,42 +32,14 @@ import java.util.Map;
|
||||
public class PastIvtQueryController {
|
||||
|
||||
private final PastIvtQueryService pastIvtQueryService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询")
|
||||
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(pastIvtQueryService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
public ResponseEntity<Object> query2(PastStructPageParam paramMap, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(pastIvtQueryService.getPage(paramMap, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增")
|
||||
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody JSONObject dto) {
|
||||
pastIvtQueryService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改")
|
||||
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody JSONObject dto) {
|
||||
pastIvtQueryService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除")
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
|
||||
pastIvtQueryService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("导出数据")
|
||||
|
||||
@GetMapping(value = "/download")
|
||||
public void download(@RequestParam Map map, HttpServletResponse response) throws IOException {
|
||||
pastIvtQueryService.download(map, response);
|
||||
public void downloadPastStructData(PastStructPageParam paramMap, HttpServletResponse response) throws IOException {
|
||||
pastIvtQueryService.downloadPastStructData(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.PastStructPageParam;
|
||||
import org.nl.wms.stat.service.vo.PastStructPageVo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -55,4 +59,13 @@ public interface PastIvtQueryService {
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
void download(Map map, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
||||
IPage<PastStructPageVo> getPage(PastStructPageParam paramMap, PageQuery page);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param paramMap
|
||||
* @param response
|
||||
*/
|
||||
void downloadPastStructData(PastStructPageParam paramMap, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.nl.wms.stat.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 临期数据实体
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/6
|
||||
*/
|
||||
@Data
|
||||
public class PastStructPageParam implements Serializable {
|
||||
private String stor_id;
|
||||
private String sect_id;
|
||||
private String sid_day_start;
|
||||
private String sid_day_end;
|
||||
private String material_code;
|
||||
private String package_box_sn;
|
||||
private String container_name;
|
||||
private String sap_pcsn;
|
||||
private String date_of_FG_inbound;
|
||||
private String sale_order_name;
|
||||
private String customer_name;
|
||||
private String begin_time;
|
||||
private String end_time;
|
||||
private String is_sid;
|
||||
}
|
||||
@@ -41,6 +41,8 @@ import java.util.concurrent.ConcurrentLinkedDeque;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static org.nl.wms.stat.service.util.StatUtils.getWidthValue;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
@@ -608,18 +610,4 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,11 @@ import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.modules.common.utils.FileUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
@@ -14,6 +17,9 @@ 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.PastIvtQueryService;
|
||||
import org.nl.wms.stat.service.dto.PastStructPageParam;
|
||||
import org.nl.wms.stat.service.vo.PastStructPageVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -25,17 +31,19 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.nl.wms.stat.service.util.StatUtils.getWidthValue;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
* @description 服务实现
|
||||
* @date 2023-04-12
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class PastIvtQueryServiceImpl implements PastIvtQueryService {
|
||||
|
||||
|
||||
@Autowired
|
||||
private StIvtStructivtService structivtService;
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
String stor_id = MapUtil.getStr(whereJson, "stor_id");
|
||||
@@ -216,4 +224,53 @@ public class PastIvtQueryServiceImpl implements PastIvtQueryService {
|
||||
FileUtil.downloadExcel(list, response);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<PastStructPageVo> getPage(PastStructPageParam paramMap, PageQuery page) {
|
||||
return structivtService.getPastStructPage(paramMap, page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void downloadPastStructData(PastStructPageParam paramMap, HttpServletResponse response) throws IOException {
|
||||
List<PastStructPageVo> pastStructPageVos = structivtService.getPastStructDatas(paramMap);
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (int i = 0; i < pastStructPageVos.size(); i++) {
|
||||
PastStructPageVo structPageVo = pastStructPageVos.get(i);
|
||||
Map<String, Object> mp = new LinkedHashMap<>();
|
||||
|
||||
mp.put("仓库", structPageVo.getStor_name());
|
||||
mp.put("库区", structPageVo.getSect_name());
|
||||
mp.put("仓位", structPageVo.getStruct_code());
|
||||
mp.put("木箱码", structPageVo.getPackage_box_sn());
|
||||
mp.put("箱内子卷数量", structPageVo.getQuanlity_in_box());
|
||||
mp.put("客户编码", structPageVo.getCustomer_name());
|
||||
mp.put("客户名称", structPageVo.getCustomer_description());
|
||||
mp.put("业务员", structPageVo.getSales_owner());
|
||||
mp.put("销售订单及行号", structPageVo.getSale_order_name());
|
||||
mp.put("子卷号", structPageVo.getPcsn());
|
||||
mp.put("sap批次", structPageVo.getSap_pcsn());
|
||||
mp.put("库龄", structPageVo.getSid_day());
|
||||
mp.put("产品编码", structPageVo.getProduct_name());
|
||||
mp.put("产品描述", structPageVo.getProduct_description());
|
||||
mp.put("产品规格(幅宽)", String.format("%.0f", getWidthValue(structPageVo.getWidth())));
|
||||
mp.put("产品厚度", structPageVo.getThickness());
|
||||
mp.put("单位面积质量", structPageVo.getMass_per_unit_area());
|
||||
mp.put("净重", structPageVo.getCanuse_qty());
|
||||
mp.put("长度", structPageVo.getLength());
|
||||
mp.put("制造完成日期", structPageVo.getDate_of_production());
|
||||
mp.put("入库日期", structPageVo.getDate_of_FG_inbound());
|
||||
mp.put("木箱自身重量", structPageVo.getBox_weight());
|
||||
mp.put("保质期", structPageVo.getQuality_guaran_period());
|
||||
mp.put("子卷的悟性值1", structPageVo.getUn_plan_product_property1());
|
||||
mp.put("子卷的悟性值2", structPageVo.getUn_plan_product_property2());
|
||||
mp.put("子卷的悟性值3", structPageVo.getUn_plan_product_property3());
|
||||
mp.put("木箱料号", structPageVo.getBox_type());
|
||||
mp.put("长", structPageVo.getBox_length());
|
||||
mp.put("宽", structPageVo.getBox_width());
|
||||
mp.put("高", structPageVo.getBox_high());
|
||||
mp.put("备注", structPageVo.getRemark());
|
||||
list.add(mp);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.stat.service.util;
|
||||
|
||||
/**
|
||||
* 工具类
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/6
|
||||
*/
|
||||
public class StatUtils {
|
||||
public 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,46 @@
|
||||
package org.nl.wms.stat.service.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 临期报表数据实体
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/6
|
||||
*/
|
||||
@Data
|
||||
public class PastStructPageVo implements Serializable {
|
||||
private String stor_name;
|
||||
private String sect_name;
|
||||
private String struct_code;
|
||||
private String package_box_sn;
|
||||
private String quanlity_in_box;
|
||||
private String customer_name;
|
||||
private String customer_description;
|
||||
private String sale_order_name;
|
||||
private String pcsn;
|
||||
private String sap_pcsn;
|
||||
private String product_name;
|
||||
private String product_description;
|
||||
private String width;
|
||||
private String thickness;
|
||||
private String mass_per_unit_area;
|
||||
private BigDecimal canuse_qty;
|
||||
private String length;
|
||||
private String date_of_production;
|
||||
private String date_of_FG_inbound;
|
||||
private String box_weight;
|
||||
private String quality_guaran_period;
|
||||
private String un_plan_product_property1;
|
||||
private String un_plan_product_property2;
|
||||
private String un_plan_product_property3;
|
||||
private String box_type;
|
||||
private String box_length;
|
||||
private String box_width;
|
||||
private String box_high;
|
||||
private String remark;
|
||||
private String sid_day;
|
||||
private String sales_owner;
|
||||
}
|
||||
Reference in New Issue
Block a user