From 88521f25ae41f05aaad441b238473848d037220d Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Sun, 27 Dec 2020 15:58:08 +0800
Subject: [PATCH] modify
---
zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java | 7 ++
zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java | 27 +++++++-
zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java | 54 ++++++++++++++++++
zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java | 62 ++++++++++++++++++++
4 files changed, 146 insertions(+), 4 deletions(-)
diff --git a/zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java
index d05dbe5..e7e3770 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java
@@ -4,23 +4,23 @@
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.WebUtil;
+import com.matrix.system.app.dto.StoreInOutListDto;
import com.matrix.system.app.dto.StoreListDto;
import com.matrix.system.app.mapper.SysStoreInfoMapper;
+import com.matrix.system.app.vo.StoreInOutListVo;
import com.matrix.system.app.vo.StoreListVo;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.tools.DataAuthUtil;
import com.matrix.system.hive.bean.SysStoreInfo;
import com.matrix.system.hive.dao.SysStoreInfoDao;
+import com.matrix.system.hive.pojo.StoreInOutRecordVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -62,4 +62,23 @@
return new AjaxResult(AjaxResult.STATUS_SUCCESS, resultList, sysStoreInfoDao.selectCountTotalRecord(sysStoreInfo));
}
+ @ApiOperation(value = "获取商品出入库列表", notes = "获取商品出入库列表")
+ @ApiResponses({
+ @ApiResponse(code = 200, message = "ok", response = StoreInOutListVo.class)
+ })
+ @PostMapping(value = "/findGoodsInOutInfo")
+ public AjaxResult findGoodsInOutInfo(@RequestBody @Validated StoreInOutListDto storeInOutListDto) {
+ StoreInOutRecordVO inOutRecordVO = new StoreInOutRecordVO();
+ inOutRecordVO.setBeginTime(storeInOutListDto.getStartTime());
+ inOutRecordVO.setEndTime(storeInOutListDto.getEndTime());
+ inOutRecordVO.setName(storeInOutListDto.getCode());
+
+ PaginationVO pageVo = new PaginationVO();
+ pageVo.setOffset((storeInOutListDto.getPageNum() - 1) * storeInOutListDto.getPageSize());
+ pageVo.setLimit(storeInOutListDto.getPageSize());
+ List<StoreInOutRecordVO> dataList =sysStoreInfoDao.findStoreInOutRecord(inOutRecordVO,pageVo);
+ List<StoreInOutListVo> list = SysStoreInfoMapper.INSTANCE.recordVosToInOutListVos(dataList);
+ return AjaxResult.buildSuccessInstance(list,sysStoreInfoDao.findStoreInOutTotal(inOutRecordVO));
+ }
+
}
diff --git a/zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java b/zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java
new file mode 100644
index 0000000..c6db79d
--- /dev/null
+++ b/zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java
@@ -0,0 +1,54 @@
+package com.matrix.system.app.dto;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.matrix.core.tools.DateUtil;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+
+/**
+ * @author wzy
+ * @date 2020-12-27
+ **/
+@ApiModel(value = "InOutListDto", description = "商品出入库记录参数接收")
+public class StoreInOutListDto extends BasePageDto {
+
+ @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8")
+ @ApiModelProperty(value = "开始时间")
+ private Date startTime;
+
+ @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8")
+ @ApiModelProperty(value = "结束时间")
+ private Date endTime;
+
+ @NotBlank(message = "参数错误")
+ @ApiModelProperty(value = "商品编号")
+ private String code;
+
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public Date getStartTime() {
+ return startTime;
+ }
+
+ public void setStartTime(Date startTime) {
+ this.startTime = startTime;
+ }
+
+ public Date getEndTime() {
+ return endTime;
+ }
+
+ public void setEndTime(Date endTime) {
+ this.endTime = endTime;
+ }
+}
diff --git a/zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java
index b8a0719..86e99cf 100644
--- a/zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java
+++ b/zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java
@@ -1,7 +1,9 @@
package com.matrix.system.app.mapper;
+import com.matrix.system.app.vo.StoreInOutListVo;
import com.matrix.system.app.vo.StoreListVo;
import com.matrix.system.hive.bean.SysStoreInfo;
+import com.matrix.system.hive.pojo.StoreInOutRecordVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
@@ -23,4 +25,9 @@
public abstract StoreListVo entityToStoreVo(SysStoreInfo sysStoreInfo);
public abstract List<StoreListVo> entitiesToStoreVos(List<SysStoreInfo> list);
+
+ @Mapping(target = "content", source = "orderType")
+ public abstract StoreInOutListVo recordVoToInOutListVo(StoreInOutRecordVO recordVO);
+
+ public abstract List<StoreInOutListVo> recordVosToInOutListVos(List<StoreInOutRecordVO> list);
}
diff --git a/zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java b/zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java
new file mode 100644
index 0000000..5790656
--- /dev/null
+++ b/zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java
@@ -0,0 +1,62 @@
+package com.matrix.system.app.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.matrix.core.tools.DateUtil;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author wzy
+ * @date 2020-12-27
+ **/
+@ApiModel(value = "StoreInOutListVo", description = "商品出入库返回参数类")
+public class StoreInOutListVo {
+
+ @ApiModelProperty(value = "详情")
+ private String content;
+
+ @ApiModelProperty(value = "单号")
+ private String orderNo;
+
+ @ApiModelProperty(value = "数量")
+ private BigDecimal amount;
+
+ @JsonFormat(pattern = DateUtil.DATE_FORMAT_MM, timezone = "GMT+8")
+ @ApiModelProperty(value = "出入库时间")
+ private Date createTime;
+
+ public String getContent() {
+ return content;
+ }
+
+ public void setContent(String content) {
+ this.content = content;
+ }
+
+ public String getOrderNo() {
+ return orderNo;
+ }
+
+ public void setOrderNo(String orderNo) {
+ this.orderNo = orderNo;
+ }
+
+ public BigDecimal getAmount() {
+ return amount;
+ }
+
+ public void setAmount(BigDecimal amount) {
+ this.amount = amount;
+ }
+
+ public Date getCreateTime() {
+ return createTime;
+ }
+
+ public void setCreateTime(Date createTime) {
+ this.createTime = createTime;
+ }
+}
--
Gitblit v1.9.1