fix: 修复一些bug
This commit is contained in:
Binary file not shown.
@@ -48,10 +48,10 @@ public class MdBaseMaterial implements Serializable {
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(value = "是否启用")
|
||||
private Integer is_used;
|
||||
private Boolean is_used;
|
||||
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
private Integer is_delete;
|
||||
private Boolean is_delete;
|
||||
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String create_id;
|
||||
|
||||
@@ -46,6 +46,8 @@ public class PdmBdWorkorderServiceImpl extends ServiceImpl<PdmBdWorkorderMapper,
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
// 点位编码和点位名称为父点位
|
||||
|
||||
entity.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||
entity.setWorkorder_code(CodeUtil.getNewCode("PDM_SHIFTORDER"));
|
||||
entity.setCreate_id(currentUserId);
|
||||
|
||||
@@ -49,6 +49,11 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||
*/
|
||||
void changeUsed(JSONObject jsonObject);
|
||||
|
||||
/**
|
||||
* 获取点位
|
||||
* @param region
|
||||
* @return
|
||||
*/
|
||||
List<SchBasePoint> getPointList(SchBasePoint region);
|
||||
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
String point_status = ObjectUtil.isNotEmpty(whereJson.get("point_status")) ? whereJson.get("point_status").toString() : null;
|
||||
Boolean is_used = ObjectUtil.isNotEmpty(whereJson.get("is_used")) ? Boolean.valueOf(whereJson.get("is_used").toString()) : null;
|
||||
Boolean lock_type = ObjectUtil.isNotEmpty(whereJson.get("lock_type")) ? Boolean.valueOf(whereJson.get("lock_type").toString()) : false;
|
||||
Boolean parent_point = ObjectUtil.isNotEmpty(whereJson.get("parent_point")) ? Boolean.valueOf(whereJson.get("parent_point").toString()) : false;
|
||||
LambdaQueryWrapper<SchBasePoint> lam = new LambdaQueryWrapper<>();
|
||||
lam.like(ObjectUtil.isNotEmpty(blurry), SchBasePoint::getPoint_code, blurry)
|
||||
.or(ObjectUtil.isNotEmpty(blurry), lam1 -> lam1.like(SchBasePoint::getPoint_name, blurry))
|
||||
@@ -66,7 +67,8 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
.or()
|
||||
.eq(SchBasePoint::getIng_task_code, ""))
|
||||
.and(lock_type, slam -> slam.isNotNull(SchBasePoint::getIng_task_code)
|
||||
.ne(SchBasePoint::getIng_task_code, ""));
|
||||
.ne(SchBasePoint::getIng_task_code, ""))
|
||||
.apply(parent_point, "point_code = parent_point_code");
|
||||
IPage<SchBasePoint> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||
pointMapper.selectPage(pages, lam);
|
||||
// 可以存放的载具类型
|
||||
@@ -102,8 +104,10 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
entity.setParent_point_code(entity.getPoint_code());
|
||||
}
|
||||
|
||||
String can_vehicle_type = String.join(",", entity.getCan_vehicle_types());
|
||||
entity.setCan_vehicle_type(can_vehicle_type);
|
||||
if (ObjectUtil.isNotEmpty(entity.getCan_vehicle_types())) {
|
||||
String can_vehicle_type = String.join(",", entity.getCan_vehicle_types());
|
||||
entity.setCan_vehicle_type(can_vehicle_type);
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
@@ -130,6 +134,9 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
|
||||
entity.setUpdate_id(currentUserId);
|
||||
entity.setUpdate_name(nickName);
|
||||
entity.setUpdate_time(now);
|
||||
// 获取region_name
|
||||
SchBaseRegion baseRegion = regionMapper.selectById(entity.getRegion_code());
|
||||
entity.setRegion_name(baseRegion.getRegion_name());
|
||||
if (ObjectUtil.isNotEmpty(entity.getCan_vehicle_types())) {
|
||||
String can_vehicle_type = String.join(",", entity.getCan_vehicle_types());
|
||||
entity.setCan_vehicle_type(can_vehicle_type);
|
||||
|
||||
@@ -174,6 +174,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
String type = ObjectUtil.isNotEmpty(param.getString("type")) ? param.getString("type") : null;
|
||||
String vehicle_code = ObjectUtil.isNotEmpty(param.getString("vehicle_code")) ? param.getString("vehicle_code") : null;
|
||||
String vehicle_qty = ObjectUtil.isNotEmpty(param.getString("vehicle_qty")) ? param.getString("vehicle_qty") : null;
|
||||
String configCode = param.getString("config_code");
|
||||
// 校验设备编码
|
||||
if (ObjectUtil.isEmpty(device_code)) {
|
||||
throw new BadRequestException("设备编码不能为空!");
|
||||
@@ -188,7 +189,7 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
//...
|
||||
//4、叫空载具
|
||||
//...
|
||||
AbstractTask task = taskFactory.getTask("HNMLTask");
|
||||
AbstractTask task = taskFactory.getTask(configCode); //"HNMLTask"
|
||||
// 执行创建任务
|
||||
task.apply(param);
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ public abstract class AbstractTask {
|
||||
// 申请任务
|
||||
SchBaseTask task = new SchBaseTask(); // 任务实体
|
||||
String apply_point_code = param.getString("device_code");
|
||||
String config_code = "HNMLTask";
|
||||
String config_code = param.getString("config_code"); // "HNMLTask"
|
||||
// 1、校验数据
|
||||
SchBaseTaskconfig taskConfig = taskConfigService.getOne(new LambdaQueryWrapper<SchBaseTaskconfig>()
|
||||
.eq(SchBaseTaskconfig::getConfig_code, config_code));
|
||||
@@ -170,14 +170,14 @@ public abstract class AbstractTask {
|
||||
.findUnFinishTasksByTaskConfig(taskConfig.getConfig_code(), apply_point_code, taskConfig.getTask_direction());
|
||||
|
||||
Assert.isFalse(unFinishTasksByTaskConfig.size() >= tcmn, "该点位申请的任务未完成数已超过上限,无法申请任务");
|
||||
// 获取设备
|
||||
// 获取对接位点位对象
|
||||
SchBasePoint pointObj = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, apply_point_code));
|
||||
// 判断是否校验工单
|
||||
if (taskConfig.getIs_check_workorder()) {
|
||||
// 校验工单
|
||||
// 根据设备的父点位编码找到工单设备
|
||||
SchBasePoint one = pointService
|
||||
.getOne(new LambdaQueryWrapper<SchBasePoint>().eq(SchBasePoint::getPoint_code, pointObj.getParent_point_code()));
|
||||
// 根据对接位的父点位编码(设备)找到工单设备
|
||||
SchBasePoint one = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()
|
||||
.eq(SchBasePoint::getPoint_code, pointObj.getParent_point_code()));
|
||||
// 查找当前设备、生产中、
|
||||
PdmBdWorkorder workorder = workorderService.getOne(new LambdaQueryWrapper<PdmBdWorkorder>()
|
||||
.eq(PdmBdWorkorder::getPoint_code, one.getPoint_code())
|
||||
@@ -189,6 +189,11 @@ public abstract class AbstractTask {
|
||||
// 设置任务数据
|
||||
task.setVehicle_type(workorder.getVehicle_type());
|
||||
}
|
||||
// 校验是否需要自动agv
|
||||
if (!pointObj.getIs_auto()) {
|
||||
// 如果不需要自动,则不创建任务
|
||||
return;
|
||||
}
|
||||
// 2、创建申请任务
|
||||
task.setAcs_trace_id(param.getString("acs_trace_id"));
|
||||
task.setConfig_code(config_code);
|
||||
|
||||
173
nladmin-ui/src/views/wms/sch/point/PointDialog.vue
Normal file
173
nladmin-ui/src/views/wms/sch/point/PointDialog.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<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.blurry"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="点位名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-switch
|
||||
v-model="query.is_used"
|
||||
:active-value="true"
|
||||
:inactive-value="false"
|
||||
@change="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="point_code" label="点位名称" width="160" />
|
||||
<el-table-column prop="point_name" label="点位编码" width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />
|
||||
<el-table-column prop="region_name" label="区域名称" :min-width="flexWidth('region_name',crud.data,'区域名称')" />
|
||||
<el-table-column prop="point_type_name" label="点位类型" :min-width="flexWidth('point_type_name',crud.data,'点位类型')"/>
|
||||
<el-table-column prop="point_status_name" label="点位状态" :min-width="flexWidth('point_status_name',crud.data,'点位类型')"/>
|
||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')" />
|
||||
<el-table-column prop="is_used" label="是否启用" :min-width="flexWidth('is_used',crud.data,'是否启用')">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.is_used?'是':'否'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</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: 'PointDialog',
|
||||
components: { rrOperation, pagination },
|
||||
dicts: ['is_used'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '点位',
|
||||
url: 'api/schBasePoint',
|
||||
optShow: {},
|
||||
query: {
|
||||
is_used: true,
|
||||
parent_point: true
|
||||
}
|
||||
})
|
||||
},
|
||||
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('tableChanged', 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('tableChanged', this.rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -204,6 +204,9 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="父类编码" prop="vehicle_code">
|
||||
<el-input v-model="form.parent_point_code" clearable style="width: 370px;" @focus="getParentPoint"/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.point_status !== '1'" label="载具编码" prop="vehicle_code">
|
||||
<el-input v-model="form.vehicle_code" clearable style="width: 370px;" />
|
||||
</el-form-item>
|
||||
@@ -259,7 +262,7 @@
|
||||
{{scope.row.ing_task_code?'是':'否'}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="parent_point_code" label="父点位编码" :min-width="flexWidth('parent_point_code',crud.data,'父点位编码')" />
|
||||
<el-table-column prop="parent_point_code" label="父点位编码" :min-width="flexWidth('parent_point_code',crud.data,'父点位编码')"/>
|
||||
<el-table-column prop="ing_task_code" label="在执行的任务标识" :min-width="flexWidth('ing_task_code',crud.data,'在执行的任务标识')" />
|
||||
<el-table-column prop="is_has_workder" label="是否有工单" :min-width="flexWidth('is_has_workder',crud.data,'是否有工单')">
|
||||
<template slot-scope="scope">
|
||||
@@ -304,6 +307,7 @@
|
||||
<pagination />
|
||||
</div>
|
||||
<ViewDialog ref="viewDialog"/>
|
||||
<PointDialog :dialog-show.sync="pointDialog" @tableChanged="tableChanged"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -317,6 +321,7 @@ import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
|
||||
import ViewDialog from '@/views/wms/sch/point/ViewDialog.vue'
|
||||
import PointDialog from '@/views/wms/sch/point/PointDialog.vue'
|
||||
|
||||
const defaultForm = {
|
||||
point_code: null,
|
||||
@@ -352,7 +357,7 @@ const defaultForm = {
|
||||
export default {
|
||||
name: 'SchBasePoint',
|
||||
dicts: ['vehicle_type', 'TrueOrFalse'],
|
||||
components: { ViewDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
components: { PointDialog, ViewDialog, pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -396,7 +401,8 @@ export default {
|
||||
pointTypesList: [],
|
||||
pointStatusList: [],
|
||||
pointStatusDialogList: [],
|
||||
pointTypesDialogList: []
|
||||
pointTypesDialogList: [],
|
||||
pointDialog: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -476,6 +482,12 @@ export default {
|
||||
if (row) {
|
||||
this.$refs.viewDialog.setParentData(row)
|
||||
}
|
||||
},
|
||||
tableChanged(row) {
|
||||
this.form.parent_point_code = row.point_code
|
||||
},
|
||||
getParentPoint() {
|
||||
this.pointDialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
<el-form-item label="终点前缀">
|
||||
<el-input v-model="form.next_region_pre" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="任务方向" prop="acs_task_type">
|
||||
<el-form-item label="任务方向" prop="task_direction">
|
||||
<el-select
|
||||
v-model="form.task_direction"
|
||||
size="mini"
|
||||
@@ -225,7 +225,7 @@
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="路由编码" prop="config_code">
|
||||
<el-form-item label="路由编码" prop="route_plan_code">
|
||||
<el-input v-model="form.route_plan_code" style="width: 240px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="未完成通知时间" prop="unfinish_notify_time">
|
||||
|
||||
@@ -195,11 +195,11 @@
|
||||
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
||||
<el-table-column v-permission="[]" label="操作" width="160px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-upload"
|
||||
@click="doOperate(scope.row, 'c')"
|
||||
>下发</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-upload"-->
|
||||
<!-- @click="doOperate(scope.row, 'c')"-->
|
||||
<!-- >下发</el-button>-->
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-success"
|
||||
|
||||
Reference in New Issue
Block a user