库存出入库记录列表
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
|
||||
package com.yxt.storage.apiadmin;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
|
||||
import com.yxt.storage.biz.wmsinventoryrecord.WmsInventoryRecordListVo;
|
||||
import com.yxt.storage.biz.wmsinventoryrecord.WmsInventoryRecordService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Api(tags = "库存出入库记录")
|
||||
@RestController
|
||||
@RequestMapping("/apiadmin/wmsinventoryrecord")
|
||||
public class WmsInventoryRecordRest {
|
||||
|
||||
@Autowired
|
||||
private WmsInventoryRecordService wmsInventoryRecordService;
|
||||
|
||||
@ApiOperation("根据库存sid获取出入库记录")
|
||||
@GetMapping("/getWmsInventoryRecordList")
|
||||
ResultBean<List<WmsInventoryRecordListVo>> getWmsInventoryRecordList(@RequestParam("sid") String sid) {
|
||||
return wmsInventoryRecordService.getWmsInventoryRecordList(sid);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.yxt.storage.biz.wmsinventoryrecord;
|
||||
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author: dimengzhe
|
||||
* @date: 2024/4/24
|
||||
**/
|
||||
@Data
|
||||
public class WmsInventoryRecord extends BaseEntity {
|
||||
|
||||
@ApiModelProperty("库存sid")
|
||||
private String inventorySid;
|
||||
@ApiModelProperty("商品ID")
|
||||
private String goodsID;
|
||||
@ApiModelProperty("来源单sid(业务单sid)")
|
||||
private String sourceBillSid;
|
||||
@ApiModelProperty("来源单据编号")
|
||||
private String billNo;
|
||||
@ApiModelProperty("单据类型(1入库、0出库)")
|
||||
private String billType;
|
||||
@ApiModelProperty("业务类型key(采购入库、维修出入库、销售出入库等)")
|
||||
private String busTypeKey;
|
||||
@ApiModelProperty("业务类型value(采购入库、调拨入库、退货入库、盘盈入库等销售出库、调拨出库、采购退货出库、报损出库、盘亏出库等)")
|
||||
private String busTypeValue;
|
||||
@ApiModelProperty("客户/供应商sid,出库是为客户,入库时为供应商")
|
||||
private String billObjSid;
|
||||
@ApiModelProperty("客户/供应商名称")
|
||||
private String billObjName;
|
||||
@ApiModelProperty("批次号")
|
||||
private String batchNumber;
|
||||
@ApiModelProperty("商品基础信息Sid")
|
||||
private String goodSpuSid;
|
||||
@ApiModelProperty("商品名称")
|
||||
private String goodsSpuName;
|
||||
@ApiModelProperty("商品Skusid")
|
||||
private String goodsSkuSid;
|
||||
@ApiModelProperty("商品Sku名称")
|
||||
private String goodsSkuTitle;
|
||||
@ApiModelProperty("商品编码(图号)")
|
||||
private String goodsSkuCode;
|
||||
@ApiModelProperty("规格型号")
|
||||
private String goodsSkuOwnSpec;
|
||||
@ApiModelProperty("出入库后的库存量")
|
||||
private BigDecimal currentCount;
|
||||
@ApiModelProperty("计量单位")
|
||||
private String unit;
|
||||
@ApiModelProperty("数量")
|
||||
private BigDecimal count;
|
||||
@ApiModelProperty("仓库sid")
|
||||
private String warehouseSid;
|
||||
@ApiModelProperty("仓库名称")
|
||||
private String warehouseName;
|
||||
@ApiModelProperty("库位sid")
|
||||
private String warehouseRackSid;
|
||||
@ApiModelProperty("库位编号")
|
||||
private String warehouseRackCode;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yxt.storage.biz.wmsinventoryrecord;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author: dimengzhe
|
||||
* @date: 2024/4/24
|
||||
**/
|
||||
@Data
|
||||
public class WmsInventoryRecordListVo {
|
||||
|
||||
@ApiModelProperty("来源单编号")
|
||||
private String billNo;
|
||||
@ApiModelProperty("单据类型")
|
||||
private String billType;
|
||||
@ApiModelProperty("发生时间")
|
||||
private String createTime;
|
||||
@ApiModelProperty("业务类型")
|
||||
private String busTypeValue;
|
||||
@ApiModelProperty("客户/供应商")
|
||||
private String billObjName;
|
||||
@ApiModelProperty("批次号")
|
||||
private String batchNumber;
|
||||
@ApiModelProperty("数量")
|
||||
private String count;
|
||||
@ApiModelProperty("出入库后的库存量")
|
||||
private String currentCount;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.yxt.storage.biz.wmsinventoryrecord;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author: dimengzhe
|
||||
* @date: 2024/4/24
|
||||
**/
|
||||
@Mapper
|
||||
public interface WmsInventoryRecordMapper extends BaseMapper<WmsInventoryRecord> {
|
||||
List<WmsInventoryRecordListVo> getWmsInventoryRecordList(String sid);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.storage.biz.wmsinventoryrecord.WmsInventoryRecordMapper">
|
||||
<select id="getWmsInventoryRecordList" resultType="com.yxt.storage.biz.wmsinventoryrecord.WmsInventoryRecordListVo">
|
||||
select wir.billNo,
|
||||
case wir.billType when 1 then '入库' when 0 then '出库' end as billType,
|
||||
DATE_FORMAT(wir.createTime, '%Y-%m-%d') as createTime,
|
||||
wir.busTypeValue,
|
||||
wir.billObjName,
|
||||
wir.count,
|
||||
wir.currentCount
|
||||
from wms_inventory_record wir
|
||||
where wir.inventorySid = #{sid}
|
||||
order by wir.createTime desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yxt.storage.biz.wmsinventoryrecord;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author: dimengzhe
|
||||
* @date: 2024/4/24
|
||||
**/
|
||||
@Service
|
||||
public class WmsInventoryRecordService extends MybatisBaseService<WmsInventoryRecordMapper, WmsInventoryRecord> {
|
||||
public ResultBean<List<WmsInventoryRecordListVo>> getWmsInventoryRecordList(String sid) {
|
||||
ResultBean<List<WmsInventoryRecordListVo>> rb = ResultBean.fireFail();
|
||||
List<WmsInventoryRecordListVo> list = baseMapper.getWmsInventoryRecordList(sid);
|
||||
list.removeAll(Collections.singleton(null));
|
||||
return rb.success().setData(list);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user