feat(example): 添加库区和仓储管理功能
This commit is contained in:
parent
b35aef5909
commit
83c128b2f9
@ -0,0 +1,11 @@
|
||||
package jnpf.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import jnpf.model.store.StoreAreaEntity;
|
||||
|
||||
/**
|
||||
* 库区主数据 Mapper
|
||||
*/
|
||||
public interface StoreAreaMapper extends BaseMapper<StoreAreaEntity> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package jnpf.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import jnpf.model.store.StoreHouseEntity;
|
||||
|
||||
/**
|
||||
* 仓储主数据 Mapper
|
||||
*/
|
||||
public interface StoreHouseMapper extends BaseMapper<StoreHouseEntity> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package jnpf.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jnpf.model.store.StoreAreaEntity;
|
||||
import jnpf.model.store.StoreAreaForm;
|
||||
import jnpf.model.store.StoreAreaPagination;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库区主数据 Service
|
||||
*/
|
||||
public interface StoreAreaService extends IService<StoreAreaEntity> {
|
||||
|
||||
List<StoreAreaEntity> getList(StoreAreaPagination storeAreaPagination);
|
||||
|
||||
StoreAreaEntity getInfo(String id);
|
||||
|
||||
void delete(StoreAreaEntity entity);
|
||||
|
||||
void create(StoreAreaEntity entity);
|
||||
|
||||
boolean update(String id, StoreAreaEntity entity);
|
||||
|
||||
String checkForm(StoreAreaForm form, int type);
|
||||
|
||||
void saveOrUpdate(StoreAreaForm storeAreaForm, String id, boolean isSave) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package jnpf.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import jnpf.model.store.StoreHouseEntity;
|
||||
import jnpf.model.store.StoreHouseForm;
|
||||
import jnpf.model.store.StoreHousePagination;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓储主数据 Service
|
||||
*/
|
||||
public interface StoreHouseService extends IService<StoreHouseEntity> {
|
||||
|
||||
|
||||
List<StoreHouseEntity> getList(StoreHousePagination storeHousePagination);
|
||||
StoreHouseEntity getInfo(String id);
|
||||
|
||||
void delete(StoreHouseEntity entity);
|
||||
|
||||
void create(StoreHouseEntity entity);
|
||||
|
||||
boolean update(String id, StoreHouseEntity entity);
|
||||
String checkForm(StoreHouseForm form, int i);
|
||||
void saveOrUpdate(StoreHouseForm storeHouseForm, String id, boolean isSave) throws Exception;
|
||||
|
||||
List<StoreHouseEntity> getSelectorList();
|
||||
|
||||
}
|
||||
@ -6,15 +6,14 @@ 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 jnpf.base.UserInfo;
|
||||
import jnpf.mapper.InspPlanMapper;
|
||||
import jnpf.model.inspplan.InspPlanEntity;
|
||||
import jnpf.model.inspplan.InspPlanForm;
|
||||
import jnpf.mapper.InspPlanMapper;
|
||||
import jnpf.model.inspplan.InspPlanPagination;
|
||||
import jnpf.service.InspPlanService;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -123,14 +122,11 @@ public class InspPlanServiceImpl extends ServiceImpl<InspPlanMapper, InspPlanEnt
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveOrUpdate(InspPlanForm inspPlanForm, String id, boolean isSave) throws Exception {
|
||||
UserInfo userInfo = userProvider.get();
|
||||
InspPlanEntity entity = JsonUtil.getJsonToBean(inspPlanForm, InspPlanEntity.class);
|
||||
|
||||
if (!isSave) {
|
||||
if (StringUtil.isNotEmpty(id)) {
|
||||
entity.setId(id);
|
||||
}
|
||||
InspPlanEntity entity = getInfo(id);
|
||||
if (entity == null) {
|
||||
entity = new InspPlanEntity();
|
||||
}
|
||||
BeanUtils.copyProperties(inspPlanForm, entity);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
|
||||
@ -6,19 +6,18 @@ 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 jnpf.base.UserInfo;
|
||||
import jnpf.model.machine.MachineEntity;
|
||||
import jnpf.model.proline.ProLineEntity;
|
||||
import jnpf.model.proc.ProcEntity;
|
||||
import jnpf.mapper.MachineMapper;
|
||||
import jnpf.model.machine.MachineEntity;
|
||||
import jnpf.model.machine.MachineForm;
|
||||
import jnpf.model.machine.MachinePagination;
|
||||
import jnpf.model.proc.ProcEntity;
|
||||
import jnpf.model.proline.ProLineEntity;
|
||||
import jnpf.service.MachineService;
|
||||
import jnpf.service.ProLineService;
|
||||
import jnpf.service.ProcService;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -66,7 +65,7 @@ public class MachineServiceImpl extends ServiceImpl<MachineMapper, MachineEntity
|
||||
if (ObjectUtil.isNotEmpty(machinePagination.getBelgProcId())) {
|
||||
machineWrapper.eq(MachineEntity::getBelgProcId, machinePagination.getBelgProcId());
|
||||
}
|
||||
machineWrapper.eq(MachineEntity::getDeleteMark,0);
|
||||
machineWrapper.eq(MachineEntity::getDeleteMark, 0);
|
||||
machineWrapper.orderByDesc(MachineEntity::getCreatorTime);
|
||||
if ("0".equals(machinePagination.getDataType())) {
|
||||
Page<MachineEntity> page = new Page<>(machinePagination.getCurrentPage(), machinePagination.getPageSize());
|
||||
@ -160,16 +159,11 @@ public class MachineServiceImpl extends ServiceImpl<MachineMapper, MachineEntity
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveOrUpdate(MachineForm machineForm, String id, boolean isSave) throws Exception {
|
||||
UserInfo userInfo = userProvider.get();
|
||||
MachineEntity entity = JsonUtil.getJsonToBean(machineForm, MachineEntity.class);
|
||||
|
||||
if (!isSave) {
|
||||
// 更新时设置ID
|
||||
if (StringUtil.isNotEmpty(id)) {
|
||||
entity.setId(Long.valueOf(id));
|
||||
MachineEntity entity = getInfo(id);
|
||||
if (entity == null) {
|
||||
entity = new MachineEntity();
|
||||
}
|
||||
}
|
||||
// 新增时ID由数据库自动生成,不需要设置
|
||||
BeanUtils.copyProperties(machineForm, entity);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
|
||||
@ -6,7 +6,6 @@ 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 jnpf.base.UserInfo;
|
||||
import jnpf.mapper.MaterialMapper;
|
||||
import jnpf.model.inspplan.InspPlanEntity;
|
||||
import jnpf.model.material.MaterialEntity;
|
||||
@ -14,9 +13,9 @@ import jnpf.model.material.MaterialForm;
|
||||
import jnpf.model.material.MaterialPagination;
|
||||
import jnpf.service.InspPlanService;
|
||||
import jnpf.service.MaterialService;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@ -147,16 +146,11 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, MaterialEnt
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveOrUpdate(MaterialForm materialForm, String id, boolean isSave) throws Exception {
|
||||
UserInfo userInfo = userProvider.get();
|
||||
MaterialEntity entity = JsonUtil.getJsonToBean(materialForm, MaterialEntity.class);
|
||||
|
||||
if (!isSave) {
|
||||
// 更新时设置ID
|
||||
if (StringUtil.isNotEmpty(id)) {
|
||||
entity.setId(Integer.valueOf(id));
|
||||
MaterialEntity entity = getInfo(id);
|
||||
if (entity == null) {
|
||||
entity = new MaterialEntity();
|
||||
}
|
||||
}
|
||||
// 新增时ID由数据库自动生成,不需要设置
|
||||
BeanUtils.copyProperties(materialForm, entity);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
|
||||
@ -6,15 +6,14 @@ 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 jnpf.base.UserInfo;
|
||||
import jnpf.model.proline.ProLineEntity;
|
||||
import jnpf.mapper.ProLineMapper;
|
||||
import jnpf.model.proline.ProLineEntity;
|
||||
import jnpf.model.proline.ProLineForm;
|
||||
import jnpf.model.proline.ProLinePagination;
|
||||
import jnpf.service.ProLineService;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -48,7 +47,7 @@ public class ProLineServiceImpl extends ServiceImpl<ProLineMapper, ProLineEntity
|
||||
if (ObjectUtil.isNotEmpty(proLinePagination.getEnabledStatus())) {
|
||||
proLineWrapper.eq(ProLineEntity::getEnabledStatus, proLinePagination.getEnabledStatus());
|
||||
}
|
||||
proLineWrapper.eq(ProLineEntity::getDeleteMark,0);
|
||||
proLineWrapper.eq(ProLineEntity::getDeleteMark, 0);
|
||||
proLineWrapper.orderByDesc(ProLineEntity::getCreatorTime);
|
||||
if ("0".equals(proLinePagination.getDataType())) {
|
||||
Page<ProLineEntity> page = new Page<>(proLinePagination.getCurrentPage(), proLinePagination.getPageSize());
|
||||
@ -121,16 +120,11 @@ public class ProLineServiceImpl extends ServiceImpl<ProLineMapper, ProLineEntity
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveOrUpdate(ProLineForm proLineForm, String id, boolean isSave) throws Exception {
|
||||
UserInfo userInfo = userProvider.get();
|
||||
ProLineEntity entity = JsonUtil.getJsonToBean(proLineForm, ProLineEntity.class);
|
||||
|
||||
if (!isSave) {
|
||||
// 更新时设置ID
|
||||
if (StringUtil.isNotEmpty(id)) {
|
||||
entity.setId(Long.valueOf(id));
|
||||
ProLineEntity entity = getInfo(id);
|
||||
if (entity == null) {
|
||||
entity = new ProLineEntity();
|
||||
}
|
||||
}
|
||||
// 新增时ID由数据库自动生成,不需要设置
|
||||
BeanUtils.copyProperties(proLineForm, entity);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
|
||||
@ -6,16 +6,15 @@ 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 jnpf.base.UserInfo;
|
||||
import jnpf.model.proc.ProcEntity;
|
||||
import jnpf.mapper.ProcMapper;
|
||||
import jnpf.model.proc.ProcEntity;
|
||||
import jnpf.model.proc.ProcForm;
|
||||
import jnpf.model.proc.ProcPagination;
|
||||
import jnpf.service.ProcService;
|
||||
import jnpf.util.GeneraterSwapUtil;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -51,7 +50,7 @@ public class ProcServiceImpl extends ServiceImpl<ProcMapper, ProcEntity> impleme
|
||||
if (ObjectUtil.isNotEmpty(procPagination.getEnabledStatus())) {
|
||||
procWrapper.eq(ProcEntity::getEnabledStatus, procPagination.getEnabledStatus());
|
||||
}
|
||||
procWrapper.eq(ProcEntity::getDeleteMark,0);
|
||||
procWrapper.eq(ProcEntity::getDeleteMark, 0);
|
||||
procWrapper.orderByDesc(ProcEntity::getCreatorTime);
|
||||
if ("0".equals(procPagination.getDataType())) {
|
||||
Page<ProcEntity> page = new Page<>(procPagination.getCurrentPage(), procPagination.getPageSize());
|
||||
@ -124,16 +123,11 @@ public class ProcServiceImpl extends ServiceImpl<ProcMapper, ProcEntity> impleme
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveOrUpdate(ProcForm procForm, String id, boolean isSave) throws Exception {
|
||||
UserInfo userInfo = userProvider.get();
|
||||
ProcEntity entity = JsonUtil.getJsonToBean(procForm, ProcEntity.class);
|
||||
|
||||
if (!isSave) {
|
||||
// 更新时设置ID
|
||||
if (StringUtil.isNotEmpty(id)) {
|
||||
entity.setId(Long.valueOf(id));
|
||||
ProcEntity entity = getInfo(id);
|
||||
if (entity == null) {
|
||||
entity = new ProcEntity();
|
||||
}
|
||||
}
|
||||
// 新增时ID由数据库自动生成,不需要设置
|
||||
BeanUtils.copyProperties(procForm, entity);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,142 @@
|
||||
package jnpf.service.impl;
|
||||
|
||||
|
||||
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 jnpf.mapper.StoreAreaMapper;
|
||||
import jnpf.model.store.StoreAreaEntity;
|
||||
import jnpf.model.store.StoreAreaForm;
|
||||
import jnpf.model.store.StoreAreaPagination;
|
||||
import jnpf.model.store.StoreHouseEntity;
|
||||
import jnpf.service.StoreAreaService;
|
||||
import jnpf.service.StoreHouseService;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库区主数据 ServiceImpl
|
||||
*/
|
||||
@Service
|
||||
public class StoreAreaServiceImpl extends ServiceImpl<StoreAreaMapper, StoreAreaEntity> implements StoreAreaService {
|
||||
|
||||
@Resource
|
||||
private UserProvider userProvider;
|
||||
|
||||
@Resource
|
||||
private StoreHouseService storeHouseService;
|
||||
|
||||
@Override
|
||||
public List<StoreAreaEntity> getList(StoreAreaPagination storeAreaPagination) {
|
||||
LambdaQueryWrapper<StoreAreaEntity> storeAreaWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (ObjectUtil.isNotEmpty(storeAreaPagination.getStoreAreCd())) {
|
||||
storeAreaWrapper.like(StoreAreaEntity::getStoreAreCd, storeAreaPagination.getStoreAreCd());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(storeAreaPagination.getStoreAreaName())) {
|
||||
storeAreaWrapper.like(StoreAreaEntity::getStoreAreaName, storeAreaPagination.getStoreAreaName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(storeAreaPagination.getEnabledStatus())) {
|
||||
storeAreaWrapper.eq(StoreAreaEntity::getEnabledStatus, storeAreaPagination.getEnabledStatus());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(storeAreaPagination.getStoreHouseId())) {
|
||||
storeAreaWrapper.eq(StoreAreaEntity::getStoreHouseId, storeAreaPagination.getStoreHouseId());
|
||||
}
|
||||
storeAreaWrapper.eq(StoreAreaEntity::getDeleteMark, 0);
|
||||
storeAreaWrapper.orderByDesc(StoreAreaEntity::getCreatorTime);
|
||||
List<StoreAreaEntity> storeAreaList;
|
||||
if ("0".equals(storeAreaPagination.getDataType())) {
|
||||
Page<StoreAreaEntity> page = new Page<>(storeAreaPagination.getCurrentPage(), storeAreaPagination.getPageSize());
|
||||
IPage<StoreAreaEntity> userIPage = this.page(page, storeAreaWrapper);
|
||||
storeAreaList = storeAreaPagination.setData(userIPage.getRecords(), userIPage.getTotal());
|
||||
} else {
|
||||
storeAreaList = this.list(storeAreaWrapper);
|
||||
}
|
||||
for (StoreAreaEntity storeAreaEntity : storeAreaList) {
|
||||
StoreHouseEntity storeHouseEntity = storeHouseService.getInfo(storeAreaEntity.getStoreHouseId());
|
||||
if (storeHouseEntity != null) {
|
||||
storeAreaEntity.setStoreHouseName(storeHouseEntity.getStoreHouseName());
|
||||
}
|
||||
}
|
||||
return storeAreaList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreAreaEntity getInfo(String id) {
|
||||
QueryWrapper<StoreAreaEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(StoreAreaEntity::getId, id);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(StoreAreaEntity entity) {
|
||||
this.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(String id, StoreAreaEntity entity) {
|
||||
return this.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(StoreAreaEntity entity) {
|
||||
if (entity != null) {
|
||||
this.removeById(entity.getId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证表单唯一字段,正则,非空 i-0新增-1修改
|
||||
*/
|
||||
@Override
|
||||
public String checkForm(StoreAreaForm form, int i) {
|
||||
boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
|
||||
String id = "";
|
||||
String countRecover = "";
|
||||
if (isUp) {
|
||||
id = form.getId();
|
||||
}
|
||||
//主表字段验证
|
||||
//库区编码唯一性验证
|
||||
if (ObjectUtil.isNotEmpty(form.getStoreAreCd())) {
|
||||
LambdaQueryWrapper<StoreAreaEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(StoreAreaEntity::getStoreAreCd, form.getStoreAreCd());
|
||||
if (isUp) {
|
||||
wrapper.ne(StoreAreaEntity::getId, id);
|
||||
}
|
||||
long count = this.count(wrapper);
|
||||
if (count > 0) {
|
||||
countRecover += "库区编码已存在,请重新输入!";
|
||||
}
|
||||
}
|
||||
|
||||
return countRecover;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增修改数据(事务回滚)
|
||||
*
|
||||
* @param id
|
||||
* @param storeAreaForm
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void saveOrUpdate(StoreAreaForm storeAreaForm, String id, boolean isSave) throws Exception {
|
||||
StoreAreaEntity entity = getInfo(id);
|
||||
if (entity == null) {
|
||||
// 新增时初始化数据
|
||||
entity = new StoreAreaEntity();
|
||||
}
|
||||
BeanUtils.copyProperties(storeAreaForm, entity);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,135 @@
|
||||
package jnpf.service.impl;
|
||||
|
||||
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 jnpf.mapper.StoreHouseMapper;
|
||||
import jnpf.model.store.StoreHouseEntity;
|
||||
import jnpf.model.store.StoreHouseForm;
|
||||
import jnpf.model.store.StoreHousePagination;
|
||||
import jnpf.service.StoreHouseService;
|
||||
import jnpf.util.StringUtil;
|
||||
import jnpf.util.UserProvider;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 仓储主数据 ServiceImpl
|
||||
*/
|
||||
@Service
|
||||
public class StoreHouseServiceImpl extends ServiceImpl<StoreHouseMapper, StoreHouseEntity> implements StoreHouseService {
|
||||
|
||||
@Resource
|
||||
private UserProvider userProvider;
|
||||
|
||||
@Override
|
||||
public List<StoreHouseEntity> getList(StoreHousePagination storeHousePagination) {
|
||||
LambdaQueryWrapper<StoreHouseEntity> storeHouseWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
if (ObjectUtil.isNotEmpty(storeHousePagination.getStoreHouseCd())) {
|
||||
storeHouseWrapper.like(StoreHouseEntity::getStoreHouseCd, storeHousePagination.getStoreHouseCd());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(storeHousePagination.getStoreHouseName())) {
|
||||
storeHouseWrapper.like(StoreHouseEntity::getStoreHouseName, storeHousePagination.getStoreHouseName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(storeHousePagination.getEnabledStatus())) {
|
||||
storeHouseWrapper.eq(StoreHouseEntity::getEnabledStatus, storeHousePagination.getEnabledStatus());
|
||||
}
|
||||
storeHouseWrapper.eq(StoreHouseEntity::getDeleteMark, 0);
|
||||
storeHouseWrapper.orderByDesc(StoreHouseEntity::getCreatorTime);
|
||||
if ("0".equals(storeHousePagination.getDataType())) {
|
||||
Page<StoreHouseEntity> page = new Page<>(storeHousePagination.getCurrentPage(), storeHousePagination.getPageSize());
|
||||
IPage<StoreHouseEntity> userIPage = this.page(page, storeHouseWrapper);
|
||||
return storeHousePagination.setData(userIPage.getRecords(), userIPage.getTotal());
|
||||
} else {
|
||||
return this.list(storeHouseWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StoreHouseEntity getInfo(String id) {
|
||||
QueryWrapper<StoreHouseEntity> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(StoreHouseEntity::getId, id);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create(StoreHouseEntity entity) {
|
||||
this.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(String id, StoreHouseEntity entity) {
|
||||
return this.updateById(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(StoreHouseEntity entity) {
|
||||
if (entity != null) {
|
||||
this.removeById(entity.getId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证表单唯一字段,正则,非空 i-0新增-1修改
|
||||
*/
|
||||
@Override
|
||||
public String checkForm(StoreHouseForm form, int i) {
|
||||
boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
|
||||
String id = "";
|
||||
String countRecover = "";
|
||||
if (isUp) {
|
||||
id = form.getId();
|
||||
}
|
||||
//主表字段验证
|
||||
//仓储编码唯一性验证
|
||||
if (ObjectUtil.isNotEmpty(form.getStoreHouseCd())) {
|
||||
LambdaQueryWrapper<StoreHouseEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(StoreHouseEntity::getStoreHouseCd, form.getStoreHouseCd());
|
||||
if (isUp) {
|
||||
wrapper.ne(StoreHouseEntity::getId, id);
|
||||
}
|
||||
long count = this.count(wrapper);
|
||||
if (count > 0) {
|
||||
countRecover += "仓储编码已存在,请重新输入!";
|
||||
}
|
||||
}
|
||||
|
||||
return countRecover;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增修改数据(事务回滚)
|
||||
*
|
||||
* @param id
|
||||
* @param storeHouseForm
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveOrUpdate(StoreHouseForm storeHouseForm, String id, boolean isSave) throws Exception {
|
||||
StoreHouseEntity entity = getInfo(id);
|
||||
if (entity == null) {
|
||||
entity = new StoreHouseEntity();
|
||||
}
|
||||
BeanUtils.copyProperties(storeHouseForm, entity);
|
||||
this.saveOrUpdate(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StoreHouseEntity> getSelectorList() {
|
||||
LambdaQueryWrapper<StoreHouseEntity> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(StoreHouseEntity::getDeleteMark, 0);
|
||||
wrapper.eq(StoreHouseEntity::getEnabledStatus, 1);
|
||||
wrapper.orderByDesc(StoreHouseEntity::getCreatorTime);
|
||||
return this.list(wrapper);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,117 @@
|
||||
|
||||
package jnpf.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jnpf.base.ActionResult;
|
||||
import jnpf.base.vo.PageListVO;
|
||||
import jnpf.base.vo.PaginationVO;
|
||||
import jnpf.model.store.StoreAreaEntity;
|
||||
import jnpf.model.store.StoreAreaForm;
|
||||
import jnpf.model.store.StoreAreaPagination;
|
||||
import jnpf.service.StoreAreaService;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 库区主数据 控制类
|
||||
*/
|
||||
@Tag(name = "库区主数据", description = "StoreArea")
|
||||
@RestController
|
||||
@RequestMapping("/api/example/storearea")
|
||||
public class StoreAreaController {
|
||||
|
||||
@Autowired
|
||||
private StoreAreaService storeAreaService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param storeAreaPagination 分页查询对象
|
||||
* @return 列表结果集
|
||||
*/
|
||||
@Operation(summary = "获取库区列表")
|
||||
@PostMapping("/getList")
|
||||
public ActionResult getList(@RequestBody StoreAreaPagination storeAreaPagination) {
|
||||
List<StoreAreaEntity> list = storeAreaService.getList(storeAreaPagination);
|
||||
List<Map<String, Object>> realList = list.stream()
|
||||
.map(JsonUtil::entityToMap)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//返回对象
|
||||
PageListVO vo = new PageListVO();
|
||||
vo.setList(realList);
|
||||
PaginationVO page = JsonUtil.getJsonToBean(storeAreaPagination, PaginationVO.class);
|
||||
vo.setPagination(page);
|
||||
return ActionResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @param id 主键
|
||||
* @return 详情结果集
|
||||
*/
|
||||
@Operation(summary = "获取库区详情")
|
||||
@GetMapping("/{id}")
|
||||
public ActionResult info(@PathVariable("id") String id) {
|
||||
StoreAreaEntity entity = storeAreaService.getInfo(id);
|
||||
if (entity != null) {
|
||||
return ActionResult.success(JsonUtil.entityToMap(entity));
|
||||
}
|
||||
return ActionResult.fail("数据不存在");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建
|
||||
* @param storeAreaForm 表单对象
|
||||
* @return 新建结果
|
||||
*/
|
||||
@Operation(summary = "新建库区")
|
||||
@PostMapping
|
||||
public ActionResult create(@RequestBody @Valid StoreAreaForm storeAreaForm) {
|
||||
String b = storeAreaService.checkForm(storeAreaForm, 0);
|
||||
if (StringUtil.isNotEmpty(b)) {
|
||||
return ActionResult.fail(b);
|
||||
}
|
||||
try {
|
||||
storeAreaService.saveOrUpdate(storeAreaForm, "", true);
|
||||
return ActionResult.success("新建成功");
|
||||
} catch (Exception e) {
|
||||
return ActionResult.fail("新建数据失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param id 主键
|
||||
* @param storeAreaForm 表单对象
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@Operation(summary = "更新库区")
|
||||
@PutMapping("/{id}")
|
||||
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid StoreAreaForm storeAreaForm) {
|
||||
storeAreaForm.setId(id);
|
||||
String b = storeAreaService.checkForm(storeAreaForm, 1);
|
||||
if (StringUtil.isNotEmpty(b)) {
|
||||
return ActionResult.fail(b);
|
||||
}
|
||||
StoreAreaEntity entity = storeAreaService.getInfo(id);
|
||||
if (entity != null) {
|
||||
try {
|
||||
storeAreaService.saveOrUpdate(storeAreaForm, id, false);
|
||||
return ActionResult.success("更新成功");
|
||||
} catch (Exception e) {
|
||||
return ActionResult.fail("更新数据失败:" + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
return ActionResult.fail("更新失败,数据不存在");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,128 @@
|
||||
package jnpf.controller;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jnpf.base.ActionResult;
|
||||
import jnpf.base.vo.PageListVO;
|
||||
import jnpf.base.vo.PaginationVO;
|
||||
import jnpf.model.store.StoreHouseEntity;
|
||||
import jnpf.model.store.StoreHouseForm;
|
||||
import jnpf.model.store.StoreHousePagination;
|
||||
import jnpf.service.StoreHouseService;
|
||||
import jnpf.util.JsonUtil;
|
||||
import jnpf.util.StringUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 仓储主数据 控制类
|
||||
*/
|
||||
@Tag(name = "仓储主数据", description = "StoreHouse")
|
||||
@RestController
|
||||
@RequestMapping("/api/example/storehouse")
|
||||
public class StoreHouseController {
|
||||
|
||||
@Autowired
|
||||
private StoreHouseService storeHouseService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param storeHousePagination 分页查询对象
|
||||
* @return 列表结果集
|
||||
*/
|
||||
@Operation(summary = "获取仓储列表")
|
||||
@PostMapping("/getList")
|
||||
public ActionResult getList(@RequestBody StoreHousePagination storeHousePagination) {
|
||||
List<StoreHouseEntity> list = storeHouseService.getList(storeHousePagination);
|
||||
List<Map<String, Object>> realList = list.stream()
|
||||
.map(JsonUtil::entityToMap)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//返回对象
|
||||
PageListVO vo = new PageListVO();
|
||||
vo.setList(realList);
|
||||
PaginationVO page = JsonUtil.getJsonToBean(storeHousePagination, PaginationVO.class);
|
||||
vo.setPagination(page);
|
||||
return ActionResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @param id 主键
|
||||
* @return 详情结果集
|
||||
*/
|
||||
@Operation(summary = "获取仓储详情")
|
||||
@GetMapping("/{id}")
|
||||
public ActionResult info(@PathVariable("id") String id) {
|
||||
StoreHouseEntity entity = storeHouseService.getInfo(id);
|
||||
if (entity != null) {
|
||||
return ActionResult.success(JsonUtil.entityToMap(entity));
|
||||
}
|
||||
return ActionResult.fail("数据不存在");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新建
|
||||
* @param storeHouseForm 表单对象
|
||||
* @return 新建结果
|
||||
*/
|
||||
@Operation(summary = "新建仓储")
|
||||
@PostMapping
|
||||
public ActionResult create(@RequestBody @Valid StoreHouseForm storeHouseForm) {
|
||||
String b = storeHouseService.checkForm(storeHouseForm, 0);
|
||||
if (StringUtil.isNotEmpty(b)) {
|
||||
return ActionResult.fail(b);
|
||||
}
|
||||
try {
|
||||
storeHouseService.saveOrUpdate(storeHouseForm, "", true);
|
||||
return ActionResult.success("新建成功");
|
||||
} catch (Exception e) {
|
||||
return ActionResult.fail("新建数据失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param id 主键
|
||||
* @param storeHouseForm 表单对象
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@Operation(summary = "更新仓储")
|
||||
@PutMapping("/{id}")
|
||||
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid StoreHouseForm storeHouseForm) {
|
||||
storeHouseForm.setId(id);
|
||||
String b = storeHouseService.checkForm(storeHouseForm, 1);
|
||||
if (StringUtil.isNotEmpty(b)) {
|
||||
return ActionResult.fail(b);
|
||||
}
|
||||
StoreHouseEntity entity = storeHouseService.getInfo(id);
|
||||
if (entity != null) {
|
||||
try {
|
||||
storeHouseService.saveOrUpdate(storeHouseForm, id, false);
|
||||
return ActionResult.success("更新成功");
|
||||
} catch (Exception e) {
|
||||
return ActionResult.fail("更新数据失败:" + e.getMessage());
|
||||
}
|
||||
} else {
|
||||
return ActionResult.fail("更新失败,数据不存在");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取仓储下拉列表
|
||||
* @return 下拉列表结果集
|
||||
*/
|
||||
@Operation(summary = "获取仓储下拉列表")
|
||||
@GetMapping("/getSelector")
|
||||
public ActionResult getSelector() {
|
||||
List<StoreHouseEntity> list = storeHouseService.getSelectorList();
|
||||
return ActionResult.success(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -41,9 +41,9 @@ public class MachineEntity {
|
||||
@TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String remark;
|
||||
@TableField(value = "belg_line_id", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long belgLineId;
|
||||
private String belgLineId;
|
||||
@TableField(value = "belg_proc_id", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long belgProcId;
|
||||
private String belgProcId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String belgLineName;
|
||||
|
||||
@ -73,7 +73,7 @@ public class MaterialEntity {
|
||||
private BigDecimal safeStock;
|
||||
|
||||
@TableField(value = "scheme_id", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Long schemeId;
|
||||
private String schemeId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String schemeName;
|
||||
|
||||
@ -0,0 +1,63 @@
|
||||
|
||||
package jnpf.model.store;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 库区主数据
|
||||
*/
|
||||
@Data
|
||||
@TableName("tba_store_area")
|
||||
public class StoreAreaEntity {
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@TableField(value = "f_creator_user_id", fill = FieldFill.INSERT)
|
||||
private String creatorUserId;
|
||||
|
||||
@TableField(value = "f_creator_time", fill = FieldFill.INSERT)
|
||||
private Date creatorTime;
|
||||
|
||||
@TableField(value = "f_last_modify_user_id", fill = FieldFill.INSERT_UPDATE)
|
||||
private String lastModifyUserId;
|
||||
|
||||
@TableField(value = "f_last_modify_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private Date lastModifyTime;
|
||||
|
||||
@TableField(value = "f_delete_user_id", fill = FieldFill.UPDATE)
|
||||
private String deleteUserId;
|
||||
|
||||
@TableField(value = "f_delete_time", fill = FieldFill.UPDATE)
|
||||
private Date deleteTime;
|
||||
|
||||
@TableField(value = "f_delete_mark", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer deleteMark;
|
||||
|
||||
@TableField(value = "f_flow_id", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String flowId;
|
||||
|
||||
@TableField(value = "f_flow_task_id", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String flowTaskId;
|
||||
|
||||
@TableField("store_are_cd")
|
||||
private String storeAreCd;
|
||||
|
||||
@TableField("store_area_name")
|
||||
private String storeAreaName;
|
||||
|
||||
@TableField(value = "enabled_status", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer enabledStatus;
|
||||
|
||||
@TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String remark;
|
||||
|
||||
@TableField(value = "store_house_id", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String storeHouseId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String storeHouseName;
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package jnpf.model.store;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 库区主数据 Form
|
||||
*/
|
||||
@Data
|
||||
public class StoreAreaForm {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@NotBlank(message = "库区编码不能为空")
|
||||
@Schema(description = "库区编码")
|
||||
private String storeAreCd;
|
||||
|
||||
@NotBlank(message = "库区名称不能为空")
|
||||
@Schema(description = "库区名称")
|
||||
private String storeAreaName;
|
||||
|
||||
@Schema(description = "状态(1启用 2 未启用)")
|
||||
private Integer enabledStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "仓库id")
|
||||
private Integer storeHouseId;
|
||||
|
||||
@Schema(description = "流程ID")
|
||||
private String flowId;
|
||||
|
||||
@Schema(description = "流程任务ID")
|
||||
private String flowTaskId;
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package jnpf.model.store;
|
||||
|
||||
import jnpf.base.Pagination;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 库区主数据分页查询
|
||||
*/
|
||||
@Data
|
||||
public class StoreAreaPagination extends Pagination {
|
||||
|
||||
@Schema(description = "selectKey")
|
||||
private String selectKey;
|
||||
|
||||
@Schema(description = "json")
|
||||
private String json;
|
||||
|
||||
@Schema(description = "数据类型")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "特殊查询json")
|
||||
private String superQueryJson;
|
||||
|
||||
@Schema(description = "模块id")
|
||||
private String moduleId;
|
||||
|
||||
@Schema(description = "菜单id")
|
||||
private String menuId;
|
||||
|
||||
@Schema(description = "库区编码")
|
||||
private String storeAreCd;
|
||||
|
||||
@Schema(description = "库区名称")
|
||||
private String storeAreaName;
|
||||
|
||||
@Schema(description = "状态(1启用 2 未启用)")
|
||||
private Integer enabledStatus;
|
||||
|
||||
@Schema(description = "仓库id")
|
||||
private Integer storeHouseId;
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package jnpf.model.store;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 仓储主数据表
|
||||
*/
|
||||
@Data
|
||||
@TableName("tba_store_house")
|
||||
public class StoreHouseEntity {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
@TableField(value = "f_creator_user_id", fill = FieldFill.INSERT)
|
||||
private String creatorUserId;
|
||||
@TableField(value = "f_creator_time", fill = FieldFill.INSERT)
|
||||
private Date creatorTime;
|
||||
@TableField(value = "f_last_modify_user_id", fill = FieldFill.INSERT_UPDATE)
|
||||
private String lastModifyUserId;
|
||||
@TableField(value = "f_last_modify_time", fill = FieldFill.INSERT_UPDATE)
|
||||
private Date lastModifyTime;
|
||||
@TableField(value = "f_delete_user_id", fill = FieldFill.UPDATE)
|
||||
private String deleteUserId;
|
||||
@TableField(value = "f_delete_time", fill = FieldFill.UPDATE)
|
||||
private Date deleteTime;
|
||||
@TableField(value = "f_delete_mark", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer deleteMark;
|
||||
@TableField(value = "f_flow_id")
|
||||
private String flowId;
|
||||
@TableField(value = "f_flow_task_id")
|
||||
private String flowTaskId;
|
||||
@TableField("store_house_cd")
|
||||
private String storeHouseCd;
|
||||
@TableField("store_house_name")
|
||||
private String storeHouseName;
|
||||
@TableField(value = "enabled_status", updateStrategy = FieldStrategy.IGNORED)
|
||||
private Integer enabledStatus;
|
||||
@TableField(value = "remark", updateStrategy = FieldStrategy.IGNORED)
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package jnpf.model.store;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 仓储主数据 Form
|
||||
*/
|
||||
@Data
|
||||
public class StoreHouseForm {
|
||||
|
||||
@Schema(description = "主键")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "仓储编码")
|
||||
private String storeHouseCd;
|
||||
|
||||
@Schema(description = "仓储名称")
|
||||
private String storeHouseName;
|
||||
|
||||
@Schema(description = "状态(1启用 2 未启用)")
|
||||
private Integer enabledStatus;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "流程ID")
|
||||
private String flowId;
|
||||
|
||||
@Schema(description = "流程任务ID")
|
||||
private String flowTaskId;
|
||||
|
||||
}
|
||||
@ -0,0 +1,34 @@
|
||||
package jnpf.model.store;
|
||||
|
||||
import jnpf.base.Pagination;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 仓储主数据分页查询
|
||||
*/
|
||||
@Data
|
||||
public class StoreHousePagination extends Pagination {
|
||||
/** 查询key */
|
||||
private String[] selectKey;
|
||||
/** json */
|
||||
private String json;
|
||||
/** 数据类型 0-当前页,1-全部数据 */
|
||||
private String dataType;
|
||||
/** 高级查询 */
|
||||
private String superQueryJson;
|
||||
/** 功能id */
|
||||
private String moduleId;
|
||||
/** 菜单id */
|
||||
private String menuId;
|
||||
|
||||
@Schema(description = "仓储编码")
|
||||
private String storeHouseCd;
|
||||
|
||||
@Schema(description = "仓储名称")
|
||||
private String storeHouseName;
|
||||
|
||||
@Schema(description = "状态(1启用 2 未启用)")
|
||||
private Integer enabledStatus;
|
||||
|
||||
}
|
||||
167
jnpf-java-boot/jnpf-web/src/views/example/storearea/form.vue
Normal file
167
jnpf-java-boot/jnpf-web/src/views/example/storearea/form.vue
Normal file
@ -0,0 +1,167 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新建' : '编辑'"
|
||||
:visible.sync="dialogVisible"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-form-item label="库区编码" prop="storeAreCd">
|
||||
<JnpfInput v-model="dataForm.storeAreCd" placeholder="请输入库区编码" clearable :disabled="!!dataForm.id" :style="{ width: '100%' }">
|
||||
</JnpfInput>
|
||||
</el-form-item>
|
||||
<el-form-item label="库区名称" prop="storeAreaName">
|
||||
<JnpfInput v-model="dataForm.storeAreaName" placeholder="请输入库区名称" clearable :style="{ width: '100%' }">
|
||||
</JnpfInput>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="storeHouseId">
|
||||
<JnpfSelect v-model="dataForm.storeHouseId" placeholder="请选择仓库" :options="warehouseOptions" :props="warehouseProps" clearable :style="{ width: '100%' }">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="enabledStatus">
|
||||
<JnpfSelect v-model="dataForm.enabledStatus" placeholder="请选择状态" :options="enabledStatusOptions" :props="enabledStatusProps" clearable :style="{ width: '100%' }">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<JnpfTextarea v-model="dataForm.remark" placeholder="请输入备注" :style="{ width: '100%' }" :autoSize="{ minRows: 4, maxRows: 4 }" type="textarea">
|
||||
</JnpfTextarea>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">保 存</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
formRef: 'formRef',
|
||||
eventType: '',
|
||||
dataForm: {
|
||||
id: '',
|
||||
storeAreCd: undefined,
|
||||
storeAreaName: undefined,
|
||||
storeHouseId: undefined,
|
||||
enabledStatus: 1,
|
||||
remark: undefined,
|
||||
},
|
||||
dataRule: {
|
||||
storeAreCd: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入库区编码',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
storeAreaName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入库区名称',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
enabledStatus: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择状态',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
enabledStatusOptions: [
|
||||
{ fullName: "启用", id: 1 },
|
||||
{ fullName: "未启用", id: 2 },
|
||||
],
|
||||
enabledStatusProps: { label: "fullName", value: "id" },
|
||||
warehouseOptions: [],
|
||||
warehouseProps: { label: "storeHouseName", value: "id" },
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo']),
|
||||
},
|
||||
created() {
|
||||
this.getWarehouseList()
|
||||
},
|
||||
methods: {
|
||||
getWarehouseList() {
|
||||
request({
|
||||
url: '/api/example/storehouse/getList',
|
||||
method: 'post',
|
||||
data: { dataType: 1 }
|
||||
}).then(res => {
|
||||
this.warehouseOptions = res.data.list || []
|
||||
})
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.dialogVisible = true;
|
||||
this.loading = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.formRef.resetFields();
|
||||
if (this.dataForm.id) {
|
||||
request({
|
||||
url: `/api/example/storearea/${this.dataForm.id}`,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataForm = res.data
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
});
|
||||
},
|
||||
dataFormSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.btnLoading = true;
|
||||
const isEdit = !!this.dataForm.id;
|
||||
const url = isEdit ? `/api/example/storearea/${this.dataForm.id}` : '/api/example/storearea';
|
||||
const method = isEdit ? 'put' : 'post';
|
||||
|
||||
request({
|
||||
url: url,
|
||||
method: method,
|
||||
data: this.dataForm
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.btnLoading = false;
|
||||
this.dialogVisible = false;
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.$emit('refresh',true)
|
||||
},
|
||||
changeData(model, index) {
|
||||
this.isEdit = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
159
jnpf-java-boot/jnpf-web/src/views/example/storearea/index.vue
Normal file
159
jnpf-java-boot/jnpf-web/src/views/example/storearea/index.vue
Normal file
@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<div class="JNPF-common-layout storearea_data">
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="14">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="状态">
|
||||
<JnpfSelect v-model="query.enabledStatus" placeholder="请选择" clearable :options="enabledStatusOptions"
|
||||
:props="enabledStatusProps">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item class="btn">
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">新建</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right"></div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list">
|
||||
<el-table-column prop="storeAreCd" label="库区编码" align="center"/>
|
||||
<el-table-column prop="storeAreaName" label="库区名称" align="center"/>
|
||||
<el-table-column prop="storeHouseName" label="仓储名称" align="center"/>
|
||||
<el-table-column prop="enabledStatus" label="状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.enabledStatus == 1 ? 'success' : 'info'" size="small">
|
||||
{{ scope.row.enabledStatus == 1 ? '启用' : scope.row.enabledStatus == 2 ? '未启用' : scope.row.enabledStatus }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" align="center"/>
|
||||
<el-table-column prop="creatorTime" label="创建时间" align="center" :formatter="jnpf.tableDateFormat1"/>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData" />
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "@/utils/request";
|
||||
import { mapGetters } from "vuex";
|
||||
import JNPFForm from "./form";
|
||||
import jnpf from "@/utils/jnpf";
|
||||
|
||||
export default {
|
||||
name: "storearea",
|
||||
components: {
|
||||
JNPFForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
query: {
|
||||
storeAreCd: undefined,
|
||||
storeAreaName: undefined,
|
||||
enabledStatus: undefined,
|
||||
storeHouseId: undefined,
|
||||
},
|
||||
defListQuery: {
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
list: [],
|
||||
listLoading: false,
|
||||
multipleSelection: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
enabledStatusOptions: [
|
||||
{ fullName: "启用", id: 1 },
|
||||
{ fullName: "未启用", id: 2 },
|
||||
],
|
||||
enabledStatusProps: { label: "fullName", value: "id" },
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
jnpf() {
|
||||
return jnpf
|
||||
},
|
||||
...mapGetters(["userInfo"]),
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || "";
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
dataType: 0,
|
||||
};
|
||||
request({
|
||||
url: `/api/example/storearea/getList`,
|
||||
method: "post",
|
||||
data: _query,
|
||||
}).then((res) => {
|
||||
var _list = [];
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data);
|
||||
}
|
||||
this.list = _list;
|
||||
this.total = res.data.pagination.total;
|
||||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
addOrUpdateHandle(row) {
|
||||
let id = row ? row.id : "";
|
||||
this.formVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id);
|
||||
});
|
||||
},
|
||||
search() {
|
||||
this.listQuery.currentPage = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.initData();
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false;
|
||||
if (isrRefresh) this.search();
|
||||
},
|
||||
reset() {
|
||||
this.query = {
|
||||
storeAreCd: undefined,
|
||||
storeAreaName: undefined,
|
||||
enabledStatus: undefined,
|
||||
storeHouseId: undefined,
|
||||
};
|
||||
this.search();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
149
jnpf-java-boot/jnpf-web/src/views/example/storehouse/form.vue
Normal file
149
jnpf-java-boot/jnpf-web/src/views/example/storehouse/form.vue
Normal file
@ -0,0 +1,149 @@
|
||||
NEW_FILE_CODE
|
||||
<template>
|
||||
<el-dialog
|
||||
:title="!dataForm.id ? '新建' : '编辑'"
|
||||
:visible.sync="dialogVisible"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
@close="handleClose"
|
||||
>
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-form-item label="仓储编码" prop="storeHouseCd">
|
||||
<JnpfInput v-model="dataForm.storeHouseCd" placeholder="请输入仓储编码" clearable :disabled="!!dataForm.id" :style="{ width: '100%' }">
|
||||
</JnpfInput>
|
||||
</el-form-item>
|
||||
<el-form-item label="仓储名称" prop="storeHouseName">
|
||||
<JnpfInput v-model="dataForm.storeHouseName" placeholder="请输入仓储名称" clearable :style="{ width: '100%' }">
|
||||
</JnpfInput>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="enabledStatus">
|
||||
<JnpfSelect v-model="dataForm.enabledStatus" placeholder="请选择状态" :options="enabledStatusOptions" :props="enabledStatusProps" clearable :style="{ width: '100%' }">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<JnpfTextarea v-model="dataForm.remark" placeholder="请输入备注" :style="{ width: '100%' }" :autoSize="{ minRows: 4, maxRows: 4 }" type="textarea">
|
||||
</JnpfTextarea>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading">保 存</el-button>
|
||||
<el-button @click="handleClose">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
formRef: 'formRef',
|
||||
eventType: '',
|
||||
dataForm: {
|
||||
id: '',
|
||||
storeHouseCd: undefined,
|
||||
storeHouseName: undefined,
|
||||
enabledStatus: 1,
|
||||
remark: undefined,
|
||||
},
|
||||
dataRule: {
|
||||
storeHouseCd: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入仓储编码',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
storeHouseName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入仓储名称',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
enabledStatus: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择状态',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
},
|
||||
enabledStatusOptions: [
|
||||
{ fullName: "启用", id: 1 },
|
||||
{ fullName: "未启用", id: 2 },
|
||||
],
|
||||
enabledStatusProps: { label: "fullName", value: "id" },
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo']),
|
||||
},
|
||||
methods: {
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.dialogVisible = true;
|
||||
this.loading = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.formRef.resetFields();
|
||||
if (this.dataForm.id) {
|
||||
request({
|
||||
url: `/api/example/storehouse/${this.dataForm.id}`,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataForm = res.data
|
||||
this.loading = false
|
||||
})
|
||||
} else {
|
||||
this.loading = false
|
||||
}
|
||||
});
|
||||
},
|
||||
dataFormSubmit() {
|
||||
this.$refs.formRef.validate((valid) => {
|
||||
if (valid) {
|
||||
this.btnLoading = true;
|
||||
const isEdit = !!this.dataForm.id;
|
||||
const url = isEdit ? `/api/example/storehouse/${this.dataForm.id}` : '/api/example/storehouse';
|
||||
const method = isEdit ? 'put' : 'post';
|
||||
|
||||
request({
|
||||
url: url,
|
||||
method: method,
|
||||
data: this.dataForm
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: res.msg,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.btnLoading = false;
|
||||
this.dialogVisible = false;
|
||||
this.$emit('refresh', true)
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleClose() {
|
||||
this.dialogVisible = false;
|
||||
this.$emit('refresh',true)
|
||||
},
|
||||
changeData(model, index) {
|
||||
this.isEdit = true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
157
jnpf-java-boot/jnpf-web/src/views/example/storehouse/index.vue
Normal file
157
jnpf-java-boot/jnpf-web/src/views/example/storehouse/index.vue
Normal file
@ -0,0 +1,157 @@
|
||||
NEW_FILE_CODE
|
||||
<template>
|
||||
<div class="JNPF-common-layout storehouse_data">
|
||||
<div class="JNPF-common-layout-center">
|
||||
<el-row class="JNPF-common-search-box" :gutter="14">
|
||||
<el-form @submit.native.prevent>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="状态">
|
||||
<JnpfSelect v-model="query.enabledStatus" placeholder="请选择" clearable :options="enabledStatusOptions"
|
||||
:props="enabledStatusProps">
|
||||
</JnpfSelect>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item class="btn">
|
||||
<el-button type="primary" icon="el-icon-search" @click="search()">查询</el-button>
|
||||
<el-button icon="el-icon-refresh-right" @click="reset()">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<div class="JNPF-common-layout-main JNPF-flex-main">
|
||||
<div class="JNPF-common-head">
|
||||
<div>
|
||||
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">新建</el-button>
|
||||
</div>
|
||||
<div class="JNPF-common-head-right"></div>
|
||||
</div>
|
||||
<JNPF-table v-loading="listLoading" :data="list">
|
||||
<el-table-column prop="storeHouseCd" label="仓储编码" align="center"/>
|
||||
<el-table-column prop="storeHouseName" label="仓储名称" align="center"/>
|
||||
<el-table-column prop="enabledStatus" label="状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.enabledStatus == 1 ? 'success' : 'info'" size="small">
|
||||
{{ scope.row.enabledStatus == 1 ? '启用' : scope.row.enabledStatus == 2 ? '未启用' : scope.row.enabledStatus }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注" align="center"/>
|
||||
<el-table-column prop="creatorTime" label="创建时间" align="center" :formatter="jnpf.tableDateFormat1"/>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="addOrUpdateHandle(scope.row)">编辑</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</JNPF-table>
|
||||
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize"
|
||||
@pagination="initData" />
|
||||
</div>
|
||||
</div>
|
||||
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import request from "@/utils/request";
|
||||
import { mapGetters } from "vuex";
|
||||
import JNPFForm from "./form";
|
||||
import jnpf from "@/utils/jnpf";
|
||||
|
||||
export default {
|
||||
name: "storehouse",
|
||||
components: {
|
||||
JNPFForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
query: {
|
||||
storeHouseCd: undefined,
|
||||
storeHouseName: undefined,
|
||||
enabledStatus: undefined,
|
||||
},
|
||||
defListQuery: {
|
||||
sort: "desc",
|
||||
sidx: "",
|
||||
},
|
||||
list: [],
|
||||
listLoading: false,
|
||||
multipleSelection: [],
|
||||
total: 0,
|
||||
listQuery: {
|
||||
currentPage: 1,
|
||||
pageSize: 20,
|
||||
sort: "",
|
||||
sidx: "",
|
||||
},
|
||||
formVisible: false,
|
||||
enabledStatusOptions: [
|
||||
{ fullName: "启用", id: 1 },
|
||||
{ fullName: "未启用", id: 2 },
|
||||
],
|
||||
enabledStatusProps: { label: "fullName", value: "id" },
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
jnpf() {
|
||||
return jnpf
|
||||
},
|
||||
...mapGetters(["userInfo"]),
|
||||
menuId() {
|
||||
return this.$route.meta.modelId || "";
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
methods: {
|
||||
initData() {
|
||||
this.listLoading = true;
|
||||
let _query = {
|
||||
...this.listQuery,
|
||||
...this.query,
|
||||
dataType: 0,
|
||||
};
|
||||
request({
|
||||
url: `/api/example/storehouse/getList`,
|
||||
method: "post",
|
||||
data: _query,
|
||||
}).then((res) => {
|
||||
var _list = [];
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let _data = res.data.list[i];
|
||||
_list.push(_data);
|
||||
}
|
||||
this.list = _list;
|
||||
this.total = res.data.pagination.total;
|
||||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
addOrUpdateHandle(row) {
|
||||
let id = row ? row.id : "";
|
||||
this.formVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.JNPFForm.init(id);
|
||||
});
|
||||
},
|
||||
search() {
|
||||
this.listQuery.currentPage = 1;
|
||||
this.listQuery.pageSize = 20;
|
||||
this.initData();
|
||||
},
|
||||
refresh(isrRefresh) {
|
||||
this.formVisible = false;
|
||||
if (isrRefresh) this.search();
|
||||
},
|
||||
reset() {
|
||||
this.query = {
|
||||
storeHouseCd: undefined,
|
||||
storeHouseName: undefined,
|
||||
enabledStatus: undefined,
|
||||
};
|
||||
this.search();
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user