diff --git a/nlsso-server/src/main/java/org/nl/common/base/CommonPage.java b/nlsso-server/src/main/java/org/nl/common/base/CommonPage.java index 167a6d6..604c50e 100644 --- a/nlsso-server/src/main/java/org/nl/common/base/CommonPage.java +++ b/nlsso-server/src/main/java/org/nl/common/base/CommonPage.java @@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert; import cn.hutool.http.HttpStatus; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.Data; +import org.checkerframework.checker.units.qual.C; import java.util.List; @@ -56,6 +57,18 @@ public class CommonPage { return result; } + public static CommonPage getPage(List list,Long total,Integer page,Integer size) { + CommonPage commonPage = new CommonPage<>(); + commonPage.setPageNum(page); + commonPage.setPageSize(size); + commonPage.setTotalElements(total); + commonPage.setTotalPage(Convert.toInt(total/ size+1)); + commonPage.setResult(list); + commonPage.setCode(1); + commonPage.setDesc("查询成功"); + return commonPage; + } + public static CommonPage getPage(Page page) { List list = page.getRecords(); CommonPage commonPage = new CommonPage<>(); diff --git a/nlsso-server/src/main/java/org/nl/common/domain/query/BaseQuery.java b/nlsso-server/src/main/java/org/nl/common/domain/query/BaseQuery.java index ce3603f..d8e66ad 100644 --- a/nlsso-server/src/main/java/org/nl/common/domain/query/BaseQuery.java +++ b/nlsso-server/src/main/java/org/nl/common/domain/query/BaseQuery.java @@ -30,7 +30,7 @@ public class BaseQuery { /** * 当前页数 */ - private Integer page=0; + private Integer page=1; /** * 排序列 diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java index 9bfa255..ab2228b 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/AllocationBillController.java @@ -31,6 +31,7 @@ import org.nl.wms.database.eas.service.IallocationBillService; @RequiredArgsConstructor @RequestMapping("/api/allocationBill") @Slf4j +@SaIgnore public class AllocationBillController { @@ -57,7 +58,7 @@ public class AllocationBillController { */ @PostMapping("/page") @Log("分页查询") - public ResponseEntity> page(@RequestBody AllocationBillQuery params) { + public ResponseEntity> page(@RequestBody AllocationBillQuery params) { return new ResponseEntity<>(allocationBillService.page(params), HttpStatus.OK); } diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java index 22ce711..7a2960d 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/EasOutInBillDetailController.java @@ -3,6 +3,7 @@ package org.nl.wms.database.eas.controller; import java.util.List; import java.util.Set; +import cn.dev33.satoken.annotation.SaIgnore; import org.nl.common.base.CommonPage; import org.nl.common.base.CommonResult; import org.nl.common.base.RestBusinessTemplate; @@ -32,6 +33,7 @@ import org.nl.wms.database.eas.service.IeasOutInBillDetailService; @RequiredArgsConstructor @RequestMapping("/api/easOutInBillDetail") @Slf4j +@SaIgnore public class EasOutInBillDetailController { diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBillController.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBillController.java index 0567280..3303926 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBillController.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/controller/ReceiptBillController.java @@ -32,6 +32,7 @@ import org.nl.wms.database.eas.service.IreceiptBillService; @RequiredArgsConstructor @RequestMapping("/api/receiptBill") @Slf4j +@SaIgnore public class ReceiptBillController { @@ -57,7 +58,7 @@ public class ReceiptBillController { */ @PostMapping("/page") @Log("分页查询") - public ResponseEntity> page(@RequestBody ReceiptBillVO params) { + public ResponseEntity> page(@RequestBody ReceiptBillVO params) { return new ResponseEntity<>(receiptBillService.page(params), HttpStatus.OK); } diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/AllocationBillMapper.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/AllocationBillMapper.java index 0411254..ae299d6 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/AllocationBillMapper.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/AllocationBillMapper.java @@ -6,6 +6,9 @@ import io.lettuce.core.dynamic.annotation.Param; import org.apache.ibatis.annotations.Select; import org.nl.wms.database.eas.dao.AllocationBill; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.nl.wms.database.eas.dto.AllocationBillQuery; + +import java.util.List; /** * {@code @Description:} (AllocationBill)数据持久层 @@ -15,18 +18,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface AllocationBillMapper extends BaseMapper { - @Select("SELECT COUNT(*) FROM receiptBill") + @DS("oracle_eas") - Long getAllocationCount(); + Long getAllocationCount(@Param("fuzzy") String fuzzy); @DS("oracle_eas") - Page allocationPage(Page page, @Param("fuzzy") String fuzzy); + List allocationPage(@Param("fuzzy") String fuzzy, @Param("page") Integer page, @Param("size") Integer size ); - @Select("SELECT COUNT(*) FROM EAS_NOBLE.receiptBill WHERE DJBH = #{djbh}") + @Select("SELECT COUNT(*) FROM EAS_NOBLE.V_UC_STOCKTRANSFERBILL WHERE DJBH = #{djbh}") @DS("oracle_eas") Long getTotalCount(@Param("djbh") String djbh); - Page allocationDetailPage(Page page, @Param("djbh") String djbh, @Param("fuzzy") String fuzzy); + @DS("oracle_eas") + List allocationDetailPage(@Param("page") Integer page, @Param("size") Integer size, @Param("djbh") String djbh, @Param("fuzzy") String fuzzy); } diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/ReceiptBillMapper.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/ReceiptBillMapper.java index c73b30b..0c867ee 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/ReceiptBillMapper.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/mapper/ReceiptBillMapper.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.lettuce.core.dynamic.annotation.Param; import org.nl.wms.database.eas.dao.ReceiptBill; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.nl.wms.database.eas.dto.ReceiptBillQuery; /** * {@code @Description:} (ReceiptBill)数据持久层 @@ -17,5 +18,5 @@ public interface ReceiptBillMapper extends BaseMapper { Page receiptPage(Page page, @Param("fuzzy") String fuzzy); @DS("mysql_srm") - Page receiptDetailPage(Page page, @Param("djbh") String djbh, @Param("fuzzy") String fuzzy); + Page receiptDetailPage(Page page, @Param("djbh") String djbh, @Param("fuzzy") String fuzzy); } diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/AllocationBillMapper.xml b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/AllocationBillMapper.xml index 57ac28f..ffe7d57 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/AllocationBillMapper.xml +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/AllocationBillMapper.xml @@ -1,71 +1,53 @@ - + WITH ranked_data AS ( SELECT t.*, ROW_NUMBER ( ) OVER ( PARTITION BY djbh ORDER BY CJSJ DESC ) AS rn FROM + EAS_NOBLE.V_UC_STOCKTRANSFERBILL t ), + grouped_data AS ( SELECT * FROM ranked_data WHERE rn = 1 ) SELECT + COUNT( 1 ) FROM - ranked_data - WHERE - rn = 1 - ) - SELECT * - FROM ( - SELECT - temp.*, - ROWNUM AS row_num - FROM ( - SELECT * - FROM grouped_data - WHERE + ( SELECT temp.*, ROWNUM AS row_num FROM ( SELECT * FROM grouped_data + + WHERE (wlmc LIKE '%' || #{fuzzy} || '%' + OR djbh LIKE '%' || #{fuzzy} || '%' + OR wlbm LIKE '%' || #{fuzzy} || '%' + OR wlmc LIKE '%' || #{fuzzy} || '%' + OR dckcmc LIKE '%' || #{fuzzy} || '%' + OR dcckmc LIKE '%' || #{fuzzy} || '%' + OR drkcmc LIKE '%' || #{fuzzy} || '%' + ) + + ORDER BY CJSJ DESC ) temp ) + + + + diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/ReceiptBillMapper.xml b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/ReceiptBillMapper.xml index 3a93c7a..65a6815 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/ReceiptBillMapper.xml +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/dao/xml/ReceiptBillMapper.xml @@ -1,9 +1,9 @@ - SELECT * - FROM EAS_NOBLE.receiptBill + FROM v_wms_recbill_third WHERE djbh LIKE CONCAT('%', #{fuzzy}, '%') OR wlmc LIKE CONCAT('%', #{fuzzy}, '%') @@ -27,7 +27,7 @@