add: 点位管理
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
package org.nl.common.enums.wms;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author: lyd
|
||||||
|
* @Description:
|
||||||
|
* @Date: 2023/5/15
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum PointStatusEnum {
|
||||||
|
EMPTY_PLACE("1", "空位"),
|
||||||
|
FULL_MATERIAL("2", "有料"),
|
||||||
|
EMPTY_VEHICLE("3", "空载具");
|
||||||
|
private final String value;
|
||||||
|
private final String description;
|
||||||
|
}
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
package org.nl.wms.sch.point.controller;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.base.TableDataInfo;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||||
|
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
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;
|
||||||
|
import java.util.Set;
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "点位管理管理")
|
||||||
|
@RequestMapping("/api/schBasePoint")
|
||||||
|
public class SchBasePointController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISchBasePointService schBasePointService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询点位管理")
|
||||||
|
@ApiOperation("查询点位管理")
|
||||||
|
//@SaCheckPermission("@el.check('schBasePoint:list')")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(schBasePointService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增点位管理")
|
||||||
|
@ApiOperation("新增点位管理")
|
||||||
|
//@SaCheckPermission("@el.check('schBasePoint:add')")
|
||||||
|
public ResponseEntity<Object> create(@Validated @RequestBody SchBasePoint entity){
|
||||||
|
schBasePointService.create(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改点位管理")
|
||||||
|
@ApiOperation("修改点位管理")
|
||||||
|
//@SaCheckPermission("@el.check('schBasePoint:edit')")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody SchBasePoint entity){
|
||||||
|
schBasePointService.update(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("删除点位管理")
|
||||||
|
@ApiOperation("删除点位管理")
|
||||||
|
//@SaCheckPermission("@el.check('schBasePoint:del')")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
|
schBasePointService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("启动与禁用")
|
||||||
|
@PostMapping("/changeUsed")
|
||||||
|
@ApiOperation("启动与禁用")
|
||||||
|
public ResponseEntity<Object> changeUsedOn(@RequestBody JSONObject jsonObject) {
|
||||||
|
schBasePointService.changeUsed(jsonObject);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
package org.nl.wms.sch.point.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 服务接口
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
public interface ISchBasePointService extends IService<SchBasePoint> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param pageable 分页参数
|
||||||
|
* @return IPage<SchBasePoint>
|
||||||
|
*/
|
||||||
|
IPage<SchBasePoint> queryAll(Map whereJson, PageQuery pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void create(SchBasePoint entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void update(SchBasePoint entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(Set<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 改变启用状态
|
||||||
|
* @param jsonObject
|
||||||
|
*/
|
||||||
|
void changeUsed(JSONObject jsonObject);
|
||||||
|
}
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
package org.nl.wms.sch.point.service.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description /
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("sch_base_point")
|
||||||
|
public class SchBasePoint implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "point_code", type = IdType.NONE)
|
||||||
|
@ApiModelProperty(value = "点位编码")
|
||||||
|
private String point_code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "点位名称")
|
||||||
|
private String point_name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区域编码")
|
||||||
|
private String region_code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "区域名称")
|
||||||
|
private String region_name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "点位类型")
|
||||||
|
private String point_type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "点位状态")
|
||||||
|
private String point_status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "允许的物料类型")
|
||||||
|
private String can_material_type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "允许的载具类型")
|
||||||
|
private String can_vehicle_type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "载具允许最大数量")
|
||||||
|
private BigDecimal vehicle_max_qty;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "载具类型")
|
||||||
|
private String vehicle_type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "载具编码")
|
||||||
|
private String vehicle_code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "载具数量")
|
||||||
|
private BigDecimal vehicle_qty;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "块")
|
||||||
|
private BigDecimal block_num;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排")
|
||||||
|
private BigDecimal row_num;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "列")
|
||||||
|
private BigDecimal col_num;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "层")
|
||||||
|
private BigDecimal layer_num;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "入库顺序")
|
||||||
|
private BigDecimal in_order_seq;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "出库顺序")
|
||||||
|
private BigDecimal out_order_seq;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "入空载具顺序")
|
||||||
|
private BigDecimal in_empty_seq;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "出空载具顺序")
|
||||||
|
private BigDecimal out_empty_seq;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父点位编码")
|
||||||
|
private String parent_point_code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "外部点位编码")
|
||||||
|
private String ext_point_code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "在执行的任务标识")
|
||||||
|
private String ing_task_code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否创建工单")
|
||||||
|
private Boolean is_has_workder;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "车间编码")
|
||||||
|
private String workshop_code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否自动")
|
||||||
|
private Boolean is_auto;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否启用")
|
||||||
|
private Boolean is_used;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String create_id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String create_name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private String create_time;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改人")
|
||||||
|
private String update_id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改人")
|
||||||
|
private String update_name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private String update_time;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "允许存放的载具数据")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<String> can_vehicle_types;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String point_type_name;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String point_status_name;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.sch.point.service.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
public interface SchBasePointMapper extends BaseMapper<SchBasePoint> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="org.nl.wms.sch.point.service.dao.mapper.SchBasePointMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
package org.nl.wms.sch.point.service.dto;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description /
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class SchBasePointDto implements Serializable {
|
||||||
|
|
||||||
|
/** 点位编码 */
|
||||||
|
private String point_code;
|
||||||
|
|
||||||
|
/** 点位名称 */
|
||||||
|
private String point_name;
|
||||||
|
|
||||||
|
/** 区域编码 */
|
||||||
|
private String region_code;
|
||||||
|
|
||||||
|
/** 区域名称 */
|
||||||
|
private String region_name;
|
||||||
|
|
||||||
|
/** 点位类型 */
|
||||||
|
private String point_type;
|
||||||
|
|
||||||
|
/** 点位状态 */
|
||||||
|
private String point_status;
|
||||||
|
|
||||||
|
/** 允许的物料类型 */
|
||||||
|
private String can_material_type;
|
||||||
|
|
||||||
|
/** 允许的载具类型 */
|
||||||
|
private String can_vehicle_type;
|
||||||
|
|
||||||
|
/** 载具允许最大数量 */
|
||||||
|
private BigDecimal vehicle_max_qty;
|
||||||
|
|
||||||
|
/** 载具类型 */
|
||||||
|
private String vehicle_type;
|
||||||
|
|
||||||
|
/** 载具编码 */
|
||||||
|
private String vehicle_code;
|
||||||
|
|
||||||
|
/** 载具数量 */
|
||||||
|
private BigDecimal vehicle_qty;
|
||||||
|
|
||||||
|
/** 块 */
|
||||||
|
private BigDecimal block_num;
|
||||||
|
|
||||||
|
/** 排 */
|
||||||
|
private BigDecimal row_num;
|
||||||
|
|
||||||
|
/** 列 */
|
||||||
|
private BigDecimal col_num;
|
||||||
|
|
||||||
|
/** 层 */
|
||||||
|
private BigDecimal layer_num;
|
||||||
|
|
||||||
|
/** 入库顺序 */
|
||||||
|
private BigDecimal in_order_seq;
|
||||||
|
|
||||||
|
/** 出库顺序 */
|
||||||
|
private BigDecimal out_order_seq;
|
||||||
|
|
||||||
|
/** 入空载具顺序 */
|
||||||
|
private BigDecimal in_empty_seq;
|
||||||
|
|
||||||
|
/** 出空载具顺序 */
|
||||||
|
private BigDecimal out_empty_seq;
|
||||||
|
|
||||||
|
/** 父点位编码 */
|
||||||
|
private String parent_point_code;
|
||||||
|
|
||||||
|
/** 外部点位编码 */
|
||||||
|
private String ext_point_code;
|
||||||
|
|
||||||
|
/** 在执行的任务标识 */
|
||||||
|
private String ing_task_code;
|
||||||
|
|
||||||
|
/** 是否创建工单 */
|
||||||
|
private Boolean is_has_workder;
|
||||||
|
|
||||||
|
/** 车间编码 */
|
||||||
|
private String workshop_code;
|
||||||
|
|
||||||
|
/** 是否自动 */
|
||||||
|
private Boolean is_auto;
|
||||||
|
|
||||||
|
/** 备注 */
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/** 是否启用 */
|
||||||
|
private Boolean is_used;
|
||||||
|
|
||||||
|
/** 创建人 */
|
||||||
|
private String create_id;
|
||||||
|
|
||||||
|
/** 创建人 */
|
||||||
|
private String create_name;
|
||||||
|
|
||||||
|
/** 创建时间 */
|
||||||
|
private String create_time;
|
||||||
|
|
||||||
|
/** 修改人 */
|
||||||
|
private String update_id;
|
||||||
|
|
||||||
|
/** 修改人 */
|
||||||
|
private String update_name;
|
||||||
|
|
||||||
|
/** 修改时间 */
|
||||||
|
private String update_time;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.sch.point.service.dto;
|
||||||
|
|
||||||
|
import org.nl.common.domain.query.BaseQuery;
|
||||||
|
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
public class SchBasePointQuery extends BaseQuery<SchBasePoint> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,147 @@
|
|||||||
|
package org.nl.wms.sch.point.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.enums.wms.PointStatusEnum;
|
||||||
|
import org.nl.common.exception.BadRequestException;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.wms.sch.point.service.ISchBasePointService;
|
||||||
|
import org.nl.wms.sch.point.service.dao.mapper.SchBasePointMapper;
|
||||||
|
import org.nl.wms.sch.point.service.dao.SchBasePoint;
|
||||||
|
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||||
|
import org.nl.wms.sch.region.service.dao.mapper.SchBaseRegionMapper;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 服务实现
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-05-15
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, SchBasePoint> implements ISchBasePointService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SchBasePointMapper pointMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SchBaseRegionMapper regionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<SchBasePoint> queryAll(Map whereJson, PageQuery page){
|
||||||
|
String blurry = ObjectUtil.isNotEmpty(whereJson.get("blurry")) ? whereJson.get("blurry").toString() : null;
|
||||||
|
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));
|
||||||
|
IPage<SchBasePoint> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
|
pointMapper.selectPage(pages, lam);
|
||||||
|
// 可以存放的载具类型
|
||||||
|
pages.getRecords().forEach(point -> {
|
||||||
|
point.setCan_vehicle_types(Arrays.asList(point.getCan_vehicle_type().split(",")));
|
||||||
|
String pointStatus = point.getPoint_status(); // 点位状态
|
||||||
|
String pointType = point.getPoint_type(); // 点位类型
|
||||||
|
SchBaseRegion regionObj = regionMapper.selectById(point.getRegion_code());
|
||||||
|
if (ObjectUtil.isNotEmpty(pointStatus)) {
|
||||||
|
JSONObject statusArr = new JSONObject();
|
||||||
|
String[] split = regionObj.getPoint_status_explain().split(",");
|
||||||
|
for ( int j = 0; j < split.length; j++) {
|
||||||
|
String[] status = split[j].split("-");
|
||||||
|
statusArr.put(status[0], status[1]);
|
||||||
|
}
|
||||||
|
// 设置
|
||||||
|
point.setPoint_status_name(statusArr.getString(pointStatus));
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(pointType)) {
|
||||||
|
JSONObject typeArr = new JSONObject();
|
||||||
|
String[] split = regionObj.getPoint_type_explain().split(",");
|
||||||
|
for ( int j = 0; j < split.length; j++) {
|
||||||
|
String[] types = split[j].split("-");
|
||||||
|
typeArr.put(types[0], types[1]);
|
||||||
|
}
|
||||||
|
// 设置
|
||||||
|
point.setPoint_type_name(typeArr.getString(pointType));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void create(SchBasePoint entity) {
|
||||||
|
String point_code = entity.getPoint_code();
|
||||||
|
SchBasePoint pointObj = pointMapper.selectById(point_code);
|
||||||
|
if (ObjectUtil.isNotEmpty(pointObj) && !pointObj.getPoint_code().equals(entity.getPoint_code())) {
|
||||||
|
throw new BadRequestException("存在相同的点位编码");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 默认父类点位为自身
|
||||||
|
if (ObjectUtil.isEmpty(entity.getParent_point_code())) {
|
||||||
|
entity.setParent_point_code(entity.getPoint_code());
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
|
||||||
|
// 获取region_name
|
||||||
|
SchBaseRegion baseRegion = regionMapper.selectById(entity.getRegion_code());
|
||||||
|
entity.setRegion_name(baseRegion.getRegion_name());
|
||||||
|
|
||||||
|
entity.setCreate_id(currentUserId);
|
||||||
|
entity.setCreate_name(nickName);
|
||||||
|
entity.setCreate_time(now);
|
||||||
|
entity.setUpdate_id(currentUserId);
|
||||||
|
entity.setUpdate_name(nickName);
|
||||||
|
entity.setUpdate_time(now);
|
||||||
|
pointMapper.insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(SchBasePoint entity) {
|
||||||
|
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||||
|
String nickName = SecurityUtils.getCurrentNickName();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
entity.setUpdate_id(currentUserId);
|
||||||
|
entity.setUpdate_name(nickName);
|
||||||
|
entity.setUpdate_time(now);
|
||||||
|
String can_vehicle_type = String.join(",", entity.getCan_vehicle_types());
|
||||||
|
entity.setCan_vehicle_type(can_vehicle_type);
|
||||||
|
String pointStatus = entity.getPoint_status();
|
||||||
|
// 根据点位状态来判断更新内容
|
||||||
|
if (ObjectUtil.isNotEmpty(pointStatus) && pointStatus.equals(PointStatusEnum.EMPTY_PLACE.getValue())) {
|
||||||
|
entity.setVehicle_type("");
|
||||||
|
entity.setVehicle_code("");
|
||||||
|
entity.setVehicle_qty(BigDecimal.valueOf(0));
|
||||||
|
}
|
||||||
|
pointMapper.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAll(Set<String> ids) {
|
||||||
|
// 真删除
|
||||||
|
pointMapper.deleteBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void changeUsed(JSONObject jsonObject) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -27,14 +27,14 @@ import java.util.Set;
|
|||||||
public class SchBaseRegionController {
|
public class SchBaseRegionController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISchBaseRegionService schBaseRegionService;
|
private ISchBaseRegionService regionService;
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@Log("查询区域管理")
|
@Log("查询区域管理")
|
||||||
@ApiOperation("查询区域管理")
|
@ApiOperation("查询区域管理")
|
||||||
//@SaCheckPermission("@el.check('schBaseRegion:list')")
|
//@SaCheckPermission("@el.check('schBaseRegion:list')")
|
||||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
||||||
return new ResponseEntity<>(TableDataInfo.build(schBaseRegionService.queryAll(whereJson,page)),HttpStatus.OK);
|
return new ResponseEntity<>(TableDataInfo.build(regionService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@@ -42,7 +42,7 @@ public class SchBaseRegionController {
|
|||||||
@ApiOperation("新增区域管理")
|
@ApiOperation("新增区域管理")
|
||||||
//@SaCheckPermission("@el.check('schBaseRegion:add')")
|
//@SaCheckPermission("@el.check('schBaseRegion:add')")
|
||||||
public ResponseEntity<Object> create(@Validated @RequestBody SchBaseRegion entity){
|
public ResponseEntity<Object> create(@Validated @RequestBody SchBaseRegion entity){
|
||||||
schBaseRegionService.create(entity);
|
regionService.create(entity);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +51,7 @@ public class SchBaseRegionController {
|
|||||||
@ApiOperation("修改区域管理")
|
@ApiOperation("修改区域管理")
|
||||||
//@SaCheckPermission("@el.check('schBaseRegion:edit')")
|
//@SaCheckPermission("@el.check('schBaseRegion:edit')")
|
||||||
public ResponseEntity<Object> update(@Validated @RequestBody SchBaseRegion entity){
|
public ResponseEntity<Object> update(@Validated @RequestBody SchBaseRegion entity){
|
||||||
schBaseRegionService.update(entity);
|
regionService.update(entity);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,31 @@ public class SchBaseRegionController {
|
|||||||
//@SaCheckPermission("@el.check('schBaseRegion:del')")
|
//@SaCheckPermission("@el.check('schBaseRegion:del')")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
schBaseRegionService.deleteAll(ids);
|
regionService.deleteAll(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getRegionList")
|
||||||
|
@Log("获取区域下拉框")
|
||||||
|
@ApiOperation("获取区域下拉框")
|
||||||
|
//@SaCheckPermission("@el.check('schBaseRegion:list')")
|
||||||
|
public ResponseEntity<Object> getRegionList(){
|
||||||
|
return new ResponseEntity<>(regionService.getRegionList(),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getPointStatusSelectById")
|
||||||
|
@Log("获取点位状态下拉框")
|
||||||
|
@ApiOperation("获取点位状态下拉框")
|
||||||
|
//@SaCheckPermission("region:add")
|
||||||
|
public ResponseEntity<Object> getPointStatusSelectById(@RequestBody String region_id) {
|
||||||
|
return new ResponseEntity<>(regionService.getPointStatusSelectById(region_id), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/getPointTypeSelectById")
|
||||||
|
@Log("获取点位类型下拉框")
|
||||||
|
@ApiOperation("获取点位类型下拉框")
|
||||||
|
//@SaCheckPermission("region:add")
|
||||||
|
public ResponseEntity<Object> getPointTypeSelectById(@RequestBody String region_id) {
|
||||||
|
return new ResponseEntity<>(regionService.getPointTypeSelectById(region_id), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package org.nl.wms.sch.region.service;
|
package org.nl.wms.sch.region.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
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.region.service.dao.SchBaseRegion;
|
import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -40,4 +42,14 @@ public interface ISchBaseRegionService extends IService<SchBaseRegion> {
|
|||||||
* @param ids /
|
* @param ids /
|
||||||
*/
|
*/
|
||||||
void deleteAll(Set<String> ids);
|
void deleteAll(Set<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域下拉框
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SchBaseRegion> getRegionList();
|
||||||
|
|
||||||
|
JSONArray getPointStatusSelectById(String regionId);
|
||||||
|
|
||||||
|
JSONArray getPointTypeSelectById(String regionId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package org.nl.wms.sch.region.service.impl;
|
|||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
@@ -18,6 +20,7 @@ import org.nl.wms.sch.region.service.dao.SchBaseRegion;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
@@ -82,4 +85,49 @@ public class SchBaseRegionServiceImpl extends ServiceImpl<SchBaseRegionMapper, S
|
|||||||
schBaseRegionMapper.deleteBatchIds(ids);
|
schBaseRegionMapper.deleteBatchIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SchBaseRegion> getRegionList() {
|
||||||
|
return this.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getPointStatusSelectById(String regionId) {
|
||||||
|
/**
|
||||||
|
* label,value
|
||||||
|
*/
|
||||||
|
SchBaseRegion schBaseRegion = schBaseRegionMapper.selectById(regionId);
|
||||||
|
JSONArray res = new JSONArray();
|
||||||
|
String pointStatusExplain = schBaseRegion.getPoint_status_explain();
|
||||||
|
if (ObjectUtil.isEmpty(pointStatusExplain)) return res;
|
||||||
|
String[] explain = pointStatusExplain.split(",");
|
||||||
|
for (int i = 0; i < explain.length; i++) {
|
||||||
|
String[] status = explain[i].split("-");
|
||||||
|
JSONObject point_status = new JSONObject();
|
||||||
|
point_status.put("label", status[1]);
|
||||||
|
point_status.put("value", status[0]);
|
||||||
|
res.add(point_status);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONArray getPointTypeSelectById(String regionId) {
|
||||||
|
/**
|
||||||
|
* label,value
|
||||||
|
*/
|
||||||
|
SchBaseRegion schBaseRegion = schBaseRegionMapper.selectById(regionId);
|
||||||
|
JSONArray res = new JSONArray();
|
||||||
|
String pointTypeExplain = schBaseRegion.getPoint_type_explain();
|
||||||
|
if (ObjectUtil.isEmpty(pointTypeExplain)) return res;
|
||||||
|
String[] explain = pointTypeExplain.split(",");
|
||||||
|
for (int i = 0; i < explain.length; i++) {
|
||||||
|
String[] types = explain[i].split("-");
|
||||||
|
JSONObject point_type = new JSONObject();
|
||||||
|
point_type.put("label", types[1]);
|
||||||
|
point_type.put("value", types[0]);
|
||||||
|
res.add(point_type);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
474
nladmin-ui/src/views/wms/sch/point/index.vue
Normal file
474
nladmin-ui/src/views/wms/sch/point/index.vue
Normal file
@@ -0,0 +1,474 @@
|
|||||||
|
<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="90px"
|
||||||
|
label-suffix=":"
|
||||||
|
>
|
||||||
|
<el-form-item label="所属车间">
|
||||||
|
<el-select
|
||||||
|
v-model="query.workshop_code"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="所属车间"
|
||||||
|
class="filter-item"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workShopList"
|
||||||
|
:label="item.workshop_name"
|
||||||
|
:value="item.workshop_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<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-select
|
||||||
|
v-model="query.region_code"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
size="mini"
|
||||||
|
placeholder="区域类型"
|
||||||
|
class="filter-item"
|
||||||
|
@change="getPointStatusAndTypeList(query.region_code, 1)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in regionList"
|
||||||
|
:label="item.region_name"
|
||||||
|
:value="item.region_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位类型">
|
||||||
|
<el-select
|
||||||
|
v-model="query.point_type"
|
||||||
|
clearable
|
||||||
|
size="mini"
|
||||||
|
placeholder="点位类型"
|
||||||
|
class="filter-item"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pointTypesList"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位状态">
|
||||||
|
<el-select
|
||||||
|
v-model="query.point_status"
|
||||||
|
clearable
|
||||||
|
filterable
|
||||||
|
size="mini"
|
||||||
|
placeholder="点位状态"
|
||||||
|
class="filter-item"
|
||||||
|
@change="hand"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pointStatusList"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否启用">
|
||||||
|
<el-switch
|
||||||
|
v-model="query.is_used"
|
||||||
|
active-value="true"
|
||||||
|
inactive-value="false"
|
||||||
|
active-color="#409EFF"
|
||||||
|
inactive-color="#C0CCDA"
|
||||||
|
@change="hand"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<rrOperation />
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" >
|
||||||
|
<el-button
|
||||||
|
v-if="crud.query.is_used == 'false'"
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-circle-check"
|
||||||
|
:disabled="crud.selections.length === 0"
|
||||||
|
@click="changeUsed(crud.selections, true)"
|
||||||
|
>
|
||||||
|
启用
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="crud.query.is_used == 'true'"
|
||||||
|
slot="right"
|
||||||
|
class="filter-item"
|
||||||
|
size="mini"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-circle-close"
|
||||||
|
:disabled="crud.selections.length === 0"
|
||||||
|
@click="changeUsed(crud.selections, false)"
|
||||||
|
>
|
||||||
|
禁用
|
||||||
|
</el-button>
|
||||||
|
</crudOperation>
|
||||||
|
<!--表单组件-->
|
||||||
|
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="540px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||||
|
<el-form-item v-if="false" label="点位标识" prop="point_id">
|
||||||
|
<el-input v-model="form.point_id" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属车间">
|
||||||
|
<el-select
|
||||||
|
v-model="form.workshop_code"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 370px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in workShopList"
|
||||||
|
:label="item.workshop_name"
|
||||||
|
:value="item.workshop_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="所属区域" prop="region_code">
|
||||||
|
<el-select
|
||||||
|
v-model="form.region_code"
|
||||||
|
placeholder="请选择"
|
||||||
|
style="width: 370px;"
|
||||||
|
@change="getPointStatusAndTypeList(form.region_code, 2)"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in regionList"
|
||||||
|
:label="item.region_name"
|
||||||
|
:value="item.region_code"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位编码" prop="point_code">
|
||||||
|
<el-input v-model="form.point_code" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="点位名称" prop="point_name">
|
||||||
|
<el-input v-model="form.point_name" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-show="pointStatusDialogList.length > 0" label="点位状态" prop="point_status">
|
||||||
|
<el-select
|
||||||
|
v-model="form.point_status"
|
||||||
|
size="mini"
|
||||||
|
placeholder="点位状态"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 370px;"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pointStatusDialogList"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-show="pointTypesDialogList.length > 0" label="点位类型" prop="device_point_type">
|
||||||
|
<el-select
|
||||||
|
v-model="form.point_type"
|
||||||
|
size="mini"
|
||||||
|
placeholder="设备点位类型"
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 370px;"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in pointTypesDialogList"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</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>
|
||||||
|
<el-form-item label="已放载具类型" prop="vehicle_type">
|
||||||
|
<el-select v-model="form.vehicle_type" placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.vehicle_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="可放载具类型" prop="can_vehicle_types">
|
||||||
|
<el-select v-model="form.can_vehicle_types" multiple placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.vehicle_type"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="载具数量" prop="vehicle_qty">
|
||||||
|
<el-input-number :controls="false" class="clear-number-input" v-model="form.vehicle_qty" :min="0" :precision="3" :max="99999" label="载具数量" size="mini" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.point_status === '3'" label="库存数" prop="ivt_qty">
|
||||||
|
<el-input-number :controls="false" class="clear-number-input" v-model="form.ivt_qty" type="number" :min="1" :precision="3" :max="99999" label="库存数" size="mini" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.point_status === '3'" label="物料来源">
|
||||||
|
<el-radio-group v-model="choose" size="mini">
|
||||||
|
<el-radio-button label="物料" />
|
||||||
|
<el-radio-button label="工单" />
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="false" label="物料名称" prop="vehicle_code">
|
||||||
|
<el-input suffix-icon="el-icon-date" v-model="form.material_id" clearable style="width: 370px;" @focus="getMaterial" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="form.point_status === '3'" label="物料名称" prop="vehicle_code">
|
||||||
|
<el-input v-model="form.material_name" clearable style="width: 370px;" @focus="getMaterial" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否创建工单">
|
||||||
|
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_has_workder" :label="item.value">{{ item.label }}</el-radio>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否自动">
|
||||||
|
<el-radio v-for="item in dict.TrueOrFalse" :key="item.id" v-model="form.is_auto" :label="item.value">{{ item.label }}</el-radio>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.remark" style="width: 370px;" rows="2" type="textarea" />
|
||||||
|
</el-form-item>
|
||||||
|
</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="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')" />
|
||||||
|
<el-table-column prop="point_code" label="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')" />
|
||||||
|
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'点位名称')" />
|
||||||
|
<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="point_type" label="点位类型" :min-width="flexWidth('point_type',crud.data,'点位类型')" />-->
|
||||||
|
<!-- <el-table-column prop="point_status" label="点位状态" :min-width="flexWidth('point_status',crud.data,'点位状态')" />-->
|
||||||
|
<el-table-column prop="vehicle_type" label="载具类型" :min-width="flexWidth('vehicle_type',crud.data,'载具类型')" />
|
||||||
|
<el-table-column prop="vehicle_code" label="载具编码" :min-width="flexWidth('vehicle_code',crud.data,'载具编码')" />
|
||||||
|
<el-table-column prop="vehicle_qty" label="载具数量" :min-width="flexWidth('vehicle_qty',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">
|
||||||
|
{{scope.row.is_has_workder?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="is_auto" label="是否自动" :min-width="flexWidth('is_auto',crud.data,'是否自动')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row.is_auto?'是':'否'}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<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-column prop="create_name" label="创建人" :min-width="flexWidth('create_name',crud.data,'创建人')" />
|
||||||
|
<el-table-column prop="create_time" label="创建时间" :min-width="flexWidth('create_time',crud.data,'创建时间')" />
|
||||||
|
<el-table-column prop="update_name" label="修改人" :min-width="flexWidth('update_name',crud.data,'修改人')" />
|
||||||
|
<el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
|
||||||
|
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudSchBasePoint from './schBasePoint'
|
||||||
|
import crudSchBaseRegion from '../region/schBaseRegion'
|
||||||
|
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 crudMdBaseWorkShop from '@/views/wms/basedata/workshop/mdBaseWorkshop'
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
point_code: null,
|
||||||
|
point_name: null,
|
||||||
|
region_code: null,
|
||||||
|
region_name: null,
|
||||||
|
point_type: null,
|
||||||
|
point_status: null,
|
||||||
|
can_material_type: null,
|
||||||
|
can_vehicle_type: null,
|
||||||
|
vehicle_max_qty: null,
|
||||||
|
vehicle_type: null,
|
||||||
|
vehicle_code: null,
|
||||||
|
vehicle_qty: null,
|
||||||
|
block_num: null,
|
||||||
|
row_num: null,
|
||||||
|
col_num: null,
|
||||||
|
layer_num: null,
|
||||||
|
in_order_seq: null,
|
||||||
|
out_order_seq: null,
|
||||||
|
in_empty_seq: null,
|
||||||
|
out_empty_seq: null,
|
||||||
|
parent_point_code: null,
|
||||||
|
ext_point_code: null,
|
||||||
|
ing_task_code: null,
|
||||||
|
is_has_workder: 'true',
|
||||||
|
workshop_code: null,
|
||||||
|
is_auto: 'true',
|
||||||
|
remark: null,
|
||||||
|
is_used: 'true',
|
||||||
|
can_vehicle_types: null
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'SchBasePoint',
|
||||||
|
dicts: ['vehicle_type', 'TrueOrFalse'],
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '点位管理',
|
||||||
|
url: 'api/schBasePoint',
|
||||||
|
idField: 'point_code',
|
||||||
|
sort: 'point_code,desc',
|
||||||
|
crudMethod: { ...crudSchBasePoint },
|
||||||
|
optShow: {
|
||||||
|
add: true,
|
||||||
|
edit: true,
|
||||||
|
del: true,
|
||||||
|
download: false,
|
||||||
|
reset: true
|
||||||
|
},
|
||||||
|
query: {
|
||||||
|
is_used: 'true'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {},
|
||||||
|
rules: {
|
||||||
|
point_code: [
|
||||||
|
{ required: true, message: '点位编码不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
point_name: [
|
||||||
|
{ required: true, message: '点位名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
point_type: [
|
||||||
|
{ required: true, message: '点位类型不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
region_code: [
|
||||||
|
{ required: true, message: '区域类型不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
can_vehicle_types: [
|
||||||
|
{ required: true, message: '载具存放类型不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
workShopList: [],
|
||||||
|
regionList: [],
|
||||||
|
pointTypesList: [],
|
||||||
|
pointStatusList: [],
|
||||||
|
pointStatusDialogList: [],
|
||||||
|
pointTypesDialogList: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getWorkShopList()
|
||||||
|
this.getRegionList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.beforeToCU]() {
|
||||||
|
this.form.is_has_workder = this.form.is_has_workder.toString()
|
||||||
|
this.form.is_auto = this.form.is_auto.toString()
|
||||||
|
},
|
||||||
|
[CRUD.HOOK.afterToCU]() {
|
||||||
|
if (this.form.region_code) {
|
||||||
|
this.getPointStatusAndTypeList(this.form.region_code, 2)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
hand(value) {
|
||||||
|
this.crud.toQuery()
|
||||||
|
},
|
||||||
|
getWorkShopList() { // 获取车间列表
|
||||||
|
crudMdBaseWorkShop.getWorkShopList().then(res => {
|
||||||
|
this.workShopList = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getRegionList() {
|
||||||
|
crudSchBaseRegion.getRegionList().then(res => {
|
||||||
|
this.regionList = res
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getPointStatusAndTypeList(id, flag) {
|
||||||
|
if (id) {
|
||||||
|
this.getPointStatusList(id, flag)
|
||||||
|
this.getPointTypeList(id, flag)
|
||||||
|
}
|
||||||
|
if (flag === 1) {
|
||||||
|
this.crud.toQuery()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getPointStatusList(id, flag) {
|
||||||
|
crudSchBaseRegion.getPointStatusSelectById(id).then(res => {
|
||||||
|
console.log('1:', res)
|
||||||
|
if (flag === 1) {
|
||||||
|
this.pointStatusList = res
|
||||||
|
} else {
|
||||||
|
this.pointStatusDialogList = res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getPointTypeList(id, flag) {
|
||||||
|
crudSchBaseRegion.getPointTypeSelectById(id).then(res => {
|
||||||
|
console.log('2:', res)
|
||||||
|
if (flag === 1) {
|
||||||
|
this.pointTypesList = res
|
||||||
|
} else {
|
||||||
|
this.pointTypesDialogList = res
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeUsed(data, flag) { // 更改启用状态
|
||||||
|
console.log('qqqqqqqqq')
|
||||||
|
const param = {}
|
||||||
|
param.data = data
|
||||||
|
param.used = flag
|
||||||
|
crudSchBasePoint.changeUsed(param).then(res => {
|
||||||
|
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
|
this.crud.toQuery()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
35
nladmin-ui/src/views/wms/sch/point/schBasePoint.js
Normal file
35
nladmin-ui/src/views/wms/sch/point/schBasePoint.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBasePoint',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBasePoint/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBasePoint',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function changeUsed(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBasePoint/changeUsed',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, changeUsed }
|
||||||
@@ -157,8 +157,8 @@ const defaultForm = {
|
|||||||
remark: null
|
remark: null
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'SchBaseRegion',
|
name: 'Region',
|
||||||
dicts:['TrueOrFalse'],
|
dicts: ['TrueOrFalse'],
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
|
|||||||
@@ -24,4 +24,27 @@ export function edit(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del }
|
export function getRegionList() {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion/getRegionList',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPointStatusSelectById(id) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion/getPointStatusSelectById',
|
||||||
|
method: 'post',
|
||||||
|
data: id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getPointTypeSelectById(id) {
|
||||||
|
return request({
|
||||||
|
url: 'api/schBaseRegion/getPointTypeSelectById',
|
||||||
|
method: 'post',
|
||||||
|
data: id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del, getRegionList, getPointStatusSelectById, getPointTypeSelectById }
|
||||||
|
|||||||
Reference in New Issue
Block a user