update 新增EPI辊信息、口型板信息

master
yinq 1 month ago
parent bb9b5aafb0
commit 9e00eea476

@ -0,0 +1,117 @@
package org.dromara.mes.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.mes.domain.vo.ProdBaseEpiRollerVo;
import org.dromara.mes.domain.bo.ProdBaseEpiRollerBo;
import org.dromara.mes.service.IProdBaseEpiRollerService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
* EPI
* 访:/mes/baseEpiRoller
*
* @author Yinq
* @date 2025-02-17
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/baseEpiRoller")
public class ProdBaseEpiRollerController extends BaseController {
private final IProdBaseEpiRollerService prodBaseEpiRollerService;
/**
* EPI
*/
@SaCheckPermission("mes:baseEpiRoller:list")
@GetMapping("/list")
public TableDataInfo<ProdBaseEpiRollerVo> list(ProdBaseEpiRollerBo bo, PageQuery pageQuery) {
return prodBaseEpiRollerService.queryPageList(bo, pageQuery);
}
/**
* EPI
*/
@SaCheckPermission("mes:baseEpiRoller:export")
@Log(title = "EPI辊信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ProdBaseEpiRollerBo bo, HttpServletResponse response) {
List<ProdBaseEpiRollerVo> list = prodBaseEpiRollerService.queryList(bo);
ExcelUtil.exportExcel(list, "EPI辊信息", ProdBaseEpiRollerVo.class, response);
}
/**
* EPI
*
* @param epiRollerId
*/
@SaCheckPermission("mes:baseEpiRoller:query")
@GetMapping("/{epiRollerId}")
public R<ProdBaseEpiRollerVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long epiRollerId) {
return R.ok(prodBaseEpiRollerService.queryById(epiRollerId));
}
/**
* EPI
*/
@SaCheckPermission("mes:baseEpiRoller:add")
@Log(title = "EPI辊信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProdBaseEpiRollerBo bo) {
return toAjax(prodBaseEpiRollerService.insertByBo(bo));
}
/**
* EPI
*/
@SaCheckPermission("mes:baseEpiRoller:edit")
@Log(title = "EPI辊信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProdBaseEpiRollerBo bo) {
return toAjax(prodBaseEpiRollerService.updateByBo(bo));
}
/**
* EPI
*
* @param epiRollerIds
*/
@SaCheckPermission("mes:baseEpiRoller:remove")
@Log(title = "EPI辊信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{epiRollerIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] epiRollerIds) {
return toAjax(prodBaseEpiRollerService.deleteWithValidByIds(List.of(epiRollerIds), true));
}
/**
* EPI
*/
@GetMapping("/getProdBaseEpiRollerList")
public R<List<ProdBaseEpiRollerVo>> getProdBaseEpiRollerList(ProdBaseEpiRollerBo bo) {
List<ProdBaseEpiRollerVo> list = prodBaseEpiRollerService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,117 @@
package org.dromara.mes.controller;
import java.util.List;
import lombok.RequiredArgsConstructor;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.validation.constraints.*;
import cn.dev33.satoken.annotation.SaCheckPermission;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.log.enums.BusinessType;
import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.mes.domain.vo.ProdBaseMouthPlateVo;
import org.dromara.mes.domain.bo.ProdBaseMouthPlateBo;
import org.dromara.mes.service.IProdBaseMouthPlateService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
*
* 访:/mes/baseMouthPlate
*
* @author Yinq
* @date 2025-02-17
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/baseMouthPlate")
public class ProdBaseMouthPlateController extends BaseController {
private final IProdBaseMouthPlateService prodBaseMouthPlateService;
/**
*
*/
@SaCheckPermission("mes:baseMouthPlate:list")
@GetMapping("/list")
public TableDataInfo<ProdBaseMouthPlateVo> list(ProdBaseMouthPlateBo bo, PageQuery pageQuery) {
return prodBaseMouthPlateService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("mes:baseMouthPlate:export")
@Log(title = "口型板信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ProdBaseMouthPlateBo bo, HttpServletResponse response) {
List<ProdBaseMouthPlateVo> list = prodBaseMouthPlateService.queryList(bo);
ExcelUtil.exportExcel(list, "口型板信息", ProdBaseMouthPlateVo.class, response);
}
/**
*
*
* @param mouthPlateId
*/
@SaCheckPermission("mes:baseMouthPlate:query")
@GetMapping("/{mouthPlateId}")
public R<ProdBaseMouthPlateVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long mouthPlateId) {
return R.ok(prodBaseMouthPlateService.queryById(mouthPlateId));
}
/**
*
*/
@SaCheckPermission("mes:baseMouthPlate:add")
@Log(title = "口型板信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProdBaseMouthPlateBo bo) {
return toAjax(prodBaseMouthPlateService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("mes:baseMouthPlate:edit")
@Log(title = "口型板信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProdBaseMouthPlateBo bo) {
return toAjax(prodBaseMouthPlateService.updateByBo(bo));
}
/**
*
*
* @param mouthPlateIds
*/
@SaCheckPermission("mes:baseMouthPlate:remove")
@Log(title = "口型板信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{mouthPlateIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] mouthPlateIds) {
return toAjax(prodBaseMouthPlateService.deleteWithValidByIds(List.of(mouthPlateIds), true));
}
/**
*
*/
@GetMapping("/getProdBaseMouthPlateList")
public R<List<ProdBaseMouthPlateVo>> getProdBaseMouthPlateList(ProdBaseMouthPlateBo bo) {
List<ProdBaseMouthPlateVo> list = prodBaseMouthPlateService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,61 @@
package org.dromara.mes.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* EPI prod_base_epi_roller
*
* @author Yinq
* @date 2025-02-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("prod_base_epi_roller")
public class ProdBaseEpiRoller extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* EPIID
*/
@TableId(value = "epi_roller_id", type = IdType.AUTO)
private Long epiRollerId;
/**
*
*/
private String endMouthType;
/**
* EPI
*/
private String preMouthType;
/**
* ID
*/
private Long machineId;
/**
* (1 0)
*/
private String activeFlag;
/**
*
*/
private String remark;
/**
*
*/
@TableField(exist = false)
private String machineName;
}

@ -0,0 +1,77 @@
package org.dromara.mes.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serial;
/**
* prod_base_mouth_plate
*
* @author Yinq
* @date 2025-02-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("prod_base_mouth_plate")
public class ProdBaseMouthPlate extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@TableId(value = "mouth_plate_id", type = IdType.AUTO)
private Long mouthPlateId;
/**
*
*/
private String endMouthType;
/**
*
*/
private String preMouthType;
/**
* ID
*/
private Long machineId;
/**
* ID
*/
private Long materialId;
/**
* RFID
*/
private String modelCode;
/**
* (1 0)
*/
private String activeFlag;
/**
*
*/
private String remark;
/**
*
*/
@TableField(exist = false)
private String machineName;
/**
*
*/
@TableField(exist = false)
private String materialName;
}

@ -0,0 +1,57 @@
package org.dromara.mes.domain.bo;
import org.dromara.mes.domain.ProdBaseEpiRoller;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
/**
* EPI prod_base_epi_roller
*
* @author Yinq
* @date 2025-02-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ProdBaseEpiRoller.class, reverseConvertGenerate = false)
public class ProdBaseEpiRollerBo extends BaseEntity {
/**
* EPIID
*/
private Long epiRollerId;
/**
*
*/
@NotBlank(message = "大帘布代码不能为空", groups = {AddGroup.class, EditGroup.class})
private String endMouthType;
/**
* EPI
*/
@NotBlank(message = "EPI条码不能为空", groups = {AddGroup.class, EditGroup.class})
private String preMouthType;
/**
* ID
*/
@NotNull(message = "机台ID不能为空", groups = {AddGroup.class, EditGroup.class})
private Long machineId;
/**
* (1 0)
*/
private String activeFlag;
/**
*
*/
private String remark;
}

@ -0,0 +1,72 @@
package org.dromara.mes.domain.bo;
import org.dromara.mes.domain.ProdBaseMouthPlate;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
/**
* prod_base_mouth_plate
*
* @author Yinq
* @date 2025-02-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ProdBaseMouthPlate.class, reverseConvertGenerate = false)
public class ProdBaseMouthPlateBo extends BaseEntity {
/**
* ID
*/
private Long mouthPlateId;
/**
*
*/
private String endMouthType;
/**
*
*/
private String preMouthType;
/**
* ID
*/
@NotNull(message = "机台ID不能为空", groups = {AddGroup.class, EditGroup.class})
private Long machineId;
/**
* ID
*/
@NotNull(message = "物料ID不能为空", groups = {AddGroup.class, EditGroup.class})
private Long materialId;
/**
* RFID
*/
private String modelCode;
/**
* (1 0)
*/
@NotBlank(message = "激活标识(1是 0否)不能为空", groups = {AddGroup.class, EditGroup.class})
private String activeFlag;
/**
*
*/
private String remark;
/**
*
*/
private String materialName;
}

@ -0,0 +1,73 @@
package org.dromara.mes.domain.vo;
import org.dromara.mes.domain.ProdBaseEpiRoller;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* EPI prod_base_epi_roller
*
* @author Yinq
* @date 2025-02-17
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ProdBaseEpiRoller.class)
public class ProdBaseEpiRollerVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* EPIID
*/
@ExcelProperty(value = "EPI辊ID")
private Long epiRollerId;
/**
*
*/
@ExcelProperty(value = "大帘布代码")
private String endMouthType;
/**
* EPI
*/
@ExcelProperty(value = "EPI条码")
private String preMouthType;
/**
* ID
*/
@ExcelProperty(value = "机台ID")
private Long machineId;
/**
* (1 0)
*/
@ExcelProperty(value = "激活标识(1是 0否)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "active_flag")
private String activeFlag;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
/**
*
*/
@ExcelProperty(value = "机台名称")
private String machineName;
}

@ -0,0 +1,93 @@
package org.dromara.mes.domain.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import org.dromara.mes.domain.ProdBaseMouthPlate;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* prod_base_mouth_plate
*
* @author Yinq
* @date 2025-02-17
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ProdBaseMouthPlate.class)
public class ProdBaseMouthPlateVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ExcelProperty(value = "口型板ID")
private Long mouthPlateId;
/**
*
*/
@ExcelProperty(value = "终口型")
private String endMouthType;
/**
*
*/
@ExcelProperty(value = "预口型")
private String preMouthType;
/**
* ID
*/
@ExcelProperty(value = "机台ID")
private Long machineId;
/**
* ID
*/
@ExcelProperty(value = "物料ID")
private Long materialId;
/**
* RFID
*/
@ExcelProperty(value = "型号RFID")
private String modelCode;
/**
* (1 0)
*/
@ExcelProperty(value = "激活标识(1是 0否)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "active_flag")
private String activeFlag;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
/**
*
*/
@ExcelProperty(value = "机台名称")
private String machineName;
/**
*
*/
@ExcelProperty(value = "物料名称")
private String materialName;
}

@ -0,0 +1,15 @@
package org.dromara.mes.mapper;
import org.dromara.mes.domain.ProdBaseEpiRoller;
import org.dromara.mes.domain.vo.ProdBaseEpiRollerVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* EPIMapper
*
* @author Yinq
* @date 2025-02-17
*/
public interface ProdBaseEpiRollerMapper extends BaseMapperPlus<ProdBaseEpiRoller, ProdBaseEpiRollerVo> {
}

