diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/controller/MaterialDataController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/controller/MaterialDataController.java index f1fd2e3..b77c4e9 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/controller/MaterialDataController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/controller/MaterialDataController.java @@ -1,8 +1,12 @@ package org.nl.wms.sch.data.controller; +import org.nl.common.base.TableDataInfo; +import org.nl.common.domain.query.PageQuery; import org.nl.wms.sch.data.service.MaterialDataService; import org.nl.wms.sch.data.service.dto.MaterialDataDto; +import org.nl.wms.sch.data.service.dto.MaterialDataRequest; +import org.nl.wms.sch.report.service.dto.ReportQuery; import org.springframework.data.domain.Pageable; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; @@ -31,8 +35,8 @@ public class MaterialDataController { @GetMapping @ApiOperation("查询data") //@PreAuthorize("@el.check('materialData:list')") - public ResponseEntity query(@RequestParam Map whereJson, Pageable page){ - return new ResponseEntity<>(materialDataService.queryAll(whereJson,page),HttpStatus.OK); + public ResponseEntity query(MaterialDataRequest whereJson, PageQuery page){ + return new ResponseEntity<>(TableDataInfo.build(materialDataService.queryAll(whereJson,page)),HttpStatus.OK); } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/MaterialDataService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/MaterialDataService.java index af27618..e8a6c2d 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/MaterialDataService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/MaterialDataService.java @@ -1,8 +1,14 @@ package org.nl.wms.sch.data.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import org.nl.common.domain.query.PageQuery; import org.nl.wms.sch.data.service.dto.MaterialDataDto; +import org.nl.wms.sch.data.service.dto.MaterialDataRequest; +import org.nl.wms.sch.data.service.dto.MaterialDataResponse; import org.nl.wms.sch.material.service.dao.Material; +import org.nl.wms.sch.report.service.dto.ReportDto; +import org.nl.wms.sch.report.service.dto.ReportQuery; import org.springframework.data.domain.Pageable; import java.util.Map; import java.util.List; @@ -22,7 +28,7 @@ public interface MaterialDataService extends IService { * @param page 分页参数 * @return Map */ - Map queryAll(Map whereJson, Pageable page); + IPage queryAll(MaterialDataRequest whereJson, PageQuery pageable); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dao/mapper/MaterialDataMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dao/mapper/MaterialDataMapper.java index 2929032..60bf71f 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dao/mapper/MaterialDataMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dao/mapper/MaterialDataMapper.java @@ -1,8 +1,13 @@ package org.nl.wms.sch.data.service.dao.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import org.nl.wms.sch.data.service.dto.MaterialDataDto; +import org.nl.wms.sch.data.service.dto.MaterialDataRequest; +import org.nl.wms.sch.data.service.dto.MaterialDataResponse; import org.nl.wms.sch.material.service.dao.Material; +import org.nl.wms.sch.report.service.dto.ReportDto; +import org.nl.wms.sch.report.service.dto.ReportQuery; /** * @author lyd @@ -10,4 +15,7 @@ import org.nl.wms.sch.material.service.dao.Material; **/ public interface MaterialDataMapper extends BaseMapper { + void set(); + IPage queryAll(IPage pages, MaterialDataRequest query); + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dao/mapper/MaterialDataMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dao/mapper/MaterialDataMapper.xml new file mode 100644 index 0000000..c49e463 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dao/mapper/MaterialDataMapper.xml @@ -0,0 +1,64 @@ + + + + + + + + + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataDto.java index 9a15b9c..3125e86 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataDto.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataDto.java @@ -1,6 +1,9 @@ package org.nl.wms.sch.data.service.dto; +import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; +import lombok.EqualsAndHashCode; + import java.sql.Timestamp; import java.math.BigDecimal; import java.io.Serializable; @@ -11,6 +14,8 @@ import java.io.Serializable; * @date 2024-05-17 **/ @Data +@EqualsAndHashCode(callSuper = false) +@TableName("material_data") public class MaterialDataDto implements Serializable { /** 客户编码 */ diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataRequest.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataRequest.java new file mode 100644 index 0000000..2c9b862 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataRequest.java @@ -0,0 +1,23 @@ +package org.nl.wms.sch.data.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.sql.Timestamp; + +/** + * @description / + * @author psh + * @date 2024-05-17 + **/ +@Data +public class MaterialDataRequest implements Serializable { + + /** 客户编码 */ + private String start_time; + + /** 客户名称 */ + private String end_time; + +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataQuery.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataResponse.java similarity index 92% rename from lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataQuery.java rename to lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataResponse.java index db0681b..e931f24 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataQuery.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/dto/MaterialDataResponse.java @@ -12,7 +12,7 @@ import java.sql.Timestamp; * @date 2024-05-17 **/ @Data -public class MaterialDataQuery implements Serializable { +public class MaterialDataResponse implements Serializable { /** 客户编码 */ private String supplierCode; @@ -42,7 +42,7 @@ public class MaterialDataQuery implements Serializable { private BigDecimal weight; /** 日期 */ - private Timestamp createTime; + private String date; /** 上月长度 */ private BigDecimal sy_length; diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/impl/MaterialDataServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/impl/MaterialDataServiceImpl.java index bd48c94..866b74d 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/impl/MaterialDataServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/data/service/impl/MaterialDataServiceImpl.java @@ -1,14 +1,22 @@ package org.nl.wms.sch.data.service.impl; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.RequiredArgsConstructor; +import org.nl.common.domain.query.PageQuery; import org.nl.common.exception.BadRequestException; import org.nl.wms.sch.data.service.MaterialDataService; import org.nl.wms.sch.data.service.dao.mapper.MaterialDataMapper; import org.nl.wms.sch.data.service.dto.MaterialDataDto; +import org.nl.wms.sch.data.service.dto.MaterialDataRequest; +import org.nl.wms.sch.data.service.dto.MaterialDataResponse; import org.nl.wms.sch.material.service.dao.Material; import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; +import org.nl.wms.sch.report.service.dto.ReportDto; +import org.nl.wms.sch.report.service.dto.ReportQuery; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -35,10 +43,14 @@ import cn.hutool.core.util.ObjectUtil; @Slf4j public class MaterialDataServiceImpl extends ServiceImpl implements MaterialDataService { + @Autowired + private MaterialDataMapper materialDataMapper; @Override - public Map queryAll(Map whereJson, Pageable page){ - //todo - return new HashMap<>(); + public IPage queryAll(MaterialDataRequest query, PageQuery pageQuery){ + IPage pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize()); + materialDataMapper.set(); + pages=materialDataMapper.queryAll(pages, query); + return pages; } } diff --git a/lms/nladmin-ui/src/views/wms/sch/data/index.vue b/lms/nladmin-ui/src/views/wms/sch/data/index.vue index 2f815e2..04673b9 100644 --- a/lms/nladmin-ui/src/views/wms/sch/data/index.vue +++ b/lms/nladmin-ui/src/views/wms/sch/data/index.vue @@ -10,16 +10,16 @@ label-width="90px" label-suffix=":" > - + - + @@ -40,11 +40,7 @@ - - - +