add:成品库存
This commit is contained in:
@@ -2,15 +2,20 @@ package org.nl.wms.storage_manage.productmanage.controller.structIvt;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓位库存表 前端控制器
|
||||
@@ -26,6 +31,14 @@ public class StIvtStructivtCpController {
|
||||
@Autowired
|
||||
private IStIvtStructivtCpService iStIvtStructivtCpService;
|
||||
|
||||
|
||||
@GetMapping
|
||||
@Log("成品库存查询")
|
||||
@ApiOperation("成品库存查询")
|
||||
public ResponseEntity<Object> query(CpIvtQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(iStIvtStructivtCpService.packageQuery(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/getStructIvt")
|
||||
@Log("查询库存")
|
||||
@ApiOperation("查询库存")
|
||||
|
||||
@@ -2,7 +2,9 @@ package org.nl.wms.storage_manage.productmanage.service.structIvt;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
|
||||
|
||||
import java.util.List;
|
||||
@@ -18,6 +20,13 @@ import java.util.Map;
|
||||
*/
|
||||
public interface IStIvtStructivtCpService extends IService<StIvtStructivtCp> {
|
||||
|
||||
|
||||
/**
|
||||
* 成品库存查询
|
||||
* @param query /
|
||||
*/
|
||||
Object packageQuery(CpIvtQuery query, PageQuery page);
|
||||
|
||||
/**
|
||||
* 成品库存更新
|
||||
* @param json
|
||||
@@ -58,4 +67,5 @@ public interface IStIvtStructivtCpService extends IService<StIvtStructivtCp> {
|
||||
* }
|
||||
*/
|
||||
List<Map> getStructIvtMore(StructIvtYLQuery whereJson);
|
||||
|
||||
}
|
||||
|
||||
@@ -3,7 +3,9 @@ package org.nl.wms.storage_manage.productmanage.service.structIvt.dao.mapper;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
|
||||
|
||||
import java.util.List;
|
||||
@@ -27,4 +29,5 @@ public interface StIvtStructivtCpMapper extends BaseMapper<StIvtStructivtCp> {
|
||||
|
||||
List<Map> getStructIvtMoreBox(JSONObject json);
|
||||
|
||||
List<Map> packageQuery(@Param("query") CpIvtQuery query);
|
||||
}
|
||||
|
||||
@@ -138,4 +138,44 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="packageQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
attr.stor_name,
|
||||
attr.sect_name,
|
||||
ivt.struct_code,
|
||||
ivt.struct_name,
|
||||
mater.material_name,
|
||||
mater.material_code,
|
||||
attr.storagevehicle_code,
|
||||
ivt.canuse_qty,
|
||||
ivt.frozen_qty,
|
||||
ivt.ivt_qty,
|
||||
ivt.warehousing_qty,
|
||||
unit.unit_name,
|
||||
ivt.instorage_time
|
||||
FROM
|
||||
st_ivt_structivt_cp ivt
|
||||
LEFT JOIN md_me_materialbase mater ON ivt.material_id = mater.material_id
|
||||
LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id
|
||||
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = ivt.qty_unit_id
|
||||
<where>
|
||||
1=1
|
||||
<if test="query.material_code!= null and query.material_code != ''">
|
||||
and mater.material_code LIKE #{query.material_code} or
|
||||
(mater.material_name LIKE #{query.material_code})
|
||||
</if>
|
||||
<if test="query.struct_code!= null and query.struct_code != ''">
|
||||
and attr.struct_code LIKE #{query.struct_code} or
|
||||
(attr.struct_name LIKE #{query.struct_code})
|
||||
</if>
|
||||
<if test="query.start_time!= null and query.start_time != ''">
|
||||
and ivt.instorage_time >= #{query.start_time}
|
||||
</if>
|
||||
<if test="query.end_time!= null and query.end_time != ''">
|
||||
and ivt.instorage_time <= #{query.end_time}
|
||||
</if>
|
||||
</where>
|
||||
order by ivt.instorage_time DESC,attr.struct_code ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.nl.wms.storage_manage.productmanage.service.structIvt.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nl.common.domain.query.BaseQuery;
|
||||
import org.nl.common.domain.query.QParam;
|
||||
import org.nl.common.enums.QueryTEnum;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
|
||||
|
||||
/*
|
||||
* @author LXY
|
||||
* @Date 2023/5/4 19:49
|
||||
*/
|
||||
@Data
|
||||
public class CpIvtQuery extends BaseQuery<StIvtStructivtCp> {
|
||||
|
||||
|
||||
private String struct_code;
|
||||
|
||||
private String material_code;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("struct_code", QParam.builder().k(new String[]{"struct_code"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -6,6 +6,10 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
|
||||
@@ -17,11 +21,13 @@ import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtStructattr;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.IStIvtStructivtCpService;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.StIvtStructivtCp;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dao.mapper.StIvtStructivtCpMapper;
|
||||
import org.nl.wms.storage_manage.productmanage.service.structIvt.dto.CpIvtQuery;
|
||||
import org.nl.wms.storage_manage.productmanage.util.ChangeIvtUtil;
|
||||
import org.nl.wms.storage_manage.rawmanage.service.structIvt.dto.StructIvtYLQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
@@ -48,6 +54,15 @@ public class StIvtStructivtCpServiceImpl extends ServiceImpl<StIvtStructivtCpMap
|
||||
@Autowired
|
||||
protected IMdPbBucketrecordService iMdPbBucketrecordService; // 包装箱记录表服务
|
||||
|
||||
@Override
|
||||
public Object packageQuery(CpIvtQuery query, PageQuery pageQuery) {
|
||||
Page<Object> page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize());
|
||||
TableDataInfo build = TableDataInfo.build(this.baseMapper.packageQuery(query));
|
||||
build.setTotalElements(page.getTotal());
|
||||
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void UpdateIvt(JSONObject json) {
|
||||
|
||||
150
mes/qd/src/views/wms/storage_manage/product/productIvt/index.vue
Normal file
150
mes/qd/src/views/wms/storage_manage/product/productIvt/index.vue
Normal file
@@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属仓库">
|
||||
<el-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="单据状态"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="入库日期">
|
||||
<el-date-picker
|
||||
v-model="query.createTime"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="['00:00:00', '23:59:59']"
|
||||
@change="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="仓位">
|
||||
<el-input
|
||||
v-model="query.struct_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="仓位"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="物料">
|
||||
<el-input
|
||||
v-model="query.material_code"
|
||||
size="mini"
|
||||
clearable
|
||||
placeholder="仓位"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission"/>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
size="mini"
|
||||
:data="crud.data"
|
||||
highlight-current-row
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库名称" />
|
||||
<el-table-column show-overflow-tooltip prop="sect_name" label="库区名称" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_code" label="仓位编码" />
|
||||
<el-table-column show-overflow-tooltip prop="struct_name" label="仓位名称" />
|
||||
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" />
|
||||
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" />
|
||||
<el-table-column show-overflow-tooltip prop="storagevehicle_code" label="载具号" />
|
||||
<el-table-column show-overflow-tooltip prop="canuse_qty" label="可用数量" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="frozen_qty" label="冻结数量" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="ivt_qty" label="库存数量" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="warehousing_qty" label="待入数量" :formatter="crud.formatNum3" />
|
||||
<el-table-column show-overflow-tooltip prop="unit_name" label="单位" />
|
||||
<el-table-column show-overflow-tooltip prop="instorage_time" label="入库时间" min-width="150" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker/index'
|
||||
import crudStorattr, { getStor } from '@/views/wms/storage_manage/basedata/basedata'
|
||||
import ProductIvt from '@/views/wms/storage_manage/product/productIvt/productivt'
|
||||
|
||||
export default {
|
||||
name: 'ProductIn',
|
||||
components: { crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '成品库存',
|
||||
optShow: { add: false, reset: true },
|
||||
idField: 'stockrecord_id',
|
||||
url: '/api/stIvtStructivtCp',
|
||||
crudMethod: { ...ProductIvt }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
permission: {},
|
||||
storlist: [],
|
||||
storId: null
|
||||
}
|
||||
},
|
||||
mounted: function() {
|
||||
const that = this
|
||||
window.onresize = function temp() {
|
||||
that.height = document.documentElement.clientHeight - 180 + 'px;'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor({ 'stor_type': '4' }).then(res => {
|
||||
this.storlist = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,31 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: '/api/stIvtStructivtCp',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: '/api/stIvtStructivtCp/delete',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: '/api/stIvtStructivtCp/update',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default {
|
||||
add,
|
||||
edit,
|
||||
del
|
||||
}
|
||||
Reference in New Issue
Block a user