fix: 入库单据分页查询
This commit is contained in:
@@ -1,2 +1,15 @@
|
||||
# nladmin
|
||||
|
||||
## 公共查询方法
|
||||
|
||||
### 查询用户对应的仓库信息
|
||||
- StIvtBsrealstorattrService#getStoreForUser(String userId)
|
||||
|
||||
|
||||
|
||||
|
||||
## 公共工具类
|
||||
### String处理工具类
|
||||
|
||||
- 判断String中的空格并转换List<String>
|
||||
org.nl.common.utils.StringDealUtils#splitString(String xxx)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.b_lms.storage_manage.ios.service.iostorInv.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
@@ -342,5 +343,7 @@ public class StIvtIostorinv implements Serializable {
|
||||
*/
|
||||
private String car_type;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String vbeln;
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dto.IostorInvQuery;
|
||||
import org.nl.wms.st.inbill.service.dto.ChargePageParam;
|
||||
import org.nl.wms.st.inbill.service.dto.InBillQueryPageParam;
|
||||
import org.nl.wms.st.inbill.service.dto.RawAssistIStorDto;
|
||||
import org.nl.wms.st.inbill.service.vo.WriteOffVo;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -68,4 +69,12 @@ public interface StIvtIostorinvMapper extends BaseMapper<StIvtIostorinv> {
|
||||
* @return
|
||||
*/
|
||||
IPage<WriteOffVo> inWriteOffPageDatas(IPage<StIvtIostorinv> pages, ChargePageParam paramMap);
|
||||
|
||||
/**
|
||||
* 入库单分页查询
|
||||
* @param pages
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
IPage<StIvtIostorinv> inBillPage(IPage<StIvtIostorinv> pages, InBillQueryPageParam paramMap);
|
||||
}
|
||||
|
||||
@@ -489,5 +489,169 @@
|
||||
</if>
|
||||
ORDER BY ios.input_time DESC
|
||||
</select>
|
||||
<select id="inBillPage" resultType="org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv">
|
||||
SELECT
|
||||
ios2.iostorinv_id,
|
||||
ios2.bill_code,
|
||||
ios2.io_type,
|
||||
ios2.buss_type,
|
||||
ios2.bill_type,
|
||||
ios2.biz_date,
|
||||
ios2.stor_id,
|
||||
ios2.stor_code,
|
||||
ios2.stor_name,
|
||||
ios2.source_id,
|
||||
ios2.source_name,
|
||||
ios2.source_type,
|
||||
ios2.total_qty,
|
||||
ios2.total_weight,
|
||||
ios2.detail_count,
|
||||
ios2.bill_status,
|
||||
ios2.remark,
|
||||
ios2.create_mode,
|
||||
ios2.input_optid,
|
||||
ios2.input_optname,
|
||||
ios2.input_time,
|
||||
ios2.update_optid,
|
||||
ios2.update_optname,
|
||||
ios2.update_time,
|
||||
ios2.dis_optid,
|
||||
ios2.dis_optname,
|
||||
ios2.dis_time,
|
||||
ios2.confirm_optid,
|
||||
ios2.confirm_optname,
|
||||
ios2.confirm_time,
|
||||
ios2.sysdeptid,
|
||||
ios2.syscompanyid,
|
||||
ios2.is_delete,
|
||||
ios2.is_upload,
|
||||
ios2.upload_optid,
|
||||
ios2.upload_time,
|
||||
ios2.is_writeoff,
|
||||
ios2.writeoff_optid,
|
||||
ios2.writeoff_time,
|
||||
ios2.consignee,
|
||||
ios2.receiver,
|
||||
ios2.receiptaddress,
|
||||
ios2.receiptphone,
|
||||
ios2.logisticscompany,
|
||||
ios2.drivername,
|
||||
ios2.carno,
|
||||
ios2.driverphone,
|
||||
ios2.contractno,
|
||||
ios2.deliveryunit,
|
||||
ios2.deliveryaddress,
|
||||
ios2.deliveryname,
|
||||
ios2.deliveryphone,
|
||||
ios2.trans_code,
|
||||
ios2.estimated_freight,
|
||||
ios2.cust_code,
|
||||
ios2.out_stor_id,
|
||||
ios2.upload_mes,
|
||||
ios2.upload_sap,
|
||||
ios2.run_freight,
|
||||
ios2.unload_freight,
|
||||
ios2.other_freight,
|
||||
ios2.order_number,
|
||||
ios2.car_type,
|
||||
ios2.is_overdue,
|
||||
IFNULL(dtl2.vbeln,'') as vbeln
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
ios.*
|
||||
FROM
|
||||
ST_IVT_IOStorInv ios
|
||||
WHERE
|
||||
ios.is_delete = '0'
|
||||
AND ios.io_type = '0'
|
||||
<if test="paramMap.in_stor_id != null and !paramMap.in_stor_id.isEmpty()">
|
||||
AND ios.stor_id IN
|
||||
<foreach collection="paramMap.in_stor_id" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.stor_id != null and paramMap.stor_id != ''">
|
||||
AND ios.stor_id = #{paramMap.stor_id}
|
||||
</if>
|
||||
<if test="paramMap.bill_type != null and paramMap.bill_type != ''">
|
||||
AND ios.bill_type = #{paramMap.bill_type}
|
||||
</if>
|
||||
<if test="paramMap.bill_code != null and paramMap.bill_code != ''">
|
||||
and ios.bill_code LIKE '%${paramMap.bill_code}%'
|
||||
</if>
|
||||
<if test="paramMap.create_mode != null and paramMap.create_mode != ''">
|
||||
AND ios.create_mode = #{paramMap.create_mode}
|
||||
</if>
|
||||
<if test="paramMap.bill_status != null and paramMap.bill_status != ''">
|
||||
AND ios.bill_status = #{paramMap.bill_status}
|
||||
</if>
|
||||
<if test="paramMap.begin_time != null and paramMap.begin_time != ''">
|
||||
AND ios.input_time <![CDATA[ >= ]]> #{paramMap.begin_time}
|
||||
</if>
|
||||
<if test="paramMap.end_time != null and paramMap.end_time != ''">
|
||||
AND ios.input_time <![CDATA[ <= ]]> #{paramMap.end_time}
|
||||
</if>
|
||||
) ios2
|
||||
<if test="paramMap.flag != null and paramMap.flag != ''">
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
dis.iostorinv_id
|
||||
FROM
|
||||
st_ivt_iostorinvdis dis
|
||||
LEFT JOIN pdm_bi_subpackagerelationrecord sub ON sub.container_name = dis.pcsn
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="paramMap.box_no != null and paramMap.box_no != ''">
|
||||
AND dis.box_no LIKE '%${paramMap.box_no}%'
|
||||
</if>
|
||||
<if test="paramMap.box_no_in != null and !paramMap.box_no_in.isEmpty()">
|
||||
AND dis.box_no IN
|
||||
<foreach collection="paramMap.box_no_in" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramMap.pcsn != null and paramMap.pcsn != ''">
|
||||
AND dis.pcsn LIKE '%${paramMap.pcsn}%'
|
||||
</if>
|
||||
<if test="paramMap.pcsn_in != null and !paramMap.pcsn_in.isEmpty()">
|
||||
AND dis.pcsn IN
|
||||
<foreach collection="paramMap.pcsn_in" 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.sap_pcsn_in != null and !paramMap.sap_pcsn_in.isEmpty()">
|
||||
AND sub.sap_pcsn IN
|
||||
<foreach collection="paramMap.sap_pcsn_in" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY dis.iostorinv_id
|
||||
) dis2 ON dis2.iostorinv_id = ios2.iostorinv_id
|
||||
</if>
|
||||
INNER JOIN (
|
||||
SELECT
|
||||
dtl.iostorinv_id,
|
||||
MAX( vbeln ) AS vbeln
|
||||
FROM
|
||||
st_ivt_iostorinvdtl dtl
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="paramMap.vbeln != null and paramMap.vbeln != ''">
|
||||
AND dtl.vbeln LIKE '%${paramMap.vbeln}%'
|
||||
</if>
|
||||
<if test="paramMap.vbeln_in != null and !paramMap.vbeln_in.isEmpty()">
|
||||
AND dtl.vbeln IN
|
||||
<foreach collection="paramMap.vbeln_in" item="code" separator="," open="(" close=")">
|
||||
#{code}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
dtl.iostorinv_id
|
||||
) dtl2 ON ios2.iostorinv_id = dtl2.iostorinv_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.common.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 字符串处理工具类
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/18
|
||||
*/
|
||||
public class StringDealUtils {
|
||||
public static List<String> splitString(String input) {
|
||||
// 不含空格直接返回
|
||||
if (input == null || input.trim().isEmpty() || !input.matches(".*\\s.*")) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
return Arrays.stream(input.split("\\s+"))
|
||||
.filter(s -> !s.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,11 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.IStIvtIostorinvService;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.st.inbill.service.RawAssistIStorService;
|
||||
import org.nl.wms.st.inbill.service.dto.InBillQueryPageParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -31,12 +34,19 @@ public class RawAssistIStorController {
|
||||
@Autowired
|
||||
private IStIvtIostorinvService iStIvtIostorinvService;
|
||||
|
||||
// @GetMapping
|
||||
// @Log("查询入库单据")
|
||||
//
|
||||
// //@PreAuthorize("@el.check('checkoutbill:list')")
|
||||
// public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
// return new ResponseEntity<>(rawAssistIStorService.pageQuery(whereJson, page), HttpStatus.OK);
|
||||
// }
|
||||
|
||||
@GetMapping
|
||||
@Log("查询入库单据")
|
||||
|
||||
//@PreAuthorize("@el.check('checkoutbill:list')")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(rawAssistIStorService.pageQuery(whereJson, page), HttpStatus.OK);
|
||||
public ResponseEntity<Object> queryInBillPage(InBillQueryPageParam paramMap, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(rawAssistIStorService.queryInBillPage(paramMap, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("删除出入库单")
|
||||
|
||||
@@ -2,6 +2,10 @@ package org.nl.wms.st.inbill.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.nl.b_lms.storage_manage.ios.service.iostorInv.dao.StIvtIostorinv;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.st.inbill.service.dto.InBillQueryPageParam;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -37,4 +41,6 @@ public interface RawAssistIStorService {
|
||||
JSONArray queryBoxMater(JSONArray rows);
|
||||
|
||||
void divPoint(Map whereJson);
|
||||
|
||||
IPage<StIvtIostorinv> queryInBillPage(InBillQueryPageParam paramMap, PageQuery page);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.nl.wms.st.inbill.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 入库单据查询分页参数
|
||||
* @Author: lyd
|
||||
* @Date: 2025/6/18
|
||||
*/
|
||||
@Data
|
||||
public class InBillQueryPageParam implements Serializable {
|
||||
private String stor_id;
|
||||
private String bill_type;
|
||||
private String bill_status;
|
||||
private String bill_code;
|
||||
private String create_mode;
|
||||
private String vbeln;
|
||||
private List<String> vbeln_in;
|
||||
private String box_no;
|
||||
private List<String> box_no_in;
|
||||
private String pcsn;
|
||||
private List<String> pcsn_in;
|
||||
private String sap_pcsn;
|
||||
private List<String> sap_pcsn_in;
|
||||
private List<String> in_stor_id;
|
||||
private String begin_time;
|
||||
private String end_time;
|
||||
private String flag;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.st.inbill.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@@ -31,6 +32,9 @@ import org.nl.b_lms.storage_manage.st.dao.StIvtStructattr;
|
||||
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.StIvtStructattrMapper;
|
||||
import org.nl.b_lms.storage_manage.st.service.StIvtBsrealstorattrService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.StringDealUtils;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
@@ -48,6 +52,7 @@ import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.st.inbill.service.RawAssistIStorService;
|
||||
import org.nl.wms.st.inbill.service.StorPublicService;
|
||||
import org.nl.wms.st.inbill.service.dto.InBillQueryPageParam;
|
||||
import org.nl.wms.st.inbill.service.dto.RawAssistIStorDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -102,6 +107,8 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
|
||||
@Autowired
|
||||
private MdPbMeasureunitMapper mdPbMeasureunitMapper;
|
||||
@Autowired
|
||||
private StIvtBsrealstorattrService bsrealstorattrService;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -218,7 +225,34 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<StIvtIostorinv> queryInBillPage(InBillQueryPageParam paramMap, PageQuery page) {
|
||||
paramMap.setPcsn_in(StringDealUtils.splitString(paramMap.getPcsn()));
|
||||
paramMap.setBox_no_in(StringDealUtils.splitString(paramMap.getBox_no()));
|
||||
paramMap.setSap_pcsn_in(StringDealUtils.splitString(paramMap.getSap_pcsn()));
|
||||
paramMap.setVbeln_in(StringDealUtils.splitString(paramMap.getVbeln()));
|
||||
if (CollectionUtil.isNotEmpty(paramMap.getPcsn_in())) {
|
||||
paramMap.setPcsn("");
|
||||
paramMap.setFlag("1");
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(paramMap.getBox_no_in())) {
|
||||
paramMap.setBox_no("");
|
||||
paramMap.setFlag("1");
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(paramMap.getSap_pcsn_in())) {
|
||||
paramMap.setSap_pcsn("");
|
||||
paramMap.setFlag("1");
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(paramMap.getVbeln_in())) {
|
||||
paramMap.setVbeln("");
|
||||
paramMap.setFlag("1");
|
||||
}
|
||||
//获取人员对应的仓库
|
||||
List<String> storIds = bsrealstorattrService.getStoreForUser(SecurityUtils.getCurrentUserId());
|
||||
paramMap.setIn_stor_id(storIds);
|
||||
IPage<StIvtIostorinv> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
return stIvtIostorinvMapper.inBillPage(pages, paramMap);
|
||||
}
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String insertDtl(Map whereJson) {
|
||||
@@ -1017,6 +1051,7 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject autoDis(JSONObject whereJson) {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user