add: 添加基数数据管理:1.仓库管理 2.库区管理 3.仓位管理
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 仓库管理控制层
|
||||
*
|
||||
* @author dsh
|
||||
* 2025/5/14
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/Storattr")
|
||||
@Slf4j
|
||||
public class BsrealStorattrController {
|
||||
|
||||
@Resource
|
||||
private final IBsrealStorattrService iBsrealStorattrService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询仓库")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iBsrealStorattrService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增仓库")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody BsrealStorattr dto) {
|
||||
iBsrealStorattrService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改仓库")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody BsrealStorattr dto) {
|
||||
iBsrealStorattrService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除仓库")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
iBsrealStorattrService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getStor")
|
||||
@Log("查询仓库下拉框")
|
||||
public ResponseEntity<Object> queryStor(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iBsrealStorattrService.getStor(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改仓库管理状态")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject json) {
|
||||
iBsrealStorattrService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.basedata_manage.service.ISectattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.Sectattr;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 库区管理控制层
|
||||
*
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/sectattr")
|
||||
@Slf4j
|
||||
public class SectattrController {
|
||||
|
||||
@Resource
|
||||
private final ISectattrService iSectattrService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询库区")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iSectattrService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增库区")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody Sectattr dto) {
|
||||
iSectattrService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改库区")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody Sectattr dto) {
|
||||
iSectattrService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除库区")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
iSectattrService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/getSect")
|
||||
@Log("查询库区下拉框")
|
||||
public ResponseEntity<Object> querySect(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(iSectattrService.getSect(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改库区状态")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject json) {
|
||||
iSectattrService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* 仓位管理控制层
|
||||
*
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
|
||||
@RequestMapping("/api/structattr")
|
||||
@Slf4j
|
||||
public class StructattrController {
|
||||
|
||||
@Resource
|
||||
private IStructattrService structattrService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询仓位")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(structattrService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增仓位")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody Structattr dto) {
|
||||
structattrService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改仓位")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody Structattr dto) {
|
||||
structattrService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除仓位")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
structattrService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/changeActive")
|
||||
@Log("修改仓位状态")
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject json) {
|
||||
structattrService.changeActive(json);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.nl.wms.basedata_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattrDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* 仓库服务层
|
||||
*
|
||||
* @author dsh
|
||||
* 2025/5/14
|
||||
*/
|
||||
public interface IBsrealStorattrService extends IService<BsrealStorattr> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
IPage<BsrealStorattrDto> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param stor_id ID
|
||||
* @return Storattr
|
||||
*/
|
||||
BsrealStorattr findById(String stor_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
*
|
||||
* @param code code
|
||||
* @return Storattr
|
||||
*/
|
||||
BsrealStorattr findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void create(BsrealStorattr dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(BsrealStorattr dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
List<BsrealStorattr> getStor(Map whereJson);
|
||||
|
||||
/**
|
||||
* 改变启用状态
|
||||
*
|
||||
* @param json
|
||||
*/
|
||||
void changeActive(JSONObject json);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package org.nl.wms.basedata_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.Sectattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.SectattrDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 库区服务层
|
||||
*
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
public interface ISectattrService extends IService<Sectattr> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
IPage<SectattrDto> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param sect_id ID
|
||||
* @return Sectattr
|
||||
*/
|
||||
Sectattr findById(String sect_id);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void create(Sectattr dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(Sectattr dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
JSONObject getSect(Map whereJson);
|
||||
|
||||
/**
|
||||
* 改变启用状态
|
||||
*
|
||||
* @param json
|
||||
*/
|
||||
void changeActive(JSONObject json);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package org.nl.wms.basedata_manage.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 仓位服务层
|
||||
*
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
public interface IStructattrService extends IService<Structattr> {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
IPage<Structattr> queryAll(Map whereJson, PageQuery page);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
*
|
||||
* @param struct_id ID
|
||||
* @return Structattr
|
||||
*/
|
||||
Structattr findById(String struct_id);
|
||||
|
||||
/**
|
||||
* 根据编码查询
|
||||
*
|
||||
* @param code code
|
||||
* @return Structattr
|
||||
*/
|
||||
Structattr findByCode(String code);
|
||||
|
||||
|
||||
/**
|
||||
* 创建
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void create(Structattr dto);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(Structattr dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
*
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
/**
|
||||
* 改变启用状态
|
||||
*
|
||||
* @param json
|
||||
*/
|
||||
void changeActive(JSONObject json);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
package org.nl.wms.basedata_manage.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_bsrealstorattr")
|
||||
public class BsrealStorattr implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
@TableId("stor_id")
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String stor_code;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 简称
|
||||
*/
|
||||
private String simple_name;
|
||||
|
||||
/**
|
||||
* 容量
|
||||
*/
|
||||
private BigDecimal stor_capacity;
|
||||
|
||||
/**
|
||||
* 总面积(㎡)
|
||||
*/
|
||||
private BigDecimal total_area;
|
||||
|
||||
/**
|
||||
* 仓库性质
|
||||
*/
|
||||
private String stor_type_scode;
|
||||
|
||||
/**
|
||||
* 是否虚拟库
|
||||
*/
|
||||
private String is_virtualstore;
|
||||
|
||||
/**
|
||||
* 是否半成品库
|
||||
*/
|
||||
private String is_semi_finished;
|
||||
|
||||
/**
|
||||
* 是否原料库
|
||||
*/
|
||||
private String is_materialstore;
|
||||
|
||||
/**
|
||||
* 是否成品库
|
||||
*/
|
||||
private String is_productstore;
|
||||
|
||||
/**
|
||||
* 是否备件库
|
||||
*/
|
||||
private String is_attachment;
|
||||
|
||||
/**
|
||||
* 是否允许红冲
|
||||
*/
|
||||
private String is_reversed;
|
||||
|
||||
/**
|
||||
* 是否移出业务自动确认
|
||||
*/
|
||||
private String is_mvout_auto_cfm;
|
||||
|
||||
/**
|
||||
* 是否移入业务自动确认
|
||||
*/
|
||||
private String is_mvin_auto_cfm;
|
||||
|
||||
/**
|
||||
* 地区
|
||||
*/
|
||||
private String area;
|
||||
|
||||
/**
|
||||
* 仓库地址
|
||||
*/
|
||||
private String storea_ddress;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String principal;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String office_phone;
|
||||
|
||||
/**
|
||||
* 负责人手机
|
||||
*/
|
||||
private String mobile_no;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private BigDecimal order_index;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String whstate_scode;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
|
||||
/**
|
||||
* 物料基本分类
|
||||
*/
|
||||
private String base_class_id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optid;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 拥有者ID
|
||||
*/
|
||||
private Long sysownerid;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long sysdeptid;
|
||||
|
||||
/**
|
||||
* 公司ID
|
||||
*/
|
||||
private Long syscompanyid;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String ext_id;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String depart_name;
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String company_name;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.wms.basedata_manage.service.dao;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
@Data
|
||||
public class BsrealStorattrDto extends BsrealStorattr implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* sys_dict.label
|
||||
*/
|
||||
private String label;
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package org.nl.wms.basedata_manage.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_sectattr")
|
||||
public class Sectattr implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
@TableId("sect_id")
|
||||
private String sect_id;
|
||||
|
||||
/**
|
||||
* 库区编码
|
||||
*/
|
||||
private String sect_code;
|
||||
|
||||
/**
|
||||
* 库区名称
|
||||
*/
|
||||
private String sect_name;
|
||||
|
||||
/**
|
||||
* 库区简称
|
||||
*/
|
||||
private String simple_name;
|
||||
|
||||
/**
|
||||
* 库区类型
|
||||
*/
|
||||
private String sect_type_attr;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 仓库类型
|
||||
*/
|
||||
private String stor_type;
|
||||
|
||||
/**
|
||||
* 容量
|
||||
*/
|
||||
private BigDecimal capacity;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private BigDecimal height;
|
||||
|
||||
/**
|
||||
* 深度
|
||||
*/
|
||||
private BigDecimal zdepth;
|
||||
|
||||
/**
|
||||
* 起始X坐标
|
||||
*/
|
||||
private BigDecimal xqty;
|
||||
|
||||
/**
|
||||
* 起始Y坐标
|
||||
*/
|
||||
private BigDecimal yqty;
|
||||
|
||||
/**
|
||||
* 起始Z坐标
|
||||
*/
|
||||
private BigDecimal zqty;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String sect_manager_name;
|
||||
|
||||
/**
|
||||
* 负责人电话
|
||||
*/
|
||||
private String mobile_no;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optid;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 背景色
|
||||
*/
|
||||
private String back_ground_color;
|
||||
|
||||
/**
|
||||
* 前景色
|
||||
*/
|
||||
private String front_ground_color;
|
||||
|
||||
/**
|
||||
* 背景图片
|
||||
*/
|
||||
private String back_ground_pic;
|
||||
|
||||
/**
|
||||
* 字体显示方向
|
||||
*/
|
||||
private String font_direction_scode;
|
||||
|
||||
/**
|
||||
* 所在楼层
|
||||
*/
|
||||
private BigDecimal floor_no;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String ext_id;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package org.nl.wms.basedata_manage.service.dao;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
@Data
|
||||
public class SectattrDto extends Sectattr implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
* st_ivt_bsrealstorattr.stor_name
|
||||
*/
|
||||
private String stor_name;
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
package org.nl.wms.basedata_manage.service.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("st_ivt_structattr")
|
||||
public class Structattr implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 仓位标识
|
||||
*/
|
||||
@TableId("struct_id")
|
||||
private String struct_id;
|
||||
|
||||
/**
|
||||
* 仓位编码
|
||||
*/
|
||||
private String struct_code;
|
||||
|
||||
/**
|
||||
* 仓位名称
|
||||
*/
|
||||
private String struct_name;
|
||||
|
||||
/**
|
||||
* 仓位简称
|
||||
*/
|
||||
private String simple_name;
|
||||
|
||||
/**
|
||||
* 库区标识
|
||||
*/
|
||||
private String sect_id;
|
||||
|
||||
/**
|
||||
* 库区编码
|
||||
*/
|
||||
private String sect_code;
|
||||
|
||||
/**
|
||||
* 库区名称
|
||||
*/
|
||||
private String sect_name;
|
||||
|
||||
/**
|
||||
* 仓库标识
|
||||
*/
|
||||
private String stor_id;
|
||||
|
||||
/**
|
||||
* 仓库编码
|
||||
*/
|
||||
private String stor_code;
|
||||
|
||||
/**
|
||||
* 仓库名称
|
||||
*/
|
||||
private String stor_name;
|
||||
|
||||
/**
|
||||
* 仓库类型
|
||||
*/
|
||||
private String stor_type;
|
||||
|
||||
/**
|
||||
* 容量
|
||||
*/
|
||||
private BigDecimal capacity;
|
||||
|
||||
/**
|
||||
* 宽度
|
||||
*/
|
||||
private BigDecimal width;
|
||||
|
||||
/**
|
||||
* 高度
|
||||
*/
|
||||
private BigDecimal height;
|
||||
|
||||
/**
|
||||
* 深度
|
||||
*/
|
||||
private BigDecimal zdepth;
|
||||
|
||||
/**
|
||||
* 承受重量
|
||||
*/
|
||||
private BigDecimal weight;
|
||||
|
||||
/**
|
||||
* 起始X坐标
|
||||
*/
|
||||
private BigDecimal xqty;
|
||||
|
||||
/**
|
||||
* 起始Y坐标
|
||||
*/
|
||||
private BigDecimal yqty;
|
||||
|
||||
/**
|
||||
* 起始Z坐标
|
||||
*/
|
||||
private BigDecimal zqty;
|
||||
|
||||
/**
|
||||
* 是否临时仓位
|
||||
*/
|
||||
private String is_tempstruct;
|
||||
|
||||
/**
|
||||
* 排
|
||||
*/
|
||||
private BigDecimal row_num;
|
||||
|
||||
/**
|
||||
* 列
|
||||
*/
|
||||
private BigDecimal col_num;
|
||||
|
||||
/**
|
||||
* 层
|
||||
*/
|
||||
private BigDecimal layer_num;
|
||||
|
||||
/**
|
||||
* 块
|
||||
*/
|
||||
private BigDecimal block_num;
|
||||
|
||||
/**
|
||||
* 入库顺序
|
||||
*/
|
||||
private BigDecimal in_order_seq;
|
||||
|
||||
/**
|
||||
* 出库顺序
|
||||
*/
|
||||
private BigDecimal out_order_seq;
|
||||
|
||||
/**
|
||||
* 入空载具顺序
|
||||
*/
|
||||
private BigDecimal in_empty_seq;
|
||||
|
||||
/**
|
||||
* 出空载具顺序
|
||||
*/
|
||||
private BigDecimal out_empty_seq;
|
||||
|
||||
/**
|
||||
* 放置类型
|
||||
*/
|
||||
private String placement_type;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 修改人
|
||||
*/
|
||||
private String update_optid;
|
||||
|
||||
/**
|
||||
* 修改人姓名
|
||||
*/
|
||||
private String update_optname;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private String update_time;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 背景色
|
||||
*/
|
||||
private String back_ground_color;
|
||||
|
||||
/**
|
||||
* 前景色
|
||||
*/
|
||||
private String front_ground_color;
|
||||
|
||||
/**
|
||||
* 背景图片
|
||||
*/
|
||||
private String back_ground_pic;
|
||||
|
||||
/**
|
||||
* 字体显示方向
|
||||
*/
|
||||
private String font_direction_scode;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
|
||||
/**
|
||||
* 是否判断高度
|
||||
*/
|
||||
private String is_zdepth;
|
||||
|
||||
/**
|
||||
* 存储载具标识
|
||||
*/
|
||||
private Long storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 存储载具号
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 存储载具类型
|
||||
*/
|
||||
private String storagevehicle_type;
|
||||
|
||||
/**
|
||||
* 是否空载具
|
||||
*/
|
||||
private String is_emptyvehicle;
|
||||
|
||||
/**
|
||||
* 载具数量
|
||||
*/
|
||||
private BigDecimal storagevehicle_qty;
|
||||
|
||||
/**
|
||||
* 锁定类型
|
||||
*/
|
||||
private String lock_type;
|
||||
|
||||
/**
|
||||
* 锁定任务类型
|
||||
*/
|
||||
private String taskdtl_type;
|
||||
|
||||
/**
|
||||
* 锁定任务明细标识
|
||||
*/
|
||||
private String taskdtl_id;
|
||||
|
||||
/**
|
||||
* 锁定任务编码
|
||||
*/
|
||||
private String task_code;
|
||||
|
||||
/**
|
||||
* 锁定单据类型
|
||||
*/
|
||||
private String inv_type;
|
||||
|
||||
/**
|
||||
* 锁定单据标识
|
||||
*/
|
||||
private String inv_id;
|
||||
|
||||
/**
|
||||
* 锁定单据编码
|
||||
*/
|
||||
private String inv_code;
|
||||
|
||||
/**
|
||||
* 物料高度类型
|
||||
*/
|
||||
private String material_height_type;
|
||||
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String ext_id;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.wms.basedata_manage.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattrDto;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/14
|
||||
*/
|
||||
@Mapper
|
||||
public interface BsrealStorattrMapper extends BaseMapper<BsrealStorattr> {
|
||||
|
||||
IPage<BsrealStorattrDto> queryAllByPage(Page<BsrealStorattrDto> page, @Param("search") String search);
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?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.basedata_manage.service.dao.mapper.BsrealStorattrMapper">
|
||||
<select id="queryAllByPage" resultType="org.nl.wms.basedata_manage.service.dao.BsrealStorattrDto">
|
||||
SELECT stor.*,detail.label FROM st_ivt_bsrealstorattr stor LEFT JOIN sys_dict detail ON detail.value = stor.stor_type_scode AND detail.code = 'st_stor_type'
|
||||
<where>
|
||||
stor.is_delete = '0'
|
||||
<if test="search != null">
|
||||
AND
|
||||
stor.stor_code LIKE CONCAT('%', #{search}, '%')
|
||||
OR
|
||||
stor.stor_name LIKE CONCAT('%', #{search}, '%')
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY stor.update_time Desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.nl.wms.basedata_manage.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattrDto;
|
||||
import org.nl.wms.basedata_manage.service.dao.Sectattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.SectattrDto;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
@Mapper
|
||||
public interface SectattrMapper extends BaseMapper<Sectattr> {
|
||||
|
||||
IPage<SectattrDto> queryAllByPage(Page<BsrealStorattrDto> page, @Param("params") Map params);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?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.basedata_manage.service.dao.mapper.SectattrMapper">
|
||||
<select id="queryAllByPage" resultType="org.nl.wms.basedata_manage.service.dao.SectattrDto">
|
||||
SELECT sect.*,stor.stor_name FROM st_ivt_sectattr sect LEFT JOIN st_ivt_bsrealstorattr stor ON sect.stor_id = stor.stor_id
|
||||
<where>
|
||||
sect.is_delete = '0'
|
||||
<if test="params.search != null">
|
||||
AND
|
||||
sect.sect_code LIKE CONCAT('%', #{params.search}, '%')
|
||||
OR
|
||||
sect.sect_name LIKE CONCAT('%', #{params.search}, '%')
|
||||
</if>
|
||||
<if test="params.stor_id != null">
|
||||
AND
|
||||
sect.stor_id = #{params.stor_id}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY sect.update_time Desc
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,14 @@
|
||||
package org.nl.wms.basedata_manage.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
|
||||
/**
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
@Mapper
|
||||
public interface StructattrMapper extends BaseMapper<Structattr>{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
package org.nl.wms.basedata_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.ISectattrService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattrDto;
|
||||
import org.nl.wms.basedata_manage.service.dao.Sectattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.BsrealStorattrMapper;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.SectattrMapper;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.StructattrMapper;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 仓库实现类
|
||||
*
|
||||
* @author dsh
|
||||
* 2025/5/14
|
||||
*/
|
||||
@Service
|
||||
public class BsrealStorattrServiceImpl extends ServiceImpl<BsrealStorattrMapper, BsrealStorattr> implements IBsrealStorattrService {
|
||||
|
||||
@Resource
|
||||
private BsrealStorattrMapper bsrealStorattrMapper;
|
||||
|
||||
@Resource
|
||||
private ISectattrService iSectattrService;
|
||||
|
||||
@Resource
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
@Override
|
||||
public IPage<BsrealStorattrDto> queryAll(Map whereJson, PageQuery page) {
|
||||
|
||||
String search = (String) whereJson.get("search");
|
||||
|
||||
return bsrealStorattrMapper.queryAllByPage(new Page<>(page.getPage() +1 ,page.getSize()), search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BsrealStorattr findById(String stor_id) {
|
||||
|
||||
LambdaQueryWrapper<BsrealStorattr> queryWrapper = new LambdaQueryWrapper<>(BsrealStorattr.class)
|
||||
.eq(BsrealStorattr::getStor_id, stor_id)
|
||||
.eq(BsrealStorattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
|
||||
BsrealStorattr bsrealStorattr = bsrealStorattrMapper.selectOne(queryWrapper);
|
||||
|
||||
if (ObjectUtil.isEmpty(bsrealStorattr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return bsrealStorattr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BsrealStorattr findByCode(String code) {
|
||||
|
||||
LambdaQueryWrapper<BsrealStorattr> queryWrapper = new LambdaQueryWrapper<>(BsrealStorattr.class)
|
||||
.eq(BsrealStorattr::getStor_code, code)
|
||||
.eq(BsrealStorattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
|
||||
BsrealStorattr bsrealStorattr = bsrealStorattrMapper.selectOne(queryWrapper);
|
||||
|
||||
if (ObjectUtil.isEmpty(bsrealStorattr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return bsrealStorattr;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(BsrealStorattr dto) {
|
||||
|
||||
BsrealStorattr bsrealStorattr = this.findByCode(dto.getStor_code());
|
||||
if (ObjectUtil.isNotEmpty(bsrealStorattr) && BaseDataEnum.IS_YES_NOT.code("否").equals(bsrealStorattr.getIs_delete())) {
|
||||
throw new BadRequestException("存在相同的仓库编号");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setStor_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
//TODO
|
||||
dto.setSyscompanyid(9L);
|
||||
dto.setSysdeptid(9L);
|
||||
dto.setSysownerid(9L);
|
||||
|
||||
bsrealStorattrMapper.insert(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(BsrealStorattr dto) {
|
||||
BsrealStorattr entity = this.findById(dto.getStor_id());
|
||||
if (entity == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
BsrealStorattr bsrealStorattr = this.findByCode(dto.getStor_code());
|
||||
if (bsrealStorattr != null && !dto.getStor_id().equals(bsrealStorattr.getStor_id()) && BaseDataEnum.IS_YES_NOT.code("否").equals(bsrealStorattr.getIs_delete())) {
|
||||
throw new BadRequestException("存在相同的供应商编号");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setSyscompanyid(dto.getSysdeptid());
|
||||
|
||||
bsrealStorattrMapper.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
for (String stor_id : ids) {
|
||||
BsrealStorattr bsrealStorattr = new BsrealStorattr();
|
||||
bsrealStorattr.setIs_delete(BaseDataEnum.IS_YES_NOT.code("是"));
|
||||
bsrealStorattr.setStor_id(stor_id);
|
||||
bsrealStorattr.setUpdate_optid(currentUserId);
|
||||
bsrealStorattr.setUpdate_optname(nickName);
|
||||
bsrealStorattr.setUpdate_time(now);
|
||||
bsrealStorattrMapper.updateById(bsrealStorattr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BsrealStorattr> getStor(Map whereJson) {
|
||||
|
||||
String is_materialstore = (String) whereJson.get("is_materialstore");
|
||||
String is_virtualstore = (String) whereJson.get("is_virtualstore");
|
||||
String is_semi_finished = (String) whereJson.get("is_semi_finished");
|
||||
String is_productstore = (String) whereJson.get("is_productstore");
|
||||
String is_attachment = (String) whereJson.get("is_attachment");
|
||||
String is_reversed = (String) whereJson.get("is_reversed");
|
||||
|
||||
LambdaQueryWrapper<BsrealStorattr> queryWrapper = new LambdaQueryWrapper<>(BsrealStorattr.class)
|
||||
.select(BsrealStorattr::getStor_id, BsrealStorattr::getStor_code, BsrealStorattr::getStor_name)
|
||||
.eq(StrUtil.isNotEmpty(is_materialstore),BsrealStorattr::getIs_materialstore,is_materialstore)
|
||||
.eq(StrUtil.isNotEmpty(is_virtualstore),BsrealStorattr::getIs_virtualstore,is_virtualstore)
|
||||
.eq(StrUtil.isNotEmpty(is_semi_finished),BsrealStorattr::getIs_materialstore,is_semi_finished)
|
||||
.eq(StrUtil.isNotEmpty(is_productstore),BsrealStorattr::getIs_materialstore,is_productstore)
|
||||
.eq(StrUtil.isNotEmpty(is_attachment),BsrealStorattr::getIs_materialstore,is_attachment)
|
||||
.eq(StrUtil.isNotEmpty(is_reversed),BsrealStorattr::getIs_materialstore,is_reversed)
|
||||
.eq(BsrealStorattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.eq(BsrealStorattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("是")
|
||||
);
|
||||
|
||||
return bsrealStorattrMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeActive(JSONObject json) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
String is_used = BaseDataEnum.IS_YES_NOT.code("是").equals(json.getString("is_used")) ? BaseDataEnum.IS_YES_NOT.code("否") : BaseDataEnum.IS_YES_NOT.code("是");
|
||||
|
||||
json.put("is_used", is_used);
|
||||
json.put("update_optid", currentUserId);
|
||||
json.put("update_optname", nickName);
|
||||
json.put("update_time", now);
|
||||
|
||||
bsrealStorattrMapper.updateById(json.toJavaObject(BsrealStorattr.class));
|
||||
|
||||
//同时修改该stor_id仓库下仓位和库区的启用状态
|
||||
String stor_id = json.getString("stor_id");
|
||||
|
||||
iSectattrService.update(new LambdaUpdateWrapper<>(Sectattr.class)
|
||||
.set(Sectattr::getIs_used, is_used)
|
||||
.set(Sectattr::getUpdate_optid, currentUserId)
|
||||
.set(Sectattr::getUpdate_optname, nickName)
|
||||
.set(Sectattr::getUpdate_time, now)
|
||||
.eq(Sectattr::getStor_id, stor_id)
|
||||
);
|
||||
|
||||
iStructattrService.update(new LambdaUpdateWrapper<>(Structattr.class)
|
||||
.set(Structattr::getIs_used, is_used)
|
||||
.set(Structattr::getUpdate_optid, currentUserId)
|
||||
.set(Structattr::getUpdate_optname, nickName)
|
||||
.set(Structattr::getUpdate_time, now)
|
||||
.eq(Structattr::getStor_id, stor_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
package org.nl.wms.basedata_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.ISectattrService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.Sectattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.SectattrDto;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.BsrealStorattrMapper;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.SectattrMapper;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 库区实现类
|
||||
*
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
@Service
|
||||
public class SectattrServiceImpl extends ServiceImpl<SectattrMapper, Sectattr> implements ISectattrService {
|
||||
|
||||
@Resource
|
||||
private SectattrMapper sectattrMapper;
|
||||
|
||||
@Resource
|
||||
private IBsrealStorattrService iBsrealStorattrService;
|
||||
|
||||
@Resource
|
||||
private IStructattrService iStructattrService;
|
||||
|
||||
@Override
|
||||
public IPage<SectattrDto> queryAll(Map whereJson, PageQuery page) {
|
||||
return sectattrMapper.queryAllByPage(new Page<>(page.getPage() +1 ,page.getSize()), whereJson);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sectattr findById(String sect_id) {
|
||||
|
||||
LambdaQueryWrapper<Sectattr> queryWrapper = new LambdaQueryWrapper<>(Sectattr.class)
|
||||
.eq(Sectattr::getSect_id, sect_id)
|
||||
.eq(Sectattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
|
||||
Sectattr sectattr = sectattrMapper.selectOne(queryWrapper);
|
||||
|
||||
if (ObjectUtil.isEmpty(sectattr)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return sectattr;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(Sectattr dto) {
|
||||
|
||||
Sectattr sectattr = sectattrMapper.selectOne(new LambdaQueryWrapper<>(Sectattr.class)
|
||||
.eq(Sectattr::getSect_id, dto.getSect_code())
|
||||
.eq(Sectattr::getStor_id, dto.getStor_id())
|
||||
);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(sectattr)) {
|
||||
throw new BadRequestException("存在相同仓库的库区编号");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setSect_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
sectattrMapper.insert(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Sectattr dto) {
|
||||
Sectattr entity = this.findById(dto.getSect_id());
|
||||
if (entity == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
String sect_code = dto.getSect_code();
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
|
||||
sectattrMapper.updateById(dto);
|
||||
|
||||
List<Sectattr> sectattrList = sectattrMapper.selectList(new LambdaQueryWrapper<Sectattr>()
|
||||
.eq(Sectattr::getSect_code,sect_code)
|
||||
.eq(Sectattr::getStor_id,dto.getStor_id())
|
||||
);
|
||||
if (sectattrList.size() > 1) {
|
||||
throw new BadRequestException("存在相同仓库的库区编号");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
for (String sect_id : ids) {
|
||||
Sectattr sectattr = new Sectattr();
|
||||
sectattr.setIs_delete(BaseDataEnum.IS_YES_NOT.code("是"));
|
||||
sectattr.setSect_id(sect_id);
|
||||
sectattr.setUpdate_optid(currentUserId);
|
||||
sectattr.setUpdate_optname(nickName);
|
||||
sectattr.setUpdate_time(now);
|
||||
sectattrMapper.updateById(sectattr);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getSect(Map whereJson) {
|
||||
JSONArray new_ja = new JSONArray();
|
||||
|
||||
String is_materialstore = (String) whereJson.get("is_materialstore");
|
||||
String is_virtualstore = (String) whereJson.get("is_virtualstore");
|
||||
String is_semi_finished = (String) whereJson.get("is_semi_finished");
|
||||
String is_productstore = (String) whereJson.get("is_productstore");
|
||||
String is_attachment = (String) whereJson.get("is_attachment");
|
||||
String is_reversed = (String) whereJson.get("is_reversed");
|
||||
String sect_type_attr = (String) whereJson.get("sect_type_attr");
|
||||
|
||||
LambdaQueryWrapper<BsrealStorattr> queryWrapper = new LambdaQueryWrapper<>(BsrealStorattr.class)
|
||||
.select(BsrealStorattr::getStor_id, BsrealStorattr::getStor_code, BsrealStorattr::getStor_name)
|
||||
.eq(StrUtil.isNotEmpty(is_materialstore),BsrealStorattr::getIs_materialstore,is_materialstore)
|
||||
.eq(StrUtil.isNotEmpty(is_virtualstore),BsrealStorattr::getIs_virtualstore,is_virtualstore)
|
||||
.eq(StrUtil.isNotEmpty(is_semi_finished),BsrealStorattr::getIs_materialstore,is_semi_finished)
|
||||
.eq(StrUtil.isNotEmpty(is_productstore),BsrealStorattr::getIs_materialstore,is_productstore)
|
||||
.eq(StrUtil.isNotEmpty(is_attachment),BsrealStorattr::getIs_materialstore,is_attachment)
|
||||
.eq(StrUtil.isNotEmpty(is_reversed),BsrealStorattr::getIs_materialstore,is_reversed)
|
||||
.eq(BsrealStorattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.eq(BsrealStorattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("是")
|
||||
);
|
||||
|
||||
List<BsrealStorattr> bsrealStorattrList = iBsrealStorattrService.list(queryWrapper);
|
||||
|
||||
for (int i = 0; i < bsrealStorattrList.size(); i++) {
|
||||
BsrealStorattr stor_jo = bsrealStorattrList.get(i);
|
||||
JSONObject stor_cas = new JSONObject();
|
||||
stor_cas.put("value", stor_jo.getStor_id());
|
||||
stor_cas.put("label", stor_jo.getStor_name());
|
||||
|
||||
List<Sectattr> sectattrList = sectattrMapper.selectList(new LambdaQueryWrapper<>(Sectattr.class)
|
||||
.select(Sectattr::getSect_id,Sectattr::getSect_name)
|
||||
.eq(StrUtil.isNotEmpty(stor_jo.getStor_id()),Sectattr::getStor_id,stor_jo.getStor_id())
|
||||
.eq(StrUtil.isNotEmpty(sect_type_attr),Sectattr::getSect_type_attr,sect_type_attr)
|
||||
.eq(Sectattr::getIs_delete,BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.eq(Sectattr::getIs_used, BaseDataEnum.IS_YES_NOT.code("是"))
|
||||
);
|
||||
|
||||
if (!sectattrList.isEmpty()) {
|
||||
JSONArray sect_ja = new JSONArray();
|
||||
for (int j = 0; j < sectattrList.size(); j++) {
|
||||
Sectattr sect_jo = sectattrList.get(j);
|
||||
JSONObject sect_cas = new JSONObject();
|
||||
sect_cas.put("value", sect_jo.getSect_id());
|
||||
sect_cas.put("label", sect_jo.getSect_name());
|
||||
sect_ja.add(sect_cas);
|
||||
}
|
||||
stor_cas.put("children", sect_ja);
|
||||
}
|
||||
new_ja.add(stor_cas);
|
||||
}
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("content", new_ja);
|
||||
return jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void changeActive(JSONObject json) {
|
||||
|
||||
String stor_id = json.getString("stor_id");
|
||||
|
||||
BsrealStorattr bsrealStorattr = iBsrealStorattrService.list(new LambdaQueryWrapper<>(BsrealStorattr.class)
|
||||
.eq(BsrealStorattr::getStor_id,stor_id)
|
||||
.eq(BsrealStorattr::getIs_used,BaseDataEnum.IS_YES_NOT.code("是")))
|
||||
.stream().findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(bsrealStorattr)) {
|
||||
throw new BadRequestException("该库区所属的仓库已禁用,请先启用该仓库!");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
String is_used = BaseDataEnum.IS_YES_NOT.code("是").equals(json.getString("is_used")) ? BaseDataEnum.IS_YES_NOT.code("否") : BaseDataEnum.IS_YES_NOT.code("是");
|
||||
|
||||
json.put("is_used", is_used);
|
||||
json.put("update_optid", currentUserId);
|
||||
json.put("update_optname", nickName);
|
||||
json.put("update_time", now);
|
||||
|
||||
sectattrMapper.updateById(json.toJavaObject(Sectattr.class));
|
||||
|
||||
String sect_id = json.getString("sect_id");
|
||||
|
||||
iStructattrService.update(new LambdaUpdateWrapper<>(Structattr.class)
|
||||
.set(Structattr::getIs_used, is_used)
|
||||
.set(Structattr::getUpdate_optid, currentUserId)
|
||||
.set(Structattr::getUpdate_optname, nickName)
|
||||
.set(Structattr::getUpdate_time, now)
|
||||
.eq(Structattr::getSect_id, sect_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
package org.nl.wms.basedata_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
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 org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.nl.common.utils.MapOf;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata_manage.enums.BaseDataEnum;
|
||||
import org.nl.wms.basedata_manage.service.IBsrealStorattrService;
|
||||
import org.nl.wms.basedata_manage.service.ISectattrService;
|
||||
import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.BsrealStorattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.Sectattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.StructattrMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 仓位实现类
|
||||
*
|
||||
* @author dsh
|
||||
* 2025/5/15
|
||||
*/
|
||||
@Service
|
||||
public class StructattrServiceImpl extends ServiceImpl<StructattrMapper, Structattr> implements IStructattrService {
|
||||
|
||||
@Resource
|
||||
private StructattrMapper structattrMapper;
|
||||
|
||||
@Resource
|
||||
private IBsrealStorattrService iBsrealStorattrService;
|
||||
|
||||
@Resource
|
||||
private ISectattrService iSectattrService;
|
||||
|
||||
@Override
|
||||
public IPage<Structattr> queryAll(Map whereJson, PageQuery page) {
|
||||
|
||||
String search = (String) whereJson.get("search");
|
||||
String stor_id = (String) whereJson.get("stor_id");
|
||||
String sect_id = (String) whereJson.get("sect_id");
|
||||
String lock_type = (String) whereJson.get("lock_type");
|
||||
String layer_num = (String) whereJson.get("layer_num");
|
||||
String is_used = (String) whereJson.get("is_used");
|
||||
String is_have = (String) whereJson.get("is_have");
|
||||
|
||||
return structattrMapper.selectPage(new Page<>(page.getPage() + 1 ,page.getSize()), new LambdaQueryWrapper<Structattr>()
|
||||
.like(StrUtil.isNotEmpty(search),Structattr::getStruct_code, search)
|
||||
.like(StrUtil.isNotEmpty(search),Structattr::getStruct_name, search)
|
||||
.eq(StrUtil.isNotEmpty(stor_id),Structattr::getStor_id, stor_id)
|
||||
.eq(StrUtil.isNotEmpty(sect_id),Structattr::getSect_id, sect_id)
|
||||
.eq(StrUtil.isNotEmpty(lock_type),Structattr::getLock_type, lock_type)
|
||||
.eq(StrUtil.isNotEmpty(layer_num),Structattr::getLayer_num, layer_num)
|
||||
.eq(StrUtil.isNotEmpty(is_used),Structattr::getIs_used, is_used)
|
||||
.eq(Structattr::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"))
|
||||
.isNull("1".equals(is_have),Structattr::getStoragevehicle_code)
|
||||
.isNotNull("2".equals(is_have),Structattr::getStoragevehicle_code)
|
||||
.orderByAsc(Structattr::getStruct_code)
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Structattr findById(String struct_id) {
|
||||
return structattrMapper.selectById(struct_id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Structattr findByCode(String code) {
|
||||
return structattrMapper.selectOne(new LambdaQueryWrapper<Structattr>()
|
||||
.eq(Structattr::getStruct_code, code)
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(Structattr dto) {
|
||||
String struct_code = dto.getStruct_code();
|
||||
Structattr structattr = this.findByCode(struct_code);
|
||||
if (structattr != null && BaseDataEnum.IS_YES_NOT.code("否").equals(structattr.getIs_delete())) {
|
||||
throw new BadRequestException("存在相同的库区编号");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
dto.setStruct_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
|
||||
Sectattr sectattr = iSectattrService.findById(dto.getSect_id());
|
||||
BsrealStorattr bsrealStorattr = iBsrealStorattrService.findById(sectattr.getStor_id());
|
||||
dto.setSect_code(sectattr.getSect_code());
|
||||
dto.setSect_name(sectattr.getSect_name());
|
||||
dto.setStor_id(bsrealStorattr.getStor_id());
|
||||
dto.setStor_code(bsrealStorattr.getStor_code());
|
||||
dto.setStor_name(bsrealStorattr.getStor_name());
|
||||
|
||||
String storagevehicle_code = dto.getStoragevehicle_code();
|
||||
if (ObjectUtil.isNotEmpty(storagevehicle_code)) {
|
||||
// 暂时搁置后续添加
|
||||
// WQLObject vehicleTab = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
|
||||
// JSONObject obj = vehicleTab.query("storagevehicle_code = '" + storagevehicle_code + "'").uniqueResult(0);
|
||||
|
||||
// if (ObjectUtil.isEmpty(obj)) {
|
||||
// throw new BadRequestException("未发现载具号为【" + storagevehicle_code + "】的载具信息");
|
||||
// }
|
||||
//
|
||||
// dto.setStoragevehicle_id(obj.getLong
|
||||
// ("storagevehicle_id"));
|
||||
// dto.setStoragevehicle_type(obj.getString("storagevehicle_type"));
|
||||
}
|
||||
|
||||
structattrMapper.insert(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Structattr dto) {
|
||||
Structattr entity = this.findById(dto.getStruct_id());
|
||||
if (entity == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
String struct_code = dto.getStruct_code();
|
||||
Structattr structattr = this.findByCode(struct_code);
|
||||
if (structattr != null && !dto.getStruct_id().equals(structattr.getStruct_id()) && BaseDataEnum.IS_YES_NOT.code("否").equals(structattr.getIs_delete())) {
|
||||
throw new BadRequestException("存在相同的库区编号");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
Sectattr sectattr = iSectattrService.findById(dto.getSect_id());
|
||||
BsrealStorattr bsrealStorattr = iBsrealStorattrService.findById(sectattr.getStor_id());
|
||||
dto.setSect_code(sectattr.getSect_code());
|
||||
dto.setSect_name(sectattr.getSect_name());
|
||||
dto.setStor_id(bsrealStorattr.getStor_id());
|
||||
dto.setStor_code(bsrealStorattr.getStor_code());
|
||||
dto.setStor_name(bsrealStorattr.getStor_name());
|
||||
|
||||
structattrMapper.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(String[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
for (String struct_id : ids) {
|
||||
Structattr structattr = new Structattr();
|
||||
structattr.setStruct_id(struct_id);
|
||||
structattr.setIs_delete(BaseDataEnum.IS_YES_NOT.code("是"));
|
||||
structattr.setUpdate_optid(currentUserId);
|
||||
structattr.setUpdate_optname(nickName);
|
||||
structattr.setUpdate_time(now);
|
||||
structattrMapper.updateById(structattr);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeActive(JSONObject json) {
|
||||
String sect_id = json.getString("sect_id");
|
||||
Sectattr sectattr = iSectattrService.getOne(new LambdaQueryWrapper<>(Sectattr.class)
|
||||
.eq(Sectattr::getSect_id,sect_id)
|
||||
.eq(Sectattr::getIs_used,BaseDataEnum.IS_YES_NOT.code("是"))
|
||||
);
|
||||
if (ObjectUtil.isEmpty(sectattr)) {
|
||||
throw new BadRequestException("该仓位所属的库区已禁用,请先启用该库区!");
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String struct_code = json.getString("struct_code");
|
||||
String now = DateUtil.now();
|
||||
|
||||
String is_used = BaseDataEnum.IS_YES_NOT.code("是").equals(json.getString("is_used")) ? BaseDataEnum.IS_YES_NOT.code("否") : BaseDataEnum.IS_YES_NOT.code("是");
|
||||
|
||||
json.put("is_used", is_used);
|
||||
json.put("update_optid", currentUserId);
|
||||
json.put("update_optname", nickName);
|
||||
json.put("update_time", now);
|
||||
|
||||
structattrMapper.updateById(json.toJavaObject(Structattr.class));
|
||||
|
||||
// 暂时搁置后续添加
|
||||
// json = new JSONObject();
|
||||
// json.put("is_used", is_used);
|
||||
// json.put("update_optid", currentUserId);
|
||||
// json.put("update_optname", nickName);
|
||||
// json.put("update_time", now);
|
||||
// WQLObject.getWQLObject("sch_base_point").update(json, " point_code = '" + struct_code + "'");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/Storattr',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/Storattr/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/Storattr',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getStor(params) {
|
||||
return request({
|
||||
url: 'api/Storattr/getStor',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/Storattr/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getStor, changeActive }
|
||||
391
wms/nladmin-ui/src/views/wms/basedata/bsrealstorattr/index.vue
Normal file
391
wms/nladmin-ui/src/views/wms/basedata/bsrealstorattr/index.vue
Normal file
@@ -0,0 +1,391 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
style="width: 300px"
|
||||
size="mini"
|
||||
placeholder="输入仓库编码或名称"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
<rrOperation />
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="700px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓库编码" prop="stor_code">
|
||||
<el-input v-model="form.stor_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓库名称" prop="stor_name">
|
||||
<el-input v-model="form.stor_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓库简称">
|
||||
<el-input v-model="form.simple_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="外部标识">
|
||||
<el-input v-model="form.ext_id" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓库容量" prop="stor_capacity">
|
||||
<el-input v-model="form.stor_capacity" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="总面积(㎡)" prop="total_area">
|
||||
<el-input v-model="form.total_area" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓库性质" prop="stor_type_scode">
|
||||
<el-select
|
||||
v-model="form.stor_type_scode"
|
||||
placeholder=""
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.st_stor_type"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓库地址">
|
||||
<el-input v-model="form.storea_ddress" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人">
|
||||
<el-input v-model="form.principal" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="office_phone">
|
||||
<el-input v-model="form.office_phone" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-form-item label="仓库类型" required>
|
||||
<el-col :span="4" />
|
||||
<el-col :span="4">
|
||||
<el-checkbox v-model="form.is_materialstore" true-label="1" false-label="0">原材料库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-checkbox v-model="form.is_semi_finished" true-label="1" false-label="0">半成品库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-checkbox v-model="form.is_productstore" true-label="1" false-label="0">成品库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-checkbox v-model="form.is_attachment" true-label="1" false-label="0">备件库</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-checkbox v-model="form.is_virtualstore" true-label="1" false-label="0">虚拟库</el-checkbox>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<label slot="label">备 注</label>
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 550px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="stor_code" label="仓库编码" />
|
||||
<el-table-column prop="stor_name" label="仓库名称" width="150" />
|
||||
<el-table-column prop="simple_name" label="简称" width="130" />
|
||||
<el-table-column prop="stor_capacity" label="容量" />
|
||||
<el-table-column prop="total_area" width="100px" label="总面积(㎡)" />
|
||||
<el-table-column prop="label" label="仓库性质" />
|
||||
<el-table-column prop="storea_ddress" label="地址" />
|
||||
<el-table-column prop="principal" label="负责人" />
|
||||
<el-table-column prop="office_phone" label="联系电话" width="130" />
|
||||
<el-table-column prop="ext_id" label="外部标识" width="130" />
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column
|
||||
v-permission="['admin','stIvtBsrealstorattr:edit','stIvtBsrealstorattr:del']"
|
||||
label="操作"
|
||||
fixed="right"
|
||||
width="120px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
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 Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import { getDepts, getDeptSuperior } from '@/views/system/dept/dept'
|
||||
import { isvalidPhone } from '@/utils/validate'
|
||||
|
||||
const defaultForm = {
|
||||
stor_id: null,
|
||||
stor_code: null,
|
||||
stor_name: null,
|
||||
simple_name: null,
|
||||
stor_capacity: null,
|
||||
total_area: null,
|
||||
stor_type_scode: null,
|
||||
is_virtualstore: null,
|
||||
is_semi_finished: null,
|
||||
is_materialstore: null,
|
||||
is_productstore: null,
|
||||
is_reversed: null,
|
||||
is_mvout_auto_cfm: null,
|
||||
is_mvin_auto_cfm: null,
|
||||
area: null,
|
||||
storea_ddress: null,
|
||||
principal: null,
|
||||
office_phone: null,
|
||||
mobile_no: null,
|
||||
remark: null,
|
||||
order_index: null,
|
||||
whstate_scode: null,
|
||||
is_used: '1',
|
||||
base_class_id: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
sysownerid: null,
|
||||
sysdeptid: null,
|
||||
syscompanyid: null,
|
||||
is_delete: null,
|
||||
ext_id: null,
|
||||
depart_name: null,
|
||||
company_name: null,
|
||||
is_attachment: null
|
||||
}
|
||||
export default {
|
||||
name: 'StIvtBsrealstorattr',
|
||||
dicts: ['st_stor_type', 'is_used'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '仓库',
|
||||
optShow: { add: true, reset: true },
|
||||
url: 'api/Storattr',
|
||||
idField: 'stor_id',
|
||||
sort: 'stor_id,desc',
|
||||
crudMethod: { ...crudStorattr }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
const validPhone = (rule, value, callback) => {
|
||||
if (value && !isvalidPhone(value)) {
|
||||
callback(new Error('请输入正确的11位手机号码'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const numberOne = (rule, value, callback) => {
|
||||
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
|
||||
const numRe = new RegExp(numReg)
|
||||
if (value) {
|
||||
if (!numRe.test(value)) {
|
||||
callback(new Error('只能输入数字'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
depts: [],
|
||||
permission: {},
|
||||
rules: {
|
||||
stor_code: [
|
||||
{ required: true, message: '仓库编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
stor_name: [
|
||||
{ required: true, message: '仓库名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
stor_capacity: [
|
||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
],
|
||||
total_area: [
|
||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
],
|
||||
office_phone: [
|
||||
{ required: false, trigger: 'blur', validator: validPhone }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 新增与编辑前做的操作
|
||||
[CRUD.HOOK.afterToCU](crud, form) {
|
||||
if (form.id == null) {
|
||||
this.getDepts()
|
||||
} else {
|
||||
this.getSupDepts(form.dept.id)
|
||||
}
|
||||
},
|
||||
[CRUD.HOOK.beforeSubmit](crud, form) {
|
||||
if (this.form.is_virtualstore === '0' && this.form.is_semi_finished === '0' && this.form.is_materialstore === '0' &&
|
||||
this.form.is_productstore === '0' && this.form.is_attachment === '0') {
|
||||
this.crud.notify('仓库类型至少选一条', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
if (!this.form.is_virtualstore && !this.form.is_semi_finished && !this.form.is_materialstore &&
|
||||
!this.form.is_productstore && !this.form.is_attachment) {
|
||||
this.crud.notify('仓库类型至少选一条', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
}
|
||||
},
|
||||
getDepts() {
|
||||
getDepts({ enabled: true }).then(res => {
|
||||
this.depts = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
// 改变状态
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudStorattr.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
getSupDepts(deptId) {
|
||||
getDeptSuperior(deptId).then(res => {
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
})
|
||||
},
|
||||
buildDepts(depts) {
|
||||
depts.forEach(data => {
|
||||
if (data.children) {
|
||||
this.buildDepts(data.children)
|
||||
}
|
||||
if (data.hasChildren && !data.children) {
|
||||
data.children = null
|
||||
}
|
||||
})
|
||||
},
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
||||
parentNode.children = res.content.map(function(obj) {
|
||||
if (obj.hasChildren) {
|
||||
obj.children = null
|
||||
}
|
||||
return obj
|
||||
})
|
||||
setTimeout(() => {
|
||||
callback()
|
||||
}, 200)
|
||||
})
|
||||
}
|
||||
},
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
325
wms/nladmin-ui/src/views/wms/basedata/sectattr/index.vue
Normal file
325
wms/nladmin-ui/src/views/wms/basedata/sectattr/index.vue
Normal file
@@ -0,0 +1,325 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-select
|
||||
v-model="query.stor_id"
|
||||
clearable
|
||||
class="filter-item"
|
||||
placeholder="所属仓库"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stors"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
class="filter-item"
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="输入库区编码或名称"
|
||||
prefix-icon="el-icon-search"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:before-close="crud.cancelCU"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
:title="crud.status.title"
|
||||
width="700px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="库区编码" prop="sect_code">
|
||||
<el-input v-model="form.sect_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="库区名称" prop="sect_name">
|
||||
<el-input v-model="form.sect_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="库区简称">
|
||||
<el-input v-model="form.simple_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属仓库" prop="stor_id">
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
placeholder=""
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in stors"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="库区容量" prop="capacity">
|
||||
<el-input v-model="form.capacity" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="库区类型" prop="sect_type_attr">
|
||||
<el-select
|
||||
v-model="form.sect_type_attr"
|
||||
placeholder=""
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.st_sect_type"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="负责人">
|
||||
<el-input v-model="form.sect_manager_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="mobile_no">
|
||||
<el-input v-model="form.mobile_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注">
|
||||
<label slot="label">备 注</label>
|
||||
<el-input v-model="form.remark" :rows="3" type="textarea" style="width: 550px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="sect_code" sortable label="库区编码" />
|
||||
<el-table-column prop="sect_name" label="库区名称" width="150" />
|
||||
<el-table-column prop="simple_name" label="库区简称" width="150" />
|
||||
<el-table-column prop="stor_name" label="仓库名称" width="150" />
|
||||
<el-table-column prop="capacity" label="容量" />
|
||||
<el-table-column prop="sect_manager_name" label="负责人" />
|
||||
<el-table-column prop="mobile_no" label="联系电话" width="100px" />
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="ext_id" label="外部标识" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column
|
||||
v-permission="['admin','sectattr:edit','sectattr:del']"
|
||||
label="操作"
|
||||
width="120px"
|
||||
fixed="right"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
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 { isvalidPhone } from '@/utils/validate'
|
||||
import crudStorattr from '@/views/wms/basedata/bsrealstorattr/bsrealstorattr'
|
||||
import { getStor } from '../bsrealstorattr/bsrealstorattr'
|
||||
|
||||
const defaultForm = {
|
||||
sect_id: null,
|
||||
sect_code: null,
|
||||
sect_name: null,
|
||||
simple_name: null,
|
||||
sect_type_attr: null,
|
||||
stor_id: null,
|
||||
stor_type: null,
|
||||
capacity: null,
|
||||
width: null,
|
||||
height: null,
|
||||
zdepth: null,
|
||||
xqty: null,
|
||||
yqty: null,
|
||||
zqty: null,
|
||||
sect_manager_name: null,
|
||||
mobile_no: null,
|
||||
remark: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null,
|
||||
back_ground_color: null,
|
||||
front_ground_color: null,
|
||||
back_ground_pic: null,
|
||||
font_direction_scode: null,
|
||||
floor_no: null,
|
||||
is_used: '',
|
||||
ext_id: null
|
||||
}
|
||||
export default {
|
||||
name: 'Sectattr',
|
||||
dicts: ['st_sect_type', 'is_used'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '库区',
|
||||
optShow: { add: true, reset: true },
|
||||
url: 'api/sectattr',
|
||||
idField: 'sect_id',
|
||||
sort: 'sect_id,desc',
|
||||
crudMethod: { ...crudSectattr }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
const validPhone = (rule, value, callback) => {
|
||||
if (value && !isvalidPhone(value)) {
|
||||
callback(new Error('请输入正确的11位手机号码'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
const numberOne = (rule, value, callback) => {
|
||||
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
|
||||
const numRe = new RegExp(numReg)
|
||||
if (value) {
|
||||
if (!numRe.test(value)) {
|
||||
callback(new Error('只能输入数字'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
stors: [],
|
||||
permission: {
|
||||
add: ['admin', 'user:add'],
|
||||
edit: ['admin', 'user:edit'],
|
||||
del: ['admin', 'user:del']
|
||||
},
|
||||
rules: {
|
||||
sect_code: [
|
||||
{ required: true, message: '库区编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
sect_name: [
|
||||
{ required: true, message: '库区名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
sect_type_attr: [
|
||||
{ required: true, message: '库区类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
stor_id: [
|
||||
{ required: true, message: '仓库标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
capacity: [
|
||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
],
|
||||
mobile_no: [
|
||||
{ required: false, trigger: 'blur', validator: validPhone }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudStorattr.getStor().then(res => {
|
||||
this.stors = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
// 改变状态
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudSectattr.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
43
wms/nladmin-ui/src/views/wms/basedata/sectattr/sectattr.js
Normal file
43
wms/nladmin-ui/src/views/wms/basedata/sectattr/sectattr.js
Normal file
@@ -0,0 +1,43 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/sectattr',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/sectattr/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/sectattr',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getSect(params) {
|
||||
return request({
|
||||
url: 'api/sectattr/getSect',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/sectattr/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getSect, changeActive }
|
||||
@@ -0,0 +1,151 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-if="dialogShow"
|
||||
title="仓位信息"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
:before-close="handleClose"
|
||||
width="1100px"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<el-form ref="form3" :model="formMst" :rules="rules" size="mini" label-width="130px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="所属库区:">
|
||||
<el-cascader
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="仓位前缀:">
|
||||
<el-input v-model="formMst.prefix" placeholder="如:91、B21、C31等" size="mini" style="width: 210px" />
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="生成数量:">
|
||||
<el-input-number :precision="0" :step="1" :min="1" :max="90000" v-model="formMst.num" size="mini" :controls="false" style="width: 210px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" type="primary" :loading="loadingBut" @click="oneCreate">保存</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="close">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { crud } from '@crud/crud'
|
||||
import crudStructattr from '@/views/wms/basedata/structattr/structattr'
|
||||
|
||||
export default {
|
||||
name: 'SunShowDialog',
|
||||
mixins: [crud()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formMst: {
|
||||
stor_id: '',
|
||||
sect_id: '',
|
||||
prefix: '',
|
||||
num: 0
|
||||
},
|
||||
sects: [],
|
||||
dialogVisible: false,
|
||||
loadingBut: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
this.$refs['form3'].resetFields()
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.formMst.stor_id = val[0]
|
||||
this.formMst.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.formMst.sect_id = ''
|
||||
this.formMst.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.formMst.stor_id = val[0]
|
||||
this.formMst.sect_id = val[1]
|
||||
}
|
||||
},
|
||||
oneCreate() {
|
||||
if (this.formMst.sect_id === '') {
|
||||
return this.crud.notify('库区不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
|
||||
if (this.formMst.num === '') {
|
||||
return this.crud.notify('数量不能为空', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
this.loadingBut = true
|
||||
crudStructattr.oneCreate(this.formMst).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.close()
|
||||
this.crud.toQuery()
|
||||
this.loadingBut = false
|
||||
}).catch(() => {
|
||||
this.loadingBut = false
|
||||
})
|
||||
},
|
||||
blurQuery() {
|
||||
this.loadingBut = true
|
||||
crudStructattr.blurQuery({ 'prefix': this.formMst.prefix }).then(res => {
|
||||
this.crud.notify('可使用此前缀!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.loadingBut = false
|
||||
}).catch(() => {
|
||||
this.loadingBut = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
534
wms/nladmin-ui/src/views/wms/basedata/structattr/index.vue
Normal file
534
wms/nladmin-ui/src/views/wms/basedata/structattr/index.vue
Normal file
@@ -0,0 +1,534 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<el-form
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="所属库区">
|
||||
<el-cascader
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
class="filter-item"
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="锁定类型">
|
||||
<el-select
|
||||
v-model="query.lock_type"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="锁定类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.d_lock_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="立库层数">
|
||||
<el-select
|
||||
v-model="query.layer_num"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="层数"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in layerList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否空位">
|
||||
<el-select
|
||||
v-model="query.is_have"
|
||||
clearable
|
||||
size="mini"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in isHaveList"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="仓位编码、名称"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-switch
|
||||
v-model="query.is_used"
|
||||
active-value="0"
|
||||
inactive-value="1"
|
||||
active-color="#C0CCDA"
|
||||
inactive-color="#409EFF"
|
||||
@change="hand"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission">
|
||||
<!-- <el-button-->
|
||||
<!-- slot="right"-->
|
||||
<!-- class="filter-item"-->
|
||||
<!-- type="warning"-->
|
||||
<!-- icon="el-icon-check"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- @click="openOneCreate"-->
|
||||
<!-- >-->
|
||||
<!-- 一键生成-->
|
||||
<!-- </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="700px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-suffix=":" label-width="90px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓位编码" prop="struct_code">
|
||||
<el-input v-model="form.struct_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓位名称" prop="struct_name">
|
||||
<el-input v-model="form.struct_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="仓位简称">
|
||||
<el-input v-model="form.simple_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="归属库区" prop="sect_id">
|
||||
<el-cascader
|
||||
v-model="form.cascader"
|
||||
style="width: 200px;"
|
||||
:options="sects"
|
||||
clearable
|
||||
@change="sectChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="载具号">
|
||||
<label slot="label">载 具 号:</label>
|
||||
<el-input v-model="form.storagevehicle_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="锁定类型" prop="lock_type">
|
||||
<el-select
|
||||
v-model="form.lock_type"
|
||||
style="width: 200px;"
|
||||
placeholder=""
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.d_lock_type"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="容量" prop="capacity">
|
||||
<label slot="label">容 量:</label>
|
||||
<el-input v-model="form.capacity" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="承受重量" prop="weight">
|
||||
<el-input v-model="form.weight" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="宽度" prop="width">
|
||||
<label slot="label">宽 度:</label>
|
||||
<el-input v-model="form.width" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="深度" prop="zdepth">
|
||||
<label slot="label">深 度:</label>
|
||||
<el-input v-model="form.zdepth" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="高度" prop="height">
|
||||
<label slot="label">高 度:</label>
|
||||
<el-input v-model="form.height" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="放置类型" prop="placement_type">
|
||||
<el-select
|
||||
v-model="form.placement_type"
|
||||
placeholder=""
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.placement_type"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="是否临时" prop="is_tempstruct">
|
||||
<el-radio v-model="form.is_tempstruct" label="1">是</el-radio>
|
||||
<el-radio v-model="form.is_tempstruct" label="0">否</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
<label slot="label">备 注:</label>
|
||||
<el-input v-model="form.remark" style="width: 550px;" rows="2" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<!--
|
||||
<el-table-column type="selection" width="55" />
|
||||
-->
|
||||
<el-table-column prop="struct_code" label="仓位编码" :min-width="flexWidth('struct_code',crud.data,'仓位编码')" />
|
||||
<el-table-column prop="struct_name" label="仓位名称" :min-width="flexWidth('struct_name',crud.data,'仓位名称')" />
|
||||
<el-table-column prop="simple_name" label="仓位简称" :min-width="flexWidth('simple_name',crud.data,'仓位简称')" />
|
||||
<el-table-column prop="sect_name" label="所属库区" width="150" />
|
||||
<el-table-column prop="stor_name" label="所属仓库" width="150" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具号" :min-width="flexWidth('storagevehicle_code',crud.data,'载具号')" />
|
||||
<el-table-column prop="lock_type" label="锁定类型" min-width="120" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.d_lock_type[scope.row.lock_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sect_name" label="库区名称" />
|
||||
<el-table-column prop="placement_type" label="放置类型" min-width="120" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.placement_type[scope.row.placement_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
:value="format_is_used(scope.row.is_used)"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="taskdtl_type" label="锁定任务类型" width="150" :formatter="taskdtl_typeFormat" />
|
||||
<el-table-column prop="task_code" label="锁定任务编码" width="150" />
|
||||
<el-table-column prop="inv_code" label="锁定单据编码" width="150" />
|
||||
<el-table-column prop="inv_type" label="锁定单据类型" width="150" :formatter="invtypeFormat" />
|
||||
<el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
v-permission="['admin','structattr:edit','structattr:del']"
|
||||
label="操作"
|
||||
fixed="right"
|
||||
width="120px"
|
||||
align="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<!-- <OneCreateDialog :dialog-show.sync="openOneCreateDialog" />-->
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStructattr from '@/views/wms/basedata/structattr/structattr'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import OneCreateDialog from '@/views/wms/basedata/structattr/OneCreateDialog'
|
||||
import crudSectattr from '@/views/wms/basedata/sectattr/sectattr'
|
||||
|
||||
const defaultForm = {
|
||||
struct_id: null,
|
||||
cascader: null,
|
||||
struct_code: null,
|
||||
struct_name: null,
|
||||
simple_name: null,
|
||||
sect_id: null,
|
||||
sect_code: null,
|
||||
sect_name: null,
|
||||
stor_id: null,
|
||||
stor_code: null,
|
||||
stor_name: null,
|
||||
stor_type: null,
|
||||
capacity: null,
|
||||
width: null,
|
||||
height: null,
|
||||
zdepth: null,
|
||||
weight: null,
|
||||
xqty: null,
|
||||
yqty: null,
|
||||
zqty: null,
|
||||
is_tempstruct: '0',
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null,
|
||||
back_ground_color: null,
|
||||
front_ground_color: null,
|
||||
back_ground_pic: null,
|
||||
font_direction_scode: null,
|
||||
is_used: null,
|
||||
is_zdepth: null,
|
||||
storagevehicle_id: null,
|
||||
storagevehicle_code: null,
|
||||
storagevehicle_type: null,
|
||||
is_emptyvehicle: null,
|
||||
storagevehicle_qty: null,
|
||||
lock_type: null,
|
||||
material_height_type: null,
|
||||
taskdtl_type: null,
|
||||
taskdtl_id: null,
|
||||
task_code: null,
|
||||
inv_type: null,
|
||||
inv_id: null,
|
||||
inv_code: null,
|
||||
ext_id: null,
|
||||
remark: null
|
||||
}
|
||||
export default {
|
||||
name: 'Structattr',
|
||||
dicts: ['ST_HEIGHT_TYPE', 'is_used', 'd_lock_type', 'SCH_TASK_TYPE_DTL', 'placement_type'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '仓位',
|
||||
optShow: { add: true, reset: true },
|
||||
url: 'api/structattr',
|
||||
idField: 'struct_id',
|
||||
crudMethod: { ...crudStructattr }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
const numberOne = (rule, value, callback) => {
|
||||
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
|
||||
const numRe = new RegExp(numReg)
|
||||
if (value) {
|
||||
if (!numRe.test(value)) {
|
||||
callback(new Error('只能输入数字'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
openOneCreateDialog: false,
|
||||
sects: [],
|
||||
invtypelist: [],
|
||||
permission: {},
|
||||
layerList: [
|
||||
{ 'label': '1层', 'value': '1' },
|
||||
{ 'label': '2层', 'value': '2' },
|
||||
{ 'label': '3层', 'value': '3' }
|
||||
],
|
||||
isHaveList: [
|
||||
{ 'label': '空位', 'value': '1' },
|
||||
{ 'label': '有货', 'value': '2' }
|
||||
],
|
||||
rules: {
|
||||
struct_id: [
|
||||
{ required: true, message: '仓位标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
struct_code: [
|
||||
{ required: true, message: '仓位编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
struct_name: [
|
||||
{ required: true, message: '仓位名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
sect_id: [
|
||||
{ required: true, message: '库区标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
stor_id: [
|
||||
{ required: true, message: '仓库标识不能为空', trigger: 'blur' }
|
||||
],
|
||||
capacity: [
|
||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
],
|
||||
weight: [
|
||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
],
|
||||
width: [
|
||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
],
|
||||
height: [
|
||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
],
|
||||
zdepth: [
|
||||
{ required: false, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
],
|
||||
material_height_type: [
|
||||
{ required: true, message: '物料高度类型不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudSectattr.getSect({ 'stor_id': '' }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
[CRUD.HOOK.afterToEdit](crud, form) {
|
||||
const val = []
|
||||
val[0] = form.stor_id
|
||||
val[1] = form.sect_id
|
||||
form.cascader = val
|
||||
},
|
||||
sectChange(val) {
|
||||
this.form.sect_id = val[1]
|
||||
},
|
||||
openOneCreate() {
|
||||
this.openOneCreateDialog = true
|
||||
},
|
||||
invtypeFormat(row) {
|
||||
for (const item of this.invtypelist) {
|
||||
if (item.code === row.inv_type) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
taskdtl_typeFormat(row) {
|
||||
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.query.sect_id = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = val[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
// 改变状态
|
||||
format_is_used(is_used) {
|
||||
return is_used === '1'
|
||||
},
|
||||
changeEnabled(data, val) {
|
||||
let msg = '此操作将停用,是否继续!'
|
||||
if (val !== '1') {
|
||||
msg = '此操作将启用,是否继续!'
|
||||
}
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudStructattr.changeActive(data).then(res => {
|
||||
this.crud.toQuery()
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
data.is_used = !data.is_used
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,51 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/structattr',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/structattr/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/structattr',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/structattr/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function oneCreate(data) {
|
||||
return request({
|
||||
url: 'api/structattr/oneCreate',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function blurQuery(data) {
|
||||
return request({
|
||||
url: 'api/structattr/blurQuery',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, oneCreate, blurQuery }
|
||||
Reference in New Issue
Block a user