点位代码更新

This commit is contained in:
lyd
2022-11-04 14:29:21 +08:00
parent 1900d7cd96
commit 19db98e95b
7 changed files with 421 additions and 28 deletions

View File

@@ -246,11 +246,6 @@
<artifactId>UserAgentUtils</artifactId> <artifactId>UserAgentUtils</artifactId>
<version>1.21</version> <version>1.21</version>
</dependency> </dependency>
<!-- redis -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!--WQL--> <!--WQL-->
<dependency> <dependency>

View File

@@ -49,9 +49,6 @@ public class PointDto implements Serializable {
/** MES设备编码 */ /** MES设备编码 */
private String mes_device_code; private String mes_device_code;
/** 物料标识 */
private Long material_id;
/** 允许的载具类型 */ /** 允许的载具类型 */
private String can_vehicle_type; private String can_vehicle_type;
@@ -62,16 +59,16 @@ public class PointDto implements Serializable {
private String vehicle_code; private String vehicle_code;
/** 载具数量 */ /** 载具数量 */
private BigDecimal vehicle_qty; private String vehicle_qty;
/** 块 */ /** 块 */
private BigDecimal block_num; private BigDecimal block_num;
/** 排 */ /** 排 */
private BigDecimal col_num; private BigDecimal row_num;
/** 列 */ /** 列 */
private BigDecimal row_num; private BigDecimal col_num;
/** 层 */ /** 层 */
private BigDecimal layer_num; private BigDecimal layer_num;
@@ -111,4 +108,43 @@ public class PointDto implements Serializable {
/** 修改时间 */ /** 修改时间 */
private String update_time; private String update_time;
/** 载具允许最大数量 */
private BigDecimal vehicle_max_qty;
/** 入库顺序 */
private BigDecimal in_order_seq;
/** 出库顺序 */
private BigDecimal out_order_seq;
/** 入空载具顺序 */
private BigDecimal in_empty_seq;
/** 出空载具顺序 */
private BigDecimal out_empty_seq;
/** 在执行的任务标识 */
private Long task_id;
/** 物料标识 */
private String material_id;
/** 批次 */
private String pcsn;
/** 库存数 */
private BigDecimal ivt_qty;
/** 计量单位标识 */
private Long qty_unit_id;
/** 入库时间 */
private String instorage_time;
/** 静置时间(分钟) */
private BigDecimal standing_time;
/** 是否关联库存表 */
private String is_ref_ivt;
} }

View File

@@ -23,6 +23,7 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -153,13 +154,8 @@ public class PointServiceImpl implements PointService {
throw new BadRequestException("被删除或无权限,操作失败!"); throw new BadRequestException("被删除或无权限,操作失败!");
} }
String pointStatus = dto.getPoint_status(); WQLObject materialBaseTab = WQLObject.getWQLObject("MD_ME_MaterialBase");
if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals("1")) { WQLObject pointTab = WQLObject.getWQLObject("SCH_BASE_Point");
entity.setMaterial_id(null);
entity.setVehicle_type(null);
entity.setVehicle_code(null);
entity.setVehicle_qty(null);
}
Long currentUserId = SecurityUtils.getCurrentUserId(); Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName(); String nickName = SecurityUtils.getCurrentNickName();
@@ -168,10 +164,31 @@ public class PointServiceImpl implements PointService {
dto.setUpdate_time(now); dto.setUpdate_time(now);
dto.setUpdate_optid(currentUserId); dto.setUpdate_optid(currentUserId);
dto.setUpdate_optname(nickName); dto.setUpdate_optname(nickName);
String pointStatus = dto.getPoint_status();
WQLObject wo = WQLObject.getWQLObject("sch_base_point"); if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals("1")) { // 空位
dto.setMaterial_id("");
dto.setVehicle_type("");
dto.setVehicle_code("");
dto.setVehicle_qty("");
dto.setPcsn("");
dto.setIvt_qty(BigDecimal.valueOf(0));
dto.setInstorage_time(null);
dto.setStanding_time(BigDecimal.valueOf(0));
} else if (pointStatus.equals("2")) { // 空载具
dto.setMaterial_id(null);
dto.setInstorage_time(now);
dto.setStanding_time(BigDecimal.valueOf(0));
} else { // 有料
if (ObjectUtil.isEmpty(dto.getMaterial_id())) throw new BadRequestException("物料不能为空");
if (ObjectUtil.isEmpty(dto.getIvt_qty())) throw new BadRequestException("库存数不能为空");
JSONObject materialObj = materialBaseTab.query("material_id = '" + dto.getMaterial_id() + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(materialObj)) throw new BadRequestException("未找到该物料");
dto.setStanding_time(materialObj.getBigDecimal("standing_time"));
dto.setInstorage_time(now);
}
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.update(json); pointTab.update(json);
} }

