Compare commits
No commits in common. 'main' and 'ck' have entirely different histories.
@ -1,114 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.warehousearea;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.stock.vo.warehouse.ErpWarehouseRespVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.stock.ErpWarehouseDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo.*;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea.WarehouseAreaDO;
|
||||
import cn.iocoder.yudao.module.erp.service.warehousearea.WarehouseAreaService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - ERP 库区信息")
|
||||
@RestController
|
||||
@RequestMapping("/erp/warehouse-area")
|
||||
@Validated
|
||||
public class WarehouseAreaController {
|
||||
|
||||
@Resource
|
||||
private WarehouseAreaService warehouseAreaService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP 库区信息")
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:create')")
|
||||
public CommonResult<Long> createWarehouseArea(@Valid @RequestBody WarehouseAreaSaveReqVO createReqVO) {
|
||||
return success(warehouseAreaService.createWarehouseArea(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP 库区信息")
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:update')")
|
||||
public CommonResult<Boolean> updateWarehouseArea(@Valid @RequestBody WarehouseAreaSaveReqVO updateReqVO) {
|
||||
warehouseAreaService.updateWarehouseArea(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP 库区信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:delete')")
|
||||
public CommonResult<Boolean> deleteWarehouseArea(@RequestParam("id") Long id) {
|
||||
warehouseAreaService.deleteWarehouseArea(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP 库区信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:query')")
|
||||
public CommonResult<WarehouseAreaRespVO> getWarehouseArea(@RequestParam("id") Long id) {
|
||||
WarehouseAreaDO warehouseArea = warehouseAreaService.getWarehouseArea(id);
|
||||
return success(BeanUtils.toBean(warehouseArea, WarehouseAreaRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP 库区信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:query')")
|
||||
public CommonResult<PageResult<WarehouseAreaRespVO>> getWarehouseAreaPage(@Valid WarehouseAreaPageReqVO pageReqVO) {
|
||||
PageResult<WarehouseAreaDO> pageResult = warehouseAreaService.getWarehouseAreaPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, WarehouseAreaRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获得库区精简列表", description = "只包含被开启的仓库库区,主要用于前端的下拉选项")
|
||||
public CommonResult<List<WarehouseAreaRespVO>> getWarehouseSimpleList(@RequestParam(value = "warehouseId", required = false) Long warehouseId) {
|
||||
List<WarehouseAreaDO> list = warehouseAreaService.getWarehouseListByStatusAndWarehouseId(CommonStatusEnum.ENABLE.getStatus(), warehouseId);
|
||||
return success(convertList(list, area -> new WarehouseAreaRespVO()
|
||||
.setId(area.getId())
|
||||
.setWarehouseId(area.getWarehouseId())
|
||||
.setAreaCode(area.getAreaCode())
|
||||
.setAreaName(area.getAreaName())
|
||||
.setStatus(area.getStatus())));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP 库区信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-area:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportWarehouseAreaExcel(@Valid WarehouseAreaPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<WarehouseAreaDO> list = warehouseAreaService.getWarehouseAreaPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP 库区信息.xls", "数据", WarehouseAreaRespVO.class,
|
||||
BeanUtils.toBean(list, WarehouseAreaRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,41 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
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 WarehouseAreaPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "所属仓库id", example = "19404")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "库区编码")
|
||||
private String areaCode;
|
||||
|
||||
@Schema(description = "库区名称", example = "赵六")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "面积(平方米)")
|
||||
private BigDecimal areaSize;
|
||||
|
||||
@Schema(description = "库区描述", example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "开启状态", example = "2")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 库区信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WarehouseAreaRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1157")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "所属仓库id", requiredMode = Schema.RequiredMode.REQUIRED, example = "19404")
|
||||
@ExcelProperty("所属仓库id")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "库区编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("库区编码")
|
||||
private String areaCode;
|
||||
|
||||
@Schema(description = "库区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@ExcelProperty("库区名称")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "面积(平方米)")
|
||||
@ExcelProperty("面积(平方米)")
|
||||
private BigDecimal areaSize;
|
||||
|
||||
@Schema(description = "库区描述", example = "你说的对")
|
||||
@ExcelProperty("库区描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("开启状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -1,38 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 库区信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class WarehouseAreaSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1157")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "所属仓库id", example = "19404")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "库区编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @NotEmpty(message = "库区编码不能为空")
|
||||
private String areaCode;
|
||||
|
||||
@Schema(description = "库区名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "A区")
|
||||
@NotEmpty(message = "库区名称不能为空")
|
||||
private String areaName;
|
||||
|
||||
@Schema(description = "面积(平方米)")
|
||||
private BigDecimal areaSize;
|
||||
|
||||
@Schema(description = "库区描述", example = "常温区")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "开启状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -1,110 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.warehouselocation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo.*;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouselocation.WarehouseLocationDO;
|
||||
import cn.iocoder.yudao.module.erp.service.warehouselocation.WarehouseLocationService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - ERP 库位信息")
|
||||
@RestController
|
||||
@RequestMapping("/erp/warehouse-location")
|
||||
@Validated
|
||||
public class WarehouseLocationController {
|
||||
|
||||
@Resource
|
||||
private WarehouseLocationService warehouseLocationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建ERP 库位信息")
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:create')")
|
||||
public CommonResult<Long> createWarehouseLocation(@Valid @RequestBody WarehouseLocationSaveReqVO createReqVO) {
|
||||
return success(warehouseLocationService.createWarehouseLocation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新ERP 库位信息")
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:update')")
|
||||
public CommonResult<Boolean> updateWarehouseLocation(@Valid @RequestBody WarehouseLocationSaveReqVO updateReqVO) {
|
||||
warehouseLocationService.updateWarehouseLocation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除ERP 库位信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:delete')")
|
||||
public CommonResult<Boolean> deleteWarehouseLocation(@RequestParam("id") Long id) {
|
||||
warehouseLocationService.deleteWarehouseLocation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得ERP 库位信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:query')")
|
||||
public CommonResult<WarehouseLocationRespVO> getWarehouseLocation(@RequestParam("id") Long id) {
|
||||
WarehouseLocationDO warehouseLocation = warehouseLocationService.getWarehouseLocation(id);
|
||||
return success(BeanUtils.toBean(warehouseLocation, WarehouseLocationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得ERP 库位信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:query')")
|
||||
public CommonResult<PageResult<WarehouseLocationRespVO>> getWarehouseLocationPage(@Valid WarehouseLocationPageReqVO pageReqVO) {
|
||||
PageResult<WarehouseLocationDO> pageResult = warehouseLocationService.getWarehouseLocationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, WarehouseLocationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获得ERP 库位信息精简列表", description = "只包含已启用的库位,主要用于前端下拉选项")
|
||||
public CommonResult<List<WarehouseLocationRespVO>> getWarehouseLocationSimpleList() {
|
||||
List<WarehouseLocationDO> list = warehouseLocationService.getWarehouseLocationListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
return success(convertList(list, item -> new WarehouseLocationRespVO()
|
||||
.setId(item.getId())
|
||||
.setWarehouseId(item.getWarehouseId())
|
||||
.setAreaId(item.getAreaId())
|
||||
.setCode(item.getCode())
|
||||
.setName(item.getName())
|
||||
.setStatus(item.getStatus())));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出ERP 库位信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('erp:warehouse-location:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportWarehouseLocationExcel(@Valid WarehouseLocationPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<WarehouseLocationDO> list = warehouseLocationService.getWarehouseLocationPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "ERP 库位信息.xls", "数据", WarehouseLocationRespVO.class,
|
||||
BeanUtils.toBean(list, WarehouseLocationRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
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 WarehouseLocationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "所属仓库ID", example = "19287")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "所属库区ID", example = "513")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "库位编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "库位名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "面积")
|
||||
private BigDecimal areaSize;
|
||||
|
||||
@Schema(description = "最大载重量")
|
||||
private BigDecimal maxLoadWeight;
|
||||
|
||||
@Schema(description = "库位位置X")
|
||||
private Integer positionX;
|
||||
|
||||
@Schema(description = "库位位置Y")
|
||||
private Integer positionY;
|
||||
|
||||
@Schema(description = "库位位置Z")
|
||||
private Integer positionZ;
|
||||
|
||||
@Schema(description = "是否允许产品混放")
|
||||
private Boolean allowProductMix;
|
||||
|
||||
@Schema(description = "是否允许批次混放")
|
||||
private Boolean allowBatchMix;
|
||||
|
||||
@Schema(description = "开启状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -1,72 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 库位信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class WarehouseLocationRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7300")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "所属仓库ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19287")
|
||||
@ExcelProperty("所属仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "所属库区ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "513")
|
||||
@ExcelProperty("所属库区ID")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "库位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("库位编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("库位名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "面积")
|
||||
@ExcelProperty("面积")
|
||||
private BigDecimal areaSize;
|
||||
|
||||
@Schema(description = "最大载重量")
|
||||
@ExcelProperty("最大载重量")
|
||||
private BigDecimal maxLoadWeight;
|
||||
|
||||
@Schema(description = "库位位置X")
|
||||
@ExcelProperty("库位位置X")
|
||||
private Integer positionX;
|
||||
|
||||
@Schema(description = "库位位置Y")
|
||||
@ExcelProperty("库位位置Y")
|
||||
private Integer positionY;
|
||||
|
||||
@Schema(description = "库位位置Z")
|
||||
@ExcelProperty("库位位置Z")
|
||||
private Integer positionZ;
|
||||
|
||||
@Schema(description = "是否允许产品混放", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否允许产品混放")
|
||||
private Boolean allowProductMix;
|
||||
|
||||
@Schema(description = "是否允许批次混放", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否允许批次混放")
|
||||
private Boolean allowBatchMix;
|
||||
|
||||
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("开启状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - ERP 库位信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class WarehouseLocationSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "7300")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "所属仓库ID", example = "19287")
|
||||
private Long warehouseId;
|
||||
|
||||
@Schema(description = "所属库区ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "513")
|
||||
@NotNull(message = "所属库区ID不能为空")
|
||||
private Long areaId;
|
||||
|
||||
@Schema(description = "库位编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @NotEmpty(message = "库位编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "库位名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "A-01-01")
|
||||
@NotEmpty(message = "库位名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "面积")
|
||||
private BigDecimal areaSize;
|
||||
|
||||
@Schema(description = "最大载重量")
|
||||
private BigDecimal maxLoadWeight;
|
||||
|
||||
@Schema(description = "库位位置X")
|
||||
private Integer positionX;
|
||||
|
||||
@Schema(description = "库位位置Y")
|
||||
private Integer positionY;
|
||||
|
||||
@Schema(description = "库位位置Z")
|
||||
private Integer positionZ;
|
||||
|
||||
@Schema(description = "是否允许产品混放", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否允许产品混放不能为空")
|
||||
private Boolean allowProductMix;
|
||||
|
||||
@Schema(description = "是否允许批次混放", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否允许批次混放不能为空")
|
||||
private Boolean allowBatchMix;
|
||||
|
||||
@Schema(description = "开启状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "开启状态不能为空")
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -1,56 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* ERP 库区信息 DO
|
||||
*
|
||||
* @author 必硕智能
|
||||
*/
|
||||
@TableName("erp_warehouse_area")
|
||||
@KeySequence("erp_warehouse_area_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WarehouseAreaDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 所属仓库id
|
||||
*/
|
||||
private Long warehouseId;
|
||||
/**
|
||||
* 库区编码
|
||||
*/
|
||||
private String areaCode;
|
||||
/**
|
||||
* 库区名称
|
||||
*/
|
||||
private String areaName;
|
||||
/**
|
||||
* 面积(平方米)
|
||||
*/
|
||||
private BigDecimal areaSize;
|
||||
/**
|
||||
* 库区描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 开启状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -1,81 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.dataobject.warehouselocation;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* ERP 库位信息 DO
|
||||
*
|
||||
* @author 必硕智能
|
||||
*/
|
||||
@TableName("erp_warehouse_location")
|
||||
@KeySequence("erp_warehouse_location_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WarehouseLocationDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 所属仓库ID
|
||||
*/
|
||||
private Long warehouseId;
|
||||
/**
|
||||
* 所属库区ID
|
||||
*/
|
||||
private Long areaId;
|
||||
/**
|
||||
* 库位编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 库位名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 面积
|
||||
*/
|
||||
private BigDecimal areaSize;
|
||||
/**
|
||||
* 最大载重量
|
||||
*/
|
||||
private BigDecimal maxLoadWeight;
|
||||
/**
|
||||
* 库位位置X
|
||||
*/
|
||||
private Integer positionX;
|
||||
/**
|
||||
* 库位位置Y
|
||||
*/
|
||||
private Integer positionY;
|
||||
/**
|
||||
* 库位位置Z
|
||||
*/
|
||||
private Integer positionZ;
|
||||
/**
|
||||
* 是否允许产品混放
|
||||
*/
|
||||
private Boolean allowProductMix;
|
||||
/**
|
||||
* 是否允许批次混放
|
||||
*/
|
||||
private Boolean allowBatchMix;
|
||||
/**
|
||||
* 开启状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
@ -1,53 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.warehousearea;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea.WarehouseAreaDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo.*;
|
||||
|
||||
/**
|
||||
* ERP 库区信息 Mapper
|
||||
*
|
||||
* @author 必硕智能
|
||||
*/
|
||||
@Mapper
|
||||
public interface WarehouseAreaMapper extends BaseMapperX<WarehouseAreaDO> {
|
||||
|
||||
default PageResult<WarehouseAreaDO> selectPage(WarehouseAreaPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseAreaDO>()
|
||||
.eqIfPresent(WarehouseAreaDO::getWarehouseId, reqVO.getWarehouseId())
|
||||
.eqIfPresent(WarehouseAreaDO::getAreaCode, reqVO.getAreaCode())
|
||||
.likeIfPresent(WarehouseAreaDO::getAreaName, reqVO.getAreaName())
|
||||
.eqIfPresent(WarehouseAreaDO::getAreaSize, reqVO.getAreaSize())
|
||||
.eqIfPresent(WarehouseAreaDO::getDescription, reqVO.getDescription())
|
||||
.eqIfPresent(WarehouseAreaDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(WarehouseAreaDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(WarehouseAreaDO::getId));
|
||||
}
|
||||
|
||||
|
||||
default WarehouseAreaDO selectByNo(String no) {
|
||||
return selectOne(WarehouseAreaDO::getAreaCode, no);
|
||||
}
|
||||
|
||||
default List<WarehouseAreaDO> selectListByStatus(Integer status) {
|
||||
return selectList(WarehouseAreaDO::getStatus, status);
|
||||
}
|
||||
|
||||
default List<WarehouseAreaDO> selectListByWarehouseId(Long warehouseId) {
|
||||
return selectList(WarehouseAreaDO::getWarehouseId, warehouseId);
|
||||
}
|
||||
|
||||
default void deleteByWarehouseId(Long warehouseId) {
|
||||
delete(WarehouseAreaDO::getWarehouseId, warehouseId);
|
||||
}
|
||||
|
||||
default Long selectCountByWarehouseId(Long warehouseId) {
|
||||
return selectCount(WarehouseAreaDO::getWarehouseId, warehouseId);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.dal.mysql.warehouselocation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouselocation.WarehouseLocationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo.*;
|
||||
|
||||
/**
|
||||
* ERP 库位信息 Mapper
|
||||
*
|
||||
* @author 必硕智能
|
||||
*/
|
||||
@Mapper
|
||||
public interface WarehouseLocationMapper extends BaseMapperX<WarehouseLocationDO> {
|
||||
|
||||
default PageResult<WarehouseLocationDO> selectPage(WarehouseLocationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<WarehouseLocationDO>()
|
||||
.eqIfPresent(WarehouseLocationDO::getWarehouseId, reqVO.getWarehouseId())
|
||||
.eqIfPresent(WarehouseLocationDO::getAreaId, reqVO.getAreaId())
|
||||
.eqIfPresent(WarehouseLocationDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(WarehouseLocationDO::getName, reqVO.getName())
|
||||
.eqIfPresent(WarehouseLocationDO::getAreaSize, reqVO.getAreaSize())
|
||||
.eqIfPresent(WarehouseLocationDO::getMaxLoadWeight, reqVO.getMaxLoadWeight())
|
||||
.eqIfPresent(WarehouseLocationDO::getPositionX, reqVO.getPositionX())
|
||||
.eqIfPresent(WarehouseLocationDO::getPositionY, reqVO.getPositionY())
|
||||
.eqIfPresent(WarehouseLocationDO::getPositionZ, reqVO.getPositionZ())
|
||||
.eqIfPresent(WarehouseLocationDO::getAllowProductMix, reqVO.getAllowProductMix())
|
||||
.eqIfPresent(WarehouseLocationDO::getAllowBatchMix, reqVO.getAllowBatchMix())
|
||||
.eqIfPresent(WarehouseLocationDO::getStatus, reqVO.getStatus())
|
||||
.betweenIfPresent(WarehouseLocationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(WarehouseLocationDO::getId));
|
||||
}
|
||||
|
||||
default WarehouseLocationDO selectByNo(String no) {
|
||||
return selectOne(WarehouseLocationDO::getCode, no);
|
||||
}
|
||||
|
||||
default List<WarehouseLocationDO> selectListByWarehouseId(Long warehouseId) {
|
||||
return selectList(WarehouseLocationDO::getWarehouseId, warehouseId);
|
||||
}
|
||||
|
||||
default void deleteByWarehouseId(Long warehouseId) {
|
||||
delete(WarehouseLocationDO::getWarehouseId, warehouseId);
|
||||
}
|
||||
|
||||
default List<WarehouseLocationDO> selectListByStatus(Integer status) {
|
||||
return selectList(WarehouseLocationDO::getStatus, status);
|
||||
}
|
||||
|
||||
default List<WarehouseLocationDO> selectListByAreaId(Long areaId) {
|
||||
return selectList(WarehouseLocationDO::getAreaId, areaId);
|
||||
}
|
||||
|
||||
default Long selectCountByWarehouseId(Long warehouseId) {
|
||||
return selectCount(WarehouseLocationDO::getWarehouseId, warehouseId);
|
||||
}
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.service.warehousearea;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo.*;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea.WarehouseAreaDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* ERP 库区信息 Service 接口
|
||||
*
|
||||
* @author 必硕智能
|
||||
*/
|
||||
public interface WarehouseAreaService {
|
||||
|
||||
/**
|
||||
* 创建ERP 库区信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createWarehouseArea(@Valid WarehouseAreaSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP 库区信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateWarehouseArea(@Valid WarehouseAreaSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP 库区信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteWarehouseArea(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP 库区信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP 库区信息
|
||||
*/
|
||||
WarehouseAreaDO getWarehouseArea(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP 库区信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP 库区信息分页
|
||||
*/
|
||||
PageResult<WarehouseAreaDO> getWarehouseAreaPage(WarehouseAreaPageReqVO pageReqVO);
|
||||
|
||||
List<WarehouseAreaDO> getWarehouseListByStatus(Integer status);
|
||||
|
||||
List<WarehouseAreaDO> getWarehouseListByStatusAndWarehouseId(Integer status, Long warehouseId);
|
||||
}
|
||||
@ -1,100 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.service.warehousearea;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.autocode.util.AutoCodeUtil;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo.WarehouseAreaPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.warehousearea.vo.WarehouseAreaSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea.WarehouseAreaDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.warehousearea.WarehouseAreaMapper;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.warehouselocation.WarehouseLocationMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_AREA_CODE_EXISTS;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_AREA_DELETE_FAIL_EXISTS_LOCATION;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_AREA_NOT_EXISTS;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class WarehouseAreaServiceImpl implements WarehouseAreaService {
|
||||
|
||||
@Resource
|
||||
private WarehouseAreaMapper warehouseAreaMapper;
|
||||
|
||||
@Resource
|
||||
private WarehouseLocationMapper warehouseLocationMapper;
|
||||
|
||||
@Resource
|
||||
private AutoCodeUtil autoCodeUtil;
|
||||
|
||||
@Override
|
||||
public Long createWarehouseArea(WarehouseAreaSaveReqVO createReqVO) {
|
||||
WarehouseAreaDO warehouseArea = BeanUtils.toBean(createReqVO, WarehouseAreaDO.class);
|
||||
if (StringUtils.isEmpty(warehouseArea.getAreaCode())) {
|
||||
warehouseArea.setAreaCode(autoCodeUtil.genSerialCode("RESERVOIR_AREA_GENERATE", null));
|
||||
} else if (warehouseAreaMapper.selectByNo(warehouseArea.getAreaCode()) != null) {
|
||||
throw exception(WAREHOUSE_AREA_CODE_EXISTS);
|
||||
}
|
||||
warehouseAreaMapper.insert(warehouseArea);
|
||||
return warehouseArea.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWarehouseArea(WarehouseAreaSaveReqVO updateReqVO) {
|
||||
validateWarehouseAreaExists(updateReqVO.getId());
|
||||
warehouseAreaMapper.updateById(BeanUtils.toBean(updateReqVO, WarehouseAreaDO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteWarehouseArea(Long id) {
|
||||
validateWarehouseAreaExists(id);
|
||||
if (!warehouseLocationMapper.selectListByAreaId(id).isEmpty()) {
|
||||
throw exception(WAREHOUSE_AREA_DELETE_FAIL_EXISTS_LOCATION);
|
||||
}
|
||||
warehouseAreaMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateWarehouseAreaExists(Long id) {
|
||||
if (warehouseAreaMapper.selectById(id) == null) {
|
||||
throw exception(WAREHOUSE_AREA_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarehouseAreaDO getWarehouseArea(Long id) {
|
||||
return warehouseAreaMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WarehouseAreaDO> getWarehouseAreaPage(WarehouseAreaPageReqVO pageReqVO) {
|
||||
return warehouseAreaMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarehouseAreaDO> getWarehouseListByStatus(Integer status) {
|
||||
return warehouseAreaMapper.selectListByStatus(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarehouseAreaDO> getWarehouseListByStatusAndWarehouseId(Integer status, Long warehouseId) {
|
||||
List<WarehouseAreaDO> list = warehouseAreaMapper.selectListByStatus(status);
|
||||
if (warehouseId == null) {
|
||||
return list;
|
||||
}
|
||||
List<WarehouseAreaDO> result = new ArrayList<>();
|
||||
for (WarehouseAreaDO item : list) {
|
||||
if (warehouseId.equals(item.getWarehouseId())) {
|
||||
result.add(item);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.service.warehouselocation;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo.*;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouselocation.WarehouseLocationDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* ERP 库位信息 Service 接口
|
||||
*
|
||||
* @author 必硕智能
|
||||
*/
|
||||
public interface WarehouseLocationService {
|
||||
|
||||
/**
|
||||
* 创建ERP 库位信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createWarehouseLocation(@Valid WarehouseLocationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新ERP 库位信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateWarehouseLocation(@Valid WarehouseLocationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除ERP 库位信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteWarehouseLocation(Long id);
|
||||
|
||||
/**
|
||||
* 获得ERP 库位信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return ERP 库位信息
|
||||
*/
|
||||
WarehouseLocationDO getWarehouseLocation(Long id);
|
||||
|
||||
List<WarehouseLocationDO> getWarehouseLocationListByStatus(Integer status);
|
||||
|
||||
/**
|
||||
* 获得ERP 库位信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return ERP 库位信息分页
|
||||
*/
|
||||
PageResult<WarehouseLocationDO> getWarehouseLocationPage(WarehouseLocationPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -1,95 +0,0 @@
|
||||
package cn.iocoder.yudao.module.erp.service.warehouselocation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.autocode.util.AutoCodeUtil;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo.WarehouseLocationPageReqVO;
|
||||
import cn.iocoder.yudao.module.erp.controller.admin.warehouselocation.vo.WarehouseLocationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.warehousearea.WarehouseAreaDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.warehouselocation.WarehouseLocationDO;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.warehousearea.WarehouseAreaMapper;
|
||||
import cn.iocoder.yudao.module.erp.dal.mysql.warehouselocation.WarehouseLocationMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_AREA_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_LOCATION_CODE_EXISTS;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_LOCATION_NOT_EXISTS;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.WAREHOUSE_LOCATION_WAREHOUSE_AREA_NOT_MATCH;
|
||||
|
||||
@Service
|
||||
@Validated
|
||||
public class WarehouseLocationServiceImpl implements WarehouseLocationService {
|
||||
|
||||
@Resource
|
||||
private WarehouseLocationMapper warehouseLocationMapper;
|
||||
|
||||
@Resource
|
||||
private WarehouseAreaMapper warehouseAreaMapper;
|
||||
|
||||
@Resource
|
||||
private AutoCodeUtil autoCodeUtil;
|
||||
|
||||
@Override
|
||||
public Long createWarehouseLocation(WarehouseLocationSaveReqVO createReqVO) {
|
||||
validateWarehouseAreaMatch(createReqVO.getWarehouseId(), createReqVO.getAreaId());
|
||||
WarehouseLocationDO warehouseLocation = BeanUtils.toBean(createReqVO, WarehouseLocationDO.class);
|
||||
if (StringUtils.isEmpty(warehouseLocation.getCode())) {
|
||||
warehouseLocation.setCode(autoCodeUtil.genSerialCode("RESERVOIR_AREA_GENERATE", null));
|
||||
} else if (warehouseLocationMapper.selectByNo(warehouseLocation.getCode()) != null) {
|
||||
throw exception(WAREHOUSE_LOCATION_CODE_EXISTS);
|
||||
}
|
||||
warehouseLocationMapper.insert(warehouseLocation);
|
||||
return warehouseLocation.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateWarehouseLocation(WarehouseLocationSaveReqVO updateReqVO) {
|
||||
validateWarehouseLocationExists(updateReqVO.getId());
|
||||
validateWarehouseAreaMatch(updateReqVO.getWarehouseId(), updateReqVO.getAreaId());
|
||||
warehouseLocationMapper.updateById(BeanUtils.toBean(updateReqVO, WarehouseLocationDO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteWarehouseLocation(Long id) {
|
||||
validateWarehouseLocationExists(id);
|
||||
warehouseLocationMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateWarehouseLocationExists(Long id) {
|
||||
if (warehouseLocationMapper.selectById(id) == null) {
|
||||
throw exception(WAREHOUSE_LOCATION_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateWarehouseAreaMatch(Long warehouseId, Long areaId) {
|
||||
WarehouseAreaDO area = warehouseAreaMapper.selectById(areaId);
|
||||
if (area == null) {
|
||||
throw exception(WAREHOUSE_AREA_NOT_EXISTS);
|
||||
}
|
||||
if (warehouseId == null || !warehouseId.equals(area.getWarehouseId())) {
|
||||
throw exception(WAREHOUSE_LOCATION_WAREHOUSE_AREA_NOT_MATCH);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarehouseLocationDO getWarehouseLocation(Long id) {
|
||||
return warehouseLocationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WarehouseLocationDO> getWarehouseLocationListByStatus(Integer status) {
|
||||
return warehouseLocationMapper.selectListByStatus(status);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<WarehouseLocationDO> getWarehouseLocationPage(WarehouseLocationPageReqVO pageReqVO) {
|
||||
return warehouseLocationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,38 +1,32 @@
|
||||
package cn.iocoder.yudao.module.iot.controller.admin.deviceoperationrecord.vo;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Schema(description = "管理后台 - 设备运行统计请求 VO")
|
||||
@Schema(description = "管理后台 - 运行记录分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeviceTotalTimeRecordReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "快捷时间范围,支持 LAST_WEEK、THIS_WEEK、LAST_7_DAYS、LAST_MONTH、THIS_MONTH")
|
||||
private String period;
|
||||
public class DeviceTotalTimeRecordReqVO extends PageParam{
|
||||
|
||||
@Schema(description = "设备编码,模糊匹配")
|
||||
@Schema(description = "设备编码")
|
||||
private String deviceCode;
|
||||
|
||||
@Schema(description = "设备名称,模糊匹配")
|
||||
@Schema(description = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "统计开始时间,格式 yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@Schema(description = "统计结束时间,格式 yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
@Schema(description = "设备 ID 集合,使用英文逗号分隔,例如 1,2,3")
|
||||
@Schema(description = "ids导出集合用")
|
||||
private String ids;
|
||||
|
||||
@Schema(description = "时间轴页码,默认 1")
|
||||
private Integer timelinePageNo;
|
||||
|
||||
@Schema(description = "时间轴每页条数,默认 10")
|
||||
private Integer timelinePageSize;
|
||||
}
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.deviceledger.vo;
|
||||
|
||||
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;
|
||||
|
||||
@Schema(description = "管理后台 - 设备产能报表 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceCapacityReportRespVO {
|
||||
|
||||
@Schema(description = "设备 id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "设备编码")
|
||||
@ExcelProperty("编码")
|
||||
private String deviceCode;
|
||||
|
||||
@Schema(description = "设备名称")
|
||||
@ExcelProperty("名称")
|
||||
private String deviceName;
|
||||
|
||||
@Schema(description = "设备类型名称")
|
||||
@ExcelProperty("类型")
|
||||
private String typeName;
|
||||
|
||||
@Schema(description = "设备状态")
|
||||
// @ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
// @DictFormat("mes_tz_status")
|
||||
private Integer deviceStatus;
|
||||
|
||||
@Schema(description = "额定产能(计划产能)")
|
||||
@ExcelProperty("额定产能(计划产能)")
|
||||
private BigDecimal ratedCapacity;
|
||||
|
||||
@Schema(description = "报工产能")
|
||||
@ExcelProperty("报工产能")
|
||||
private BigDecimal reportCapacity;
|
||||
|
||||
@Schema(description = "实际产能")
|
||||
@ExcelProperty("实际产能")
|
||||
private BigDecimal actualCapacity;
|
||||
|
||||
@Schema(description = "所属车间")
|
||||
@ExcelProperty("所属车间")
|
||||
private String workshopName;
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.energydevice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 能源总览 Request VO")
|
||||
@Data
|
||||
public class EnergyOverviewReqVO {
|
||||
|
||||
@Schema(description = "所属区域")
|
||||
private Long orgId;
|
||||
|
||||
@Schema(description = "能源类型 ID")
|
||||
private Long energyTypeId;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@Schema(description = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
@Schema(description = "页码", example = "1")
|
||||
private Integer pageNo = 1;
|
||||
|
||||
@Schema(description = "每页数量", example = "10")
|
||||
private Integer pageSize = 10;
|
||||
}
|
||||
@ -1,81 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.energydevice.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 能源总览 Response VO")
|
||||
@Data
|
||||
public class EnergyOverviewRespVO {
|
||||
|
||||
@Schema(description = "指标卡片")
|
||||
private List<MetricItem> metrics;
|
||||
|
||||
@Schema(description = "趋势图")
|
||||
private TrendChart trendChart;
|
||||
|
||||
@Schema(description = "区域占比")
|
||||
private RegionChart regionChart;
|
||||
|
||||
@Schema(description = "TOP5 排行")
|
||||
private List<RankItem> rankList;
|
||||
|
||||
@Schema(description = "明细列表总数")
|
||||
private Long total;
|
||||
|
||||
@Schema(description = "明细列表")
|
||||
private List<DetailItem> detailList;
|
||||
|
||||
@Data
|
||||
public static class MetricItem {
|
||||
private String key;
|
||||
private String label;
|
||||
private String value;
|
||||
private String unit;
|
||||
private String subLabel;
|
||||
private String subValue;
|
||||
private String change;
|
||||
private Boolean down;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class TrendChart {
|
||||
private String unit;
|
||||
private List<String> xAxis;
|
||||
private List<String> data;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RegionChart {
|
||||
private String unit;
|
||||
private String totalValue;
|
||||
private List<RegionItem> items;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RegionItem {
|
||||
private String name;
|
||||
private String value;
|
||||
private String percent;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class RankItem {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String region;
|
||||
private String value;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class DetailItem {
|
||||
private Long id;
|
||||
private String name;
|
||||
private String energyType;
|
||||
private String region;
|
||||
private String value;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
}
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.plan.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
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 = "管理后台 - 生产计划按产品分组产能分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class PlanProductCapacityPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "设备台账 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long deviceId;
|
||||
|
||||
@Schema(description = "产品编码")
|
||||
private String productCode;
|
||||
|
||||
@Schema(description = "产品名称")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "任务编码")
|
||||
private String taskCode;
|
||||
|
||||
@Schema(description = "报工开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime beginBaogongTime;
|
||||
|
||||
@Schema(description = "报工结束时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime endBaogongTime;
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.plan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "管理后台 - 生产计划按产品分组产能分页 Response VO")
|
||||
@Data
|
||||
public class PlanProductCapacityRespVO {
|
||||
|
||||
@Schema(description = "产品编码")
|
||||
private String productCode;
|
||||
|
||||
@Schema(description = "产品名称")
|
||||
private String productName;
|
||||
|
||||
// @Schema(description = "任务编码")
|
||||
// private String taskCode;
|
||||
|
||||
@Schema(description = "报工总数")
|
||||
private Long baogongTotal;
|
||||
|
||||
@Schema(description = "报工均值产能,按近半年到昨天的统计天数计算,四舍五入")
|
||||
private Integer avgCapacity;
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.plan.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Schema(description = "管理后台 - 生产计划质量概况 Response VO")
|
||||
public class PlanQualityOverviewRespVO {
|
||||
|
||||
@Schema(description = "报工总数")
|
||||
private Long totalWangongNumber;
|
||||
|
||||
@Schema(description = "合格总数")
|
||||
private Long totalPassNumber;
|
||||
|
||||
@Schema(description = "不合格总数")
|
||||
private Long totalNoPassNumber;
|
||||
|
||||
@Schema(description = "总合格率")
|
||||
private BigDecimal totalPassRate;
|
||||
|
||||
@Schema(description = "按产品合格率排行")
|
||||
private List<ProductPassRateItem> productPassRateList;
|
||||
|
||||
@Schema(description = "双折线图数据")
|
||||
private List<TrendItem> trendList;
|
||||
|
||||
@Data
|
||||
@Schema(description = "产品合格率项")
|
||||
public static class ProductPassRateItem {
|
||||
|
||||
@Schema(description = "产品ID")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "产品名称")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "报工总数")
|
||||
private Long wangongNumber;
|
||||
|
||||
@Schema(description = "合格数")
|
||||
private Long passNumber;
|
||||
|
||||
@Schema(description = "不合格数")
|
||||
private Long noPassNumber;
|
||||
|
||||
@Schema(description = "合格率")
|
||||
private BigDecimal passRate;
|
||||
}
|
||||
|
||||
@Data
|
||||
@Schema(description = "趋势项")
|
||||
public static class TrendItem {
|
||||
|
||||
@Schema(description = "日期")
|
||||
private String day;
|
||||
|
||||
@Schema(description = "合格数")
|
||||
private Long passNumber;
|
||||
|
||||
@Schema(description = "不合格数")
|
||||
private Long noPassNumber;
|
||||
}
|
||||
}
|
||||
@ -1,96 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.printtemplate;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.printtemplate.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.printtemplate.PrintTemplateDO;
|
||||
import cn.iocoder.yudao.module.mes.service.printtemplate.PrintTemplateService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
|
||||
@Tag(name = "管理后台 - 打印模板")
|
||||
@RestController
|
||||
@RequestMapping("/mes/print-template")
|
||||
@Validated
|
||||
public class PrintTemplateController {
|
||||
|
||||
@Resource
|
||||
private PrintTemplateService printTemplateService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建打印模板")
|
||||
@PreAuthorize("@ss.hasPermission('mes:print-template:create')")
|
||||
public CommonResult<Long> createPrintTemplate(@Valid @RequestBody PrintTemplateSaveReqVO createReqVO) {
|
||||
return success(printTemplateService.createPrintTemplate(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新打印模板")
|
||||
@PreAuthorize("@ss.hasPermission('mes:print-template:update')")
|
||||
public CommonResult<Boolean> updatePrintTemplate(@Valid @RequestBody PrintTemplateSaveReqVO updateReqVO) {
|
||||
printTemplateService.updatePrintTemplate(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除打印模板")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:print-template:delete')")
|
||||
public CommonResult<Boolean> deletePrintTemplate(@RequestParam("id") Long id) {
|
||||
printTemplateService.deletePrintTemplate(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得打印模板")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:print-template:query')")
|
||||
public CommonResult<PrintTemplateRespVO> getPrintTemplate(@RequestParam("id") Long id) {
|
||||
PrintTemplateDO printTemplate = printTemplateService.getPrintTemplate(id);
|
||||
return success(BeanUtils.toBean(printTemplate, PrintTemplateRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得打印模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:print-template:query')")
|
||||
public CommonResult<PageResult<PrintTemplateRespVO>> getPrintTemplatePage(@Valid PrintTemplatePageReqVO pageReqVO) {
|
||||
PageResult<PrintTemplateDO> pageResult = printTemplateService.getPrintTemplatePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PrintTemplateRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出打印模板 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:print-template:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportPrintTemplateExcel(@Valid PrintTemplatePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<PrintTemplateDO> list = printTemplateService.getPrintTemplatePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "打印模板.xls", "数据", PrintTemplateRespVO.class,
|
||||
BeanUtils.toBean(list, PrintTemplateRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.printtemplate.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum PrintTemplateTypeEnum {
|
||||
|
||||
MATERIAL_PRODUCT(1),
|
||||
EQUIPMENT_LEDGER(2),
|
||||
KEY_COMPONENT(3),
|
||||
MOLD(4),
|
||||
SPARE_PARTS(5);
|
||||
|
||||
private final Integer value;
|
||||
|
||||
public static PrintTemplateTypeEnum fromValue(int value) {
|
||||
for (PrintTemplateTypeEnum type : PrintTemplateTypeEnum.values()) {
|
||||
if (type.getValue() == value) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown value: " + value);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,30 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.task.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
|
||||
import cn.iocoder.yudao.module.iot.dal.dataobject.device.DeviceDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.deviceledger.DeviceLedgerDO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class CapacityContext {
|
||||
private List<LocalDate> statDays = new ArrayList<>();
|
||||
private Integer statDayCount = 0;
|
||||
private Map<Long, Integer> productDailyAverageMap = new HashMap<>();
|
||||
private Map<Long, Integer> deviceCollectionAverageMap = new HashMap<>();
|
||||
private Map<Long, ErpProductDO> productCache = new HashMap<>();
|
||||
private Map<Long, DeviceDO> deviceCache = new HashMap<>();
|
||||
|
||||
public Integer getProductDailyAverageCapacity(Long productId) {
|
||||
return productDailyAverageMap.get(productId);
|
||||
}
|
||||
|
||||
public Integer getDeviceCollectionAverageCapacity(Long deviceId) {
|
||||
return deviceCollectionAverageMap.get(deviceId);
|
||||
}
|
||||
}
|
||||
@ -1,40 +0,0 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.printtemplate;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.printtemplate.PrintTemplateDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.printtemplate.vo.*;
|
||||
|
||||
/**
|
||||
* 打印模板 Mapper
|
||||
*
|
||||
* @author 必硕智能
|
||||
*/
|
||||
@Mapper
|
||||
public interface PrintTemplateMapper extends BaseMapperX<PrintTemplateDO> {
|
||||
|
||||
default PrintTemplateDO selectByNo(String no) {
|
||||
return selectOne(PrintTemplateDO::getTemplateCode, no);
|
||||
}
|
||||
|
||||
default PrintTemplateDO selectByTemplateType(Integer templateType) {
|
||||
return selectOne(PrintTemplateDO::getTemplateType, templateType);
|
||||
}
|
||||
|
||||
default PageResult<PrintTemplateDO> selectPage(PrintTemplatePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PrintTemplateDO>()
|
||||
.eqIfPresent(PrintTemplateDO::getTemplateCode, reqVO.getTemplateCode())
|
||||
.likeIfPresent(PrintTemplateDO::getTemplateName, reqVO.getTemplateName())
|
||||
.eqIfPresent(PrintTemplateDO::getTemplateType, reqVO.getTemplateType())
|
||||
.eqIfPresent(PrintTemplateDO::getTemplateJson, reqVO.getTemplateJson())
|
||||
.eqIfPresent(PrintTemplateDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(PrintTemplateDO::getIsEnable, reqVO.getIsEnable())
|
||||
.betweenIfPresent(PrintTemplateDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PrintTemplateDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue