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;
|
package com.chanko.yunxi.mes.module.heli.service.storagemat;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.validation.*;
|
import javax.validation.*;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.*;
|
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.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
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.pojo.PageParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 入/出库物料 Service 接口
|
* 入/出库物料 Service 接口
|
||||||
*
|
*
|
||||||
* @author 管理员
|
* @author 管理员
|
||||||
*/
|
*/
|
||||||
public interface StorageMatService {
|
public interface StorageMatService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建入/出库物料
|
* 创建入/出库物料
|
||||||
*
|
*
|
||||||
* @param createReqVO 创建信息
|
* @param createReqVO 创建信息
|
||||||
* @return 编号
|
* @return 编号
|
||||||
*/
|
*/
|
||||||
Long createStorageMat(@Valid StorageMatSaveReqVO createReqVO);
|
Long createStorageMat(@Valid StorageMatSaveReqVO createReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新入/出库物料
|
* 更新入/出库物料
|
||||||
*
|
*
|
||||||
* @param updateReqVO 更新信息
|
* @param updateReqVO 更新信息
|
||||||
*/
|
*/
|
||||||
void updateStorageMat(@Valid StorageMatSaveReqVO updateReqVO);
|
void updateStorageMat(@Valid StorageMatSaveReqVO updateReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除入/出库物料
|
* 删除入/出库物料
|
||||||
*
|
*
|
||||||
* @param id 编号
|
* @param id 编号
|
||||||
*/
|
*/
|
||||||
void deleteStorageMat(Long id);
|
void deleteStorageMat(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得入/出库物料
|
* 获得入/出库物料
|
||||||
*
|
*
|
||||||
* @param id 编号
|
* @param id 编号
|
||||||
* @return 入/出库物料
|
* @return 入/出库物料
|
||||||
*/
|
*/
|
||||||
StorageMatDO getStorageMat(Long id);
|
StorageMatDO getStorageMat(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得入/出库物料分页
|
* 获得入/出库物料分页
|
||||||
*
|
*
|
||||||
* @param pageReqVO 分页查询
|
* @param pageReqVO 分页查询
|
||||||
* @return 入/出库物料分页
|
* @return 入/出库物料分页
|
||||||
*/
|
*/
|
||||||
PageResult<StorageMatDO> getStorageMatPage(StorageMatPageReqVO pageReqVO);
|
PageResult<StorageMatDO> getStorageMatPage(StorageMatPageReqVO pageReqVO);
|
||||||
|
|
||||||
}
|
/**
|
||||||
|
* 获得入/出库物料列表
|
||||||
|
*
|
||||||
|
* @return 入/出库物料分页
|
||||||
|
*/
|
||||||
|
List<StorageMatValidRespVO> getStorageMatList();
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -1,74 +1,84 @@
|
|||||||
package com.chanko.yunxi.mes.module.heli.service.storagemat;
|
package com.chanko.yunxi.mes.module.heli.service.storagemat;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import javax.annotation.Resource;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.projectorder.ProjectOrderDO;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import java.util.*;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.*;
|
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
import java.util.*;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
import com.chanko.yunxi.mes.module.heli.controller.admin.storagemat.vo.*;
|
||||||
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
import com.chanko.yunxi.mes.module.heli.dal.dataobject.storagemat.StorageMatDO;
|
||||||
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import com.chanko.yunxi.mes.module.heli.dal.mysql.storagemat.StorageMatMapper;
|
||||||
import static com.chanko.yunxi.mes.module.heli.enums.ErrorCodeConstants.*;
|
|
||||||
|
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 实现类
|
||||||
*/
|
*
|
||||||
@Service
|
* @author 管理员
|
||||||
@Validated
|
*/
|
||||||
public class StorageMatServiceImpl implements StorageMatService {
|
@Service
|
||||||
|
@Validated
|
||||||
@Resource
|
public class StorageMatServiceImpl implements StorageMatService {
|
||||||
private StorageMatMapper storageMatMapper;
|
|
||||||
|
@Resource
|
||||||
@Override
|
private StorageMatMapper storageMatMapper;
|
||||||
public Long createStorageMat(StorageMatSaveReqVO createReqVO) {
|
|
||||||
// 插入
|
@Resource
|
||||||
StorageMatDO storageMat = BeanUtils.toBean(createReqVO, StorageMatDO.class);
|
private StorageMatMapper storageMatGlobalMapper;
|
||||||
storageMatMapper.insert(storageMat);
|
|
||||||
// 返回
|
@Override
|
||||||
return storageMat.getId();
|
public Long createStorageMat(StorageMatSaveReqVO createReqVO) {
|
||||||
}
|
// 插入
|
||||||
|
StorageMatDO storageMat = BeanUtils.toBean(createReqVO, StorageMatDO.class);
|
||||||
@Override
|
storageMatMapper.insert(storageMat);
|
||||||
public void updateStorageMat(StorageMatSaveReqVO updateReqVO) {
|
// 返回
|
||||||
// 校验存在
|
return storageMat.getId();
|
||||||
validateStorageMatExists(updateReqVO.getId());
|
}
|
||||||
// 更新
|
|
||||||
StorageMatDO updateObj = BeanUtils.toBean(updateReqVO, StorageMatDO.class);
|
@Override
|
||||||
storageMatMapper.updateById(updateObj);
|
public void updateStorageMat(StorageMatSaveReqVO updateReqVO) {
|
||||||
}
|
// 校验存在
|
||||||
|
validateStorageMatExists(updateReqVO.getId());
|
||||||
@Override
|
// 更新
|
||||||
public void deleteStorageMat(Long id) {
|
StorageMatDO updateObj = BeanUtils.toBean(updateReqVO, StorageMatDO.class);
|
||||||
// 校验存在
|
storageMatMapper.updateById(updateObj);
|
||||||
validateStorageMatExists(id);
|
}
|
||||||
// 删除
|
|
||||||
storageMatMapper.deleteById(id);
|
@Override
|
||||||
}
|
public void deleteStorageMat(Long id) {
|
||||||
|
// 校验存在
|
||||||
private void validateStorageMatExists(Long id) {
|
validateStorageMatExists(id);
|
||||||
if (storageMatMapper.selectById(id) == null) {
|
// 删除
|
||||||
throw exception(STORAGE_MAT_NOT_EXISTS);
|
storageMatMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
private void validateStorageMatExists(Long id) {
|
||||||
@Override
|
if (storageMatMapper.selectById(id) == null) {
|
||||||
public StorageMatDO getStorageMat(Long id) {
|
throw exception(STORAGE_MAT_NOT_EXISTS);
|
||||||
return storageMatMapper.selectById(id);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<StorageMatDO> getStorageMatPage(StorageMatPageReqVO pageReqVO) {
|
public StorageMatDO getStorageMat(Long id) {
|
||||||
return storageMatMapper.selectPage(pageReqVO);
|
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