fix:修改了模具详情的点检保养维修履历界面
parent
108c207b3d
commit
a112373b17
@ -0,0 +1,206 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.mold;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.mold.MesMoldBrandDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.mold.MesMoldBrandProductDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.mold.MesMoldDO;
|
||||
import cn.iocoder.yudao.module.mes.service.mold.MoldBrandService;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 模具型号")
|
||||
@RestController("mesMoldBrandController")
|
||||
@RequestMapping("/mes/mold-brand")
|
||||
@Validated
|
||||
public class MoldBrandController {
|
||||
|
||||
@Resource
|
||||
private MoldBrandService moldBrandService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模具型号")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:create')")
|
||||
public CommonResult<Long> createMoldBrand(@Valid @RequestBody MoldBrandSaveReqVO createReqVO) {
|
||||
return success(moldBrandService.createMoldBrand(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模具型号")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:update')")
|
||||
public CommonResult<Boolean> updateMoldBrand(@Valid @RequestBody MoldBrandSaveReqVO updateReqVO) {
|
||||
moldBrandService.updateMoldBrand(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模具型号")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:delete')")
|
||||
public CommonResult<Boolean> deleteMoldBrand(@RequestParam("id") Long id) {
|
||||
moldBrandService.deleteMoldBrand(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模具型号")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:query')")
|
||||
public CommonResult<MoldBrandRespVO> getMoldBrand(@RequestParam("id") Long id) {
|
||||
MesMoldBrandDO moldBrand = moldBrandService.getMoldBrand(id);
|
||||
return success(BeanUtils.toBean(moldBrand, MoldBrandRespVO.class));
|
||||
}
|
||||
@GetMapping("/getBrandList")
|
||||
@Operation(summary = "获得模具型号列表")
|
||||
public CommonResult<List<MesMoldBrandDO>> getBrandList(MoldBrandPageReqVO pageReqVO) {
|
||||
List<MesMoldBrandDO> brandDOList = moldBrandService.selectBy(pageReqVO);
|
||||
return success(brandDOList);
|
||||
}
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模具型号分页")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:query')")
|
||||
public CommonResult<PageResult<MoldBrandRespVO>> getMoldBrandPage(@Valid MoldBrandPageReqVO pageReqVO) {
|
||||
PageResult<MoldBrandRespVO> pageResult = moldBrandService.getMoldBrandPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模具型号 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMoldBrandExcel(@Valid MoldBrandPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MoldBrandRespVO> list = moldBrandService.getMoldBrandPage(pageReqVO).getList();
|
||||
List<MoldBrandRespVO> moldBrandRespVOS = BeanUtils.toBean(list, MoldBrandRespVO.class);
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模具型号.xls", "数据", MoldBrandRespVO.class, moldBrandRespVOS);
|
||||
}
|
||||
|
||||
// ==================== 子表(模具) ====================
|
||||
@GetMapping("/getMoldList")
|
||||
@Operation(summary = "获得模具型号")
|
||||
public CommonResult<List<MesMoldDO>> getMoldList(MesMoldDO moldDO) {
|
||||
List<MesMoldDO> doList = moldBrandService.selectBy(moldDO);
|
||||
return success(doList);
|
||||
}
|
||||
|
||||
@GetMapping("/getMoldAllList")
|
||||
@Operation(summary = "获得模具型号")
|
||||
public CommonResult<List<MesMoldDO>> getMoldAllList() {
|
||||
List<MesMoldDO> doList = moldBrandService.getAllList();
|
||||
return success(doList);
|
||||
}
|
||||
|
||||
@GetMapping("/mold/page")
|
||||
@Operation(summary = "获得模具分页")
|
||||
@Parameter(name = "brandId", description = "型号id")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:query')")
|
||||
public CommonResult<PageResult<MoldRespVO>> getMoldPage(PageParam pageReqVO, @RequestParam(value = "brandId", required = false) Long brandId) {
|
||||
return success(moldBrandService.getMoldPage(pageReqVO, brandId));
|
||||
}
|
||||
|
||||
@GetMapping("/mold/list")
|
||||
@Operation(summary = "获得模具列表")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:query')")
|
||||
public CommonResult<List<MesMoldDO>> getMoldList() {
|
||||
List<MesMoldDO> moldDOList = moldBrandService.getMoldList();
|
||||
return success(moldDOList);
|
||||
}
|
||||
|
||||
@PostMapping("/mold/create")
|
||||
@Operation(summary = "创建模具")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:create')")
|
||||
public CommonResult<Long> createMold(@Valid @RequestBody MesMoldDO mold) {
|
||||
return success(moldBrandService.createMold(mold));
|
||||
}
|
||||
|
||||
@PutMapping("/mold/update")
|
||||
@Operation(summary = "更新模具")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:update')")
|
||||
public CommonResult<Boolean> updateMold(@Valid @RequestBody MesMoldDO mold) {
|
||||
moldBrandService.updateMold(mold);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/mold/delete")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Operation(summary = "删除模具")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:delete')")
|
||||
public CommonResult<Boolean> deleteMold(@RequestParam("id") Long id) {
|
||||
moldBrandService.deleteMold(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/mold/get")
|
||||
@Operation(summary = "获得模具")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:query')")
|
||||
public CommonResult<MesMoldDO> getMold(@RequestParam("id") Long id) {
|
||||
return success(moldBrandService.getMold(id));
|
||||
}
|
||||
|
||||
// ==================== 子表(模具产品) ====================
|
||||
|
||||
@GetMapping("/mold-brand-product/page")
|
||||
@Operation(summary = "获得模具产品分页")
|
||||
@Parameter(name = "brandId", description = "型号ID")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:query')")
|
||||
public CommonResult<PageResult<MoldProductRespVO>> getMoldBrandProductPage(PageParam pageReqVO,
|
||||
@RequestParam("brandId") Long brandId) {
|
||||
PageResult<MesMoldBrandProductDO> pageResult = moldBrandService.getMoldBrandProductPage(pageReqVO, brandId);
|
||||
PageResult<MoldProductRespVO> result = new PageResult<>(moldBrandService.buildProduct(pageResult.getList()),pageResult.getTotal());
|
||||
return success(result);
|
||||
}
|
||||
|
||||
@PostMapping("/mold-brand-product/create")
|
||||
@Operation(summary = "创建模具产品")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:create')")
|
||||
public CommonResult<Long> createMoldBrandProduct(@Valid @RequestBody MesMoldBrandProductDO moldBrandProduct) {
|
||||
return success(moldBrandService.createMoldBrandProduct(moldBrandProduct));
|
||||
}
|
||||
|
||||
@PutMapping("/mold-brand-product/update")
|
||||
@Operation(summary = "更新模具产品")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:update')")
|
||||
public CommonResult<Boolean> updateMoldBrandProduct(@Valid @RequestBody MesMoldBrandProductDO moldBrandProduct) {
|
||||
moldBrandService.updateMoldBrandProduct(moldBrandProduct);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/mold-brand-product/delete")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Operation(summary = "删除模具产品")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:delete')")
|
||||
public CommonResult<Boolean> deleteMoldBrandProduct(@RequestParam("id") Long id) {
|
||||
moldBrandService.deleteMoldBrandProduct(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/mold-brand-product/get")
|
||||
@Operation(summary = "获得模具产品")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold-brand:query')")
|
||||
public CommonResult<MesMoldBrandProductDO> getMoldBrandProduct(@RequestParam("id") Long id) {
|
||||
return success(moldBrandService.getMoldBrandProduct(id));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,94 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.mold;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.mold.MesMoldDO;
|
||||
import cn.iocoder.yudao.module.mes.service.mold.MoldService;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.MoldPageReqVO;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.MoldRespVO;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.MoldSaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 模具")
|
||||
@RestController("mesMoldController")
|
||||
@RequestMapping("/mes/mold")
|
||||
@Validated
|
||||
public class MoldController {
|
||||
|
||||
@Resource
|
||||
private MoldService moldService;
|
||||
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模具")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold:create')")
|
||||
public CommonResult<Long> createMold(@Valid @RequestBody MoldSaveReqVO createReqVO) {
|
||||
return success(moldService.createMold(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模具")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold:update')")
|
||||
public CommonResult<Boolean> updateMold(@Valid @RequestBody MoldSaveReqVO updateReqVO) {
|
||||
moldService.updateMold(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模具")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold:delete')")
|
||||
public CommonResult<Boolean> deleteMold(@RequestParam("id") Long id) {
|
||||
moldService.deleteMold(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得模具")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold:query')")
|
||||
public CommonResult<MoldRespVO> getMold(@RequestParam("id") Long id) {
|
||||
MesMoldDO mold = moldService.getMold(id);
|
||||
return success(BeanUtils.toBean(mold, MoldRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模具分页")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold:query')")
|
||||
public CommonResult<PageResult<MoldRespVO>> getMoldPage(@Valid MoldPageReqVO pageReqVO) {
|
||||
PageResult<MesMoldDO> pageResult = moldService.getMoldPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MoldRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出模具 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('erp:mold:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportMoldExcel(@Valid MoldPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MesMoldDO> list = moldService.getMoldPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "模具.xls", "数据", MoldRespVO.class,
|
||||
BeanUtils.toBean(list, MoldRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.mold.enums;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OrgTypeStatusEnum {
|
||||
zhijiang("zhijiang", "制浆"),
|
||||
duidie("duidie", "堆叠"),
|
||||
chengxing("chengxing", "成型"),
|
||||
honggan("honggan", "烘干"),
|
||||
zhuanyi("zhuanyi", "转移"),
|
||||
jiashi("jiashi", "加湿"),
|
||||
reya("reya", "热压"),
|
||||
qiebian("qiebian", "切边"),
|
||||
pinjian("pinjian", "品检"),
|
||||
dabao("dabao", "打包"),
|
||||
tiebiao("tiebiao", "贴标"),
|
||||
sufeng("sufeng", "塑封"),
|
||||
pinyin("pinyin", "品印");
|
||||
|
||||
private final String orgtype;
|
||||
private final String description;
|
||||
|
||||
public static OrgTypeStatusEnum getByCode(String code) {
|
||||
for (OrgTypeStatusEnum status : values()) {
|
||||
if (status.getOrgtype().equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.mold.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.math.BigDecimal;
|
||||
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)
|
||||
@ToString(callSuper = true)
|
||||
public class MoldBrandPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "型号编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "型号名称", example = "王五")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "规格", example = "2")
|
||||
private String moldType;
|
||||
|
||||
@Schema(description = "产品ID", example = "2336")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "预期寿命(小时)")
|
||||
private BigDecimal useTime;
|
||||
|
||||
@Schema(description = "维保模式", example = "2")
|
||||
private Integer maintainType;
|
||||
|
||||
@Schema(description = "维保周期")
|
||||
private BigDecimal maintainTime;
|
||||
|
||||
@Schema(description = "模具系数")
|
||||
private Long moldSize;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "工序", example = "你说的对")
|
||||
private String orgType;
|
||||
|
||||
@Schema(description = "id集合导出用")
|
||||
private String ids;
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.mold.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 com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 模具型号 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MoldBrandRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24140")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "型号编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("型号编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "型号名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("型号名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("规格")
|
||||
private String moldType;
|
||||
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2336")
|
||||
private Long productId;
|
||||
@Schema(description = "产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "2336")
|
||||
// @ExcelProperty("产品")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "预期寿命/次")
|
||||
@ExcelProperty("预期寿命/次")
|
||||
private BigDecimal useTime;
|
||||
|
||||
@Schema(description = "维保模式", example = "2")
|
||||
// @ExcelProperty(value = "维保模式", converter = DictConvert.class)
|
||||
@DictFormat("maintain_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer maintainType;
|
||||
|
||||
@Schema(description = "维保周期")
|
||||
// @ExcelProperty("维保周期")
|
||||
private BigDecimal maintainTime;
|
||||
|
||||
@Schema(description = "模穴数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模穴数")
|
||||
private Long moldSize;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @ExcelProperty("是否启用")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
@ColumnWidth(20)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "工序", example = "reya")
|
||||
@ExcelProperty(value = "工序", converter = DictConvert.class)
|
||||
@DictFormat("mes_org_type")
|
||||
private String orgType;
|
||||
// , converter = OrgTypeConverter.class
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.mold.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 = "管理后台 - 模具型号新增/修改 Request VO")
|
||||
@Data
|
||||
public class MoldBrandSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24140")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "型号编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "型号编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "型号名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "型号名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "规格", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "规格不能为空")
|
||||
private String moldType;
|
||||
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2336")
|
||||
// @NotNull(message = "产品ID不能为空")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "预期寿命(小时)")
|
||||
private BigDecimal useTime;
|
||||
|
||||
@Schema(description = "维保模式", example = "2")
|
||||
private Integer maintainType;
|
||||
|
||||
@Schema(description = "维保周期")
|
||||
private BigDecimal maintainTime;
|
||||
|
||||
@Schema(description = "模穴数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "模穴数不能为空")
|
||||
private Long moldSize;
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启用不能为空")
|
||||
private Boolean isEnable;
|
||||
@Schema(description = "工序", example = "你说的对")
|
||||
private String orgType;
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.mold.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.math.BigDecimal;
|
||||
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)
|
||||
@ToString(callSuper = true)
|
||||
public class MoldPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "模具编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模具名称", example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位ID", example = "19527")
|
||||
private Long unitId;
|
||||
|
||||
@Schema(description = "设备ID", example = "24428")
|
||||
private Long machineId;
|
||||
|
||||
@Schema(description = "设备名称", example = "24428")
|
||||
private String machineName;
|
||||
|
||||
@Schema(description = "使用次数/次")
|
||||
private BigDecimal useTime;
|
||||
|
||||
@Schema(description = "入库时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] inTime;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "模具图片")
|
||||
private String images;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否启用")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "型号id", example = "15258")
|
||||
private Long brandId;
|
||||
|
||||
@Schema(description = "id集合导出用")
|
||||
private String ids;
|
||||
|
||||
|
||||
@Schema(description = "附件地址")
|
||||
private String fileUrl;
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.mold.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.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 模具 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MoldProductRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32278")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2336")
|
||||
private Long productId;
|
||||
@Schema(description = "产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "2336")
|
||||
@ExcelProperty("产品")
|
||||
private String productName;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "型号id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15258")
|
||||
@ExcelProperty("型号id")
|
||||
private Long brandId;
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.mold.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 org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
|
||||
@Schema(description = "管理后台 - 模具 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MoldRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32278")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "模具编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("模具编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@ExcelProperty("模具名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19527")
|
||||
private Long unitId;
|
||||
@Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED, example = "个")
|
||||
// @ExcelProperty("单位")
|
||||
private String unitName;
|
||||
|
||||
@Schema(description = "设备ID", example = "24428")
|
||||
private Long machineId;
|
||||
|
||||
@Schema(description = "设备名称", example = "24428")
|
||||
@ExcelProperty("使用设备")
|
||||
private String machineName;
|
||||
|
||||
@Schema(description = "使用次数/次")
|
||||
@ExcelProperty("使用次数/次")
|
||||
private BigDecimal useTime;
|
||||
|
||||
@Schema(description = "入库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("入库时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDateTime inTime;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat("erp_mold_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "模具图片")
|
||||
// @ExcelProperty("模具图片")
|
||||
private String images;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @ExcelProperty("是否启用")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "型号id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15258")
|
||||
private Long brandId;
|
||||
|
||||
@Schema(description = "型号", requiredMode = Schema.RequiredMode.REQUIRED, example = "15258")
|
||||
@ExcelProperty("型号")
|
||||
private String brandName;
|
||||
|
||||
@Schema(description = "附件地址")
|
||||
@ExcelProperty("附件地址")
|
||||
private String fileUrl;
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.mold.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;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 模具新增/修改 Request VO")
|
||||
@Data
|
||||
public class MoldSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32278")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "模具编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "模具编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模具名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@NotEmpty(message = "模具名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "单位ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "19527")
|
||||
// @NotNull(message = "单位ID不能为空")
|
||||
private Long unitId;
|
||||
|
||||
@Schema(description = "机台ID", example = "24428")
|
||||
private Long machineId;
|
||||
|
||||
@Schema(description = "使用次数/次")
|
||||
private BigDecimal useTime;
|
||||
|
||||
@Schema(description = "入库时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "入库时间不能为空")
|
||||
private LocalDateTime inTime;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "模具图片")
|
||||
private String images;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @NotNull(message = "是否启用不能为空")
|
||||
private Boolean isEnable;
|
||||
|
||||
@Schema(description = "型号id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15258")
|
||||
// @NotNull(message = "型号id不能为空")
|
||||
private Long brandId;
|
||||
|
||||
@Schema(description = "附件地址")
|
||||
private String fileUrl;
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldrepair.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 维修结果状态枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum RepairResultEnum {
|
||||
PENDING(0, "待维修"),
|
||||
PASS(1, "OK"),
|
||||
FAIL(2, "NG");
|
||||
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
||||
public Integer getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public static String getDescByCode(Integer code) {
|
||||
if (code == null) {
|
||||
return "";
|
||||
}
|
||||
for (RepairResultEnum value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value.desc;
|
||||
}
|
||||
}
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldrepair.vo;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 模具维修记录 Resp VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MoldRepairLineRespVO {
|
||||
|
||||
@Schema(description = "项目行Id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "维修单编号")
|
||||
@ExcelProperty("维修单编号")
|
||||
private String repairCode;
|
||||
|
||||
@Schema(description = "维修单名称")
|
||||
@ExcelProperty("维修单名称")
|
||||
private String repairName;
|
||||
|
||||
@Schema(description = "维修完成日期")
|
||||
@ExcelProperty("维修完成日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime finishDate;
|
||||
|
||||
@Schema(description = "项目编码")
|
||||
@ExcelProperty("项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
@ExcelProperty("项目名称")
|
||||
private String subjectName;
|
||||
|
||||
@Schema(description = "项目内容")
|
||||
@ExcelProperty("项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "维修结果 0-待维修 1-通过 2-不通过")
|
||||
private Integer result;
|
||||
|
||||
@Schema(description = "维修结果")
|
||||
@ExcelProperty("维修结果")
|
||||
private String repairResult;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldrepair.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 模具维修记录子表/修改 Request VO")
|
||||
@Data
|
||||
public class MoldRepairLineSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27809")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "维修单ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long repairId;
|
||||
|
||||
@Schema(description = "项目ID")
|
||||
private Long subjectId;
|
||||
|
||||
@Schema(description = "项目编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "6979")
|
||||
private String subjectCode;
|
||||
|
||||
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String subjectName;
|
||||
|
||||
@Schema(description = "项目类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
private String subjectType;
|
||||
|
||||
@Schema(description = "项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
@Schema(description = "标准")
|
||||
private String subjectStandard;
|
||||
|
||||
@Schema(description = "故障描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "1622")
|
||||
private String malfunction;
|
||||
|
||||
@Schema(description = "故障描述资源")
|
||||
private String malfunctionUrl;
|
||||
|
||||
@Schema(description = "维修情况")
|
||||
private String repairDes;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
@Schema(description = "维修结果 0-待维修 1-通过 2-不通过")
|
||||
private Integer result;
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldrepair.vo;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 设备维修更新子记录 Req VO")
|
||||
@Data
|
||||
public class MoldRepairUpdateReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27809")
|
||||
@NotNull
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "报修日期")
|
||||
@NotNull(message = "报修日期不能为空")
|
||||
private LocalDateTime requireDate;
|
||||
|
||||
@Schema(description = "完成日期")
|
||||
@NotNull(message = "完成日期不能为空")
|
||||
private LocalDateTime finishDate;
|
||||
|
||||
@Schema(description = "验收日期")
|
||||
@NotNull(message = "验收日期不能为空")
|
||||
private LocalDateTime confirmDate;
|
||||
|
||||
@Schema(description = "维修结果")
|
||||
@NotBlank(message = "维修结果不能为空")
|
||||
private String repairResult;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "子列表")
|
||||
@NotNull(message = "子列表不能为空")
|
||||
private List<MoldRepairLineSaveReqVO> updateReqVOList;
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.moldticketresults.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MoldTicketInspectionExportVO {
|
||||
|
||||
// @ExcelProperty("设备编号")
|
||||
// private String deviceCode;
|
||||
//
|
||||
// @ExcelProperty("设备名称")
|
||||
// private String deviceName;
|
||||
|
||||
@ExcelProperty("检验项名称")
|
||||
private String inspectionItemName;
|
||||
|
||||
@ExcelProperty("检验方式")
|
||||
private String inspectionMethod;
|
||||
|
||||
@ExcelProperty("判定基准")
|
||||
private String judgmentCriteria;
|
||||
|
||||
@ExcelProperty("点检时间")
|
||||
@ColumnWidth(20)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
private LocalDateTime taskTime;
|
||||
|
||||
@ExcelProperty("作业结果")
|
||||
private String result;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
private Integer inspectionResult;
|
||||
|
||||
@ExcelProperty("作业人")
|
||||
private String operator;
|
||||
|
||||
@ExcelProperty("创建时间")
|
||||
@ColumnWidth(20)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.mold;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 模具型号 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("erp_mold_brand")
|
||||
@KeySequence("erp_mold_brand_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MesMoldBrandDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 型号编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 型号名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String moldType;
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 预期寿命(小时)
|
||||
*/
|
||||
private BigDecimal useTime;
|
||||
/**
|
||||
* 维保模式
|
||||
*
|
||||
* 枚举 {@link TODO maintain_type 对应的类}
|
||||
*/
|
||||
private Integer maintainType;
|
||||
/**
|
||||
* 维保周期
|
||||
*/
|
||||
private BigDecimal maintainTime;
|
||||
/**
|
||||
* 模具系数
|
||||
*/
|
||||
private Long moldSize;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean isEnable;
|
||||
|
||||
// @Schema(description = "工序", example = "你说的对")
|
||||
private String orgType;
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.mold;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 模具产品 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("erp_mold_brand_product")
|
||||
@KeySequence("erp_mold_brand_product_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MesMoldBrandProductDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 型号ID
|
||||
*/
|
||||
private Long brandId;
|
||||
/**
|
||||
* 产品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@ -0,0 +1,118 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.mold;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.moldrepair.MoldRepairLineDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.moldticketresults.MoldTicketResultsDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 模具 DO
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@TableName("erp_mold")
|
||||
@KeySequence("erp_mold_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MesMoldDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 模具编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 模具名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 单位ID
|
||||
*/
|
||||
private Long unitId;
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long machineId;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String machineName;
|
||||
/**
|
||||
* 使用时间(小时)
|
||||
*/
|
||||
private BigDecimal useTime;
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private LocalDateTime inTime;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
* 枚举 {@link TODO erp_mold_status 对应的类}
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 模具图片
|
||||
*/
|
||||
private String images;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 是否启用
|
||||
*/
|
||||
private Boolean isEnable;
|
||||
/**
|
||||
* 型号id
|
||||
*/
|
||||
private Long brandId;
|
||||
|
||||
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 点检列表
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<MoldTicketResultsDO> inspectionList;
|
||||
|
||||
/**
|
||||
* 保养列表
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<MoldTicketResultsDO> maintainList;
|
||||
|
||||
/**
|
||||
* 维修列表
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Map<String,List<MoldRepairLineDO>> repairList;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String orgType;
|
||||
@TableField(exist = false)
|
||||
private Long moldSize;
|
||||
@TableField(exist = false)
|
||||
private String brandName;
|
||||
@TableField(exist = false)
|
||||
private String moldType;
|
||||
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.mold;
|
||||
|
||||
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.mes.controller.admin.mold.vo.MoldBrandPageReqVO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.mold.MesMoldBrandDO;
|
||||
import com.alibaba.excel.util.StringUtils;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 模具型号 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesMoldBrandMapper extends BaseMapperX<MesMoldBrandDO> {
|
||||
|
||||
default PageResult<MesMoldBrandDO> selectPage(MoldBrandPageReqVO reqVO) {
|
||||
|
||||
LambdaQueryWrapperX<MesMoldBrandDO> moldBrandDOLambdaQueryWrapperX = new LambdaQueryWrapperX<>();
|
||||
moldBrandDOLambdaQueryWrapperX
|
||||
.eqIfPresent(MesMoldBrandDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(MesMoldBrandDO::getName, reqVO.getName())
|
||||
.eqIfPresent(MesMoldBrandDO::getMoldType, reqVO.getMoldType())
|
||||
.eqIfPresent(MesMoldBrandDO::getProductId, reqVO.getProductId())
|
||||
.eqIfPresent(MesMoldBrandDO::getUseTime, reqVO.getUseTime())
|
||||
.eqIfPresent(MesMoldBrandDO::getMaintainType, reqVO.getMaintainType())
|
||||
.eqIfPresent(MesMoldBrandDO::getMaintainTime, reqVO.getMaintainTime())
|
||||
.eqIfPresent(MesMoldBrandDO::getMoldSize, reqVO.getMoldSize())
|
||||
.eqIfPresent(MesMoldBrandDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(MesMoldBrandDO::getIsEnable, reqVO.getIsEnable())
|
||||
.eqIfPresent(MesMoldBrandDO::getOrgType, reqVO.getOrgType())
|
||||
.betweenIfPresent(MesMoldBrandDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MesMoldBrandDO::getId);
|
||||
|
||||
// 单独处理 ids 条件
|
||||
if (StringUtils.isNotBlank(reqVO.getIds())) {
|
||||
List<Long> idList = Arrays.stream(reqVO.getIds().split(","))
|
||||
.map(String::trim)
|
||||
.map(Long::valueOf)
|
||||
.collect(Collectors.toList());
|
||||
moldBrandDOLambdaQueryWrapperX.in(MesMoldBrandDO::getId, idList);
|
||||
}
|
||||
|
||||
return selectPage(reqVO, moldBrandDOLambdaQueryWrapperX);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
default List<MesMoldBrandDO> selectBy(MoldBrandPageReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<MesMoldBrandDO>()
|
||||
.eqIfPresent(MesMoldBrandDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(MesMoldBrandDO::getName, reqVO.getName())
|
||||
.eqIfPresent(MesMoldBrandDO::getMoldType, reqVO.getMoldType())
|
||||
.eqIfPresent(MesMoldBrandDO::getProductId, reqVO.getProductId())
|
||||
.eqIfPresent(MesMoldBrandDO::getUseTime, reqVO.getUseTime())
|
||||
.eqIfPresent(MesMoldBrandDO::getMaintainType, reqVO.getMaintainType())
|
||||
.eqIfPresent(MesMoldBrandDO::getMaintainTime, reqVO.getMaintainTime())
|
||||
.eqIfPresent(MesMoldBrandDO::getMoldSize, reqVO.getMoldSize())
|
||||
.eqIfPresent(MesMoldBrandDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(MesMoldBrandDO::getIsEnable, reqVO.getIsEnable())
|
||||
.eqIfPresent(MesMoldBrandDO::getOrgType, reqVO.getOrgType())
|
||||
.betweenIfPresent(MesMoldBrandDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(MesMoldBrandDO::getId));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.mold;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.mes.dal.dataobject.mold.MesMoldBrandProductDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模具产品 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesMoldBrandProductMapper extends BaseMapperX<MesMoldBrandProductDO> {
|
||||
|
||||
default PageResult<MesMoldBrandProductDO> selectPage(PageParam reqVO, Long brandId) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MesMoldBrandProductDO>()
|
||||
.eq(MesMoldBrandProductDO::getBrandId, brandId)
|
||||
.orderByDesc(MesMoldBrandProductDO::getId));
|
||||
}
|
||||
|
||||
default int deleteByBrandId(Long brandId) {
|
||||
return delete(MesMoldBrandProductDO::getBrandId, brandId);
|
||||
}
|
||||
default List<MesMoldBrandProductDO> selectList(MesMoldBrandProductDO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<MesMoldBrandProductDO>()
|
||||
.eqIfPresent(MesMoldBrandProductDO::getProductId, reqVO.getProductId())
|
||||
.eqIfPresent(MesMoldBrandProductDO::getBrandId, reqVO.getBrandId())
|
||||
.orderByDesc(MesMoldBrandProductDO::getId));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.mold;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
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.mes.dal.dataobject.mold.MesMoldDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模具 Mapper
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Mapper
|
||||
public interface MesMoldMapper extends BaseMapperX<MesMoldDO> {
|
||||
|
||||
default PageResult<MesMoldDO> selectPage(PageParam reqVO, Long brandId) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MesMoldDO>()
|
||||
.eqIfPresent(MesMoldDO::getBrandId, brandId)
|
||||
.orderByDesc(MesMoldDO::getId));
|
||||
}
|
||||
|
||||
default int deleteByBrandId(Long brandId) {
|
||||
return delete(MesMoldDO::getBrandId, brandId);
|
||||
}
|
||||
|
||||
default List<MesMoldDO> selectBy(MesMoldDO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<MesMoldDO>()
|
||||
.eqIfPresent(MesMoldDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(MesMoldDO::getName, reqVO.getName())
|
||||
.eqIfPresent(MesMoldDO::getBrandId, reqVO.getBrandId())
|
||||
.orderByDesc(MesMoldDO::getId));
|
||||
}
|
||||
|
||||
default List<MesMoldDO> selectBy(Long brandId) {
|
||||
return selectList(new LambdaQueryWrapperX<MesMoldDO>()
|
||||
.eq(MesMoldDO::getBrandId, brandId)
|
||||
.orderByDesc(MesMoldDO::getId));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,176 @@
|
||||
package cn.iocoder.yudao.module.mes.service.mold;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.mold.MesMoldBrandDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.mold.MesMoldBrandProductDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.mold.MesMoldDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||
|
||||
/**
|
||||
* 模具型号 Service 接口
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
public interface MoldBrandService {
|
||||
|
||||
/**
|
||||
* 创建模具型号
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createMoldBrand(@Valid MoldBrandSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新模具型号
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMoldBrand(@Valid MoldBrandSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除模具型号
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMoldBrand(Long id);
|
||||
|
||||
/**
|
||||
* 获得模具型号
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 模具型号
|
||||
*/
|
||||
MesMoldBrandDO getMoldBrand(Long id);
|
||||
List<MesMoldBrandDO> selectBy(MoldBrandPageReqVO reqVO);
|
||||
/**
|
||||
* 获得模具型号分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 模具型号分页
|
||||
*/
|
||||
PageResult<MoldBrandRespVO> getMoldBrandPage(MoldBrandPageReqVO pageReqVO);
|
||||
default Map<Long, MesMoldBrandDO> getMap(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return CollectionUtils.convertMap(getList(ids), MesMoldBrandDO::getId);
|
||||
}
|
||||
List<MesMoldBrandDO> getList(Collection<Long> ids);
|
||||
// ==================== 子表(模具) ====================
|
||||
|
||||
/**
|
||||
* 获得模具分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @param brandId 型号id
|
||||
* @return 模具分页
|
||||
*/
|
||||
PageResult<MoldRespVO> getMoldPage(PageParam pageReqVO, Long brandId);
|
||||
|
||||
List<MesMoldDO> getMoldList();
|
||||
|
||||
/**
|
||||
* 创建模具
|
||||
*
|
||||
* @param mold 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createMold(@Valid MesMoldDO mold);
|
||||
|
||||
/**
|
||||
* 更新模具
|
||||
*
|
||||
* @param mold 更新信息
|
||||
*/
|
||||
void updateMold(@Valid MesMoldDO mold);
|
||||
|
||||
/**
|
||||
* 删除模具
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMold(Long id);
|
||||
|
||||
/**
|
||||
* 获得模具
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 模具
|
||||
*/
|
||||
MesMoldDO getMold(Long id);
|
||||
List<MesMoldDO> selectBy(MesMoldDO reqVO);
|
||||
// ==================== 子表(模具产品) ====================
|
||||
|
||||
/**
|
||||
* 获得模具产品分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @param brandId 型号ID
|
||||
* @return 模具产品分页
|
||||
*/
|
||||
PageResult<MesMoldBrandProductDO> getMoldBrandProductPage(PageParam pageReqVO, Long brandId);
|
||||
List<MoldProductRespVO> buildProduct(List<MesMoldBrandProductDO> list);
|
||||
/**
|
||||
* 创建模具产品
|
||||
*
|
||||
* @param moldBrandProduct 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createMoldBrandProduct(@Valid MesMoldBrandProductDO moldBrandProduct);
|
||||
|
||||
/**
|
||||
* 更新模具产品
|
||||
*
|
||||
* @param moldBrandProduct 更新信息
|
||||
*/
|
||||
void updateMoldBrandProduct(@Valid MesMoldBrandProductDO moldBrandProduct);
|
||||
|
||||
/**
|
||||
* 删除模具产品
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMoldBrandProduct(Long id);
|
||||
|
||||
/**
|
||||
* 获得模具产品
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 模具产品
|
||||
*/
|
||||
MesMoldBrandProductDO getMoldBrandProduct(Long id);
|
||||
|
||||
List<MesMoldDO> getAllList();
|
||||
|
||||
|
||||
/**
|
||||
* 获得产品分类列表
|
||||
*
|
||||
* @param ids 编号数组
|
||||
* @return 产品分类列表
|
||||
*/
|
||||
List<MesMoldBrandDO> getMoldBrandList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得产品分类 Map
|
||||
*
|
||||
* @param ids 编号数组
|
||||
* @return 产品分类 Map
|
||||
*/
|
||||
default Map<Long, MesMoldBrandDO> getMoldBrandMap(Collection<Long> ids) {
|
||||
if(ids.isEmpty())return new HashMap<>();
|
||||
return convertMap(getMoldBrandList(ids), MesMoldBrandDO::getId);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,99 @@
|
||||
package cn.iocoder.yudao.module.mes.service.mold;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.MoldPageReqVO;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.MoldRespVO;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.MoldSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.mold.MesMoldDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
||||
|
||||
/**
|
||||
* 模具 Service 接口
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
public interface MoldService {
|
||||
|
||||
/**
|
||||
* 创建模具
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createMold(@Valid MoldSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新模具
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateMold(@Valid MoldSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除模具
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteMold(Long id);
|
||||
|
||||
/**
|
||||
* 获得模具
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 模具
|
||||
*/
|
||||
MesMoldDO getMold(Long id);
|
||||
|
||||
/**
|
||||
* 获得模具分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 模具分页
|
||||
*/
|
||||
PageResult<MesMoldDO> getMoldPage(MoldPageReqVO pageReqVO);
|
||||
List<MesMoldDO> getList(Collection<Long> ids);
|
||||
default Map<Long, MesMoldDO> getMap(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
return CollectionUtils.convertMap(getList(ids), MesMoldDO::getId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验模具们的有效性
|
||||
*
|
||||
* @param ids 编号数组
|
||||
* @return 模具列表
|
||||
*/
|
||||
List<MesMoldDO> validMoldList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得产品 VO 列表
|
||||
*
|
||||
* @param ids 编号数组
|
||||
* @return 产品 VO 列表
|
||||
*/
|
||||
List<MoldRespVO> getMoldVOList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得模具 VO Map
|
||||
*
|
||||
* @param ids 编号数组
|
||||
* @return 模具 VO Map
|
||||
*/
|
||||
default Map<Long, MoldRespVO> getMoldVOMap(Collection<Long> ids) {
|
||||
if(ids.isEmpty())return new HashMap<>();
|
||||
return convertMap(getMoldVOList(ids), MoldRespVO::getId);
|
||||
}
|
||||
|
||||
List<MoldRespVO> buildMoldVOList(List<MesMoldDO> list);
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package cn.iocoder.yudao.module.mes.service.mold;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.MoldPageReqVO;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.MoldRespVO;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.mold.vo.MoldSaveReqVO;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.mold.MesMoldDO;
|
||||
import cn.iocoder.yudao.module.mes.dal.mysql.mold.MesMoldMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.erp.enums.ErrorCodeConstants.MOLD_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 模具 Service 实现类
|
||||
*
|
||||
* @author 内蒙必硕
|
||||
*/
|
||||
@Service("mesMoldService")
|
||||
@Validated
|
||||
public class MoldServiceImpl implements MoldService {
|
||||
|
||||
@Resource
|
||||
private MesMoldMapper mesMoldMapper;
|
||||
|
||||
@Override
|
||||
public Long createMold(MoldSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MesMoldDO mold = BeanUtils.toBean(createReqVO, MesMoldDO.class);
|
||||
mesMoldMapper.insert(mold);
|
||||
// 返回
|
||||
return mold.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMold(MoldSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateMoldExists(updateReqVO.getId());
|
||||
// 更新
|
||||
MesMoldDO updateObj = BeanUtils.toBean(updateReqVO, MesMoldDO.class);
|
||||
mesMoldMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMold(Long id) {
|
||||
// 校验存在
|
||||
validateMoldExists(id);
|
||||
// 删除
|
||||
mesMoldMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateMoldExists(Long id) {
|
||||
if (mesMoldMapper.selectById(id) == null) {
|
||||
throw exception(MOLD_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MesMoldDO getMold(Long id) {
|
||||
return mesMoldMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MesMoldDO> getMoldPage(MoldPageReqVO pageReqVO) {
|
||||
return mesMoldMapper.selectPage(pageReqVO, pageReqVO.getBrandId());
|
||||
}
|
||||
@Override
|
||||
public List<MesMoldDO> getList(Collection<Long> ids) {
|
||||
return mesMoldMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MesMoldDO> validMoldList(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return mesMoldMapper.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MoldRespVO> getMoldVOList(Collection<Long> ids) {
|
||||
if (CollUtil.isEmpty(ids)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<MesMoldDO> list = mesMoldMapper.selectBatchIds(ids);
|
||||
return buildMoldVOList(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MoldRespVO> buildMoldVOList(List<MesMoldDO> list) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return BeanUtils.toBean(list, MoldRespVO.class);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue