parent
e377490c90
commit
97a69bce8b
@ -0,0 +1,37 @@
|
||||
package com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@Data
|
||||
public class StorageMatValidRespVO {
|
||||
|
||||
private Long matId;
|
||||
|
||||
private String matName;
|
||||
|
||||
private String matCode;
|
||||
|
||||
private String materialType;
|
||||
|
||||
private Long whId;
|
||||
|
||||
private Long rgId;
|
||||
|
||||
private Long pnId;
|
||||
|
||||
private BigDecimal matRest;
|
||||
|
||||
private String lotNo;
|
||||
|
||||
private String spec;
|
||||
|
||||
private String unit;
|
||||
|
||||
private String storageOkQty;
|
||||
|
||||
|
||||
}
|
@ -1,55 +1,62 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.storagemat;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 入/出库物料 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface StorageMatService {
|
||||
|
||||
/**
|
||||
* 创建入/出库物料
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createStorageMat(@Valid StorageMatSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新入/出库物料
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateStorageMat(@Valid StorageMatSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除入/出库物料
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteStorageMat(Long id);
|
||||
|
||||
/**
|
||||
* 获得入/出库物料
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 入/出库物料
|
||||
*/
|
||||
StorageMatDO getStorageMat(Long id);
|
||||
|
||||
/**
|
||||
* 获得入/出库物料分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 入/出库物料分页
|
||||
*/
|
||||
PageResult<StorageMatDO> getStorageMatPage(StorageMatPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
package com.chanko.yunxi.mes.module.heli.service.storagemat;
|
||||
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 入/出库物料 Service 接口
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
public interface StorageMatService {
|
||||
|
||||
/**
|
||||
* 创建入/出库物料
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createStorageMat(@Valid StorageMatSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新入/出库物料
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateStorageMat(@Valid StorageMatSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除入/出库物料
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteStorageMat(Long id);
|
||||
|
||||
/**
|
||||
* 获得入/出库物料
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 入/出库物料
|
||||
*/
|
||||
StorageMatDO getStorageMat(Long id);
|
||||
|
||||
/**
|
||||
* 获得入/出库物料分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 入/出库物料分页
|
||||
*/
|
||||
PageResult<StorageMatDO> getStorageMatPage(StorageMatPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得入/出库物料列表
|
||||
*
|
||||
* @return 入/出库物料分页
|
||||
*/
|
||||
List<StorageMatValidRespVO> getStorageMatList();
|
||||
|
||||
}
|
||||
|
@ -1,74 +1,84 @@
|
||||
package com.chanko.yunxi.mes.module.heli.service.storagemat;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 入/出库物料 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class StorageMatServiceImpl implements StorageMatService {
|
||||
|
||||
@Resource
|
||||
private StorageMatMapper storageMatMapper;
|
||||
|
||||
@Override
|
||||
public Long createStorageMat(StorageMatSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
StorageMatDO storageMat = BeanUtils.toBean(createReqVO, StorageMatDO.class);
|
||||
storageMatMapper.insert(storageMat);
|
||||
// 返回
|
||||
return storageMat.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStorageMat(StorageMatSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateStorageMatExists(updateReqVO.getId());
|
||||
// 更新
|
||||
StorageMatDO updateObj = BeanUtils.toBean(updateReqVO, StorageMatDO.class);
|
||||
storageMatMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteStorageMat(Long id) {
|
||||
// 校验存在
|
||||
validateStorageMatExists(id);
|
||||
// 删除
|
||||
storageMatMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateStorageMatExists(Long id) {
|
||||
if (storageMatMapper.selectById(id) == null) {
|
||||
throw exception(STORAGE_MAT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageMatDO getStorageMat(Long id) {
|
||||
return storageMatMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<StorageMatDO> getStorageMatPage(StorageMatPageReqVO pageReqVO) {
|
||||
return storageMatMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
package com.chanko.yunxi.mes.module.heli.service.storagemat;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.*;
|
||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
||||
|
||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 入/出库物料 Service 实现类
|
||||
*
|
||||
* @author 管理员
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class StorageMatServiceImpl implements StorageMatService {
|
||||
|
||||
@Resource
|
||||
private StorageMatMapper storageMatMapper;
|
||||
|
||||
@Resource
|
||||
private StorageMatMapper storageMatGlobalMapper;
|
||||
|
||||
@Override
|
||||
public Long createStorageMat(StorageMatSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
StorageMatDO storageMat = BeanUtils.toBean(createReqVO, StorageMatDO.class);
|
||||
storageMatMapper.insert(storageMat);
|
||||
// 返回
|
||||
return storageMat.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateStorageMat(StorageMatSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateStorageMatExists(updateReqVO.getId());
|
||||
// 更新
|
||||
StorageMatDO updateObj = BeanUtils.toBean(updateReqVO, StorageMatDO.class);
|
||||
storageMatMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteStorageMat(Long id) {
|
||||
// 校验存在
|
||||
validateStorageMatExists(id);
|
||||
// 删除
|
||||
storageMatMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateStorageMatExists(Long id) {
|
||||
if (storageMatMapper.selectById(id) == null) {
|
||||
throw exception(STORAGE_MAT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageMatDO getStorageMat(Long id) {
|
||||
return storageMatMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<StorageMatDO> getStorageMatPage(StorageMatPageReqVO pageReqVO) {
|
||||
return storageMatMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StorageMatValidRespVO> getStorageMatList() {
|
||||
return storageMatMapper.selectStorageMatValid();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in new issue