add:供应商,载具维护,计量单位
This commit is contained in:
@@ -3,15 +3,28 @@ package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
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.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author liuxy
|
||||
* @date 2025-5-13
|
||||
**/
|
||||
* <p>
|
||||
* 物料基本信息表 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-13
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/Materia")
|
||||
@@ -21,4 +34,31 @@ public class MaterialbaseController {
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService iMdMeMaterialbaseService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询物料")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdMeMaterialbaseService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增物料")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MdMeMaterialbase dto) {
|
||||
iMdMeMaterialbaseService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改物料")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody MdMeMaterialbase dto) {
|
||||
iMdMeMaterialbaseService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除物料")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iMdMeMaterialbaseService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
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.IMdPbMeasureunitService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 计量单位表 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/mdPbMeasureunit")
|
||||
@Slf4j
|
||||
public class MeasureUnitController {
|
||||
|
||||
@Autowired
|
||||
private IMdPbMeasureunitService iMdPbMeasureunitService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询单位")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPbMeasureunitService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增计量单位")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MdPbMeasureunit dto) {
|
||||
iMdPbMeasureunitService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改计量单位")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody MdPbMeasureunit dto) {
|
||||
iMdPbMeasureunitService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除计量单位")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iMdPbMeasureunitService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
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.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具基本信息表 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/storagevehicleinfo")
|
||||
@Slf4j
|
||||
public class StorageVehicleInfoController {
|
||||
|
||||
@Autowired
|
||||
private IMdPbStoragevehicleinfoService iMdPbStoragevehicleinfoService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询载具")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdPbStoragevehicleinfoService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增载具")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MdPbStoragevehicleinfo dto) {
|
||||
iMdPbStoragevehicleinfoService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改载具")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody MdPbStoragevehicleinfo dto) {
|
||||
iMdPbStoragevehicleinfoService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除载具")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iMdPbStoragevehicleinfoService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package org.nl.wms.basedata_manage.controller;
|
||||
|
||||
|
||||
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.IMdCsSupplierbaseService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 供应商 控制层
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/supplierbase")
|
||||
@Slf4j
|
||||
public class SupplierController {
|
||||
|
||||
@Autowired
|
||||
private IMdCsSupplierbaseService iMdCsSupplierbaseService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询供应商")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page) {
|
||||
return new ResponseEntity<>(TableDataInfo.build(iMdCsSupplierbaseService.queryAll(whereJson, page)), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增供应商")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody MdCsSupplierbase dto) {
|
||||
iMdCsSupplierbaseService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改供应商")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody MdCsSupplierbase dto) {
|
||||
iMdCsSupplierbaseService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除供应商")
|
||||
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||
iMdCsSupplierbaseService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.nl.wms.basedata_manage.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.MapOf;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 基础数据枚举类
|
||||
*
|
||||
* @author Liuxy
|
||||
* @Date 2025/05/14 20:11
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum BaseDataEnum {
|
||||
|
||||
// 是否
|
||||
IS_YES_NOT(MapOf.of("是", "1", "否", "0")),
|
||||
;
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
public String code(String desc) {
|
||||
String code = this.getCode().get(desc);
|
||||
if (StringUtils.isNotEmpty(code)) {
|
||||
return code;
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + desc + "未定义");
|
||||
}
|
||||
|
||||
public String check(String code) {
|
||||
for (Map.Entry<String, String> entry : this.getCode().entrySet())
|
||||
if (entry.getValue().equals("code")) {
|
||||
return entry.getValue();
|
||||
}
|
||||
throw new BadRequestException(this.name() + "对应类型" + code + "未定义");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package org.nl.wms.basedata_manage.service;
|
||||
|
||||
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.MdCsSupplierbase;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 供应商基本信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
public interface IMdCsSupplierbaseService extends IService<MdCsSupplierbase> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param whereJson : {查询参数}
|
||||
* @param pageable : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<MdCsSupplierbase> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 新增供应商
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void create(MdCsSupplierbase dto);
|
||||
|
||||
/**
|
||||
* 修改供应商
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void update(MdCsSupplierbase dto);
|
||||
|
||||
/**
|
||||
* 删除供应商
|
||||
* @param ids 供应商标识集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
}
|
||||
@@ -1,16 +1,45 @@
|
||||
package org.nl.wms.basedata_manage.service;
|
||||
|
||||
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.MdMeMaterialbase;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料基本信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @author Liuxy
|
||||
* @since 2025-05-13
|
||||
*/
|
||||
public interface IMdMeMaterialbaseService extends IService<MdMeMaterialbase> {
|
||||
/**
|
||||
* 分页查询
|
||||
* @param whereJson : {查询参数}
|
||||
* @param pageable : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<MdMeMaterialbase> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 新增物料
|
||||
* @param dto 物料实体类
|
||||
*/
|
||||
void create(MdMeMaterialbase dto);
|
||||
|
||||
/**
|
||||
* 修改物料
|
||||
* @param dto 物料实体类
|
||||
*/
|
||||
void update(MdMeMaterialbase dto);
|
||||
|
||||
/**
|
||||
* 删除物料
|
||||
* @param ids 物料标识集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package org.nl.wms.basedata_manage.service;
|
||||
|
||||
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.MdPbMeasureunit;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 计量单位表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
public interface IMdPbMeasureunitService extends IService<MdPbMeasureunit> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param whereJson : {查询参数}
|
||||
* @param pageable : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<MdPbMeasureunit> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 新增计量单位
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void create(MdPbMeasureunit dto);
|
||||
|
||||
/**
|
||||
* 修改计量单位
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void update(MdPbMeasureunit dto);
|
||||
|
||||
/**
|
||||
* 删除计量单位
|
||||
* @param ids 计量单位标识集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package org.nl.wms.basedata_manage.service;
|
||||
|
||||
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.MdPbStoragevehicleinfo;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具信息表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
public interface IMdPbStoragevehicleinfoService extends IService<MdPbStoragevehicleinfo> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param whereJson : {查询参数}
|
||||
* @param pageable : 分页对象
|
||||
* @return 返回结果
|
||||
*/
|
||||
IPage<MdPbStoragevehicleinfo> queryAll(Map whereJson, PageQuery pageable);
|
||||
|
||||
/**
|
||||
* 新增载具信息
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void create(MdPbStoragevehicleinfo dto);
|
||||
|
||||
/**
|
||||
* 修改载具
|
||||
* @param dto 实体类
|
||||
*/
|
||||
void update(MdPbStoragevehicleinfo dto);
|
||||
|
||||
/**
|
||||
* 删除载具信息
|
||||
* @param ids 载具标识集合
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 供应商基本信息表
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("md_cs_supplierbase")
|
||||
public class MdCsSupplierbase implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 供应商标识
|
||||
*/
|
||||
@TableId(value = "supp_id")
|
||||
private String supp_id;
|
||||
|
||||
/**
|
||||
* 供应商编码
|
||||
*/
|
||||
private String supp_code;
|
||||
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supp_name;
|
||||
|
||||
/**
|
||||
* 法人代表
|
||||
*/
|
||||
private String jurid_name;
|
||||
|
||||
/**
|
||||
* 税务登记号
|
||||
*/
|
||||
private String tax_no;
|
||||
|
||||
/**
|
||||
* 工商注册号
|
||||
*/
|
||||
private String register_no;
|
||||
|
||||
/**
|
||||
* 经营许可证号
|
||||
*/
|
||||
private String manage_lice_no;
|
||||
|
||||
/**
|
||||
* 营业执照
|
||||
*/
|
||||
private String busi_char_name;
|
||||
|
||||
/**
|
||||
* 邮政编码
|
||||
*/
|
||||
private String zip_code;
|
||||
|
||||
/**
|
||||
* 公司电话
|
||||
*/
|
||||
private String corp_tele_no;
|
||||
|
||||
/**
|
||||
* 公司地址
|
||||
*/
|
||||
private String corp_address;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
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_used_time;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String ext_id;
|
||||
|
||||
/**
|
||||
* 分类标识
|
||||
*/
|
||||
private Long class_id;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -20,9 +20,7 @@ import lombok.experimental.Accessors;
|
||||
* @since 2025-05-13
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Accessors(chain = true)
|
||||
@TableName("md_me_materialbase")
|
||||
public class MdMeMaterialbase implements Serializable {
|
||||
|
||||
@@ -31,7 +29,7 @@ public class MdMeMaterialbase implements Serializable {
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
@TableId(value = "material_id", type = IdType.AUTO)
|
||||
@TableId(value = "material_id")
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
@@ -62,12 +60,12 @@ public class MdMeMaterialbase implements Serializable {
|
||||
/**
|
||||
* 基本计量单位
|
||||
*/
|
||||
private String baseUnit_id;
|
||||
private String base_unit_id;
|
||||
|
||||
/**
|
||||
* 辅助计量单位
|
||||
*/
|
||||
private String assUnit_id;
|
||||
private String ass_unit_id;
|
||||
|
||||
/**
|
||||
* 批准文号
|
||||
@@ -132,7 +130,7 @@ public class MdMeMaterialbase implements Serializable {
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private Long create_id;
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
@@ -162,7 +160,7 @@ public class MdMeMaterialbase implements Serializable {
|
||||
/**
|
||||
* 启用时间
|
||||
*/
|
||||
private String isUsed_time;
|
||||
private String is_used_time;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 计量单位表
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("md_pb_measureunit")
|
||||
public class MdPbMeasureunit implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 计量单位标识
|
||||
*/
|
||||
@TableId(value = "measure_unit_id")
|
||||
private String measure_unit_id;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String unit_code;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String unit_name;
|
||||
|
||||
/**
|
||||
* 数据精度
|
||||
*/
|
||||
private BigDecimal qty_precision;
|
||||
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private String is_used;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
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 ext_id;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具信息表
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("md_pb_storagevehicleinfo")
|
||||
public class MdPbStoragevehicleinfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 载具标识
|
||||
*/
|
||||
@TableId(value = "storagevehicle_id")
|
||||
private String storagevehicle_id;
|
||||
|
||||
/**
|
||||
* 载具编码
|
||||
*/
|
||||
private String storagevehicle_code;
|
||||
|
||||
/**
|
||||
* 载具名称
|
||||
*/
|
||||
private String storagevehicle_name;
|
||||
|
||||
/**
|
||||
* 一维码
|
||||
*/
|
||||
private String one_code;
|
||||
|
||||
/**
|
||||
* 二维码
|
||||
*/
|
||||
private String two_code;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
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 is_used;
|
||||
|
||||
/**
|
||||
* 载具类型
|
||||
*/
|
||||
private String storagevehicle_type;
|
||||
|
||||
/**
|
||||
* 载具宽度
|
||||
*/
|
||||
private BigDecimal vehicle_width;
|
||||
|
||||
/**
|
||||
* 载具长度
|
||||
*/
|
||||
private BigDecimal vehicle_long;
|
||||
|
||||
/**
|
||||
* 载具高度
|
||||
*/
|
||||
private BigDecimal vehicle_height;
|
||||
|
||||
/**
|
||||
* 托盘重量
|
||||
*/
|
||||
private BigDecimal weigth;
|
||||
|
||||
/**
|
||||
* 载具是否超仓位
|
||||
*/
|
||||
private String overstruct_type;
|
||||
|
||||
/**
|
||||
* 占仓位数
|
||||
*/
|
||||
private BigDecimal occupystruct_qty;
|
||||
|
||||
/**
|
||||
* 外部标识
|
||||
*/
|
||||
private String ext_id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.basedata_manage.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 供应商基本信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
public interface MdCsSupplierbaseMapper extends BaseMapper<MdCsSupplierbase> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.basedata_manage.service.dao.mapper.MdCsSupplierbaseMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.basedata_manage.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 计量单位表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
public interface MdPbMeasureunitMapper extends BaseMapper<MdPbMeasureunit> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.basedata_manage.service.dao.mapper.MdPbMeasureunitMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.basedata_manage.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具信息表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
public interface MdPbStoragevehicleinfoMapper extends BaseMapper<MdPbStoragevehicleinfo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,96 @@
|
||||
package org.nl.wms.basedata_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.IMdCsSupplierbaseService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdCsSupplierbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdCsSupplierbaseMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 供应商基本信息表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
@Service
|
||||
public class MdCsSupplierbaseServiceImpl extends ServiceImpl<MdCsSupplierbaseMapper, MdCsSupplierbase> implements IMdCsSupplierbaseService {
|
||||
|
||||
@Override
|
||||
public IPage<MdCsSupplierbase> queryAll(Map whereJson, PageQuery page) {
|
||||
// 查询条件
|
||||
LambdaQueryWrapper<MdCsSupplierbase> queryWrapper = new QueryWrapper<MdCsSupplierbase>().lambda();
|
||||
String search = MapUtil.getStr(whereJson, "search");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(search)) {
|
||||
queryWrapper.likeRight(MdCsSupplierbase::getSupp_code, search)
|
||||
.or(item -> item.likeRight(MdCsSupplierbase::getSupp_name, search));
|
||||
}
|
||||
queryWrapper.eq(MdCsSupplierbase::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
queryWrapper.orderByDesc(MdCsSupplierbase::getUpdate_time);
|
||||
|
||||
return this.baseMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
queryWrapper
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(MdCsSupplierbase dto) {
|
||||
MdCsSupplierbase mdCsSupplierbase = this.baseMapper.selectOne(
|
||||
new QueryWrapper<MdCsSupplierbase>().lambda()
|
||||
.eq(MdCsSupplierbase::getSupp_code, dto.getSupp_code())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(mdCsSupplierbase)) {
|
||||
throw new BadRequestException("当前计量单位编码已存在【"+dto.getSupp_code()+"】");
|
||||
}
|
||||
|
||||
// 新增
|
||||
dto.setSupp_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(MdCsSupplierbase dto) {
|
||||
MdCsSupplierbase mdCsSupplierbase = this.baseMapper.selectById(dto.getSupp_id());
|
||||
if (ObjectUtil.isEmpty(mdCsSupplierbase)) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
// 修改
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
this.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Set<String> ids) {
|
||||
this.baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,95 @@
|
||||
package org.nl.wms.basedata_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdMeMaterialbaseMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 物料基本信息表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author author
|
||||
* @author Liuxy
|
||||
* @since 2025-05-13
|
||||
*/
|
||||
@Service
|
||||
public class MdMeMaterialbaseServiceImpl extends ServiceImpl<MdMeMaterialbaseMapper, MdMeMaterialbase> implements IMdMeMaterialbaseService {
|
||||
|
||||
@Override
|
||||
public IPage<MdMeMaterialbase> queryAll(Map whereJson, PageQuery page) {
|
||||
// 查询条件
|
||||
LambdaQueryWrapper<MdMeMaterialbase> queryWrapper = new QueryWrapper<MdMeMaterialbase>().lambda();
|
||||
String search = MapUtil.getStr(whereJson, "search");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(search)) {
|
||||
queryWrapper.likeRight(MdMeMaterialbase::getMaterial_code, search)
|
||||
.or(item -> item.likeRight(MdMeMaterialbase::getMaterial_name, search));
|
||||
}
|
||||
queryWrapper.orderByDesc(MdMeMaterialbase::getUpdate_time);
|
||||
|
||||
return this.baseMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
queryWrapper
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(MdMeMaterialbase dto) {
|
||||
// 根据物料编码查询是否有相同物料编码的物料
|
||||
MdMeMaterialbase mdMeMaterialbase = this.baseMapper.selectOne(
|
||||
new QueryWrapper<MdMeMaterialbase>().lambda()
|
||||
.eq(MdMeMaterialbase::getMaterial_code, dto.getMaterial_code())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(mdMeMaterialbase)) {
|
||||
throw new BadRequestException("当前物料编码已存在【"+dto.getMaterial_code()+"】");
|
||||
}
|
||||
|
||||
// 新增
|
||||
dto.setMaterial_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(MdMeMaterialbase dto) {
|
||||
MdMeMaterialbase mdMeMaterialbase = this.baseMapper.selectById(dto.getMaterial_id());
|
||||
if (ObjectUtil.isEmpty(mdMeMaterialbase)) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
// 修改
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
this.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Set<String> ids) {
|
||||
this.baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package org.nl.wms.basedata_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.IMdPbMeasureunitService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbMeasureunit;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbMeasureunitMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 计量单位表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
@Service
|
||||
public class MdPbMeasureunitServiceImpl extends ServiceImpl<MdPbMeasureunitMapper, MdPbMeasureunit> implements IMdPbMeasureunitService {
|
||||
|
||||
@Override
|
||||
public IPage<MdPbMeasureunit> queryAll(Map whereJson, PageQuery page) {
|
||||
// 查询条件
|
||||
LambdaQueryWrapper<MdPbMeasureunit> queryWrapper = new QueryWrapper<MdPbMeasureunit>().lambda();
|
||||
String search = MapUtil.getStr(whereJson, "search");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(search)) {
|
||||
queryWrapper.likeRight(MdPbMeasureunit::getUnit_code, search)
|
||||
.or(item -> item.likeRight(MdPbMeasureunit::getUnit_name, search));
|
||||
}
|
||||
queryWrapper.eq(MdPbMeasureunit::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
queryWrapper.orderByDesc(MdPbMeasureunit::getUpdate_time);
|
||||
|
||||
return this.baseMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
queryWrapper
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(MdPbMeasureunit dto) {
|
||||
MdPbMeasureunit mdPbMeasureunit = this.baseMapper.selectOne(
|
||||
new QueryWrapper<MdPbMeasureunit>().lambda()
|
||||
.eq(MdPbMeasureunit::getUnit_code, dto.getUnit_code())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(mdPbMeasureunit)) {
|
||||
throw new BadRequestException("当前计量单位编码已存在【"+dto.getUnit_code()+"】");
|
||||
}
|
||||
|
||||
// 新增
|
||||
dto.setMeasure_unit_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(MdPbMeasureunit dto) {
|
||||
MdPbMeasureunit mdPbMeasureunit = this.baseMapper.selectById(dto.getMeasure_unit_id());
|
||||
if (ObjectUtil.isEmpty(mdPbMeasureunit)) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
// 修改
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
this.updateById(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Set<String> ids) {
|
||||
this.baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package org.nl.wms.basedata_manage.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.IMdPbStoragevehicleinfoService;
|
||||
import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleinfo;
|
||||
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleinfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 载具信息表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author Liuxy
|
||||
* @since 2025-05-14
|
||||
*/
|
||||
@Service
|
||||
public class MdPbStoragevehicleinfoServiceImpl extends ServiceImpl<MdPbStoragevehicleinfoMapper, MdPbStoragevehicleinfo> implements IMdPbStoragevehicleinfoService {
|
||||
|
||||
@Override
|
||||
public IPage<MdPbStoragevehicleinfo> queryAll(Map whereJson, PageQuery page) {
|
||||
// 查询条件
|
||||
LambdaQueryWrapper<MdPbStoragevehicleinfo> queryWrapper = new QueryWrapper<MdPbStoragevehicleinfo>().lambda();
|
||||
String search = MapUtil.getStr(whereJson, "storagevehicle_code");
|
||||
String storagevehicle_type = MapUtil.getStr(whereJson, "storagevehicle_type");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(search)) {
|
||||
queryWrapper.likeRight(MdPbStoragevehicleinfo::getStoragevehicle_code, search)
|
||||
.or(item -> item.likeRight(MdPbStoragevehicleinfo::getStoragevehicle_name, search));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(storagevehicle_type)) {
|
||||
queryWrapper.eq(MdPbStoragevehicleinfo::getStoragevehicle_type, storagevehicle_type);
|
||||
}
|
||||
queryWrapper.eq(MdPbStoragevehicleinfo::getIs_delete, BaseDataEnum.IS_YES_NOT.code("否"));
|
||||
queryWrapper.orderByDesc(MdPbStoragevehicleinfo::getUpdate_time);
|
||||
|
||||
return this.baseMapper.selectPage(new Page<>(page.getPage() + 1, page.getSize()),
|
||||
queryWrapper
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(MdPbStoragevehicleinfo dto) {
|
||||
// 根据载具编码查询是否有相同载具编码的载具
|
||||
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = this.baseMapper.selectOne(
|
||||
new QueryWrapper<MdPbStoragevehicleinfo>().lambda()
|
||||
.eq(MdPbStoragevehicleinfo::getStoragevehicle_code, dto.getStoragevehicle_code())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(mdPbStoragevehicleinfo)) {
|
||||
throw new BadRequestException("当前载具编码已存在【"+dto.getStoragevehicle_code()+"】");
|
||||
}
|
||||
|
||||
// 新增
|
||||
dto.setStoragevehicle_id(IdUtil.getStringId());
|
||||
dto.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
dto.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
dto.setCreate_time(DateUtil.now());
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
this.save(dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(MdPbStoragevehicleinfo dto) {
|
||||
MdPbStoragevehicleinfo mdPbStoragevehicleinfo = this.baseMapper.selectById(dto.getStoragevehicle_id());
|
||||
if (ObjectUtil.isEmpty(mdPbStoragevehicleinfo)) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
// 修改
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getCurrentNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
this.updateById(dto);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Set<String> ids) {
|
||||
this.baseMapper.deleteBatchIds(ids);
|
||||
}
|
||||
}
|
||||
@@ -32,8 +32,8 @@
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="物料编码" prop="material_code">
|
||||
<el-input v-model="form.material_code" style="width: 200px;" />
|
||||
<el-form-item label="物料编码" prop="material_code" >
|
||||
<el-input v-model="form.material_code" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
||||
176
wms/nladmin-ui/src/views/wms/basedata/measure/index.vue
Normal file
176
wms/nladmin-ui/src/views/wms/basedata/measure/index.vue
Normal file
@@ -0,0 +1,176 @@
|
||||
<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="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
<el-form-item label="编码" prop="unit_code">
|
||||
<el-input v-model="form.unit_code" style="width: 370px;" :disabled="crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="unit_name">
|
||||
<el-input v-model="form.unit_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="外部标识" prop="ext_id">
|
||||
<el-input v-model="form.ext_id" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据精度" prop="qty_precision">
|
||||
<el-input-number v-model="form.qty_precision" :min="1" :max="6" label="描述文字" style="width: 150px;" @change="handleChange" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="is_used">
|
||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_used" label="1">是</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column prop="unit_code" label="编码" />
|
||||
<el-table-column prop="unit_name" label="名称" />
|
||||
<el-table-column prop="qty_precision" label="数据精度" />
|
||||
<el-table-column prop="update_optname" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="135" />
|
||||
<el-table-column prop="is_used" label="启用 ">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.is_used"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-permission="['admin','mdPbMeasureunit:edit','mdPbMeasureunit:del']" fixed="right" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudMdPbMeasureunit from '@/views/wms/basedata/measure/mdPbMeasureunit'
|
||||
import CRUD, { presenter, header, form, crud } 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'
|
||||
const defaultForm = { measure_unit_id: null, unit_code: null, unit_name: null, qty_precision: null, is_used: '1', create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, ext_id: null }
|
||||
export default {
|
||||
dicts: ['is_used'],
|
||||
name: 'MdPbMeasureunit',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: '计量单位',
|
||||
url: 'api/mdPbMeasureunit',
|
||||
optShow: {
|
||||
add: true,
|
||||
reset: true
|
||||
},
|
||||
idField: 'measure_unit_id',
|
||||
sort: 'measure_unit_id,desc',
|
||||
crudMethod: { ...crudMdPbMeasureunit }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
},
|
||||
rules: {
|
||||
measure_unit_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
unit_code: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
unit_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
qty_precision: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_time: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_delete: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.unit_name + ', 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudMdPbMeasureunit.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
},
|
||||
handleChange(value) {
|
||||
console.log(value)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,35 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/mdPbMeasureunit',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/mdPbMeasureunit/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/mdPbMeasureunit',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getUnit(params) {
|
||||
return request({
|
||||
url: 'api/mdPbMeasureunit/getUnit',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getUnit }
|
||||
@@ -0,0 +1,280 @@
|
||||
<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-select
|
||||
v-model="query.storagevehicle_type"
|
||||
clearable
|
||||
class="filter-item"
|
||||
placeholder="请选择"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.storagevehicle_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="模糊搜索">
|
||||
<el-input
|
||||
v-model="query.storagevehicle_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="载具号、载具名称"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation/>
|
||||
</el-form>
|
||||
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:before-close="crud.cancelCU"
|
||||
:close-on-click-modal="false"
|
||||
:title="crud.status.title"
|
||||
:visible.sync="crud.status.cu > 0"
|
||||
width="450px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item label="载具类型" prop="storagevehicle_type">
|
||||
<el-select
|
||||
v-model="form.storagevehicle_type"
|
||||
class="filter-item"
|
||||
placeholder="请选择"
|
||||
:disabled="crud.status.edit > 0"
|
||||
style="width: 200px;"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.storagevehicle_type"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="载具编码" prop="storagevehicle_code">
|
||||
<el-input v-model="form.storagevehicle_code" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="载具名称" prop="storagevehicle_name">
|
||||
<el-input v-model="form.storagevehicle_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="载具重量" prop="weigth">
|
||||
<el-input-number v-model="form.weigth" :precision="1" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用">
|
||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_used" label="1">是</el-radio>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @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 v-if="false" prop="storagevehicle_id" label="载具标识" />
|
||||
<el-table-column prop="storagevehicle_type_name" label="载具类型" :formatter="formattType" />
|
||||
<el-table-column prop="storagevehicle_code" label="载具编码" />
|
||||
<el-table-column prop="storagevehicle_name" label="载具名称" />
|
||||
<el-table-column prop="pcsn" label="绑定物料" />
|
||||
<el-table-column prop="weigth" label="托盘重量" />
|
||||
<el-table-column label="是否启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.is_used"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_name" label="创建人"/>
|
||||
<el-table-column prop="create_time" label="创建时间" width="150px"/>
|
||||
<el-table-column
|
||||
v-permission="['admin','storagevehicleinfo:edit','storagevehicleinfo:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStoragevehicleinfo from '@/views/wms/basedata/storagevehicleinfo/storagevehicleinfo'
|
||||
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'
|
||||
|
||||
const defaultForm = {
|
||||
storagevehicle_id: null,
|
||||
storagevehicle_code: null,
|
||||
storagevehicle_name: null,
|
||||
one_code: null,
|
||||
two_code: null,
|
||||
rfid_code: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_delete: null,
|
||||
is_used: '1',
|
||||
storagevehicle_type: null,
|
||||
weigth: null,
|
||||
vehicle_width: null,
|
||||
vehicle_long: null,
|
||||
vehicle_height: null,
|
||||
overstruct_type: null,
|
||||
occupystruct_qty: null,
|
||||
ext_id: null,
|
||||
qty: null,
|
||||
pcsn: null
|
||||
}
|
||||
export default {
|
||||
name: 'Storagevehicleinfo',
|
||||
dicts: ['storagevehicle_type', 'is_used'],
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '载具',
|
||||
url: 'api/storagevehicleinfo',
|
||||
idField: 'storagevehicle_id',
|
||||
sort: 'storagevehicle_id,desc',
|
||||
crudMethod: { ...crudStoragevehicleinfo },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
}
|
||||
})
|
||||
},
|
||||
data() {
|
||||
var numberOne = (rule, value, callback) => {
|
||||
const numReg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
|
||||
const numRe = new RegExp(numReg)
|
||||
if (!numRe.test(value)) {
|
||||
callback(new Error('只能输入数字'))
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
return {
|
||||
resultCodeArr: [],
|
||||
permission: {},
|
||||
classes1: [],
|
||||
rules: {
|
||||
is_delete: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
storagevehicle_type: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
storagevehicle_code: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
storagevehicle_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
overstruct_type: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
num: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' },
|
||||
{ validator: numberOne }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.storagevehicle_code + ', 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudStoragevehicleinfo.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
},
|
||||
formattType(row) {
|
||||
return this.dict.label.storagevehicle_type[row.storagevehicle_type]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,42 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/storagevehicleinfo',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/storagevehicleinfo/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/storagevehicleinfo',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function changeActive(data) {
|
||||
return request({
|
||||
url: 'api/storagevehicleinfo/changeActive',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getVehicle(code) {
|
||||
return request({
|
||||
url: 'api/storagevehicleinfo/getVehicle/' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, changeActive, getVehicle }
|
||||
290
wms/nladmin-ui/src/views/wms/basedata/supp/index.vue
Normal file
290
wms/nladmin-ui/src/views/wms/basedata/supp/index.vue
Normal file
@@ -0,0 +1,290 @@
|
||||
<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="1200px"
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="130px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商编码" prop="supp_code">
|
||||
<el-input v-model="form.supp_code" style="width: 200px;" :disabled="crud.status.edit > 0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="供应商名称 " prop="supp_name">
|
||||
<el-input v-model="form.supp_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="法人代表">
|
||||
<el-input v-model="form.jurid_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="税务登记号">
|
||||
<el-input v-model="form.tax_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="工商注册号">
|
||||
<el-input v-model="form.register_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="经营许可证号">
|
||||
<el-input v-model="form.manage_lice_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="营业执照">
|
||||
<el-input v-model="form.busi_char_name" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="条码打印起始值">
|
||||
<el-input v-model="form.barcode_print" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="邮政编码">
|
||||
<el-input v-model="form.zip_code" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司电话">
|
||||
<el-input v-model="form.corp_tele_no" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="公司地址">
|
||||
<el-input v-model="form.corp_address" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否启用" prop="is_used">
|
||||
<el-radio v-model="form.is_used" label="0">否</el-radio>
|
||||
<el-radio v-model="form.is_used" label="1">是</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="外部标识">
|
||||
<el-input v-model="form.ext_id" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="资金计划履约天数">
|
||||
<el-input v-model="form.honour_days" style="width: 200px;" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" style="width: 600px;" type="textarea" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
size="mini"
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column prop="supp_code" label="供应商编码" />
|
||||
<el-table-column prop="supp_name" label="供应商名称 " />
|
||||
<el-table-column prop="corp_address" label="公司地址" />
|
||||
<el-table-column prop="corp_tele_no" label="公司电话" />
|
||||
<el-table-column prop="jurid_name" label="法人代表" />
|
||||
<el-table-column prop="update_optname" label="修改者" />
|
||||
<el-table-column prop="update_time" label="修改时间" width="150" />
|
||||
<el-table-column label="启用" align="center" prop="is_used">
|
||||
<template slot-scope="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.is_used"
|
||||
active-color="#409EFF"
|
||||
inactive-color="#F56C6C"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
@change="changeEnabled(scope.row, scope.row.is_used)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-permission="['admin','Supplierbase:edit','Supplierbase:del']"
|
||||
label="操作"
|
||||
width="150px"
|
||||
lign="center"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudSupplierbase from '@/views/wms/basedata/supp/supplierbase'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
|
||||
const defaultForm = {
|
||||
supp_id: null,
|
||||
supp_code: null,
|
||||
supp_name: null,
|
||||
jurid_name: null,
|
||||
tax_no: null,
|
||||
register_no: null,
|
||||
manage_lice_no: null,
|
||||
busi_char_name: null,
|
||||
area_id: null,
|
||||
zip_code: null,
|
||||
corp_tele_no: null,
|
||||
corp_address: null,
|
||||
create_id: null,
|
||||
create_name: null,
|
||||
create_time: null,
|
||||
update_optid: null,
|
||||
update_optname: null,
|
||||
update_time: null,
|
||||
is_used_time: null,
|
||||
is_used: '1',
|
||||
is_delete: null,
|
||||
ext_id: null,
|
||||
barcode_print: null,
|
||||
class_code: null,
|
||||
remark: null,
|
||||
honour_days: null
|
||||
}
|
||||
export default {
|
||||
name: 'Supplierbase',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
dicts: ['is_used'],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '供应商',
|
||||
url: 'api/supplierbase',
|
||||
optShow: {
|
||||
add: true,
|
||||
reset: true
|
||||
},
|
||||
idField: 'supp_id',
|
||||
sort: 'supp_id,desc',
|
||||
crudMethod: { ...crudSupplierbase }
|
||||
})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {},
|
||||
classes: [],
|
||||
rules: {
|
||||
supp_code: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
supp_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_name: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
create_time: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_delete: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
],
|
||||
class_id: [
|
||||
{ required: true, message: '不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
// 改变状态
|
||||
changeEnabled(data, val) {
|
||||
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.supp_code + ', 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
crudSupplierbase.edit(data).then(res => {
|
||||
this.crud.notify(this.dict.label.is_used[val] + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
if (data.is_used === '0') {
|
||||
data.is_used = '1'
|
||||
return
|
||||
}
|
||||
if (data.is_used === '1') {
|
||||
data.is_used = '0'
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
27
wms/nladmin-ui/src/views/wms/basedata/supp/supplierbase.js
Normal file
27
wms/nladmin-ui/src/views/wms/basedata/supp/supplierbase.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/supplierbase',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/supplierbase/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/supplierbase',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
Reference in New Issue
Block a user