rev:安全库存、库区维护
This commit is contained in:
@@ -2,25 +2,19 @@
|
||||
package org.nl.wms.masterdata_manage.storage.controller.material;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.anno.Log;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.MaterialsafeivtService;
|
||||
import org.nl.wms.masterdata_manage.备份st.service.dto.MaterialsafeivtDto;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.IStIvtMaterialsafeivtService;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dto.SafeIvtQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dto.ShutQuery;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhouz
|
||||
* @date 2021-12-10
|
||||
@@ -39,13 +33,15 @@ public class MaterialsafeivtController {
|
||||
@ApiOperation("查询安全库存")
|
||||
//@PreAuthorize("@el.check('materialsafeivt:list')")
|
||||
public ResponseEntity<Object> query(SafeIvtQuery query, PageQuery page){
|
||||
return new ResponseEntity<>(materialsafeivtService.queryAll(query,page),HttpStatus.OK);
|
||||
return new ResponseEntity<>(materialsafeivtService.pageQuery(query,page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询拼盘单")
|
||||
@ApiOperation("查询拼盘单")
|
||||
public ResponseEntity<Object> query(ShutQuery query, PageQuery page) {
|
||||
return new ResponseEntity<>(shutframeinvBcpService.pageQuery(query, page), HttpStatus.OK);
|
||||
@PostMapping("/save")
|
||||
@Log("保存安全库存")
|
||||
@ApiOperation("保存安全库存")
|
||||
//@PreAuthorize("@el.check('materialsafeivt:list')")
|
||||
public ResponseEntity<Object> save(@RequestBody JSONObject form){
|
||||
materialsafeivtService.save(form);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.material;
|
||||
|
||||
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.basedata.service.material.dao.StIvtMaterialsafeivt;
|
||||
@@ -22,4 +23,5 @@ public interface IStIvtMaterialsafeivtService extends IService<StIvtMaterialsafe
|
||||
* @return JSONObject
|
||||
*/
|
||||
Object pageQuery(SafeIvtQuery query, PageQuery page);
|
||||
void save(JSONObject form);
|
||||
}
|
||||
|
||||
@@ -25,12 +25,12 @@ public class StIvtMaterialsafeivt implements Serializable {
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private Long stor_id;
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private Long material_id;
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 安全库存下限
|
||||
@@ -45,7 +45,7 @@ public class StIvtMaterialsafeivt implements Serializable {
|
||||
/**
|
||||
* 数量计量单位标识
|
||||
*/
|
||||
private Long qty_unit_id;
|
||||
private String qty_unit_id;
|
||||
|
||||
/**
|
||||
* 数量计量单位名称
|
||||
@@ -55,7 +55,7 @@ public class StIvtMaterialsafeivt implements Serializable {
|
||||
/**
|
||||
* 设置人
|
||||
*/
|
||||
private Long set_id;
|
||||
private String set_id;
|
||||
|
||||
/**
|
||||
* 设置人姓名
|
||||
|
||||
@@ -22,16 +22,16 @@
|
||||
LEFT JOIN st_ivt_bsrealstorattr stor ON stor.stor_id = safe.stor_id
|
||||
LEFT JOIN md_pb_measureunit unit ON unit.measure_unit_id = mb.base_unit_id
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_id = mb.material_type_id
|
||||
WHERE
|
||||
1 = 1
|
||||
<where>
|
||||
<if test="query.material_type_id != null and query.material_type_id != ''">
|
||||
mb.material_type_id = #{query.material_type_id}
|
||||
AND mb.material_type_id = #{query.material_type_id}
|
||||
</if>
|
||||
<if test="query.stor_id != null and query.stor_id != ''">
|
||||
stor.stor_id = #{stor_id}
|
||||
AND stor.stor_id = #{query.stor_id}
|
||||
</if>
|
||||
<if test="query.material_search != null and query.material_search != ''">
|
||||
(mb.material_code = #{query.material_search} OR mb.material_name = #{query.material_search})
|
||||
AND (mb.material_code like '%${query.material_search}%' OR mb.material_name like '%${query.material_search}%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -20,4 +20,8 @@ public class SafeIvtQuery extends BaseQuery<StIvtShutframeinvBcp> {
|
||||
|
||||
private String material_search;
|
||||
|
||||
@Override
|
||||
public void paramMapping() {
|
||||
super.doP.put("material_search", QParam.builder().k(new String[]{"material_search"}).type(QueryTEnum.LK).build());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
package org.nl.wms.storage_manage.basedata.service.material.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
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.mvel2.ast.Safe;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.IStIvtMaterialsafeivtService;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dao.StIvtMaterialsafeivt;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dao.mapper.StIvtMaterialsafeivtMapper;
|
||||
import org.nl.wms.storage_manage.basedata.service.material.dto.SafeIvtQuery;
|
||||
import org.nl.wms.storage_manage.semimanage.service.shutFrame.dto.ShutQuery;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -36,4 +39,28 @@ public class StIvtMaterialsafeivtServiceImpl extends ServiceImpl<StIvtMaterialsa
|
||||
return build;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(JSONObject form) {
|
||||
String stor_id = form.getString("stor_id");
|
||||
JSONArray rows = form.getJSONArray("rows");
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject row = rows.getJSONObject(i);
|
||||
String material_id = row.getString("material_id");
|
||||
this.remove(new QueryWrapper<StIvtMaterialsafeivt>().eq("material_id", material_id).eq("stor_id", stor_id));
|
||||
|
||||
StIvtMaterialsafeivt safe = new StIvtMaterialsafeivt();
|
||||
if (row.getDouble("safe_ivt_down") > 0) {
|
||||
safe.setMaterial_id(material_id);
|
||||
safe.setStor_id(stor_id);
|
||||
safe.setSafe_ivt_up(row.getBigDecimal("safe_ivt_down"));
|
||||
safe.setSafe_ivt_down(row.getBigDecimal("safe_ivt_down"));
|
||||
safe.setQty_unit_id(row.getString("qty_unit_id"));
|
||||
safe.setQty_unit_name(row.getString("qty_unit_name"));
|
||||
safe.setSet_id(SecurityUtils.getCurrentUserId());
|
||||
safe.setSet_name(SecurityUtils.getCurrentNickName());
|
||||
safe.setSet_time(DateUtil.now());
|
||||
this.save(safe);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function insertSafe(data) {
|
||||
export function save(data) {
|
||||
return request({
|
||||
url: 'api/materialsafeivt/insertSafe',
|
||||
url: 'api/materialsafeivt/save',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, insertSafe }
|
||||
export default { add, edit, del, save }
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
placeholder="物料类型"
|
||||
/>
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
v-model="query.material_search"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
@@ -51,9 +51,9 @@
|
||||
>
|
||||
<el-table-column prop="stor_code" label="仓库编码" />
|
||||
<el-table-column prop="stor_name" label="仓库名称" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="material_name" label="物料名称" min-width="200" show-overflow-tooltip />
|
||||
<el-table-column prop="safe_ivt_down" label="安全库存" width="150">
|
||||
<el-table-column prop="safe_ivt_down" label="安全库存" width="170">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="crud.data[scope.$index].safe_ivt_down"
|
||||
@@ -107,7 +107,7 @@ export default {
|
||||
return CRUD({
|
||||
title: '安全库存',
|
||||
optShow: { reset: true },
|
||||
url: 'api/materialsafeivt',
|
||||
url: '/api/materialsafeivt',
|
||||
idField: 'material_id',
|
||||
sort: 'material_id,desc',
|
||||
crudMethod: { ...crudMaterialsafeivt }
|
||||
@@ -207,7 +207,7 @@ export default {
|
||||
const data = {}
|
||||
data.stor_id = this.stor_id
|
||||
data.rows = this.crud.data
|
||||
crudMaterialsafeivt.insertSafe(data).then(() => {
|
||||
crudMaterialsafeivt.save(data).then(() => {
|
||||
this.crud.dleChangePage(1)
|
||||
this.crud.editSuccessNotify()
|
||||
this.crud.refresh()
|
||||
|
||||
@@ -180,7 +180,7 @@ import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudStorattr from '@/api/wms/basedata/st/storattr'
|
||||
import crudStorattr from '@/views/wms/storage_manage/basedata/basedata'
|
||||
import { isvalidPhone } from '@/utils/validate'
|
||||
|
||||
const defaultForm = {
|
||||
@@ -283,7 +283,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor().then(res => {
|
||||
crudStorattr.getStor({}).then(res => {
|
||||
this.stors = res.content
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user