rev:修改缓存线异常盘点功能

This commit is contained in:
2023-05-22 12:28:21 +08:00
parent dbf6773d47
commit a229ccd9f8
7 changed files with 526 additions and 17 deletions

View File

@@ -57,4 +57,11 @@ public interface WmsToAcsService {
* @return
*/
Map<String, Object> replaceDevice(JSONArray arr);
/**
* 变更设备电气信号
* @param arr
* @return
*/
Map<String, Object> action(JSONArray arr);
}

View File

@@ -97,4 +97,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService{
return AcsUtil.notifyAcs(api, arr);
}
@Override
public Map<String, Object> action(JSONArray arr) {
String api = "api/wms/action";
return AcsUtil.notifyAcs(api, arr);
}
}

View File

@@ -240,6 +240,15 @@ public class CacheLineHandController {
return new ResponseEntity<>(cacheLineHandService.deleteBox(param), HttpStatus.OK);
}
@PostMapping("/check")
@Log("修改缓存线盘点状态")
@ApiOperation("修改缓存线盘点状态")
public ResponseEntity<Object> check(@RequestBody JSONObject param) {
log.info("海亮缓存线手持服务 [盘点] 接口被请求, 请求参数-{}", param);
cacheLineHandService.check(param);
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/agvInBoxExceptionQuery")
@Log("AGV入箱异常-查询")
@ApiOperation("AGV入箱异常-查询")

View File

@@ -251,7 +251,7 @@ public interface CacheLineHandService{
* @author gbx
* @date 2023/3/24
*/
CommonResult<JSONObject> cacheLineExcepOpt(JSONObject param);
JSONObject cacheLineExcepOpt(JSONObject param);
/**
* 倒料操作
@@ -292,4 +292,11 @@ public interface CacheLineHandService{
* @param param
*/
JSONObject deleteBox(JSONObject param);
/**
* 删除箱子
*
* @param param
*/
void check(JSONObject param);
}

View File

@@ -83,6 +83,8 @@ public class CacheLineHandServiceImpl implements CacheLineHandService {
private IMdMeMaterialbaseService materialbaseService;
@Autowired
private ISchBaseTaskService taskService;
@Autowired
private WmsToAcsService wmsToAcsService;
@Override
public JSONArray dropdownListQuery(String param, String type) {
@@ -692,27 +694,19 @@ public class CacheLineHandServiceImpl implements CacheLineHandService {
*/
@Override
@Transactional(rollbackFor = Exception.class)
public CommonResult<JSONObject> cacheLineExcepOpt(JSONObject param) {
public JSONObject cacheLineExcepOpt(JSONObject param) {
// 缓存线编码
String wcsdevice_code = param.getString("wcsdevice_code");
// opt_type 1-暂停、2-启动,默认为1暂停
String type = StatusEnum.PAUSE_CACHELINE.getCode();
String opt_type = param.getString("opt_type");
if (StatusEnum.START_CACHELINE.getCode().equals(opt_type)) {
type = "0";
}
JSONArray jsonArray = new JSONArray();
JSONObject jsonObject = new JSONObject();
//下发接收的恢复是0暂停是1
jsonObject.put("type", type);
jsonObject.put("type", opt_type);
//缓存线编码
jsonObject.put("wcsdevice_code", wcsdevice_code);
jsonArray.add(jsonObject);
try {
return RestBusinessTemplate.execute(() -> AcsUtil.notifyAcs("api/wms/puaseCacheLine", jsonArray));
} catch (NullPointerException e) {
throw new BadRequestException(e.toString());
}
jsonObject.put("device_code", wcsdevice_code);
AcsUtil.notifyAcs("api/wms/puaseCacheLine", jsonObject);
JSONObject result = new JSONObject();
result.put("message", "操作成功!");
return result;
}
/**
@@ -895,4 +889,31 @@ public class CacheLineHandServiceImpl implements CacheLineHandService {
}
return res;
}
@Override
public void check(JSONObject param) {
String option = param.getString("option");
if (StrUtil.isEmpty(option)) {
throw new BadRequestException("缺少关键参数option");
}
String device_code = param.getString("device_code");
String code = "";
if (option.equals("0")) {
code = "to_start_checking";
}
if (option.equals("1")) {
code = "to_check_finish";
}
String value = "1";
JSONObject jo = new JSONObject();
jo.put("device_code", device_code);
jo.put("code", code);
jo.put("value", value);
JSONArray ja = new JSONArray();
ja.add(jo);
wmsToAcsService.action(ja);
}
}

View File

@@ -30,6 +30,6 @@
</if>
</where>
ORDER BY
scp.cacheline_code, scp.layer_num, scp.positionorder_no, scp.cache_line_no
scp.cacheline_code, scp.layer_num desc, scp.positionorder_no, scp.cache_line_no
</select>
</mapper>

View File

@@ -0,0 +1,459 @@
<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-select
v-model="query.lock_type"
clearable
size="mini"
placeholder="锁定类型"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.d_lock_type"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="模糊搜索">
<el-input
v-model="query.search"
clearable
size="mini"
placeholder="仓位编码、名称"
@keyup.enter.native="crud.toQuery"
/>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" />
<!--表单组件-->
<el-dialog
:close-on-click-modal="false"
:before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0"
:title="crud.status.title"
width="700px"
>
<el-form ref="form" :model="form" :rules="rules" size="mini" label-suffix=":" label-width="90px">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓位编码" prop="struct_code">
<el-input v-model="form.struct_code" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="仓位名称" prop="struct_name">
<el-input v-model="form.struct_name" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="仓位简称">
<el-input v-model="form.simple_name" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归属库区" prop="sect_id">
<el-cascader
v-model="form.cascader"
style="width: 200px;"
:options="sects"
clearable
@change="sectChange"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="载具号">
<label slot="label">载&nbsp;&nbsp;具&nbsp;号:</label>
<el-input v-model="form.storagevehicle_code" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="锁定类型" prop="lock_type">
<el-select
v-model="form.lock_type"
style="width: 200px;"
placeholder=""
>
<el-option
v-for="item in dict.d_lock_type"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="容量" prop="capacity">
<label slot="label">容&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;量:</label>
<el-input v-model="form.capacity" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="承受重量" prop="weight">
<el-input v-model="form.weight" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="宽度" prop="width">
<label slot="label">宽&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;度:</label>
<el-input v-model="form.width" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="深度" prop="zdepth">
<label slot="label">深&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;度:</label>
<el-input v-model="form.zdepth" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="高度" prop="height">
<label slot="label">高&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;度:</label>
<el-input v-model="form.height" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="高度类型" prop="material_height_type">
<el-select
v-model="form.material_height_type"
placeholder=""
style="width: 200px"
>
<el-option
v-for="item in dict.ST_HEIGHT_TYPE"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="是否临时" prop="is_tempstruct">
<el-radio v-model="form.is_tempstruct" label="1">是</el-radio>
<el-radio v-model="form.is_tempstruct" label="0">否</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="备注">
<label slot="label">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注:</label>
<el-input v-model="form.remark" style="width: 550px;" rows="2" type="textarea" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
</div>
</el-dialog>
<!--表格渲染-->
<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="struct_code" label="仓位编码" width="120" show-overflow-tooltip />
<el-table-column prop="struct_name" label="仓位名称" width="150" show-overflow-tooltip />
<el-table-column prop="simple_name" label="仓位简称" width="100" />
<el-table-column prop="sect_name" label="所属库区" width="150" />
<el-table-column prop="stor_name" label="所属仓库" width="150" />
<el-table-column prop="storagevehicle_code" label="载具号" min-width="120" show-overflow-tooltip />
<el-table-column prop="lock_type" label="锁定类型" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.d_lock_type[scope.row.lock_type] }}
</template>
</el-table-column>
<el-table-column prop="sect_name" label="库区名称" />
<el-table-column label="是否启用" align="center" prop="is_used">
<template slot-scope="scope">
<el-switch
:value="format_is_used(scope.row.is_used)"
active-color="#409EFF"
inactive-color="#F56C6C"
@change="changeEnabled(scope.row)"
/>
</template>
</el-table-column>
<el-table-column prop="taskdtl_type" label="锁定任务类型" width="150" :formatter="taskdtl_typeFormat" />
<el-table-column prop="task_code" label="锁定任务编码" width="150" />
<el-table-column prop="inv_code" label="锁定单据编码" width="150" />
<el-table-column prop="inv_type" label="锁定单据类型" width="150" :formatter="invtypeFormat" />
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
<el-table-column
v-permission="['admin','structattr:edit','structattr:del']"
label="操作"
fixed="right"
width="120px"
align="center"
>
<template slot-scope="scope">
<udOperation
:data="scope.row"
:permission="permission"
/>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</div>
</template>
<script>
import crudStructattr from '@/api/wms/basedata/st/structattr'
import CRUD, { crud, form, 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 crudSectattr from '@/api/wms/basedata/st/sectattr'
/* import checkoutbill from "@/api/wms/st/core/outbill/checkoutbill";*/
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,
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_HEIGHT_TYPE', 'd_lock_type', 'SCH_TASK_TYPE_DTL'],
components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() {
return CRUD({
title: '仓位',
optShow: { add: true, reset: true },
url: 'api/structattr',
idField: 'struct_id',
crudMethod: { ...crudStructattr }
})
},
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 {
sects: [],
invtypelist: [],
permission: {},
rules: {
struct_id: [
{ required: true, message: '仓位标识不能为空', trigger: 'blur' }
],
struct_code: [
{ required: true, message: '仓位编码不能为空', trigger: 'blur' }
],
struct_name: [
{ required: true, message: '仓位名称不能为空', trigger: 'blur' }
],
sect_id: [
{ required: true, message: '库区标识不能为空', trigger: 'blur' }
],
stor_id: [
{ required: true, message: '仓库标识不能为空', trigger: 'blur' }
],
capacity: [
{ required: false, message: '不能为空', trigger: 'blur' },
{ validator: numberOne }
],
weight: [
{ required: false, message: '不能为空', trigger: 'blur' },
{ validator: numberOne }
],
width: [
{ required: false, message: '不能为空', trigger: 'blur' },
{ validator: numberOne }
],
height: [
{ required: false, message: '不能为空', trigger: 'blur' },
{ validator: numberOne }
],
zdepth: [
{ required: false, message: '不能为空', trigger: 'blur' },
{ validator: numberOne }
],
material_height_type: [
{ required: true, message: '物料高度类型不能为空', trigger: 'blur' }
]
}
}
},
created() {
crudSectattr.getSect({}).then(res => {
this.sects = res.content
})
/* checkoutbill.getInvTypes().then(res => {
this.invtypelist = res
})*/
},
methods: {
// 钩子在获取表格数据之前执行false 则代表不获取数据
[CRUD.HOOK.beforeRefresh]() {
return true
},
[CRUD.HOOK.afterToEdit](crud, form) {
const val = []
val[0] = form.stor_id
val[1] = form.sect_id
form.cascader = val
},
sectChange(val) {
this.form.sect_id = val[1]
},
invtypeFormat(row) {
for (const item of this.invtypelist) {
if (item.code === row.inv_type) {
return item.name
}
}
},
taskdtl_typeFormat(row) {
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
},
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()
},
// 改变状态
format_is_used(is_used) {
return is_used === true
},
changeEnabled(data) {
let msg = '此操作将停用是否继续2'
if (data.is_used === false) {
msg = '此操作将启用是否继续2'
}
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
data.is_used = !data.is_used
crudStructattr.changeActive(data).then(res => {
this.crud.toQuery()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
data.is_used = !data.is_used
})
}).catch(() => {
})
}
}
}
</script>
<style scoped>
</style>