Browse Source

feat:[系统管理][存储位置选择器]

master
HanLong 1 month ago
parent
commit
94bb517ca9
7 changed files with 124 additions and 11 deletions
  1. +3
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java
  2. +11
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java
  3. +92
    -0
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/yq/StorageLocationSearchForm.java
  4. +3
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java
  5. +7
    -2
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java
  6. +7
    -4
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java
  7. +1
    -1
      hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml

+ 3
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StorageLocationController.java View File

@ -3,6 +3,7 @@ package com.hxhq.business.controller;
import java.util.Arrays;
import java.util.List;
import com.hxhq.business.form.yq.StorageLocationSearchForm;
import com.hxhq.common.security.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -31,10 +32,10 @@ public class StorageLocationController extends BaseController
*/
@GetMapping("/list")
@RequiresPermissions("business:storageLocation:list")
public TableDataInfo list(StorageLocation storageLocation)
public TableDataInfo list(StorageLocationSearchForm form)
{
startPage();
List<StorageLocation> list = storageLocationService.queryList(storageLocation);
List<StorageLocation> list = storageLocationService.queryList(form);
return getDataTable(list);
}

+ 11
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/domain/StorageLocation.java View File

@ -37,6 +37,17 @@ public class StorageLocation extends MpBaseEntity
@TableField(exist = false)
private String deptName;
@TableField(exist = false)
private String wc;
public String getWc() {
return wc;
}
public void setWc(String wc) {
this.wc = wc;
}
public String getDeptName() {
return deptName;
}

+ 92
- 0
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/form/yq/StorageLocationSearchForm.java View File

@ -0,0 +1,92 @@
package com.hxhq.business.form.yq;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hxhq.common.core.annotation.Excel;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
* @author hanlong
*/
public class StorageLocationSearchForm {
/** 放置地点 */
private String location;
/** 设备名称或编号 */
private String name;
/** 放置货架 */
private String shelfPlacement;
/** 温层 */
private String compartment;
/** 部门id */
private Long deptId;
/** 状态 1-禁用 10-启用 */
private Integer status;
private List<Long> deptIdList;
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getShelfPlacement() {
return shelfPlacement;
}
public void setShelfPlacement(String shelfPlacement) {
this.shelfPlacement = shelfPlacement;
}
public String getCompartment() {
return compartment;
}
public void setCompartment(String compartment) {
this.compartment = compartment;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public List<Long> getDeptIdList() {
return deptIdList;
}
public void setDeptIdList(List<Long> deptIdList) {
this.deptIdList = deptIdList;
}
}

+ 3
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/IStorageLocationService.java View File

@ -3,6 +3,7 @@ package com.hxhq.business.service;
import java.util.List;
import com.hxhq.business.domain.StorageLocation;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hxhq.business.form.yq.StorageLocationSearchForm;
/**
* 存储位置Service接口
@ -15,9 +16,9 @@ public interface IStorageLocationService extends IService
/**
* 查询存储位置列表
*
* @param storageLocation 存储位置
* @param form 存储位置
* @return 存储位置集合
*/
public List<StorageLocation> queryList(StorageLocation storageLocation);
public List<StorageLocation> queryList(StorageLocationSearchForm form);
}

+ 7
- 2
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/service/impl/StorageLocationServiceImpl.java View File

@ -2,8 +2,10 @@ package com.hxhq.business.service.impl;
import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.hxhq.common.core.utils.DateUtils;
import com.hxhq.business.form.yq.StorageLocationSearchForm;
import com.hxhq.common.core.utils.DateUtils;
import com.hxhq.common.core.utils.StringUtils;
import org.springframework.stereotype.Service;
import com.hxhq.business.mapper.StorageLocationMapper;
@ -27,7 +29,7 @@ public class StorageLocationServiceImpl extends ServiceImpl
* @return 存储位置
*/
@Override
public List<StorageLocation> queryList(StorageLocation form)
public List<StorageLocation> queryList(StorageLocationSearchForm form)
{
QueryWrapper<StorageLocation> queryWrapper = Wrappers.query();
queryWrapper.eq("s.del_flag", 0);
@ -43,6 +45,9 @@ public class StorageLocationServiceImpl extends ServiceImpl
if(form.getStatus() != null) {
queryWrapper.eq("s.status", form.getStatus());
}
if(CollectionUtils.isNotEmpty(form.getDeptIdList())) {
queryWrapper.in("s.dept_id", form.getDeptIdList());
}
return baseMapper.queryList(queryWrapper);
}

+ 7
- 4
hxhq-modules/hxhq-system/src/main/java/com/hxhq/system/controller/SysDictDataController.java View File

@ -5,9 +5,12 @@ import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.hxhq.business.domain.StorageLocation;
import com.hxhq.business.domain.Yq;
import com.hxhq.business.enums.NormalEnum;
import com.hxhq.business.form.yq.StorageLocationSearchForm;
import com.hxhq.business.form.yq.YqSearchForm;
import com.hxhq.business.service.IStorageLocationService;
import com.hxhq.business.service.IYqService;
import com.hxhq.system.api.domain.SysDept;
import com.hxhq.system.service.ISysDeptService;
@ -49,7 +52,7 @@ public class SysDictDataController extends BaseController
private ISysDictTypeService dictTypeService;
@Autowired
private IYqService yqService;
private IStorageLocationService storageLocationService;
@Autowired
private ISysDeptService sysDeptService;
@ -63,13 +66,13 @@ public class SysDictDataController extends BaseController
{
String ccwz = "business_ccwz";
if(StringUtils.equals(dictData.getDictType(),ccwz)) {
YqSearchForm form = new YqSearchForm();
StorageLocationSearchForm form = new StorageLocationSearchForm();
List<SysDept> superiorAndSubordinate = sysDeptService.getSuperiorAndSubordinate(SecurityUtils.getLoginUser().getSysUser().getDeptId());
List<Long> deptIdList = superiorAndSubordinate.stream().map(SysDept::getDeptId).collect(Collectors.toList());
form.setDeptIdList(deptIdList);
form.setCcwz(NormalEnum.yes.getValue());
form.setStatus(NormalEnum.yes.getValue());
startPage();
List<Yq> list = yqService.queryList(form);
List<StorageLocation> list = storageLocationService.queryList(form);
return getDataTable(list);
} else {

+ 1
- 1
hxhq-modules/hxhq-system/src/main/resources/mapper/business/StorageLocationMapper.xml View File

@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hxhq.business.mapper.StorageLocationMapper">
<select id="queryList" resultType="com.hxhq.business.domain.StorageLocation">
SELECT s.*, d.dept_name as deptName
SELECT s.*, s.compartment as wc, d.dept_name as deptName
FROM `t_storage_location` s
LEFT JOIN `sys_dept` d on s.dept_id = d.dept_id
<if test="ew.sqlSegment != '' and ew.sqlSegment != null">

Loading…
Cancel
Save