Commit f9cef2ea authored by 罗林杰's avatar 罗林杰

初始化库存管理

parent 0bca7943
package org.rcisoft.bus.storegoodsstock.controller;
/*固定导入*/
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.rcisoft.bus.storegoodsstock.dto.StoreGoodsStockPageResultsDto;
import org.rcisoft.bus.storegoodsstock.entity.StoreGoodsStock;
import org.rcisoft.bus.storegoodsstock.service.StoreGoodsStockService;
import org.rcisoft.bus.wmsgoods.entity.WmsGoods;
import org.rcisoft.core.anno.CyOpeLogAnno;
import org.rcisoft.core.constant.CyMessCons;
import org.rcisoft.core.controller.CyPaginationController;
import org.rcisoft.core.model.CyGridModel;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.operlog.enums.CyLogTypeEnum;
import org.rcisoft.core.result.CyResult;
import org.rcisoft.core.util.CyEpExcelUtil;
import org.rcisoft.core.util.CyResultGenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.util.List;
/**
* Created by cy on 2024年5月29日 下午1:21:49.
*/
@RestController
@RequestMapping("/storegoodsstock")
public class StoreGoodsStockController extends CyPaginationController<StoreGoodsStockPageResultsDto> {
@Autowired
private StoreGoodsStockService storeGoodsStockServiceImpl;
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsStock:add')")
@CyOpeLogAnno(title = "system-库存管理表管理-新增库存管理表", businessType = CyLogTypeEnum.INSERT)
@ApiOperation(value="添加库存管理表", notes="添加库存管理表")
@PostMapping(value = "/add")
public CyResult add(@Valid StoreGoodsStock storeGoodsStock, BindingResult bindingResult) {
CyPersistModel data = storeGoodsStockServiceImpl.persist(storeGoodsStock);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
storeGoodsStock);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsStock:delete')")
@CyOpeLogAnno(title = "system-库存管理表管理-删除库存管理表", businessType = CyLogTypeEnum.DELETE)
@ApiOperation(value="逻辑删除库存管理表", notes="逻辑删除库存管理表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/deleteLogical/{businessId:\\w+}")
public CyResult deleteLogical(@PathVariable int businessId, StoreGoodsStock storeGoodsStock) {
storeGoodsStock.setBusinessId(businessId);
CyPersistModel data = storeGoodsStockServiceImpl.removeLogical(storeGoodsStock);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
businessId);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsStock:delete')")
@CyOpeLogAnno(title = "system-库存管理表管理-删除库存管理表", businessType = CyLogTypeEnum.DELETE)
@ApiOperation(value="删除库存管理表", notes="删除库存管理表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@DeleteMapping("/delete/{businessId:\\w+}")
public CyResult delete(@PathVariable int businessId, StoreGoodsStock storeGoodsStock) {
storeGoodsStock.setBusinessId(businessId);
CyPersistModel data = storeGoodsStockServiceImpl.remove(storeGoodsStock);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
businessId);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsStock:update')")
@CyOpeLogAnno(title = "system-库存管理表管理-修改库存管理表", businessType = CyLogTypeEnum.UPDATE)
@ApiOperation(value="修改库存管理表", notes="修改库存管理表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PutMapping("/update/{businessId:\\w+}")
public CyResult update(@PathVariable int businessId, @Valid StoreGoodsStock storeGoodsStock, BindingResult bindingResult) {
storeGoodsStock.setBusinessId(businessId);
CyPersistModel data = storeGoodsStockServiceImpl.merge(storeGoodsStock);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
storeGoodsStock);
}
@CyOpeLogAnno(title = "system-库存管理表管理-修改库存管理表", businessType = CyLogTypeEnum.UPDATE)
@ApiOperation(value="修改库存管理表", notes="修改库存管理表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PutMapping("/updateCounts/{businessId:\\w+}")
public CyResult updateCounts(@PathVariable int businessId, @Valid StoreGoodsStock storeGoodsStock, BindingResult bindingResult) {
storeGoodsStock.setBusinessId(businessId);
CyPersistModel data = storeGoodsStockServiceImpl.updateCounts(storeGoodsStock);
return CyResultGenUtil.builder(data,
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
storeGoodsStock);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsStock:query')")
@CyOpeLogAnno(title = "system-库存管理表管理-查询库存管理表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询单一库存管理表", notes="查询单一库存管理表")
@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = true, dataType = "varchar")})
@GetMapping("/detail/{businessId:\\w+}")
public CyResult detail(@PathVariable int businessId) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
storeGoodsStockServiceImpl.findById(businessId));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsStock:list')")
@CyOpeLogAnno(title = "system-库存管理表管理-查询库存管理表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询库存管理表集合", notes="查询库存管理表集合")
@GetMapping(value = "/listAll")
public CyResult listAll(StoreGoodsStock storeGoodsStock) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
storeGoodsStockServiceImpl.findAll(storeGoodsStock));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsStock:list')")
@CyOpeLogAnno(title = "system-库存管理表管理-查询库存管理表", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="分页查询库存管理表集合", notes="分页查询库存管理表集合")
@GetMapping(value = "/list")
public CyGridModel listByPagination(StoreGoodsStockPageResultsDto wmsGoodsStock) {
storeGoodsStockServiceImpl.findAllByPagination(getPaginationUtility(), wmsGoodsStock);
return getGridModelResponse();
}
@CyOpeLogAnno(title = "system-库存管理表管理-查询库存管理表", businessType = CyLogTypeEnum.EXPORT)
@ApiOperation(value = "导出库存管理表信息", notes = "导出库存管理表信息")
@GetMapping(value = "/export")
public void outWmsGoodsStock(HttpServletResponse response, StoreGoodsStock storeGoodsStock, @PathVariable @RequestParam(defaultValue = "0") String excelId) {
String excelName="";
switch(excelId){
case "0": excelName="库存管理表信息.xls";break;
case "1": excelName="库存管理表信息.xlsx";break;
case "2": excelName="库存管理表信息.csv";break;
}
List<StoreGoodsStock> storeGoodsStockList = storeGoodsStockServiceImpl.export(storeGoodsStock);
CyEpExcelUtil.exportExcel(storeGoodsStockList, "库存管理表信息", "库存管理表信息", StoreGoodsStock.class, excelName, response);
}
@CyOpeLogAnno(title = "system-商品信息表管理-查询商品", businessType = CyLogTypeEnum.QUERY)
@ApiOperation(value="查询商品", notes="查询商品")
@GetMapping(value = "/detailByCode")
public CyResult detailByCode(WmsGoods wmsGoods) {
return CyResultGenUtil.builder(new CyPersistModel(1),
CyMessCons.MESSAGE_ALERT_SUCCESS,
CyMessCons.MESSAGE_ALERT_ERROR,
storeGoodsStockServiceImpl.queryWmsGoodsStock(wmsGoods));
}
}
package org.rcisoft.bus.storegoodsstock.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.rcisoft.bus.storegoodsstock.dto.StoreGoodsStockPageResultsDto;
import org.rcisoft.bus.storegoodsstock.entity.StoreGoodsStock;
import org.rcisoft.core.mapper.CyBaseMapper;
import org.rcisoft.core.model.CyPageInfo;
import java.util.List;
/**
* Created with cy on 2024年5月29日 下午1:21:49.
*/
public interface StoreGoodsStockRepository extends CyBaseMapper<StoreGoodsStock> {
List<StoreGoodsStock> queryWmsGoodsStocks(@Param("entity") StoreGoodsStock storeGoodsStock);
/**
* 分页查询 wmsGoodsStock
*
*/
IPage<StoreGoodsStockPageResultsDto> queryWmsGoodsStocksPaged(CyPageInfo cyPageInfo, @Param("entity") StoreGoodsStockPageResultsDto storeGoodsStock);
StoreGoodsStock selectByIdOut(int id);
}
package org.rcisoft.bus.storegoodsstock.dto;
import lombok.Data;
import org.rcisoft.bus.storegoodsstock.entity.StoreGoodsStock;
/**
* @Author: gy
* @Date: 2024/5/29 23:00
* @Description:
*/
@Data
public class StoreGoodsStockPageResultsDto extends StoreGoodsStock {
/**
* @desc 商品名称
* @column goods_name
* @default
*/
private String goodsName;
private String goodsDictName;
/**
* @desc 商品编码
* @column goods_code
* @default
*/
private String goodsCode;
private String goodsNumber;
/**
* @desc 商品类型
* @column goods_style
* @default
*/
private String goodsStyle;
/**
* @desc 商品货号
* @column goods_article_number
* @default
*/
private String goodsArtNumber;
/**
* @desc 季节
* @column goods_season
* @default
*/
private String goodsSeason;
/**
* @desc 商品颜色
* @column goods_colour
* @default
*/
private String goodsColour;
/**
* @desc 商品规格
* @column goods_norms
* @default
*/
private String goodsNorms;
/**
* @desc 商品尺码
* @column goods_size
* @default
*/
private String goodsSize;
/**
* @desc 品牌
* @column goods_brand
* @default
*/
private String goodsBrand;
}
package org.rcisoft.bus.storegoodsstock.entity;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.rcisoft.core.entity.CyIdIncreEntity;
/**
* Created with cy on 2024年5月29日 下午1:21:49.
*/
@Data
@TableName("store_goods_stock")
public class StoreGoodsStock extends CyIdIncreEntity<StoreGoodsStock> {
/**
* @desc 商品id
* @column goods_id
* @default
*/
private Integer goodsId;
/**
* @desc 商品编码
* @column goods_code
* @default
*/
@TableField(exist = false)
@Excel(name = "商品编码", orderNum = "1", width = 40)
private String goodsCode;
@TableField(exist = false)
@Excel(name = "商品名称", orderNum = "2", width = 20)
private String goodsName;
/**
* @desc 商品数量
* @column goods_counts
* @default
*/
@Excel(name = "库存", orderNum = "3", width = 20)
private Integer goodsCounts;
/**
* @desc 商品数量
* @column goods_counts
* @default
*/
@Excel(name = "库位号", orderNum = "3", width = 20)
private String goodsNumber;
/**
* @desc 品牌
* @column goods_brand
* @default
*/
@TableField(exist = false)
@Excel(name = "品牌", orderNum = "4", width = 20)
private String goodsBrand;
@TableField(exist = false)
private Integer inventoryValue;
/**
* @desc 季节
* @column goods_season
* @default
*/
@TableField(exist = false)
@Excel(name = "季节", orderNum = "5", width = 20)
private String goodsSeason;
@TableField(exist = false)
@Excel(name = "品名", orderNum = "6", width = 20)
private String goodsDictName;
/**
* @desc 商品货号
* @column goods_article_number
* @default
*/
@TableField(exist = false)
@Excel(name = "货号", orderNum = "7", width = 20)
private String goodsArtNumber;
/**
* @desc 商品类型
* @column goods_style
* @default
*/
@TableField(exist = false)
@Excel(name = "款式", orderNum = "8", width = 20)
private String goodsStyle;
/**
* @desc 商品颜色
* @column goods_colour
* @default
*/
@TableField(exist = false)
@Excel(name = "颜色", orderNum = "9", width = 20)
private String goodsColour;
/**
* @desc 商品规格
* @column goods_norms
* @default
*/
@TableField(exist = false)
@Excel(name = "规格", orderNum = "10", width = 20)
private String goodsNorms;
/**
* @desc 商品尺码
* @column goods_size
* @default
*/
@TableField(exist = false)
@Excel(name = "尺码", orderNum = "11", width = 20)
private String goodsSize;
// = 查询
@TableField(exist = false)
private String actualGoodsCode;
// >
@TableField(exist = false)
private Integer actualGtGoodsCounts;
}
package org.rcisoft.bus.storegoodsstock.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.rcisoft.bus.storegoodsstock.dto.StoreGoodsStockPageResultsDto;
import org.rcisoft.bus.storegoodsstock.entity.StoreGoodsStock;
import org.rcisoft.bus.wmsgoods.entity.WmsGoods;
import org.rcisoft.core.model.CyPageInfo;
import org.rcisoft.core.model.CyPersistModel;
import java.util.List;
/**
* Created by cy on 2024年5月29日 下午1:21:49.
*/
public interface StoreGoodsStockService {
/**
* 保存 库存管理表
* @param storeGoodsStock
* @return
*/
CyPersistModel persist(StoreGoodsStock storeGoodsStock);
/**
* 删除 库存管理表
* @param storeGoodsStock
* @return
*/
CyPersistModel remove(StoreGoodsStock storeGoodsStock);
/**
* 逻辑删除 库存管理表
* @param storeGoodsStock
* @return
*/
CyPersistModel removeLogical(StoreGoodsStock storeGoodsStock);
/**
* 修改 库存管理表
* @param storeGoodsStock
* @return
*/
CyPersistModel merge(StoreGoodsStock storeGoodsStock);
CyPersistModel updateCounts(StoreGoodsStock storeGoodsStock);
/**
* 根据id查询 库存管理表
* @param id
* @return
*/
StoreGoodsStock findById(int id);
StoreGoodsStock findByIdOut(int id);
/**
* 分页查询 库存管理表
* @param storeGoodsStock
* @return
*/
IPage<StoreGoodsStockPageResultsDto> findAllByPagination(CyPageInfo<StoreGoodsStockPageResultsDto> paginationUtility,
StoreGoodsStockPageResultsDto storeGoodsStock);
/**
* 查询list 库存管理表
* @param storeGoodsStock
* @return
*/
List<StoreGoodsStock> findAll(StoreGoodsStock storeGoodsStock);
/**
* 导出库存管理表
* @return
*/
List<StoreGoodsStock> export(StoreGoodsStock storeGoodsStock);
/**
* 查询 stock
* @param wmsGoods
* @return
*/
StoreGoodsStock queryWmsGoodsStock(WmsGoods wmsGoods);
}
package org.rcisoft.bus.storegoodsstock.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.rcisoft.bus.storegoodsstock.dao.StoreGoodsStockRepository;
import org.rcisoft.bus.storegoodsstock.dto.StoreGoodsStockPageResultsDto;
import org.rcisoft.bus.storegoodsstock.entity.StoreGoodsStock;
import org.rcisoft.bus.storegoodsstock.service.StoreGoodsStockService;
import org.rcisoft.bus.wmsgoods.entity.WmsGoods;
import org.rcisoft.bus.wmsgoodslog.dao.WmsGoodsLogRepository;
import org.rcisoft.bus.wmsgoodslog.entity.WmsGoodsLog;
import org.rcisoft.core.exception.CyServiceException;
import org.rcisoft.core.model.CyPageInfo;
import org.rcisoft.core.model.CyPersistModel;
import org.rcisoft.core.util.CyUserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Created by cy on 2024年5月29日 下午1:21:49.
*/
@Service
@Transactional(readOnly = true,propagation = Propagation.NOT_SUPPORTED)
@Slf4j
public class StoreGoodsStockServiceImpl extends ServiceImpl<StoreGoodsStockRepository, StoreGoodsStock> implements StoreGoodsStockService {
@Autowired
WmsGoodsLogRepository wmsGoodsLogRepository;
/**
* 保存 库存管理表
* @param storeGoodsStock
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel persist(StoreGoodsStock storeGoodsStock){
//增加操作
int line = baseMapper.insert(storeGoodsStock);
log.debug(CyUserUtil.getAuthenUsername()+"新增了ID为"+
storeGoodsStock.getBusinessId()+"的库存管理表信息");
return new CyPersistModel(line);
}
/**
* 删除 库存管理表
* @param storeGoodsStock
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel remove(StoreGoodsStock storeGoodsStock){
int line = baseMapper.realDelete(storeGoodsStock);
log.debug(CyUserUtil.getAuthenUsername()+"删除了ID为"+
storeGoodsStock.getBusinessId()+"的库存管理表信息");
return new CyPersistModel(line);
}
/**
* 逻辑删除 库存管理表
* @param storeGoodsStock
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel removeLogical(StoreGoodsStock storeGoodsStock){
storeGoodsStock.setDeleted();
int line = baseMapper.deleteById(storeGoodsStock);
log.debug(CyUserUtil.getAuthenUsername()+"逻辑删除了ID为"+
storeGoodsStock.getBusinessId()+"的库存管理表信息");
return new CyPersistModel(line);
}
/**
* 修改 库存管理表
* @param storeGoodsStock
* @return
*/
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel merge(StoreGoodsStock storeGoodsStock){
StoreGoodsStock wmsOrigin = baseMapper.selectById(storeGoodsStock.getBusinessId());
int line = baseMapper.updateById(storeGoodsStock);
log.debug(CyUserUtil.getAuthenUsername()+"修改了ID为"+ storeGoodsStock.getBusinessId()+"的库存管理表信息");
WmsGoodsLog wmsGoodsLog = new WmsGoodsLog();
wmsGoodsLog.setGoodsId(storeGoodsStock.getBusinessId());
wmsGoodsLog.setGoodsCounts(wmsOrigin.getGoodsCounts());
wmsGoodsLog.setGoodsName(wmsOrigin.getGoodsName());
wmsGoodsLog.setGoodsCode(wmsOrigin.getGoodsCode());
wmsGoodsLog.setIoType("3");
wmsGoodsLog.setUpdateCounts(storeGoodsStock.getGoodsCounts());
wmsGoodsLogRepository.insert(wmsGoodsLog);
return new CyPersistModel(line);
}
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.DEFAULT)
@Override
public CyPersistModel updateCounts(StoreGoodsStock storeGoodsStock) {
int line = baseMapper.updateById(storeGoodsStock);
log.debug(CyUserUtil.getAuthenUsername()+"修改了ID为"+ storeGoodsStock.getBusinessId()+"的库存管理表信息");
return new CyPersistModel(line);
}
/**
* 根据id查询 库存管理表
* @param id
* @return
*/
@Override
public StoreGoodsStock findById(int id){
return baseMapper.selectById(id);
}
@Override
public StoreGoodsStock findByIdOut(int id){
return baseMapper.selectByIdOut(id);
}
/**
* 分页查询 库存管理表
* @param storeGoodsStock
* @return
*/
@Override
public IPage<StoreGoodsStockPageResultsDto> findAllByPagination(CyPageInfo<StoreGoodsStockPageResultsDto> paginationUtility,
StoreGoodsStockPageResultsDto storeGoodsStock){
return baseMapper.queryWmsGoodsStocksPaged(paginationUtility,storeGoodsStock);
}
/**
* 查询list 库存管理表
* @param storeGoodsStock
* @return
*/
@Override
public List<StoreGoodsStock> findAll(StoreGoodsStock storeGoodsStock){
return baseMapper.queryWmsGoodsStocks(storeGoodsStock);
}
/**
* 导出库存管理表
* @return
*/
@Override
public List<StoreGoodsStock> export(StoreGoodsStock storeGoodsStock) {
List<StoreGoodsStock> storeGoodsStockList = baseMapper.queryWmsGoodsStocks(storeGoodsStock);
return storeGoodsStockList;
}
@Override
public StoreGoodsStock queryWmsGoodsStock(WmsGoods wmsGoods) {
StoreGoodsStock stock = new StoreGoodsStock();
stock.setActualGoodsCode(wmsGoods.getGoodsCode());
stock.setActualGtGoodsCounts(0);
// 1. 查询 goodsNumber
List<StoreGoodsStock> result = baseMapper.queryWmsGoodsStocks(stock);
if(CollectionUtils.isEmpty(result) || result.size() > 1 || result.get(0).getGoodsCounts() < 1) {
throw new CyServiceException(500, "商品不存在或库存不足!");
}
return result.get(0);
}
}
<?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="org.rcisoft.bus.storegoodsstock.dao.StoreGoodsStockRepository">
<resultMap id="BaseResultMap" type="org.rcisoft.bus.storegoodsstock.entity.StoreGoodsStock">
<id column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="flag" jdbcType="CHAR" property="flag"/>
<result column="del_flag" jdbcType="CHAR" property="delFlag"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="goods_id" jdbcType="INTEGER" property="goodsId"/>
<result column="goods_counts" jdbcType="INTEGER" property="goodsCounts"/>
<result column="goods_number" jdbcType="VARCHAR" property="goodsNumber"/>
</resultMap>
<resultMap id="BasePageResultMap" type="org.rcisoft.bus.storegoodsstock.dto.StoreGoodsStockPageResultsDto">
<id column="business_id" jdbcType="INTEGER" property="businessId"/>
<result column="flag" jdbcType="CHAR" property="flag"/>
<result column="del_flag" jdbcType="CHAR" property="delFlag"/>
<result column="create_by" jdbcType="VARCHAR" property="createBy"/>
<result column="create_date" jdbcType="TIMESTAMP" property="createDate"/>
<result column="update_by" jdbcType="VARCHAR" property="updateBy"/>
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate"/>
<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
<result column="goods_id" jdbcType="INTEGER" property="goodsId"/>
<result column="goods_counts" jdbcType="INTEGER" property="goodsCounts"/>
<result column="goods_number" jdbcType="VARCHAR" property="goodsNumber"/>
<result column="goods_name" jdbcType="VARCHAR" property="goodsName"/>
<result column="goods_dict_name" jdbcType="VARCHAR" property="goodsDictName"/>
<result column="goods_code" jdbcType="VARCHAR" property="goodsCode"/>
<result column="goods_style" jdbcType="VARCHAR" property="goodsStyle"/>
<result column="goods_art_number" jdbcType="VARCHAR" property="goodsArtNumber"/>
<result column="goods_season" jdbcType="VARCHAR" property="goodsSeason"/>
<result column="goods_colour" jdbcType="VARCHAR" property="goodsColour"/>
<result column="goods_norms" jdbcType="VARCHAR" property="goodsNorms"/>
<result column="goods_size" jdbcType="VARCHAR" property="goodsSize"/>
<result column="goods_brand" jdbcType="VARCHAR" property="goodsBrand"/>
<result column="inventoryValue" jdbcType="INTEGER" property="inventoryValue"/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select id="queryWmsGoodsStocks" resultMap="BasePageResultMap">
select
wgs.*,
wg.goods_name,
wg.goods_code,
sdd_goods_dict_name.dict_label AS goods_dict_name,
sdd_goods_art_number.dict_label AS goods_art_number,
sdd_goods_brand.dict_label AS goods_brand,
sdd_goods_season.dict_label AS goods_season,
sdd_goods_style.dict_label AS goods_style,
sdd_goods_colour.dict_label AS goods_colour,
sdd_goods_norms.dict_label AS goods_norms,
sdd_goods_size.dict_label AS goods_size
from wms_goods_stock wgs
left join wms_goods wg on wg.business_id = wgs.goods_id
LEFT JOIN sys_dict_data sdd_goods_dict_name ON sdd_goods_dict_name.dict_type = 'GOODS_DICT_NAME' AND
sdd_goods_dict_name.dict_value = wg.goods_dict_name AND sdd_goods_dict_name.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_art_number ON sdd_goods_art_number.dict_type = 'GOODS_ART_NUMBER' AND
sdd_goods_art_number.dict_value = wg.goods_art_number AND sdd_goods_art_number.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_brand ON sdd_goods_brand.dict_type = 'GOODS_BRAND' AND sdd_goods_brand.dict_value =
wg.goods_brand AND sdd_goods_brand.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_season ON sdd_goods_season.dict_type = 'GOODS_SEASON' AND sdd_goods_season.dict_value =
wg.goods_season AND sdd_goods_season.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_style ON sdd_goods_style.dict_type = 'GOODS_STYLE' AND sdd_goods_style.dict_value =
wg.goods_style AND sdd_goods_style.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_colour ON sdd_goods_colour.dict_type = 'GOODS_COLOUR' AND sdd_goods_colour.dict_value =
wg.goods_colour AND sdd_goods_colour.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_norms ON sdd_goods_norms.dict_type = 'GOODS_NORMS' AND sdd_goods_norms.dict_value =
wg.goods_norms AND sdd_goods_norms.del_flag = '0'
LEFT JOIN sys_dict_data sdd_goods_size ON sdd_goods_size.dict_type = 'GOODS_SIZE' AND sdd_goods_size.dict_value =
wg.goods_size AND sdd_goods_size.del_flag = '0'
where wgs.del_flag = '0' and wg.del_flag = '0'
<if test="entity.flag !=null and entity.flag != '' ">
and wgs.flag = #{entity.flag}
</if>
<if test="entity.goodsId !=null and entity.goodsId != '' ">
and wgs.goods_id = #{entity.goodsId}
</if>
<if test="entity.goodsCounts !=null and entity.goodsCounts != '' ">
and wgs.goods_counts = #{entity.goodsCounts}
</if>
<if test="entity.goodsNumber !=null and entity.goodsNumber != '' ">
and wgs.goods_number like concat('%',#{entity.goodsNumber},'%')
</if>
<if test="entity.goodsCode !=null and entity.goodsCode != '' ">
and wg.goods_code like concat('%',#{entity.goodsCode},'%')
</if>
<if test="entity.actualGtGoodsCounts != null and entity.actualGtGoodsCounts != ''">
and wgs.goods_counts &gt; #{entity.actualGtGoodsCounts}
</if>
<if test="entity.actualGoodsCode !=null and entity.actualGoodsCode != '' ">
and wg.goods_code = #{entity.actualGoodsCode}
</if>
ORDER BY wg.business_id DESC
</select>
<select id="queryWmsGoodsStocksPaged" resultMap="BasePageResultMap">
SELECT
wgs.*,
wg.goods_name,
wg.goods_dict_name,
wg.goods_code,
wg.goods_style,
wg.goods_art_number,
wg.goods_season,
wg.goods_colour,
wg.goods_norms,
wg.goods_brand,
wg.goods_size
FROM
wms_goods_stock wgs left join wms_goods wg on wg.business_id = wgs.goods_id
where
wgs.del_flag = '0'
and wg.del_flag = '0'
<if test="entity.flag !=null and entity.flag != '' ">
and wgs.flag = #{entity.flag}
</if>
<if test="entity.goodsId !=null and entity.goodsId != '' ">
and wgs.goods_id = #{entity.goodsId}
</if>
<if test="entity.goodsCounts !=null and entity.goodsCounts != '' ">
and wgs.goods_counts = #{entity.goodsCounts}
</if>
<if test="entity.goodsName !=null and entity.goodsName != '' ">
and wg.goods_name = #{entity.goodsName}
</if>
<if test="entity.goodsDictName !=null and entity.goodsDictName != '' ">
and wg.goods_dict_name = #{entity.goodsDictName}
</if>
<if test="entity.goodsCode !=null and entity.goodsCode != '' ">
and wg.goods_code like concat('%',#{entity.goodsCode},'%')
</if>
<if test="entity.goodsStyle !=null and entity.goodsStyle != '' ">
and wg.goods_style = #{entity.goodsStyle}
</if>
<if test="entity.goodsArtNumber !=null and entity.goodsArtNumber != '' ">
and wg.goods_art_number = #{entity.goodsArtNumber}
</if>
<if test="entity.goodsSeason !=null and entity.goodsSeason != '' ">
and wg.goods_season = #{entity.goodsSeason}
</if>
<if test="entity.goodsColour !=null and entity.goodsColour != '' ">
and wg.goods_colour = #{entity.goodsColour}
</if>
<if test="entity.goodsNorms !=null and entity.goodsNorms != '' ">
and wg.goods_norms = #{entity.goodsNorms}
</if>
<if test="entity.goodsSize !=null and entity.goodsSize != '' ">
and wg.goods_size = #{entity.goodsSize}
</if>
<if test="entity.goodsBrand !=null and entity.goodsBrand != '' ">
and wg.goods_brand = #{entity.goodsBrand}
</if>
<if test="entity.inventoryValue != null and entity.inventoryValue != ''">
and wgs.goods_counts &lt; #{entity.inventoryValue}
</if>
<if test="entity.goodsNumber !=null and entity.goodsNumber != '' ">
and wgs.goods_number like concat('%',#{entity.goodsNumber},'%')
</if>
ORDER BY wgs.business_id ASC
</select>
<select id="selectByIdOut" resultMap="BaseResultMap">
select *
from wms_goods_stock
where goods_id = #{businessId}
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment