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 + "'");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user