feat(eqp): 添加公辅消耗记录和公辅类型管理功能
- 创建公辅消耗记录实体类、业务对象和视图对象 - 实现公辅消耗记录的增删改查和导出功能 - 创建公辅类型实体类、业务对象和视图对象 - 实现公辅类型的增删改查和导出功能 - 添加对应的控制器、服务层和数据访问层实现 - 配置MyBatis映射文件和相关依赖 - 更新代码生成配置以适配新模块结构
This commit is contained in:
@@ -3,7 +3,7 @@ gen:
|
||||
# 作者
|
||||
author: klp
|
||||
# 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
|
||||
packageName: com.klp.system
|
||||
packageName: com.klp
|
||||
# 自动去除表前缀,默认是false
|
||||
autoRemovePre: false
|
||||
# 表前缀(生成类名不会包含表前缀,多个用逗号分隔)
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.klp.mes.eqp.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.mes.eqp.domain.vo.EqpAuxiliaryConsumeVo;
|
||||
import com.klp.mes.eqp.domain.bo.EqpAuxiliaryConsumeBo;
|
||||
import com.klp.mes.eqp.service.IEqpAuxiliaryConsumeService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 公辅消耗记录
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/eqp/auxiliaryConsume")
|
||||
public class EqpAuxiliaryConsumeController extends BaseController {
|
||||
|
||||
private final IEqpAuxiliaryConsumeService iEqpAuxiliaryConsumeService;
|
||||
|
||||
/**
|
||||
* 查询公辅消耗记录列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<EqpAuxiliaryConsumeVo> list(EqpAuxiliaryConsumeBo bo, PageQuery pageQuery) {
|
||||
return iEqpAuxiliaryConsumeService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出公辅消耗记录列表
|
||||
*/
|
||||
@Log(title = "公辅消耗记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(EqpAuxiliaryConsumeBo bo, HttpServletResponse response) {
|
||||
List<EqpAuxiliaryConsumeVo> list = iEqpAuxiliaryConsumeService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "公辅消耗记录", EqpAuxiliaryConsumeVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公辅消耗记录详细信息
|
||||
*
|
||||
* @param consumeId 主键
|
||||
*/
|
||||
@GetMapping("/{consumeId}")
|
||||
public R<EqpAuxiliaryConsumeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long consumeId) {
|
||||
return R.ok(iEqpAuxiliaryConsumeService.queryById(consumeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公辅消耗记录
|
||||
*/
|
||||
@Log(title = "公辅消耗记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EqpAuxiliaryConsumeBo bo) {
|
||||
return toAjax(iEqpAuxiliaryConsumeService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公辅消耗记录
|
||||
*/
|
||||
@Log(title = "公辅消耗记录", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody EqpAuxiliaryConsumeBo bo) {
|
||||
return toAjax(iEqpAuxiliaryConsumeService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公辅消耗记录
|
||||
*
|
||||
* @param consumeIds 主键串
|
||||
*/
|
||||
@Log(title = "公辅消耗记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{consumeIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] consumeIds) {
|
||||
return toAjax(iEqpAuxiliaryConsumeService.deleteWithValidByIds(Arrays.asList(consumeIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.klp.mes.eqp.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.klp.common.annotation.RepeatSubmit;
|
||||
import com.klp.common.annotation.Log;
|
||||
import com.klp.common.core.controller.BaseController;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.domain.R;
|
||||
import com.klp.common.core.validate.AddGroup;
|
||||
import com.klp.common.core.validate.EditGroup;
|
||||
import com.klp.common.enums.BusinessType;
|
||||
import com.klp.common.utils.poi.ExcelUtil;
|
||||
import com.klp.mes.eqp.domain.vo.EqpAuxiliaryTypeVo;
|
||||
import com.klp.mes.eqp.domain.bo.EqpAuxiliaryTypeBo;
|
||||
import com.klp.mes.eqp.service.IEqpAuxiliaryTypeService;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 公辅类型
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/eqp/auxiliaryType")
|
||||
public class EqpAuxiliaryTypeController extends BaseController {
|
||||
|
||||
private final IEqpAuxiliaryTypeService iEqpAuxiliaryTypeService;
|
||||
|
||||
/**
|
||||
* 查询公辅类型列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<EqpAuxiliaryTypeVo> list(EqpAuxiliaryTypeBo bo, PageQuery pageQuery) {
|
||||
return iEqpAuxiliaryTypeService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出公辅类型列表
|
||||
*/
|
||||
@Log(title = "公辅类型", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(EqpAuxiliaryTypeBo bo, HttpServletResponse response) {
|
||||
List<EqpAuxiliaryTypeVo> list = iEqpAuxiliaryTypeService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "公辅类型", EqpAuxiliaryTypeVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公辅类型详细信息
|
||||
*
|
||||
* @param typeId 主键
|
||||
*/
|
||||
@GetMapping("/{typeId}")
|
||||
public R<EqpAuxiliaryTypeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long typeId) {
|
||||
return R.ok(iEqpAuxiliaryTypeService.queryById(typeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公辅类型
|
||||
*/
|
||||
@Log(title = "公辅类型", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody EqpAuxiliaryTypeBo bo) {
|
||||
return toAjax(iEqpAuxiliaryTypeService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公辅类型
|
||||
*/
|
||||
@Log(title = "公辅类型", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody EqpAuxiliaryTypeBo bo) {
|
||||
return toAjax(iEqpAuxiliaryTypeService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公辅类型
|
||||
*
|
||||
* @param typeIds 主键串
|
||||
*/
|
||||
@Log(title = "公辅类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{typeIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] typeIds) {
|
||||
return toAjax(iEqpAuxiliaryTypeService.deleteWithValidByIds(Arrays.asList(typeIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.klp.mes.eqp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 公辅消耗记录对象 eqp_auxiliary_consume
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("eqp_auxiliary_consume")
|
||||
public class EqpAuxiliaryConsume extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 消耗记录ID
|
||||
*/
|
||||
@TableId(value = "consume_id")
|
||||
private Long consumeId;
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
private Date recordDate;
|
||||
/**
|
||||
* 公辅类型ID(关联ems_auxiliary_type)
|
||||
*/
|
||||
private Long typeId;
|
||||
/**
|
||||
* 消耗量
|
||||
*/
|
||||
private BigDecimal consume;
|
||||
/**
|
||||
* 删除标志(0=存在 2=删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.klp.mes.eqp.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
||||
/**
|
||||
* 公辅类型对象 eqp_auxiliary_type
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("eqp_auxiliary_type")
|
||||
public class EqpAuxiliaryType extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 公辅类型ID
|
||||
*/
|
||||
@TableId(value = "type_id")
|
||||
private Long typeId;
|
||||
/**
|
||||
* 公辅类型名称
|
||||
*/
|
||||
private String typeName;
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
private String lineName;
|
||||
/**
|
||||
* 删除标志(0=存在 2=删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.klp.mes.eqp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 公辅消耗记录业务对象 eqp_auxiliary_consume
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class EqpAuxiliaryConsumeBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 消耗记录ID
|
||||
*/
|
||||
private Long consumeId;
|
||||
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
private Date recordDate;
|
||||
|
||||
/**
|
||||
* 公辅类型ID(关联ems_auxiliary_type)
|
||||
*/
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 消耗量
|
||||
*/
|
||||
private BigDecimal consume;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.klp.mes.eqp.domain.bo;
|
||||
|
||||
import com.klp.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
|
||||
/**
|
||||
* 公辅类型业务对象 eqp_auxiliary_type
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class EqpAuxiliaryTypeBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 公辅类型ID
|
||||
*/
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 公辅类型名称
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.klp.mes.eqp.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 公辅消耗记录视图对象 eqp_auxiliary_consume
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EqpAuxiliaryConsumeVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 消耗记录ID
|
||||
*/
|
||||
@ExcelProperty(value = "消耗记录ID")
|
||||
private Long consumeId;
|
||||
|
||||
/**
|
||||
* 记录日期
|
||||
*/
|
||||
@ExcelProperty(value = "记录日期")
|
||||
private Date recordDate;
|
||||
|
||||
/**
|
||||
* 公辅类型ID(关联ems_auxiliary_type)
|
||||
*/
|
||||
@ExcelProperty(value = "公辅类型ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "关=联ems_auxiliary_type")
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 消耗量
|
||||
*/
|
||||
@ExcelProperty(value = "消耗量")
|
||||
private BigDecimal consume;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.klp.mes.eqp.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.klp.common.annotation.ExcelDictFormat;
|
||||
import com.klp.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* 公辅类型视图对象 eqp_auxiliary_type
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class EqpAuxiliaryTypeVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 公辅类型ID
|
||||
*/
|
||||
@ExcelProperty(value = "公辅类型ID")
|
||||
private Long typeId;
|
||||
|
||||
/**
|
||||
* 公辅类型名称
|
||||
*/
|
||||
@ExcelProperty(value = "公辅类型名称")
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 产线名称
|
||||
*/
|
||||
@ExcelProperty(value = "产线名称")
|
||||
private String lineName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.klp.mes.eqp.mapper;
|
||||
|
||||
import com.klp.mes.eqp.domain.EqpAuxiliaryConsume;
|
||||
import com.klp.mes.eqp.domain.vo.EqpAuxiliaryConsumeVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 公辅消耗记录Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
public interface EqpAuxiliaryConsumeMapper extends BaseMapperPlus<EqpAuxiliaryConsumeMapper, EqpAuxiliaryConsume, EqpAuxiliaryConsumeVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.klp.mes.eqp.mapper;
|
||||
|
||||
import com.klp.mes.eqp.domain.EqpAuxiliaryType;
|
||||
import com.klp.mes.eqp.domain.vo.EqpAuxiliaryTypeVo;
|
||||
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 公辅类型Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
public interface EqpAuxiliaryTypeMapper extends BaseMapperPlus<EqpAuxiliaryTypeMapper, EqpAuxiliaryType, EqpAuxiliaryTypeVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.klp.mes.eqp.service;
|
||||
|
||||
import com.klp.mes.eqp.domain.EqpAuxiliaryConsume;
|
||||
import com.klp.mes.eqp.domain.vo.EqpAuxiliaryConsumeVo;
|
||||
import com.klp.mes.eqp.domain.bo.EqpAuxiliaryConsumeBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公辅消耗记录Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
public interface IEqpAuxiliaryConsumeService {
|
||||
|
||||
/**
|
||||
* 查询公辅消耗记录
|
||||
*/
|
||||
EqpAuxiliaryConsumeVo queryById(Long consumeId);
|
||||
|
||||
/**
|
||||
* 查询公辅消耗记录列表
|
||||
*/
|
||||
TableDataInfo<EqpAuxiliaryConsumeVo> queryPageList(EqpAuxiliaryConsumeBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询公辅消耗记录列表
|
||||
*/
|
||||
List<EqpAuxiliaryConsumeVo> queryList(EqpAuxiliaryConsumeBo bo);
|
||||
|
||||
/**
|
||||
* 新增公辅消耗记录
|
||||
*/
|
||||
Boolean insertByBo(EqpAuxiliaryConsumeBo bo);
|
||||
|
||||
/**
|
||||
* 修改公辅消耗记录
|
||||
*/
|
||||
Boolean updateByBo(EqpAuxiliaryConsumeBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除公辅消耗记录信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.klp.mes.eqp.service;
|
||||
|
||||
import com.klp.mes.eqp.domain.EqpAuxiliaryType;
|
||||
import com.klp.mes.eqp.domain.vo.EqpAuxiliaryTypeVo;
|
||||
import com.klp.mes.eqp.domain.bo.EqpAuxiliaryTypeBo;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 公辅类型Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
public interface IEqpAuxiliaryTypeService {
|
||||
|
||||
/**
|
||||
* 查询公辅类型
|
||||
*/
|
||||
EqpAuxiliaryTypeVo queryById(Long typeId);
|
||||
|
||||
/**
|
||||
* 查询公辅类型列表
|
||||
*/
|
||||
TableDataInfo<EqpAuxiliaryTypeVo> queryPageList(EqpAuxiliaryTypeBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询公辅类型列表
|
||||
*/
|
||||
List<EqpAuxiliaryTypeVo> queryList(EqpAuxiliaryTypeBo bo);
|
||||
|
||||
/**
|
||||
* 新增公辅类型
|
||||
*/
|
||||
Boolean insertByBo(EqpAuxiliaryTypeBo bo);
|
||||
|
||||
/**
|
||||
* 修改公辅类型
|
||||
*/
|
||||
Boolean updateByBo(EqpAuxiliaryTypeBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除公辅类型信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.klp.mes.eqp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.mes.eqp.domain.bo.EqpAuxiliaryConsumeBo;
|
||||
import com.klp.mes.eqp.domain.vo.EqpAuxiliaryConsumeVo;
|
||||
import com.klp.mes.eqp.domain.EqpAuxiliaryConsume;
|
||||
import com.klp.mes.eqp.mapper.EqpAuxiliaryConsumeMapper;
|
||||
import com.klp.mes.eqp.service.IEqpAuxiliaryConsumeService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 公辅消耗记录Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class EqpAuxiliaryConsumeServiceImpl implements IEqpAuxiliaryConsumeService {
|
||||
|
||||
private final EqpAuxiliaryConsumeMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询公辅消耗记录
|
||||
*/
|
||||
@Override
|
||||
public EqpAuxiliaryConsumeVo queryById(Long consumeId){
|
||||
return baseMapper.selectVoById(consumeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公辅消耗记录列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<EqpAuxiliaryConsumeVo> queryPageList(EqpAuxiliaryConsumeBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<EqpAuxiliaryConsume> lqw = buildQueryWrapper(bo);
|
||||
Page<EqpAuxiliaryConsumeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公辅消耗记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<EqpAuxiliaryConsumeVo> queryList(EqpAuxiliaryConsumeBo bo) {
|
||||
LambdaQueryWrapper<EqpAuxiliaryConsume> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<EqpAuxiliaryConsume> buildQueryWrapper(EqpAuxiliaryConsumeBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<EqpAuxiliaryConsume> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getRecordDate() != null, EqpAuxiliaryConsume::getRecordDate, bo.getRecordDate());
|
||||
lqw.eq(bo.getTypeId() != null, EqpAuxiliaryConsume::getTypeId, bo.getTypeId());
|
||||
lqw.eq(bo.getConsume() != null, EqpAuxiliaryConsume::getConsume, bo.getConsume());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公辅消耗记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(EqpAuxiliaryConsumeBo bo) {
|
||||
EqpAuxiliaryConsume add = BeanUtil.toBean(bo, EqpAuxiliaryConsume.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setConsumeId(add.getConsumeId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公辅消耗记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(EqpAuxiliaryConsumeBo bo) {
|
||||
EqpAuxiliaryConsume update = BeanUtil.toBean(bo, EqpAuxiliaryConsume.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(EqpAuxiliaryConsume entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除公辅消耗记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.klp.mes.eqp.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.klp.mes.eqp.domain.bo.EqpAuxiliaryTypeBo;
|
||||
import com.klp.mes.eqp.domain.vo.EqpAuxiliaryTypeVo;
|
||||
import com.klp.mes.eqp.domain.EqpAuxiliaryType;
|
||||
import com.klp.mes.eqp.mapper.EqpAuxiliaryTypeMapper;
|
||||
import com.klp.mes.eqp.service.IEqpAuxiliaryTypeService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 公辅类型Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2026-04-29
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class EqpAuxiliaryTypeServiceImpl implements IEqpAuxiliaryTypeService {
|
||||
|
||||
private final EqpAuxiliaryTypeMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询公辅类型
|
||||
*/
|
||||
@Override
|
||||
public EqpAuxiliaryTypeVo queryById(Long typeId){
|
||||
return baseMapper.selectVoById(typeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公辅类型列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<EqpAuxiliaryTypeVo> queryPageList(EqpAuxiliaryTypeBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<EqpAuxiliaryType> lqw = buildQueryWrapper(bo);
|
||||
Page<EqpAuxiliaryTypeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公辅类型列表
|
||||
*/
|
||||
@Override
|
||||
public List<EqpAuxiliaryTypeVo> queryList(EqpAuxiliaryTypeBo bo) {
|
||||
LambdaQueryWrapper<EqpAuxiliaryType> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<EqpAuxiliaryType> buildQueryWrapper(EqpAuxiliaryTypeBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<EqpAuxiliaryType> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTypeName()), EqpAuxiliaryType::getTypeName, bo.getTypeName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLineName()), EqpAuxiliaryType::getLineName, bo.getLineName());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公辅类型
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(EqpAuxiliaryTypeBo bo) {
|
||||
EqpAuxiliaryType add = BeanUtil.toBean(bo, EqpAuxiliaryType.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setTypeId(add.getTypeId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公辅类型
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(EqpAuxiliaryTypeBo bo) {
|
||||
EqpAuxiliaryType update = BeanUtil.toBean(bo, EqpAuxiliaryType.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(EqpAuxiliaryType entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除公辅类型
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?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="com.klp.mes.eqp.mapper.EqpAuxiliaryConsumeMapper">
|
||||
|
||||
<resultMap type="com.klp.mes.eqp.domain.EqpAuxiliaryConsume" id="EqpAuxiliaryConsumeResult">
|
||||
<result property="consumeId" column="consume_id"/>
|
||||
<result property="recordDate" column="record_date"/>
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="consume" column="consume"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,20 @@
|
||||
<?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="com.klp.mes.eqp.mapper.EqpAuxiliaryTypeMapper">
|
||||
|
||||
<resultMap type="com.klp.mes.eqp.domain.EqpAuxiliaryType" id="EqpAuxiliaryTypeResult">
|
||||
<result property="typeId" column="type_id"/>
|
||||
<result property="typeName" column="type_name"/>
|
||||
<result property="lineName" column="line_name"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user