add:日库存统计
This commit is contained in:
@@ -9,8 +9,10 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.wms.masterdata_manage.service.master.IMdPbMeasureunitService;
|
||||
import org.nl.wms.masterdata_manage.service.master.dao.MdPbMeasureunit;
|
||||
import org.nl.wms.masterdata_manage.service.master.dto.UnitQuery;
|
||||
@@ -22,7 +24,9 @@ import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author loujf
|
||||
@@ -45,6 +49,17 @@ public class MdPbMeasureunitController {
|
||||
return new ResponseEntity<>(measureunitService.pageQuery(query, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/select")
|
||||
@Log("查询单位下拉列表设备")
|
||||
public ResponseEntity<Object> selectAll(){
|
||||
List<MdPbMeasureunit> list = measureunitService.list();
|
||||
List<Map> result = new ArrayList<>();
|
||||
for (MdPbMeasureunit item : list) {
|
||||
result.add(MapOf.of("label",item.getUnit_name(),"value",item.getMeasure_unit_id()));
|
||||
}
|
||||
return new ResponseEntity<>(TableDataInfo.build(result),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
@Log("新增计量单位")
|
||||
//("新增计量单位")
|
||||
|
||||
@@ -17,4 +17,5 @@ public interface IStIvtStructivtDailyService extends IService<StIvtStructivtDail
|
||||
* 统计日常数据
|
||||
*/
|
||||
void dailyStructivt(String...structivts);
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,21 @@ public class StIvtStructivtDaily implements Serializable {
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
private String sect_id;
|
||||
/**
|
||||
* 库区名称
|
||||
*/
|
||||
private String sect_name;
|
||||
|
||||
/**
|
||||
* 仓库表
|
||||
*/
|
||||
@@ -64,6 +79,17 @@ public class StIvtStructivtDaily implements Serializable {
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_spec;
|
||||
|
||||
/**
|
||||
* 可用数
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.util.Map;
|
||||
*/
|
||||
public interface StIvtStructivtDailyMapper extends BaseMapper<StIvtStructivtDaily> {
|
||||
|
||||
@Select("select #{table} as table_name,'A1' as product_area, UUID_SHORT() id,material_id,sum(canuse_qty) canuse_qty ,sum(frozen_qty) frozen_qty,sum(ivt_qty) ivt_qty,sum(warehousing_qty) warehousing_qty,GROUP_CONCAT(struct_code) struct_code,stor_id,qty_unit_id,CURDATE() create_time from ${table} GROUP BY material_id")
|
||||
@Select("SELECT #{table} AS table_name,GROUP_CONCAT(a.struct_code) struct_code, 'A1' AS product_area, st_ivt_structattr.stor_id,st_ivt_structattr.stor_name , st_ivt_structattr.sect_id,st_ivt_structattr.sect_name , UUID_SHORT( ) id,a.material_id,md_me_materialbase.material_code,md_me_materialbase.material_spec, sum( canuse_qty ) canuse_qty, sum( frozen_qty ) frozen_qty, sum( ivt_qty ) ivt_qty, sum( warehousing_qty ) warehousing_qty, qty_unit_id, CURDATE( ) create_time FROM ${table} as a left join st_ivt_structattr on a.struct_code = st_ivt_structattr.struct_code left join md_me_materialbase on a.material_id = md_me_materialbase.material_id GROUP BY material_id")
|
||||
List<Map> selectStructivt(@Param("table") String table);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,23 +13,14 @@ import org.nl.wms.masterdata_manage.storage.service.dailyStructivt.dao.StIvtStru
|
||||
@Data
|
||||
public class DailyStructivtQuery extends BaseQuery<StIvtStructivtDaily> {
|
||||
|
||||
private String is_materialstore;
|
||||
private String is_reversed;
|
||||
private String is_attachment;
|
||||
private String is_productstore;
|
||||
private String is_semi_finished;
|
||||
private String is_virtualstore;
|
||||
|
||||
private String stor_id;
|
||||
private String sect_id;
|
||||
private String struct_code;
|
||||
private String lock_type;
|
||||
private Boolean is_used;
|
||||
private Boolean emptyvehicle;
|
||||
private Boolean is_emptyvehicle;
|
||||
private String blurry;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("blurry", QParam.builder().k(new String[]{"struct_code"}).type(QueryTEnum.LK).build());
|
||||
super.doP.put("emptyvehicle", QParam.builder().k(new String[]{"storagevehicle_code"}).type(QueryTEnum.NULL_OR_EMPTY).build());
|
||||
super.doP.put("blurry", QParam.builder().k(new String[]{"material_code","material_spec"}).type(QueryTEnum.ORLK).build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,9 +37,11 @@ public enum IOSEnum {
|
||||
//锁定类型
|
||||
LOCK_TYPE(MapOf.of("未锁定", "0", "入库锁", "1", "出库锁", "2","盘点锁", "3","损溢锁", "4","拼盘锁","5","移库锁","10","其他锁","99")),
|
||||
// 海柔半成品出入库类型
|
||||
BILL_TYPE_HR(MapOf.of("生产出库", "1001", "盘点出库", "1002", "手工出库", "1009","生产入库","0001")),
|
||||
BILL_TYPE_HR(MapOf.of("生产出库", "1001", "盘点出库", "1002", "手工出库", "1009","生产入库","0001","手工入库", "0009")),
|
||||
// 半成品出入类型
|
||||
BILL_TYPE_BCP(MapOf.of("清洗入库", "0001", "手工入库", "0009","生产出库","1001","手工出库","1009")),
|
||||
|
||||
ST_INV_CP_TYPE(MapOf.of("生产出库", "1001", "盘点出库", "1002", "移库出库", "1003","手工出库", "1009","生产入库","0001","移库入库","0003","手工入库", "0009")),
|
||||
;
|
||||
private Map<String, String> code;
|
||||
|
||||
|
||||
@@ -284,7 +284,8 @@ public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper,
|
||||
ivtOutParam.put("sale_id", dtl.getSale_id());
|
||||
ivtOutParam.put("bill_code",mst.getBill_code());
|
||||
ivtOutParam.put("inv_id",mst.getMoveinv_id());
|
||||
ivtOutParam.put("bill_type_scode",mst.getBill_type());
|
||||
ivtOutParam.put("bill_type_scode",IOSEnum.ST_INV_CP_TYPE.code("移库出库"));
|
||||
ivtOutParam.put("stor_id",mst.getStor_id());
|
||||
iStIvtStructivtCpService.UpdateIvt(ivtOutParam);
|
||||
//加入库
|
||||
JSONObject ivtInParam = new JSONObject();
|
||||
@@ -298,7 +299,8 @@ public class StIvtMoveinvCpServiceImpl extends ServiceImpl<StIvtMoveinvCpMapper,
|
||||
ivtInParam.put("sale_id", dtl.getSale_id());
|
||||
ivtInParam.put("bill_code",mst.getBill_code());
|
||||
ivtInParam.put("inv_id",mst.getMoveinv_id());
|
||||
ivtInParam.put("bill_type_scode",mst.getBill_type());
|
||||
ivtInParam.put("bill_type_scode",IOSEnum.ST_INV_CP_TYPE.code("移库入库"));
|
||||
ivtInParam.put("product_area",mst.getProduct_area());
|
||||
iStIvtStructivtCpService.UpdateIvt(ivtInParam);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
|
||||
mst.setPcsn(StringUtils.isNotEmpty(form.getString("pcsn")) ? form.getString("pcsn") : DateUtil.today());
|
||||
mst.setPlan_qty(stIvtStructivtBcp.getCanuse_qty());
|
||||
mst.setQuality_scode(stIvtStructivtBcp.getQuality_scode());
|
||||
mst.setQty_unit_id(stIvtStructivtBcp.getQty_unit_id());
|
||||
mst.setQty_unit_id("2");
|
||||
mst.setBase_bill_code("");
|
||||
mst.setQty_unit_name(" ");
|
||||
mst.setUnit_weight(material.getNet_weight());
|
||||
|
||||
@@ -219,7 +219,7 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
.pcsn(DateUtil.today())
|
||||
.ivt_level(IVTEnum.IVT_LEVEL.code("一级"))
|
||||
.is_active(true)
|
||||
.qty_unit_id(mdMeMaterialbase.getBase_unit_id())
|
||||
.qty_unit_id("2")
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(form.getString("stor_id"))
|
||||
.canuse_qty(form.getBigDecimal("qty"))
|
||||
@@ -273,7 +273,7 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
|
||||
.pcsn(mst.getPcsn())
|
||||
.ivt_level(mst.getIvt_level())
|
||||
.is_active(mst.getIs_active())
|
||||
.qty_unit_id(mst.getQty_unit_id())
|
||||
.qty_unit_id("2")
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(mst.getStor_id())
|
||||
.canuse_qty(mst.getPlan_qty())
|
||||
|
||||
@@ -288,7 +288,7 @@ public class StIvtMoveinvBcpServiceImpl extends ServiceImpl<StIvtMoveinvBcpMappe
|
||||
.pcsn(dtl.getPcsn())
|
||||
.ivt_level(dtl.getIvt_level())
|
||||
.is_active(dtl.getIs_active())
|
||||
.qty_unit_id(dtl.getQty_unit_id())
|
||||
.qty_unit_id("2")
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(mst.getStor_id())
|
||||
.canuse_qty(dtl.getQty())
|
||||
|
||||
@@ -235,7 +235,7 @@ public class StIvtMoreorlessmstBcpServiceImpl extends ServiceImpl<StIvtMoreorles
|
||||
.ivt_level(dtl.getIvt_level())
|
||||
.is_active(dtl.getIs_active())
|
||||
.canuse_qty(mol_qty)
|
||||
.qty_unit_id(dtl.getQty_unit_id())
|
||||
.qty_unit_id("2")
|
||||
.instorage_time(DateUtil.now())
|
||||
.stor_id(mst.getStor_id())
|
||||
.workshop_id(mst.getProduct_area())
|
||||
|
||||
@@ -86,7 +86,7 @@ public class StIvtStructivtBcp implements Serializable {
|
||||
private BigDecimal warehousing_qty;
|
||||
|
||||
/**
|
||||
* 计量单位标识
|
||||
* 计量单位标识:2/g
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ public class StIvtIostorinvHrBcpOutServiceImpl extends ServiceImpl<StIvtIostorin
|
||||
new QueryWrapper<MdPbStoragevehicleext>().lambda()
|
||||
.eq(MdPbStoragevehicleext::getStoragevehicle_code,form.getString("storagevehicle_code"))
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ public class StIvtIostorinvHrBcpOutServiceImpl extends ServiceImpl<StIvtIostorin
|
||||
mst.setPcsn(StringUtils.isNotEmpty(form.getString("pcsn")) ? form.getString("pcsn") : DateUtil.today());
|
||||
mst.setPlan_qty(stIvtStructivtBcp.getCanuse_qty());
|
||||
mst.setQuality_scode(stIvtStructivtBcp.getQuality_scode());
|
||||
mst.setQty_unit_id(stIvtStructivtBcp.getQty_unit_id());
|
||||
mst.setQty_unit_id("2");
|
||||
mst.setBase_bill_code("");
|
||||
mst.setQty_unit_name(" ");
|
||||
mst.setUnit_weight(material.getNet_weight());
|
||||
|
||||
@@ -19,3 +19,6 @@ ALTER TABLE st_ivt_structivt_bcp
|
||||
ADD COLUMN `frozen_qty` decimal(18,3) DEFAULT '0.000' COMMENT '冻结数',
|
||||
ADD COLUMN `ivt_qty` decimal(18,3) NOT NULL DEFAULT '0.000' COMMENT '库存数',
|
||||
ADD COLUMN `warehousing_qty` decimal(18,3) DEFAULT '0.000' COMMENT '待入数';
|
||||
-- CP移库类型
|
||||
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1703954832731279360', 'ST_INV_CP_IN_TYPE', '成品入库单据类型', '移库入库', '0003', 3, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-19 10:11:04', '1694303357524643840', '管理员', '2023-09-19 10:11:04');
|
||||
INSERT INTO `hl_one_mes`.`sys_dict`(`dict_id`, `code`, `name`, `label`, `value`, `dict_sort`, `dict_type`, `para1`, `para2`, `para3`, `create_id`, `create_name`, `create_time`, `update_id`, `update_name`, `update_time`) VALUES ('1703955348920078336', 'ST_INV_CP_OUT_TYPE', '成品出库单据类型', '移库出库', '1003', 3, NULL, NULL, NULL, NULL, '1694303357524643840', '管理员', '2023-09-19 10:13:07', '1694303357524643840', '管理员', '2023-09-19 10:13:16');
|
||||
|
||||
@@ -31,5 +31,11 @@ export function getUnit(params) {
|
||||
params
|
||||
})
|
||||
}
|
||||
export function getSelect() {
|
||||
return request({
|
||||
url: 'api/mdPbMeasureunit/select',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getUnit }
|
||||
export default { add, edit, del, getUnit, getSelect }
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/structivtDaily',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/structivtDaily',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/structivtDaily',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export default { add, edit, del }
|
||||
@@ -0,0 +1,200 @@
|
||||
<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-cascader
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
class="filter-item"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料编码">
|
||||
<el-input
|
||||
v-model="query.blurry"
|
||||
clearable
|
||||
size="mini"
|
||||
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"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<!--
|
||||
<el-table-column type="selection" width="55" />
|
||||
-->
|
||||
<el-table-column prop="stor_name" label="所属仓库" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="sect_name" label="所属库区" width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="struct_code" label="所属仓位" width="120" />
|
||||
<el-table-column prop="material_code" label="物料编码" width="150" />
|
||||
<el-table-column prop="material_spec" label="物料规格" width="150" />
|
||||
<el-table-column prop="material_id" label="物料id" width="150" />
|
||||
<el-table-column prop="canuse_qty" label="可用总数" width="150" />
|
||||
<el-table-column prop="ivt_qty" label="库存总数" width="150" />
|
||||
<el-table-column prop="frozen_qty" label="冻结总数" width="150" />
|
||||
<el-table-column prop="warehousing_qty" label="待入总数" width="150" />
|
||||
<el-table-column prop="qty_unit_id" label="单位" width="150" :formatter="formatUnit"/>
|
||||
<el-table-column prop="create_time" label="统计日期" width="150" fixed="right" align="center"></el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import dailyStructivt from '@/views/wms/masterdata_manage/st/dailyStructivt/dailyStructivt'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudMdPbMeasureunit from '@/api/wms/basedata/master/mdPbMeasureunit'
|
||||
|
||||
const defaultForm = {
|
||||
struct_id: null,
|
||||
cascader: null,
|
||||
struct_code: null,
|
||||
struct_name: null,
|
||||
simple_name: null,
|
||||
sect_id: null,
|
||||
sect_code: null,
|
||||
sect_name: null,
|
||||
stor_id: null,
|
||||
material_code: null,
|
||||
stor_code: null,
|
||||
stor_name: null,
|
||||
stor_type: null,
|
||||
capacity: null,
|
||||
width: null,
|
||||
height: null,
|
||||
zdepth: null,
|
||||
weight: null,
|
||||
xqty: null,
|
||||
yqty: null,
|
||||
zqty: null,
|
||||
is_tempstruct: '0',
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null,
|
||||
back_ground_color: null,
|
||||
front_ground_color: null,
|
||||
back_ground_pic: null,
|
||||
font_direction_scode: null,
|
||||
is_used: true,
|
||||
is_zdepth: null,
|
||||
storagevehicle_id: null,
|
||||
storagevehicle_code: null,
|
||||
storagevehicle_type: null,
|
||||
is_emptyvehicle: null,
|
||||
storagevehicle_qty: null,
|
||||
lock_type: null,
|
||||
material_height_type: null,
|
||||
ext_id: null,
|
||||
remark: null
|
||||
}
|
||||
export default {
|
||||
name: 'Structattr',
|
||||
dicts: ['ST_INV_BCP_IN_TYPE'],
|
||||
components: { pagination, crudOperation, rrOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '仓位',
|
||||
optShow: { add: false, reset: true },
|
||||
url: 'api/structivtDaily',
|
||||
idField: 'id',
|
||||
crudMethod: { ...dailyStructivt }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
const numberOne = (rule, value, callback) => {
|
||||
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
|
||||
const numRe = new RegExp(numReg)
|
||||
if (value) {
|
||||
if (!numRe.test(value)) {
|
||||
callback(new Error('只能输入数字'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
measure_unit:[],
|
||||
sects: [],
|
||||
permission: {
|
||||
add: ['admin', 'dept:add'],
|
||||
edit: ['admin', 'dept:edit'],
|
||||
del: ['admin', 'dept:del']
|
||||
},
|
||||
trueorfalse: [ { value: true, label: '是' }, { value: false, label: '否' }]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudSectattr.getSect({}).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
crudMdPbMeasureunit.getSelect().then(res => {
|
||||
this.measure_unit = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
sectChange(val) {
|
||||
this.form.sect_id = val[1]
|
||||
},
|
||||
formatUnit(row, column) {
|
||||
const values = this.measure_unit.filter(v => {
|
||||
return v.value === row.qty_unit_id
|
||||
})
|
||||
return values[0].label
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.query.sect_id = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = val[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user