fix: 任务配置以及基础分类三级回显失败BUG
This commit is contained in:
@@ -213,40 +213,36 @@ public class MdBaseClassstandardServiceImpl extends ServiceImpl<MdBaseClassstand
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<MdBaseClassstandard> buildTree(ArrayList<MdBaseClassstandard> list) {
|
public List<MdBaseClassstandard> buildTree(ArrayList<MdBaseClassstandard> list) {
|
||||||
// 将获取的数据初始化状态
|
// 初始化数据
|
||||||
list.forEach(classstandard -> {
|
list.forEach(classstandard -> {
|
||||||
classstandard.setId(classstandard.getClass_id());
|
classstandard.setId(classstandard.getClass_id());
|
||||||
classstandard.setLabel(classstandard.getClass_name());
|
classstandard.setLabel(classstandard.getClass_name());
|
||||||
classstandard.setLeaf((classstandard.getSub_count() <= 0));
|
classstandard.setLeaf((classstandard.getSub_count() <= 0));
|
||||||
classstandard.setHasChildren(classstandard.getSub_count() > 0);
|
classstandard.setHasChildren(classstandard.getSub_count() > 0);
|
||||||
});
|
});
|
||||||
// 待返回数据
|
|
||||||
List<MdBaseClassstandard> trees = new ArrayList<>();
|
// 创建树结构
|
||||||
for (MdBaseClassstandard mdBaseClassstandard : list) {
|
return list.stream()
|
||||||
// 筛选父类的值
|
.filter(node -> "0".equals(node.getParent_class_id()) || ObjectUtil.isEmpty(node.getParent_class_id()))
|
||||||
if (ObjectUtil.isEmpty(mdBaseClassstandard.getParent_class_id())
|
.map(node -> createTree(node, list))
|
||||||
|| mdBaseClassstandard.getParent_class_id().equals("0")) {
|
.collect(Collectors.toList());
|
||||||
// collect:获取当前对象的所有子级
|
}
|
||||||
List<MdBaseClassstandard> collect = list.stream().filter(t -> t.getParent_class_id()
|
|
||||||
.equals(mdBaseClassstandard.getClass_id())).collect(Collectors.toList());
|
private MdBaseClassstandard createTree(MdBaseClassstandard node, List<MdBaseClassstandard> list) {
|
||||||
if (ObjectUtil.isNotEmpty(collect)) {
|
List<MdBaseClassstandard> children = list.stream()
|
||||||
// 设置参数
|
.filter(child -> node.getClass_id().equals(child.getParent_class_id()))
|
||||||
collect.forEach(classstandard -> {
|
.map(child -> createTree(child, list))
|
||||||
classstandard.setId(classstandard.getClass_id());
|
.collect(Collectors.toList());
|
||||||
classstandard.setLabel(classstandard.getClass_name());
|
if (!children.isEmpty()) {
|
||||||
classstandard.setHasChildren(classstandard.getSub_count() > 0);
|
MdBaseClassstandardTrees tObj = new MdBaseClassstandardTrees();
|
||||||
});
|
// 赋值一份实体,可以避免vue-tree拿到children属性显示展开图标
|
||||||
MdBaseClassstandardTrees tObj = new MdBaseClassstandardTrees();
|
BeanUtils.copyProperties(node, tObj);
|
||||||
// 赋值一份实体,可以避免vue-tree拿到children属性显示展开图标
|
tObj.setChildren(children);
|
||||||
BeanUtils.copyProperties(mdBaseClassstandard, tObj);
|
return tObj;
|
||||||
tObj.setChildren(collect);
|
} else {
|
||||||
trees.add(tObj);
|
node.setLeaf(true);
|
||||||
} else {
|
|
||||||
trees.add(mdBaseClassstandard);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return trees;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.nl.common.domain.query.PageQuery;
|
|||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
|
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
|
||||||
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
||||||
|
import org.nl.wms.sch.task.service.dto.SchBaseTaskconfigQuery;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -30,7 +31,7 @@ public class SchBaseTaskconfigController {
|
|||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询任务配置")
|
@Log("查询任务配置")
|
||||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
public ResponseEntity<Object> query(SchBaseTaskconfigQuery whereJson, PageQuery page){
|
||||||
return new ResponseEntity<>(TableDataInfo.build(schBaseTaskconfigService.queryAll(whereJson,page)),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(schBaseTaskconfigService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
||||||
|
import org.nl.wms.sch.task.service.dto.SchBaseTaskconfigQuery;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -21,7 +22,7 @@ public interface ISchBaseTaskconfigService extends IService<SchBaseTaskconfig> {
|
|||||||
* @param pageable 分页参数
|
* @param pageable 分页参数
|
||||||
* @return IPage<SchBaseTaskconfig>
|
* @return IPage<SchBaseTaskconfig>
|
||||||
*/
|
*/
|
||||||
IPage<SchBaseTaskconfig> queryAll(Map whereJson, PageQuery pageable);
|
IPage<SchBaseTaskconfig> queryAll(SchBaseTaskconfigQuery whereJson, PageQuery pageable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建
|
* 创建
|
||||||
|
|||||||
@@ -25,124 +25,128 @@ public class SchBaseTaskconfig implements Serializable {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@TableId(value = "config_id", type = IdType.NONE)
|
@TableId(value = "config_id", type = IdType.NONE)
|
||||||
|
|
||||||
private String config_id;
|
private String config_id;
|
||||||
|
|
||||||
|
|
||||||
private String config_code;
|
private String config_code;
|
||||||
|
|
||||||
|
|
||||||
private String config_name;
|
private String config_name;
|
||||||
|
|
||||||
|
|
||||||
private String route_plan_code;
|
private String route_plan_code;
|
||||||
|
|
||||||
|
|
||||||
private String task_qf_type;
|
private String task_qf_type;
|
||||||
|
|
||||||
|
|
||||||
private String acs_task_type;
|
private String acs_task_type;
|
||||||
|
|
||||||
|
|
||||||
private String task_name;
|
private String task_name;
|
||||||
|
|
||||||
|
|
||||||
private String task_type;
|
|
||||||
|
|
||||||
|
private String task_type;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String task_type_id;
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String task_type_name;
|
||||||
|
|
||||||
|
|
||||||
private String task_direction;
|
private String task_direction;
|
||||||
|
|
||||||
|
|
||||||
private String priority;
|
private String priority;
|
||||||
|
|
||||||
|
|
||||||
private Integer task_create_max_num;
|
private Integer task_create_max_num;
|
||||||
|
|
||||||
|
|
||||||
private Integer task_issue_max_num;
|
private Integer task_issue_max_num;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_auto_issue;
|
private Boolean is_auto_issue;
|
||||||
|
|
||||||
|
|
||||||
private String start_region_str;
|
private String start_region_str;
|
||||||
|
|
||||||
|
|
||||||
private String next_region_str;
|
private String next_region_str;
|
||||||
|
|
||||||
|
|
||||||
private String start_point_pre;
|
private String start_point_pre;
|
||||||
|
|
||||||
|
|
||||||
private String next_region_pre;
|
private String next_region_pre;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_check_workorder;
|
private Boolean is_check_workorder;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_check_start_lock;
|
private Boolean is_check_start_lock;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_immediate_create;
|
private Boolean is_immediate_create;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_check_next_lock;
|
private Boolean is_check_next_lock;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_start_auto;
|
private Boolean is_start_auto;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_next_auto;
|
private Boolean is_next_auto;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_lock_start;
|
private Boolean is_lock_start;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_lock_next;
|
private Boolean is_lock_next;
|
||||||
|
|
||||||
|
|
||||||
private String request_param;
|
private String request_param;
|
||||||
|
|
||||||
|
|
||||||
private String response_param;
|
private String response_param;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_group_congrol_issue_seq;
|
private Boolean is_group_congrol_issue_seq;
|
||||||
|
|
||||||
|
|
||||||
private BigDecimal unfinish_notify_time;
|
private BigDecimal unfinish_notify_time;
|
||||||
|
|
||||||
|
|
||||||
private String sql_param;
|
private String sql_param;
|
||||||
|
|
||||||
|
|
||||||
private String workshop_code;
|
private String workshop_code;
|
||||||
|
|
||||||
|
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_used;
|
private Boolean is_used;
|
||||||
|
|
||||||
|
|
||||||
private Boolean is_delete;
|
private Boolean is_delete;
|
||||||
|
|
||||||
|
|
||||||
private String create_id;
|
private String create_id;
|
||||||
|
|
||||||
|
|
||||||
private String create_name;
|
private String create_name;
|
||||||
|
|
||||||
|
|
||||||
private String create_time;
|
private String create_time;
|
||||||
|
|
||||||
|
|
||||||
private String update_id;
|
private String update_id;
|
||||||
|
|
||||||
|
|
||||||
private String update_name;
|
private String update_name;
|
||||||
|
|
||||||
|
|
||||||
private String update_time;
|
private String update_time;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package org.nl.wms.sch.task.service.dao.mapper;
|
package org.nl.wms.sch.task.service.dao.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
||||||
|
import org.nl.wms.sch.task.service.dto.SchBaseTaskconfigQuery;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lyd
|
* @author lyd
|
||||||
@@ -9,4 +11,11 @@ import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
|||||||
**/
|
**/
|
||||||
public interface SchBaseTaskconfigMapper extends BaseMapper<SchBaseTaskconfig> {
|
public interface SchBaseTaskconfigMapper extends BaseMapper<SchBaseTaskconfig> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 连接查询
|
||||||
|
* @param pages 分页
|
||||||
|
* @param config 参数
|
||||||
|
* @return 任务配置数据
|
||||||
|
*/
|
||||||
|
IPage<SchBaseTaskconfig> selectPageLeftJoin(IPage<SchBaseTaskconfig> pages, SchBaseTaskconfigQuery config);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,4 +2,20 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.nl.wms.sch.task.service.dao.mapper.SchBaseTaskconfigMapper">
|
<mapper namespace="org.nl.wms.sch.task.service.dao.mapper.SchBaseTaskconfigMapper">
|
||||||
|
|
||||||
|
<select id="selectPageLeftJoin" resultType="org.nl.wms.sch.task.service.dao.SchBaseTaskconfig">
|
||||||
|
SELECT
|
||||||
|
sc.*,
|
||||||
|
mc.class_id AS task_type_id,
|
||||||
|
mc.class_name AS task_type_name
|
||||||
|
FROM
|
||||||
|
`sch_base_taskconfig` sc
|
||||||
|
LEFT JOIN md_base_classstandard mc ON mc.class_code = sc.task_type
|
||||||
|
WHERE sc.is_delete = FALSE
|
||||||
|
<if test="config.blurry != null">
|
||||||
|
AND sc.config_name LIKE '%${config.blurry}%'
|
||||||
|
</if>
|
||||||
|
<if test="config.workshop_code != null">
|
||||||
|
AND sc.workshop_code = config.workshop_code
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
package org.nl.wms.sch.task.service.dto;
|
package org.nl.wms.sch.task.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
import org.nl.common.domain.query.BaseQuery;
|
import org.nl.common.domain.query.BaseQuery;
|
||||||
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lyd
|
* @author lyd
|
||||||
* @date 2023-05-15
|
* @date 2023-05-15
|
||||||
**/
|
**/
|
||||||
public class SchBaseTaskconfigQuery extends BaseQuery<SchBaseTaskconfig> {
|
@Data
|
||||||
|
public class SchBaseTaskconfigQuery extends SchBaseTaskconfig {
|
||||||
|
|
||||||
|
private String blurry;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,12 @@ import org.nl.common.domain.query.PageQuery;
|
|||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
import org.nl.common.utils.SecurityUtils;
|
||||||
import org.nl.config.language.LangProcess;
|
import org.nl.config.language.LangProcess;
|
||||||
|
import org.nl.wms.basedata.master.classification.service.IMdBaseClassstandardService;
|
||||||
|
import org.nl.wms.basedata.master.classification.service.dao.MdBaseClassstandard;
|
||||||
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
|
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
|
||||||
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
|
||||||
import org.nl.wms.sch.task.service.dao.mapper.SchBaseTaskconfigMapper;
|
import org.nl.wms.sch.task.service.dao.mapper.SchBaseTaskconfigMapper;
|
||||||
|
import org.nl.wms.sch.task.service.dto.SchBaseTaskconfigQuery;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -33,32 +36,27 @@ public class SchBaseTaskconfigServiceImpl extends ServiceImpl<SchBaseTaskconfigM
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SchBaseTaskconfigMapper schBaseTaskconfigMapper;
|
private SchBaseTaskconfigMapper schBaseTaskconfigMapper;
|
||||||
|
@Autowired
|
||||||
|
private IMdBaseClassstandardService classstandardService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<SchBaseTaskconfig> queryAll(Map whereJson, PageQuery page) {
|
public IPage<SchBaseTaskconfig> queryAll(SchBaseTaskconfigQuery whereJson, PageQuery page) {
|
||||||
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null;
|
|
||||||
String workshop_code = ObjectUtil.isNotEmpty(whereJson.get("workshop_code")) ? whereJson.get("workshop_code").toString() : null;
|
|
||||||
LambdaQueryWrapper<SchBaseTaskconfig> lam = new LambdaQueryWrapper<>();
|
|
||||||
lam.like(ObjectUtil.isNotEmpty(blurry), SchBaseTaskconfig::getConfig_name, blurry)
|
|
||||||
.eq(ObjectUtil.isNotEmpty(workshop_code), SchBaseTaskconfig::getWorkshop_code, workshop_code);
|
|
||||||
IPage<SchBaseTaskconfig> pages = new Page<>(page.getPage() + 1, page.getSize());
|
IPage<SchBaseTaskconfig> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
schBaseTaskconfigMapper.selectPage(pages, lam);
|
pages = schBaseTaskconfigMapper.selectPageLeftJoin(pages, whereJson);
|
||||||
pages.getRecords().forEach(config -> {
|
|
||||||
if (ObjectUtil.isNotEmpty(config.getStart_region_str())) {
|
|
||||||
config.setStart_region_strs(Arrays.asList(config.getStart_region_str().split(",")));
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isNotEmpty(config.getNext_region_str())) {
|
|
||||||
config.setNext_region_strs(Arrays.asList(config.getNext_region_str().split(",")));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create(SchBaseTaskconfig entity) {
|
public void create(SchBaseTaskconfig entity) {
|
||||||
SchBaseTaskconfig schBaseTaskconfig = schBaseTaskconfigMapper.selectOne(new LambdaQueryWrapper<SchBaseTaskconfig>().eq(SchBaseTaskconfig::getConfig_code, entity.getConfig_code()));
|
SchBaseTaskconfig schBaseTaskconfig = schBaseTaskconfigMapper.selectOne(new LambdaQueryWrapper<SchBaseTaskconfig>().eq(SchBaseTaskconfig::getConfig_code, entity.getConfig_code()));
|
||||||
if (ObjectUtil.isNotEmpty(schBaseTaskconfig))
|
if (ObjectUtil.isNotEmpty(schBaseTaskconfig)) {
|
||||||
throw new BadRequestException(LangProcess.msg("error_ParamExist", entity.getConfig_code()));
|
throw new BadRequestException(LangProcess.msg("error_ParamExist", entity.getConfig_code()));
|
||||||
|
}
|
||||||
|
|
||||||
|
MdBaseClassstandard classstandard = classstandardService.getById(entity.getTask_type_id());
|
||||||
|
if (classstandard == null) {
|
||||||
|
throw new BadRequestException(LangProcess.msg("error_isNull", entity.getTask_type()));
|
||||||
|
}
|
||||||
|
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
@@ -71,26 +69,19 @@ public class SchBaseTaskconfigServiceImpl extends ServiceImpl<SchBaseTaskconfigM
|
|||||||
entity.setUpdate_id(currentUserId);
|
entity.setUpdate_id(currentUserId);
|
||||||
entity.setUpdate_name(nickName);
|
entity.setUpdate_name(nickName);
|
||||||
entity.setUpdate_time(now);
|
entity.setUpdate_time(now);
|
||||||
|
entity.setTask_type(classstandard.getClass_code());
|
||||||
schBaseTaskconfigMapper.insert(entity);
|
schBaseTaskconfigMapper.insert(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(SchBaseTaskconfig entity) {
|
public void update(SchBaseTaskconfig entity) {
|
||||||
SchBaseTaskconfig dto = schBaseTaskconfigMapper.selectById(entity.getConfig_id());
|
SchBaseTaskconfig dto = schBaseTaskconfigMapper.selectById(entity.getConfig_id());
|
||||||
if (dto == null) throw new BadRequestException(LangProcess.msg("error_SystemAuthError"));
|
if (dto == null) {
|
||||||
if (ObjectUtil.isAllEmpty(entity.getStart_region_strs(), entity.getNext_region_strs()))
|
throw new BadRequestException(LangProcess.msg("error_SystemAuthError"));
|
||||||
throw new BadRequestException(LangProcess.msg("point_checkNull_1"));
|
|
||||||
|
|
||||||
if (ObjectUtil.isNotEmpty(entity.getStart_region_strs())) {
|
|
||||||
// 起点区域配置
|
|
||||||
String startRegion = String.join(",", entity.getStart_region_strs());
|
|
||||||
entity.setStart_region_str(startRegion);
|
|
||||||
}
|
}
|
||||||
|
MdBaseClassstandard classstandard = classstandardService.getById(entity.getTask_type_id());
|
||||||
if (ObjectUtil.isNotEmpty(entity.getNext_region_strs())) {
|
if (classstandard == null) {
|
||||||
// 终点区域配置
|
throw new BadRequestException(LangProcess.msg("error_isNull", entity.getTask_type()));
|
||||||
String nextRegion = String.join(",", entity.getNext_region_strs());
|
|
||||||
entity.setNext_region_str(nextRegion);
|
|
||||||
}
|
}
|
||||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
String nickName = SecurityUtils.getCurrentNickName();
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
@@ -98,7 +89,7 @@ public class SchBaseTaskconfigServiceImpl extends ServiceImpl<SchBaseTaskconfigM
|
|||||||
entity.setUpdate_id(currentUserId);
|
entity.setUpdate_id(currentUserId);
|
||||||
entity.setUpdate_name(nickName);
|
entity.setUpdate_name(nickName);
|
||||||
entity.setUpdate_time(now);
|
entity.setUpdate_time(now);
|
||||||
|
entity.setTask_type(classstandard.getClass_code());
|
||||||
schBaseTaskconfigMapper.updateById(entity);
|
schBaseTaskconfigMapper.updateById(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -93,18 +93,13 @@
|
|||||||
<el-input v-model="form.task_name" style="width: 240px;" />
|
<el-input v-model="form.task_name" style="width: 240px;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务类型">
|
<el-form-item label="任务类型">
|
||||||
<el-select
|
<treeselect
|
||||||
v-model="form.task_type"
|
v-model="form.task_type_id"
|
||||||
size="mini"
|
:load-options="loadTaskType"
|
||||||
placeholder="任务类型"
|
:options="taskTypes"
|
||||||
style="width: 240px;"
|
style="width: 240px;"
|
||||||
>
|
placeholder="请选择任务类型"
|
||||||
<el-option
|
/>
|
||||||
v-for="item in dict.task_type"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="优先级" pro="priority">
|
<el-form-item label="优先级" pro="priority">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
@@ -197,14 +192,15 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="task_name" label="任务名字" :min-width="flexWidth('task_name',crud.data,'任务名字')" />
|
<el-table-column prop="task_name" label="任务名字" :min-width="flexWidth('task_name',crud.data,'任务名字')" />
|
||||||
<el-table-column prop="task_type" label="任务类型" :min-width="flexWidth('task_type',crud.data,'任务类型', 20)">
|
<el-table-column prop="task_type_name" label="任务类型" :min-width="flexWidth('task_type_name',crud.data,'任务类型')" />
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ dict.label.task_type[scope.row.task_type] }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="priority" label="优先级" :min-width="flexWidth('priority',crud.data,'优先级')" />
|
<el-table-column prop="priority" label="优先级" :min-width="flexWidth('priority',crud.data,'优先级')" />
|
||||||
<el-table-column prop="task_create_max_num" label="任务生成数上限" :min-width="flexWidth('task_create_max_num',crud.data,'任务生成数上限')" />
|
<el-table-column prop="task_create_max_num" label="任务生成数上限" :min-width="flexWidth('task_create_max_num',crud.data,'任务生成数上限')" />
|
||||||
<el-table-column prop="task_issue_max_num" label="任务下发数上限" :min-width="flexWidth('task_issue_max_num',crud.data,'任务下发数上限')" />
|
<el-table-column prop="task_issue_max_num" label="任务下发数上限" :min-width="flexWidth('task_issue_max_num',crud.data,'任务下发数上限')" />
|
||||||
|
<el-table-column prop="is_immediate_create" label="是否立即创建" :min-width="flexWidth('is_immediate_create',crud.data,'是否立即创建')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.is_immediate_create ? '是' : '否' }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="is_auto_issue" label="是否自动下发" :min-width="flexWidth('is_auto_issue',crud.data,'是否自动下发')">
|
<el-table-column prop="is_auto_issue" label="是否自动下发" :min-width="flexWidth('is_auto_issue',crud.data,'是否自动下发')">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.is_auto_issue?'是':'否' }}
|
{{ scope.row.is_auto_issue?'是':'否' }}
|
||||||
@@ -238,11 +234,6 @@
|
|||||||
{{ scope.row.is_check_start_lock?'是':'否' }}
|
{{ scope.row.is_check_start_lock?'是':'否' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="is_immediate_create" label="是否立即创建" :min-width="flexWidth('is_immediate_create',crud.data,'是否立即创建')">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
{{ scope.row.is_immediate_create?'是':'否' }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column v-if="false" prop="is_check_next_lock" label="是否判断终点锁" :min-width="flexWidth('is_check_next_lock',crud.data,'是否判断终点锁')">
|
<el-table-column v-if="false" prop="is_check_next_lock" label="是否判断终点锁" :min-width="flexWidth('is_check_next_lock',crud.data,'是否判断终点锁')">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.is_check_next_lock?'是':'否' }}
|
{{ scope.row.is_check_next_lock?'是':'否' }}
|
||||||
@@ -306,8 +297,11 @@ import rrOperation from '@crud/RR.operation.vue'
|
|||||||
import crudOperation from '@crud/CRUD.operation.vue'
|
import crudOperation from '@crud/CRUD.operation.vue'
|
||||||
import udOperation from '@crud/UD.operation.vue'
|
import udOperation from '@crud/UD.operation.vue'
|
||||||
import pagination from '@crud/Pagination.vue'
|
import pagination from '@crud/Pagination.vue'
|
||||||
|
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||||
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
import crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
|
import crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
|
||||||
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
|
import crudSchBaseRegion from '@/views/wms/sch/region/schBaseRegion'
|
||||||
|
import crudClassstandard from '@/views/wms/basedata/master/classification/mdBaseClassstandard'
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
config_id: null,
|
config_id: null,
|
||||||
@@ -317,6 +311,7 @@ const defaultForm = {
|
|||||||
acs_task_type: null,
|
acs_task_type: null,
|
||||||
task_name: null,
|
task_name: null,
|
||||||
task_type: null,
|
task_type: null,
|
||||||
|
task_type_id: null,
|
||||||
priority: null,
|
priority: null,
|
||||||
task_create_max_num: null,
|
task_create_max_num: null,
|
||||||
task_issue_max_num: null,
|
task_issue_max_num: null,
|
||||||
@@ -350,7 +345,7 @@ const defaultForm = {
|
|||||||
export default {
|
export default {
|
||||||
name: 'TaskConfig',
|
name: 'TaskConfig',
|
||||||
dicts: ['task_qf_type', 'acs_task_type', 'task_direction', 'task_type'],
|
dicts: ['task_qf_type', 'acs_task_type', 'task_direction', 'task_type'],
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({
|
return CRUD({
|
||||||
@@ -390,7 +385,8 @@ export default {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
workShopList: [],
|
workShopList: [],
|
||||||
regionList: []
|
regionList: [],
|
||||||
|
taskTypes: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -414,12 +410,28 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.getWorkShopList()
|
this.getWorkShopList()
|
||||||
this.getRegionList()
|
this.getRegionList()
|
||||||
|
this.initClassType()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
[CRUD.HOOK.beforeRefresh]() {
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
// 新增与编辑前做的操作
|
||||||
|
[CRUD.HOOK.afterToCU](crud, form) {
|
||||||
|
// 为了初始化数据 -> 树的数据
|
||||||
|
if (form.task_type_id !== null && form.task_type_id !== '0' && form.task_type_id !== '') {
|
||||||
|
this.getSubTypes(form.task_type_id)
|
||||||
|
} else {
|
||||||
|
this.getClass()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getSubTypes(id) { // 获取当前对象与所有父类数据
|
||||||
|
crudClassstandard.getClassSuperior(id).then(res => {
|
||||||
|
this.buildTree(res)
|
||||||
|
this.taskTypes = res
|
||||||
|
})
|
||||||
|
},
|
||||||
getWorkShopList() { // 获取车间列表
|
getWorkShopList() { // 获取车间列表
|
||||||
crudMdBaseWorkShop.getWorkShopList().then(res => {
|
crudMdBaseWorkShop.getWorkShopList().then(res => {
|
||||||
this.workShopList = res
|
this.workShopList = res
|
||||||
@@ -429,6 +441,42 @@ export default {
|
|||||||
crudSchBaseRegion.getRegionList().then(res => {
|
crudSchBaseRegion.getRegionList().then(res => {
|
||||||
this.regionList = res
|
this.regionList = res
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
// 获取弹窗内任务类型数据
|
||||||
|
loadTaskType({ action, parentNode, callback }) {
|
||||||
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
|
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
|
||||||
|
parentNode.children = res.map(function(obj) {
|
||||||
|
if (obj.hasChildren) {
|
||||||
|
obj.children = null
|
||||||
|
}
|
||||||
|
return obj
|
||||||
|
})
|
||||||
|
setTimeout(() => {
|
||||||
|
callback()
|
||||||
|
}, 100)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
initClassType() {
|
||||||
|
const param = {
|
||||||
|
parent_class_code: 'task_type'
|
||||||
|
}
|
||||||
|
crudClassstandard.getClassType(param).then(res => {
|
||||||
|
const data = res
|
||||||
|
this.buildTree(data)
|
||||||
|
this.taskTypes = data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
buildTree(classes) {
|
||||||
|
classes.forEach(data => {
|
||||||
|
if (data.children) {
|
||||||
|
this.buildTree(data.children)
|
||||||
|
}
|
||||||
|
if (data.hasChildren && !data.children) {
|
||||||
|
data.children = null // 重点代码
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user