后台存酒取酒功能完善
This commit is contained in:
parent
eca9ffa036
commit
6d0f58ec7d
|
@ -38,6 +38,6 @@ public class StorageRecord extends BaseEntity
|
||||||
|
|
||||||
@Excel(name = "取酒数量")
|
@Excel(name = "取酒数量")
|
||||||
@ApiModelProperty("取酒数量")
|
@ApiModelProperty("取酒数量")
|
||||||
private Long number;
|
private Integer number;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,27 @@
|
||||||
package com.ruoyi.bst.storageRecord.domain;
|
package com.ruoyi.bst.storageRecord.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.bst.specValue.domain.SpecValue;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class StorageRecordVO extends StorageRecord{
|
public class StorageRecordVO extends StorageRecord{
|
||||||
|
|
||||||
|
@ApiModelProperty("用户名称")
|
||||||
|
private String userName;
|
||||||
|
|
||||||
|
@ApiModelProperty("店铺名称")
|
||||||
|
private String storeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品名称")
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
|
@ApiModelProperty("存放总数")
|
||||||
|
private Integer totalNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("商品规格")
|
||||||
|
private List<SpecValue> specValue;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,18 +12,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="reason" column="reason" />
|
<result property="reason" column="reason" />
|
||||||
<result property="number" column="number" />
|
<result property="number" column="number" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="specValue" column="spec_value" typeHandler="com.ruoyi.bst.storage.mapper.typehandler.SpecValueListTypeHandler" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectStorageRecordVo">
|
<sql id="selectStorageRecordVo">
|
||||||
select
|
select
|
||||||
id,
|
bsr.id,
|
||||||
storage_id,
|
bsr.storage_id,
|
||||||
store_id,
|
bsr.store_id,
|
||||||
user_id,
|
bsr.user_id,
|
||||||
reason,
|
bsr.reason,
|
||||||
number,
|
bsr.number,
|
||||||
create_time
|
bsr.create_time,
|
||||||
from bst_storage_record
|
bs.store_name,
|
||||||
|
su.user_name,
|
||||||
|
bst.goods_name,
|
||||||
|
bst.spec_value,
|
||||||
|
bst.total_num,
|
||||||
|
bst.taken_num
|
||||||
|
from <include refid="searchTables"/>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="searchTables">
|
||||||
|
bst_storage_record bsr
|
||||||
|
left join bst_storage bst on bsr.storage_id = bst.id
|
||||||
|
left join bst_store bs on bsr.store_id = bs.store_id
|
||||||
|
left join sys_user su on bsr.user_id = su.user_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<sql id="searchCondition">
|
<sql id="searchCondition">
|
||||||
|
|
|
@ -19,8 +19,13 @@ public interface StorageRecordService
|
||||||
* @param id 取酒记录主键
|
* @param id 取酒记录主键
|
||||||
* @return 取酒记录
|
* @return 取酒记录
|
||||||
*/
|
*/
|
||||||
public StorageRecordVO selectStorageRecordById(Long id);
|
public StorageRecordVO selectStorageRecordById(Long id,boolean scope);
|
||||||
|
|
||||||
|
default StorageRecordVO selectStorageRecordById(Long id){
|
||||||
|
return this.selectStorageRecordById(id,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StorageRecordVO selectOne(StorageRecordQuery query);
|
||||||
/**
|
/**
|
||||||
* 查询取酒记录列表
|
* 查询取酒记录列表
|
||||||
*
|
*
|
||||||
|
@ -60,4 +65,6 @@ public interface StorageRecordService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deleteStorageRecordById(Long id);
|
public int deleteStorageRecordById(Long id);
|
||||||
|
|
||||||
|
int batchInsert(List<StorageRecord> storageRecordList);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
package com.ruoyi.bst.storageRecord.service.impl;
|
package com.ruoyi.bst.storageRecord.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
|
import com.ruoyi.bst.storage.domain.StorageQuery;
|
||||||
|
import com.ruoyi.bst.storage.domain.StorageVO;
|
||||||
|
import com.ruoyi.bst.storeStaff.domain.enums.StoreStaffPermission;
|
||||||
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.collection.CollectionUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ruoyi.bst.storageRecord.mapper.StorageRecordMapper;
|
import com.ruoyi.bst.storageRecord.mapper.StorageRecordMapper;
|
||||||
|
@ -29,9 +35,23 @@ public class StorageRecordServiceImpl implements StorageRecordService
|
||||||
* @return 取酒记录
|
* @return 取酒记录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public StorageRecordVO selectStorageRecordById(Long id)
|
public StorageRecordVO selectStorageRecordById(Long id,boolean scope)
|
||||||
{
|
{
|
||||||
return storageRecordMapper.selectStorageRecordById(id);
|
if (id == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
StorageRecordQuery query = new StorageRecordQuery();
|
||||||
|
query.setId(id);
|
||||||
|
query.setScope(scope);
|
||||||
|
query.addStorePermission(StoreStaffPermission.STORAGE_RECORD_VIEW.getCode());
|
||||||
|
return this.selectOne(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public StorageRecordVO selectOne(StorageRecordQuery query) {
|
||||||
|
PageHelper.startPage(1, 1);
|
||||||
|
List<StorageRecordVO> list = this.selectStorageRecordList(query);
|
||||||
|
return CollectionUtils.firstElement(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -94,4 +114,9 @@ public class StorageRecordServiceImpl implements StorageRecordService
|
||||||
{
|
{
|
||||||
return storageRecordMapper.deleteStorageRecordById(id);
|
return storageRecordMapper.deleteStorageRecordById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchInsert(List<StorageRecord> storageRecordList) {
|
||||||
|
return storageRecordMapper.batchInsert(storageRecordList);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.ruoyi.bst.storageRecord.domain.StorageRecord;
|
||||||
import com.ruoyi.bst.storageRecord.domain.StorageRecordQuery;
|
import com.ruoyi.bst.storageRecord.domain.StorageRecordQuery;
|
||||||
import com.ruoyi.bst.storageRecord.domain.StorageRecordVO;
|
import com.ruoyi.bst.storageRecord.domain.StorageRecordVO;
|
||||||
import com.ruoyi.bst.storageRecord.service.StorageRecordService;
|
import com.ruoyi.bst.storageRecord.service.StorageRecordService;
|
||||||
|
import com.ruoyi.bst.storeStaff.domain.enums.StoreStaffPermission;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
@ -39,6 +40,8 @@ public class StorageRecordController extends BaseController
|
||||||
{
|
{
|
||||||
startPage();
|
startPage();
|
||||||
startOrderBy();
|
startOrderBy();
|
||||||
|
query.setScope(true);
|
||||||
|
query.addStorePermission(StoreStaffPermission.STORAGE_RECORD_VIEW.getCode());
|
||||||
List<StorageRecordVO> list = storageRecordService.selectStorageRecordList(query);
|
List<StorageRecordVO> list = storageRecordService.selectStorageRecordList(query);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
@ -51,6 +54,7 @@ public class StorageRecordController extends BaseController
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, StorageRecordQuery query)
|
public void export(HttpServletResponse response, StorageRecordQuery query)
|
||||||
{
|
{
|
||||||
|
query.setScope(true);
|
||||||
List<StorageRecordVO> list = storageRecordService.selectStorageRecordList(query);
|
List<StorageRecordVO> list = storageRecordService.selectStorageRecordList(query);
|
||||||
ExcelUtil<StorageRecordVO> util = new ExcelUtil<StorageRecordVO>(StorageRecordVO.class);
|
ExcelUtil<StorageRecordVO> util = new ExcelUtil<StorageRecordVO>(StorageRecordVO.class);
|
||||||
util.exportExcel(response, list, "取酒记录数据");
|
util.exportExcel(response, list, "取酒记录数据");
|
||||||
|
@ -63,7 +67,7 @@ public class StorageRecordController extends BaseController
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
{
|
||||||
return success(storageRecordService.selectStorageRecordById(id));
|
return success(storageRecordService.selectStorageRecordById(id,true));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user