@ -0,0 +1,15 @@
package org.dromara.mes.mapper;
import org.dromara.mes.domain.ProdBaseMouthPlate;
import org.dromara.mes.domain.vo.ProdBaseMouthPlateVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* Mapper
*
* @author Yinq
* @date 2025-02-17
*/
public interface ProdBaseMouthPlateMapper extends BaseMapperPlus<ProdBaseMouthPlate, ProdBaseMouthPlateVo> {
}

@ -0,0 +1,69 @@
package org.dromara.mes.service;
import org.dromara.mes.domain.ProdBaseEpiRoller;
import org.dromara.mes.domain.vo.ProdBaseEpiRollerVo;
import org.dromara.mes.domain.bo.ProdBaseEpiRollerBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* EPIService
*
* @author Yinq
* @date 2025-02-17
*/
public interface IProdBaseEpiRollerService {
/**
* EPI
*
* @param epiRollerId
* @return EPI
*/
ProdBaseEpiRollerVo queryById(Long epiRollerId);
/**
* EPI
*
* @param bo
* @param pageQuery
* @return EPI
*/
TableDataInfo<ProdBaseEpiRollerVo> queryPageList(ProdBaseEpiRollerBo bo, PageQuery pageQuery);
/**
* EPI
*
* @param bo
* @return EPI
*/
List<ProdBaseEpiRollerVo> queryList(ProdBaseEpiRollerBo bo);
/**
* EPI
*
* @param bo EPI
* @return
*/
Boolean insertByBo(ProdBaseEpiRollerBo bo);
/**
* EPI
*
* @param bo EPI
* @return
*/
Boolean updateByBo(ProdBaseEpiRollerBo bo);
/**
* EPI
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,69 @@
package org.dromara.mes.service;
import org.dromara.mes.domain.ProdBaseMouthPlate;
import org.dromara.mes.domain.vo.ProdBaseMouthPlateVo;
import org.dromara.mes.domain.bo.ProdBaseMouthPlateBo;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author Yinq
* @date 2025-02-17
*/
public interface IProdBaseMouthPlateService {
/**
*
*
* @param mouthPlateId
* @return
*/
ProdBaseMouthPlateVo queryById(Long mouthPlateId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<ProdBaseMouthPlateVo> queryPageList(ProdBaseMouthPlateBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<ProdBaseMouthPlateVo> queryList(ProdBaseMouthPlateBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(ProdBaseMouthPlateBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(ProdBaseMouthPlateBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,139 @@
package org.dromara.mes.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.RequiredArgsConstructor;
import org.dromara.mes.domain.ProdBaseMachineInfo;
import org.dromara.mes.domain.ProdBaseMouthPlate;
import org.springframework.stereotype.Service;
import org.dromara.mes.domain.bo.ProdBaseEpiRollerBo;
import org.dromara.mes.domain.vo.ProdBaseEpiRollerVo;
import org.dromara.mes.domain.ProdBaseEpiRoller;
import org.dromara.mes.mapper.ProdBaseEpiRollerMapper;
import org.dromara.mes.service.IProdBaseEpiRollerService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* EPIService
*
* @author Yinq
* @date 2025-02-17
*/
@RequiredArgsConstructor
@Service
public class ProdBaseEpiRollerServiceImpl implements IProdBaseEpiRollerService {
private final ProdBaseEpiRollerMapper baseMapper;
/**
* EPI
*
* @param epiRollerId
* @return EPI
*/
@Override
public ProdBaseEpiRollerVo queryById(Long epiRollerId) {
return baseMapper.selectVoById(epiRollerId);
}
/**
* EPI
*
* @param bo
* @param pageQuery
* @return EPI
*/
@Override
public TableDataInfo<ProdBaseEpiRollerVo> queryPageList(ProdBaseEpiRollerBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<ProdBaseEpiRoller> lqw = buildQueryWrapper(bo);
Page<ProdBaseEpiRollerVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* EPI
*
* @param bo
* @return EPI
*/
@Override
public List<ProdBaseEpiRollerVo> queryList(ProdBaseEpiRollerBo bo) {
MPJLambdaWrapper<ProdBaseEpiRoller> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<ProdBaseEpiRoller> buildQueryWrapper(ProdBaseEpiRollerBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ProdBaseEpiRoller> lqw = JoinWrappers.lambda(ProdBaseEpiRoller.class)
.selectAll(ProdBaseEpiRoller.class)
.select(ProdBaseMachineInfo::getMachineName)
.leftJoin(ProdBaseMachineInfo.class, ProdBaseMachineInfo::getMachineId, ProdBaseMouthPlate::getMachineId)
.eq(bo.getEpiRollerId() != null, ProdBaseEpiRoller::getEpiRollerId, bo.getEpiRollerId())
.eq(StringUtils.isNotBlank(bo.getEndMouthType()), ProdBaseEpiRoller::getEndMouthType, bo.getEndMouthType())
.eq(StringUtils.isNotBlank(bo.getPreMouthType()), ProdBaseEpiRoller::getPreMouthType, bo.getPreMouthType())
.eq(bo.getMachineId() != null, ProdBaseEpiRoller::getMachineId, bo.getMachineId())
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), ProdBaseEpiRoller::getActiveFlag, bo.getActiveFlag())
.orderByAsc(ProdBaseEpiRoller::getCreateTime);
return lqw;
}
/**
* EPI
*
* @param bo EPI
* @return
*/
@Override
public Boolean insertByBo(ProdBaseEpiRollerBo bo) {
ProdBaseEpiRoller add = MapstructUtils.convert(bo, ProdBaseEpiRoller.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setEpiRollerId(add.getEpiRollerId());
}
return flag;
}
/**
* EPI
*
* @param bo EPI
* @return
*/
@Override
public Boolean updateByBo(ProdBaseEpiRollerBo bo) {
ProdBaseEpiRoller update = MapstructUtils.convert(bo, ProdBaseEpiRoller.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(ProdBaseEpiRoller entity) {
//TODO 做一些数据校验,如唯一约束
}
/**
* EPI
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -0,0 +1,142 @@
package org.dromara.mes.service.impl;
import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.toolkit.JoinWrappers;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import lombok.RequiredArgsConstructor;
import org.dromara.mes.domain.*;
import org.springframework.stereotype.Service;
import org.dromara.mes.domain.bo.ProdBaseMouthPlateBo;
import org.dromara.mes.domain.vo.ProdBaseMouthPlateVo;
import org.dromara.mes.mapper.ProdBaseMouthPlateMapper;
import org.dromara.mes.service.IProdBaseMouthPlateService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author Yinq
* @date 2025-02-17
*/
@RequiredArgsConstructor
@Service
public class ProdBaseMouthPlateServiceImpl implements IProdBaseMouthPlateService {
private final ProdBaseMouthPlateMapper baseMapper;
/**
*
*
* @param mouthPlateId
* @return
*/
@Override
public ProdBaseMouthPlateVo queryById(Long mouthPlateId) {
ProdBaseMouthPlateBo bo = new ProdBaseMouthPlateBo();
bo.setMouthPlateId(mouthPlateId);
MPJLambdaWrapper<ProdBaseMouthPlate> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoOne(lqw);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<ProdBaseMouthPlateVo> queryPageList(ProdBaseMouthPlateBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<ProdBaseMouthPlate> lqw = buildQueryWrapper(bo);
Page<ProdBaseMouthPlateVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<ProdBaseMouthPlateVo> queryList(ProdBaseMouthPlateBo bo) {
MPJLambdaWrapper<ProdBaseMouthPlate> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<ProdBaseMouthPlate> buildQueryWrapper(ProdBaseMouthPlateBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ProdBaseMouthPlate> lqw = JoinWrappers.lambda(ProdBaseMouthPlate.class)
.selectAll(ProdBaseMouthPlate.class)
.select(ProdBaseMachineInfo::getMachineName)
.select(BaseMaterialInfo::getMaterialName)
.leftJoin(ProdBaseMachineInfo.class, ProdBaseMachineInfo::getMachineId, ProdBaseMouthPlate::getMachineId)
.leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, ProdBaseMouthPlate::getMaterialId)
.eq(bo.getMouthPlateId() != null, ProdBaseMouthPlate::getMouthPlateId, bo.getMouthPlateId())
.eq(bo.getMachineId() != null, ProdBaseMouthPlate::getMachineId, bo.getMachineId())
.eq(bo.getMaterialId() != null, ProdBaseMouthPlate::getMaterialId, bo.getMaterialId())
.like(bo.getMaterialName() != null, BaseMaterialInfo::getMaterialName, bo.getMaterialName())
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), ProdBaseMouthPlate::getActiveFlag, bo.getActiveFlag())
.orderByAsc(ProdBaseMouthPlate::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(ProdBaseMouthPlateBo bo) {
ProdBaseMouthPlate add = MapstructUtils.convert(bo, ProdBaseMouthPlate.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setMouthPlateId(add.getMouthPlateId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(ProdBaseMouthPlateBo bo) {
ProdBaseMouthPlate update = MapstructUtils.convert(bo, ProdBaseMouthPlate.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(ProdBaseMouthPlate entity) {
//TODO 做一些数据校验,如唯一约束
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if (isValid) {
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.mes.mapper.ProdBaseEpiRollerMapper">
</mapper>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.dromara.mes.mapper.ProdBaseMouthPlateMapper">
</mapper>
Loading…
Cancel
Save