View File

@@ -49,11 +49,13 @@
PAGEQUERY PAGEQUERY
SELECT SELECT
point.*, point.*,
d3.label as lock_type_name d3.label as lock_type_name,
ma.material_name
FROM FROM
sch_base_point point sch_base_point point
LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id LEFT JOIN SCH_BASE_Region region ON point.region_id = region.region_id
LEFT JOIN sys_dict_detail d3 ON point.lock_type = d3.value and d3.name='d_lock_type' LEFT JOIN sys_dict_detail d3 ON point.lock_type = d3.value and d3.name='d_lock_type'
LEFT JOIN md_me_materialbase ma ON ma.material_id = point.material_id
WHERE WHERE
point.is_delete = '0' point.is_delete = '0'
OPTION 输入.region_id <> "" OPTION 输入.region_id <> ""

View File

@@ -0,0 +1,155 @@
<template>
<el-dialog
title="生产任务选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<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>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
size="mini"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="material_code" label="物料编码" width="160" />
<el-table-column prop="material_name" label="物料名称" width="180" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="140" />
<el-table-column prop="material_model" label="物料型号" />
<el-table-column prop="class_name" label="物料分类" width="140" />
<el-table-column prop="unit_name" label="计量单位" />
<el-table-column prop="standing_time" label="静置时间(分钟)" width="130px" />
<el-table-column prop="product_series_name" label="系列" />
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="135" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: 'MaterialDialog',
components: { rrOperation, pagination },
dicts: ['is_used'],
cruds() {
return CRUD({ title: '生产任务', url: 'api/Materialbase', optShow: {}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
}
},
data() {
return {
dialogVisible: false,
tableRadio: null,
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
clickChange(item) {
this.tableRadio = item
},
open() {
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('tableChanged3', this.tableRadio)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged3', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -0,0 +1,158 @@
<template>
<el-dialog
title="生产任务选择"
append-to-body
:visible.sync="dialogVisible"
destroy-on-close
width="1000px"
@close="close"
@open="open"
>
<el-form
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="80px"
label-suffix=":"
>
<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>
<!--表格渲染-->
<el-table
ref="table"
v-loading="crud.loading"
:data="crud.data"
style="width: 100%;"
size="mini"
border
:cell-style="{'text-align':'center'}"
:header-cell-style="{background:'#f5f7fa',color:'#606266','text-align':'center'}"
@select="handleSelectionChange"
@select-all="onSelectAll"
@current-change="clickChange"
>
<el-table-column v-if="!isSingle" type="selection" width="55" />
<el-table-column v-if="isSingle" label="选择" width="55">
<template slot-scope="scope">
<el-radio v-model="tableRadio" :label="scope.row"><i /></el-radio>
</template>
</el-table-column>
<el-table-column prop="workorder_code" label="工单编号" width="120px"/>
<el-table-column v-if="false" prop="material_id" label="物料标识" />
<el-table-column prop="device_name" label="设备" width="100" show-overflow-tooltip />
<el-table-column prop="material_code" label="物料编码" width="100" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" width="100" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip />
<el-table-column prop="vehicle_type" label="载具类型" min-width="120" show-overflow-tooltip>
<template slot-scope="scope">
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
</template>
</el-table-column>
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="150" />
</el-table>
<!--分页组件-->
<pagination />
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { header, presenter } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
export default {
name: 'WorkOrderDialog',
components: { rrOperation, pagination },
dicts: ['is_used', 'vehicle_type'],
cruds() {
return CRUD({ title: '生产工单', url: 'api/workorder', optShow: {}})
},
mixins: [presenter(), header()],
props: {
dialogShow: {
type: Boolean,
default: false
},
isSingle: {
type: Boolean,
default: true
}
},
data() {
return {
dialogVisible: false,
tableRadio: null,
tableData: []
}
},
watch: {
dialogShow: {
handler(newValue) {
this.dialogVisible = newValue
}
}
},
methods: {
clickChange(item) {
this.tableRadio = item
},
open() {
},
handleSelectionChange(val, row) {
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
} else {
this.checkrow = row
}
},
onSelectAll() {
this.$refs.table.clearSelection()
},
close() {
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
},
submit() {
// 处理单选
if (this.isSingle && this.tableRadio) {
this.$emit('update:dialogShow', false)
this.$emit('tableChanged4', this.tableRadio)
return
}
this.rows = this.$refs.table.selection
if (this.rows.length <= 0) {
this.$message('请先勾选物料')
return
}
this.crud.resetQuery(false)
this.$emit('update:dialogShow', false)
this.$emit('tableChanged4', this.rows)
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
::v-deep .el-dialog__body {
padding-top: 0px;
}
</style>

View File

@@ -225,7 +225,7 @@
<el-form-item label="点位名称" prop="point_name"> <el-form-item label="点位名称" prop="point_name">
<el-input v-model="form.point_name" style="width: 370px;" /> <el-input v-model="form.point_name" style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="点位状态" prop="point_status"> <el-form-item label="点位状态" prop="point_status" v-show="pointStatusDialogList.length > 0">
<el-select <el-select
v-model="form.point_status" v-model="form.point_status"
size="mini" size="mini"
@@ -256,7 +256,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="点位类型" prop="device_point_type"> <el-form-item label="点位类型" prop="device_point_type" v-show="pointTypesDialogList.length > 0">
<el-select <el-select
v-model="form.point_type" v-model="form.point_type"
size="mini" size="mini"
@@ -271,10 +271,24 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="载具编码" prop="vehicle_code"> <el-form-item label="载具编码" prop="vehicle_code" v-if="form.point_status !== '1'">
<el-input v-model="form.vehicle_code" clearable style="width: 370px;" /> <el-input v-model="form.vehicle_code" clearable style="width: 370px;" />
</el-form-item> </el-form-item>
<el-form-item label="库存数" prop="ivt_qty" v-if="form.point_status === '3'">
<el-input-number v-model="form.ivt_qty" :min="1" :precision="3" :max="999" label="库存数" size="mini"/>
</el-form-item>
<el-form-item label="物料来源" v-if="form.point_status === '3'">
<el-radio-group v-model="choose" size="mini">
<el-radio-button label="物料"></el-radio-button>
<el-radio-button label="工单"></el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="物料名称" prop="vehicle_code" v-if="false">
<el-input v-model="form.material_id" clearable style="width: 370px;" @focus="getMaterial"/>
</el-form-item>
<el-form-item label="物料名称" prop="vehicle_code" v-if="form.point_status === '3'">
<el-input v-model="form.material_name" clearable style="width: 370px;" @focus="getMaterial"/>
</el-form-item>
<el-form-item label="备注"> <el-form-item label="备注">
<el-input v-model="form.remark" style="width: 370px;" rows="2" type="textarea" /> <el-input v-model="form.remark" style="width: 370px;" rows="2" type="textarea" />
</el-form-item> </el-form-item>
@@ -337,7 +351,8 @@
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination />
</div> </div>
<MaterialDialog :dialog-show.sync="materialDialog" @tableChanged3="tableChanged"/>
<WorkOrderDialog :dialog-show.sync="workOrderDialog" @tableChanged4="tableChanged"/>
<ViewDialog ref="viewDialog" /> <ViewDialog ref="viewDialog" />
</div> </div>
</template> </template>
@@ -351,6 +366,8 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation' import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import ViewDialog from '@/views/wms/sch/point/ViewDialog' import ViewDialog from '@/views/wms/sch/point/ViewDialog'
import MaterialDialog from '@/views/wms/sch/point/MaterialDialog'
import WorkOrderDialog from '@/views/wms/sch/point/WorkOrderDialog'
const defaultForm = { const defaultForm = {
point_id: null, point_id: null,
@@ -374,7 +391,7 @@ const defaultForm = {
export default { export default {
name: 'Point', name: 'Point',
dicts: ['vehicle_type', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'vehicle_type'], dicts: ['vehicle_type', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'vehicle_type'],
components: { pagination, crudOperation, rrOperation, udOperation , ViewDialog}, components: { WorkOrderDialog, MaterialDialog, pagination, crudOperation, rrOperation, udOperation , ViewDialog},
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() { cruds() {
return CRUD({ return CRUD({
@@ -395,6 +412,9 @@ export default {
data() { data() {
return { return {
syncLoading: false, syncLoading: false,
materialDialog: false,
workOrderDialog: false,
choose: '物料',
invtypelist: [], invtypelist: [],
pointStatusList: [], pointStatusList: [],
pointStatusDialogList: [], pointStatusDialogList: [],
@@ -513,8 +533,18 @@ export default {
if (row) { if (row) {
this.$refs.viewDialog.setParentData(row) this.$refs.viewDialog.setParentData(row)
} }
},
getMaterial() {
if (this.choose == '物料') {
this.materialDialog = true
} else {
this.workOrderDialog = true
}
},
tableChanged(row) {
this.form.material_name = row.material_name
this.form.material_id = row.material_id
} }
} }
} }
</script> </script>