✨ ERP:初始化其它入库的表单 50%
parent
db79926c31
commit
46d26659bf
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.validation.InEnum;
|
||||
import cn.iocoder.yudao.module.erp.enums.ErpAuditStatus;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 其它入库单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ErpStockInPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "入库单号", example = "S123")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "供应商编号", example = "3113")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "入库时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] inTime;
|
||||
|
||||
@Schema(description = "状态", example = "10")
|
||||
@InEnum(ErpAuditStatus.class)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建者")
|
||||
private String creator;
|
||||
|
||||
}
|
||||
@ -0,0 +1,106 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
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;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.module.erp.enums.DictTypeConstants.AUDIT_STATUS;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 其它入库单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ErpStockInRespVO {
|
||||
|
||||
@Schema(description = "入库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
@ExcelProperty("入库编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "入库单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "S123")
|
||||
@ExcelProperty("入库单号")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "供应商编号", example = "3113")
|
||||
@ExcelProperty("供应商编号")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "入库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("入库时间")
|
||||
private LocalDateTime inTime;
|
||||
|
||||
@Schema(description = "合计数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "15663")
|
||||
@ExcelProperty("合计数量")
|
||||
private BigDecimal totalCount;
|
||||
|
||||
@Schema(description = "合计金额,单位:元", requiredMode = Schema.RequiredMode.REQUIRED, example = "24906")
|
||||
@ExcelProperty("合计金额")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat(AUDIT_STATUS)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "附件 URL", example = "https://www.iocoder.cn/1.doc")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "审核人", example = "芋道")
|
||||
private String creator;
|
||||
@Schema(description = "审核人名称", example = "芋道")
|
||||
private String creatorName;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "入库项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Item> items;
|
||||
|
||||
@Schema(description = "产品信息", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("产品信息")
|
||||
private String productNames;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "入库项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
// ========== 关联字段 ==========
|
||||
|
||||
@Schema(description = "产品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "巧克力")
|
||||
private String productName;
|
||||
@Schema(description = "产品单位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "盒")
|
||||
private String productUnitName;
|
||||
|
||||
@Schema(description = "库存数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
private BigDecimal stockCount; // 该字段仅仅在“详情”和“编辑”时使用
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 其它入库单新增/修改 Request VO")
|
||||
@Data
|
||||
public class ErpStockInSaveReqVO {
|
||||
|
||||
@Schema(description = "入库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "入库单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "S123")
|
||||
@NotEmpty(message = "入库单号不能为空")
|
||||
private String no;
|
||||
|
||||
@Schema(description = "供应商编号", example = "3113")
|
||||
private Long supplierId;
|
||||
|
||||
@Schema(description = "入库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "入库时间不能为空")
|
||||
private LocalDateTime inTime;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "附件 URL", example = "https://www.iocoder.cn/1.doc")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "入库项列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "入库项列表不能为空")
|
||||
@Valid
|
||||
private List<Item> items;
|
||||
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "入库项编号", example = "11756")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "仓库编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "仓库编号不能为空")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "产品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3113")
|
||||
@NotNull(message = "产品编号不能为空")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品单价", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品单价不能为空")
|
||||
private BigDecimal productPrice;
|
||||
|
||||
@Schema(description = "产品数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "100.00")
|
||||
@NotNull(message = "产品数量不能为空")
|
||||
private BigDecimal count;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.stockrecord;
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.record;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.stockrecord;
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.stock.vo.record;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.stock;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockInItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP 其它入库单项 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpStockInItemMapper extends BaseMapperX<ErpStockInItemDO> {
|
||||
|
||||
default List<ErpStockInItemDO> selectListByInId(Long inId) {
|
||||
return selectList(ErpStockInItemDO::getInId, inId);
|
||||
}
|
||||
|
||||
default List<ErpStockInItemDO> selectListByInIds(Collection<Long> inIds) {
|
||||
return selectList(ErpStockInItemDO::getInId, inIds);
|
||||
}
|
||||
|
||||
default int deleteByInId(Long inId) {
|
||||
return delete(ErpStockInItemDO::getInId, inId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.stock;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in.ErpStockInPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockInDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* ERP 其它入库单 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ErpStockInMapper extends BaseMapperX<ErpStockInDO> {
|
||||
|
||||
default PageResult<ErpStockInDO> selectPage(ErpStockInPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ErpStockInDO>()
|
||||
.eqIfPresent(ErpStockInDO::getNo, reqVO.getNo())
|
||||
.eqIfPresent(ErpStockInDO::getSupplierId, reqVO.getSupplierId())
|
||||
.betweenIfPresent(ErpStockInDO::getInTime, reqVO.getInTime())
|
||||
.eqIfPresent(ErpStockInDO::getStatus, reqVO.getStatus())
|
||||
.likeIfPresent(ErpStockInDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(ErpStockInDO::getCreator, reqVO.getCreator())
|
||||
.orderByDesc(ErpStockInDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.erp.service.stock;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in.ErpStockInPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.in.ErpStockInSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockInDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpStockInItemDO;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ERP 其它入库单 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ErpStockInService {
|
||||
|
||||
/**
|
||||
* 创建其它入库单
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createStockIn(@Valid ErpStockInSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新其它入库单
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateStockIn(@Valid ErpStockInSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除其它入库单
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteStockIn(Long id);
|
||||
|
||||
/**
|
||||
* 获得其它入库单
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 其它入库单
|
||||
*/
|
||||
ErpStockInDO getStockIn(Long id);
|
||||
|
||||
/**
|
||||
* 获得其它入库单分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 其它入库单分页
|
||||
*/
|
||||
PageResult<ErpStockInDO> getStockInPage(ErpStockInPageReqVO pageReqVO);
|
||||
|
||||
// ==================== 入库项 ====================
|
||||
|
||||
/**
|
||||
* 获得其它入库单项列表
|
||||
*
|
||||
* @param inId 入库编号
|
||||
* @return 其它入库单项列表
|
||||
*/
|
||||
List<ErpStockInItemDO> getStockInItemListByInId(Long inId);
|
||||
|
||||
/**
|
||||
* 获得其它入库单项 List
|
||||
*
|
||||
* @param inIds 入库编号数组
|
||||
* @return 其它入库单项 List
|
||||
*/
|
||||
List<ErpStockInItemDO> getStockInItemListByInIds(Collection<Long> inIds);
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue