zq-erp/src/main/java/com/matrix/system/app/action/ApiStoreAction.java | ●●●●● patch | view | raw | blame | history | |
zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java | ●●●●● patch | view | raw | blame | history | |
zq-erp/src/main/java/com/matrix/system/app/mapper/SysStoreInfoMapper.java | ●●●●● patch | view | raw | blame | history | |
zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java | ●●●●● patch | view | raw | blame | history |
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)); } } zq-erp/src/main/java/com/matrix/system/app/dto/StoreInOutListDto.java
New file @@ -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; } } 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); } zq-erp/src/main/java/com/matrix/system/app/vo/StoreInOutListVo.java
New file @@ -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; } }