add(hwmom-mes): 工序信息关联用户和产线功能
- 新增工序信息关联用户和产线的接口和实现 - 在工序信息中添加关联用户和产线的列表字段 - 实现工序信息关联用户和产线的增删改查功能 - 优化工序信息查询接口,支持查询关联的用户和产线信息master
parent
1b6bb08d91
commit
f0013b7c6e
@ -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.ProdBaseProcessProdLineVo;
|
||||
import org.dromara.mes.domain.bo.ProdBaseProcessProdLineBo;
|
||||
import org.dromara.mes.service.IProdBaseProcessProdLineService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 工序关联产线
|
||||
* 前端访问路由地址为:/mes/prodBaseProcessProdLine
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/prodBaseProcessProdLine")
|
||||
public class ProdBaseProcessProdLineController extends BaseController {
|
||||
|
||||
private final IProdBaseProcessProdLineService prodBaseProcessProdLineService;
|
||||
|
||||
/**
|
||||
* 查询工序关联产线列表
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessProdLine:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ProdBaseProcessProdLineVo> list(ProdBaseProcessProdLineBo bo, PageQuery pageQuery) {
|
||||
return prodBaseProcessProdLineService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出工序关联产线列表
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessProdLine:export")
|
||||
@Log(title = "工序关联产线", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ProdBaseProcessProdLineBo bo, HttpServletResponse response) {
|
||||
List<ProdBaseProcessProdLineVo> list = prodBaseProcessProdLineService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "工序关联产线", ProdBaseProcessProdLineVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工序关联产线详细信息
|
||||
*
|
||||
* @param processId 主键
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessProdLine:query")
|
||||
@GetMapping("/{processId}")
|
||||
public R<ProdBaseProcessProdLineVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long processId) {
|
||||
return R.ok(prodBaseProcessProdLineService.queryById(processId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工序关联产线
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessProdLine:add")
|
||||
@Log(title = "工序关联产线", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProdBaseProcessProdLineBo bo) {
|
||||
return toAjax(prodBaseProcessProdLineService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工序关联产线
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessProdLine:edit")
|
||||
@Log(title = "工序关联产线", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProdBaseProcessProdLineBo bo) {
|
||||
return toAjax(prodBaseProcessProdLineService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工序关联产线
|
||||
*
|
||||
* @param processIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessProdLine:remove")
|
||||
@Log(title = "工序关联产线", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{processIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] processIds) {
|
||||
return toAjax(prodBaseProcessProdLineService.deleteWithValidByIds(List.of(processIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询工序关联产线列表
|
||||
*/
|
||||
|
||||
@GetMapping("getProdBaseProcessProdLineList")
|
||||
public R<List<ProdBaseProcessProdLineVo>> getProdBaseProcessProdLinelist(ProdBaseProcessProdLineBo bo) {
|
||||
List<ProdBaseProcessProdLineVo> list = prodBaseProcessProdLineService.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.ProdBaseProcessUserVo;
|
||||
import org.dromara.mes.domain.bo.ProdBaseProcessUserBo;
|
||||
import org.dromara.mes.service.IProdBaseProcessUserService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 工序关联人员
|
||||
* 前端访问路由地址为:/mes/prodBaseProcessUser
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/prodBaseProcessUser")
|
||||
public class ProdBaseProcessUserController extends BaseController {
|
||||
|
||||
private final IProdBaseProcessUserService prodBaseProcessUserService;
|
||||
|
||||
/**
|
||||
* 查询工序关联人员列表
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessUser:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ProdBaseProcessUserVo> list(ProdBaseProcessUserBo bo, PageQuery pageQuery) {
|
||||
return prodBaseProcessUserService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出工序关联人员列表
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessUser:export")
|
||||
@Log(title = "工序关联人员", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ProdBaseProcessUserBo bo, HttpServletResponse response) {
|
||||
List<ProdBaseProcessUserVo> list = prodBaseProcessUserService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "工序关联人员", ProdBaseProcessUserVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取工序关联人员详细信息
|
||||
*
|
||||
* @param processId 主键
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessUser:query")
|
||||
@GetMapping("/{processId}")
|
||||
public R<ProdBaseProcessUserVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long processId) {
|
||||
return R.ok(prodBaseProcessUserService.queryById(processId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工序关联人员
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessUser:add")
|
||||
@Log(title = "工序关联人员", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ProdBaseProcessUserBo bo) {
|
||||
return toAjax(prodBaseProcessUserService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工序关联人员
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessUser:edit")
|
||||
@Log(title = "工序关联人员", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ProdBaseProcessUserBo bo) {
|
||||
return toAjax(prodBaseProcessUserService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工序关联人员
|
||||
*
|
||||
* @param processIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("mes:prodBaseProcessUser:remove")
|
||||
@Log(title = "工序关联人员", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{processIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] processIds) {
|
||||
return toAjax(prodBaseProcessUserService.deleteWithValidByIds(List.of(processIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询工序关联人员列表
|
||||
*/
|
||||
|
||||
@GetMapping("getProdBaseProcessUserList")
|
||||
public R<List<ProdBaseProcessUserVo>> getProdBaseProcessUserlist(ProdBaseProcessUserBo bo) {
|
||||
List<ProdBaseProcessUserVo> list = prodBaseProcessUserService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.mes.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 工序关联产线对象 prod_base_process_prod_line
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode()
|
||||
@TableName("prod_base_process_prod_line")
|
||||
public class ProdBaseProcessProdLine {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 工序ID
|
||||
*/
|
||||
private Long processId;
|
||||
|
||||
/**
|
||||
* 所属产线ID
|
||||
*/
|
||||
private Long prodLineId;
|
||||
|
||||
|
||||
|
||||
/*删除继承BaseEntity*/
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
/**
|
||||
* 创建部门
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createDept;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
private String tenantId;
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package org.dromara.mes.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 工序关联人员对象 prod_base_process_user
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode()
|
||||
@TableName("prod_base_process_user")
|
||||
public class ProdBaseProcessUser {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 工序ID
|
||||
*/
|
||||
private Long processId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
|
||||
/*删除继承BaseEntity*/
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
/**
|
||||
* 创建部门
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createDept;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
private String tenantId;
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package org.dromara.mes.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import org.dromara.mes.domain.ProdBaseProcessProdLine;
|
||||
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.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 工序关联产线业务对象 prod_base_process_prod_line
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode()
|
||||
@AutoMapper(target = ProdBaseProcessProdLine.class, reverseConvertGenerate = false)
|
||||
public class ProdBaseProcessProdLineBo {
|
||||
|
||||
/**
|
||||
* 工序ID
|
||||
*/
|
||||
@NotNull(message = "工序ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long processId;
|
||||
|
||||
/**
|
||||
* 所属产线ID
|
||||
*/
|
||||
@NotNull(message = "所属产线ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long prodLineId;
|
||||
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
private String searchValue;
|
||||
|
||||
/**
|
||||
* 创建部门
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createDept;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String tenantId;
|
||||
|
||||
}
|
@ -0,0 +1,81 @@
|
||||
package org.dromara.mes.domain.bo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import org.dromara.mes.domain.ProdBaseProcessUser;
|
||||
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.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 工序关联人员业务对象 prod_base_process_user
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode()
|
||||
@AutoMapper(target = ProdBaseProcessUser.class, reverseConvertGenerate = false)
|
||||
public class ProdBaseProcessUserBo {
|
||||
|
||||
/**
|
||||
* 工序ID
|
||||
*/
|
||||
@NotNull(message = "工序ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long processId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@NotNull(message = "用户ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 搜索值
|
||||
*/
|
||||
@JsonIgnore
|
||||
@TableField(exist = false)
|
||||
private String searchValue;
|
||||
|
||||
/**
|
||||
* 创建部门
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createDept;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
|
||||
/**
|
||||
* 请求参数
|
||||
*/
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package org.dromara.mes.domain.vo;
|
||||
|
||||
import org.dromara.mes.domain.ProdBaseProcessProdLine;
|
||||
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_process_prod_line
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ProdBaseProcessProdLine.class)
|
||||
public class ProdBaseProcessProdLineVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 工序ID
|
||||
*/
|
||||
@ExcelProperty(value = "工序ID")
|
||||
private Long processId;
|
||||
|
||||
/**
|
||||
* 所属产线ID
|
||||
*/
|
||||
@ExcelProperty(value = "所属产线ID")
|
||||
private Long prodLineId;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@ExcelProperty(value = "租户编号")
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ExcelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package org.dromara.mes.domain.vo;
|
||||
|
||||
import org.dromara.mes.domain.ProdBaseProcessUser;
|
||||
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_process_user
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = ProdBaseProcessUser.class)
|
||||
public class ProdBaseProcessUserVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 工序ID
|
||||
*/
|
||||
@ExcelProperty(value = "工序ID")
|
||||
private Long processId;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ExcelProperty(value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 租户编号
|
||||
*/
|
||||
@ExcelProperty(value = "租户编号")
|
||||
private String tenantId;
|
||||
|
||||
/**
|
||||
* 用户名称
|
||||
*/
|
||||
@ExcelProperty(value = "用户名称")
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ExcelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.mes.mapper;
|
||||
|
||||
import org.dromara.mes.domain.ProdBaseProcessProdLine;
|
||||
import org.dromara.mes.domain.vo.ProdBaseProcessProdLineVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 工序关联产线Mapper接口
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
public interface ProdBaseProcessProdLineMapper extends BaseMapperPlus<ProdBaseProcessProdLine, ProdBaseProcessProdLineVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.mes.mapper;
|
||||
|
||||
import org.dromara.mes.domain.ProdBaseProcessUser;
|
||||
import org.dromara.mes.domain.vo.ProdBaseProcessUserVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 工序关联人员Mapper接口
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
public interface ProdBaseProcessUserMapper extends BaseMapperPlus<ProdBaseProcessUser, ProdBaseProcessUserVo> {
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.mes.service;
|
||||
|
||||
import org.dromara.mes.domain.ProdBaseProcessProdLine;
|
||||
import org.dromara.mes.domain.vo.ProdBaseProcessProdLineVo;
|
||||
import org.dromara.mes.domain.bo.ProdBaseProcessProdLineBo;
|
||||
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 LionLi
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
public interface IProdBaseProcessProdLineService {
|
||||
|
||||
/**
|
||||
* 查询工序关联产线
|
||||
*
|
||||
* @param processId 主键
|
||||
* @return 工序关联产线
|
||||
*/
|
||||
ProdBaseProcessProdLineVo queryById(Long processId);
|
||||
|
||||
/**
|
||||
* 分页查询工序关联产线列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 工序关联产线分页列表
|
||||
*/
|
||||
TableDataInfo<ProdBaseProcessProdLineVo> queryPageList(ProdBaseProcessProdLineBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的工序关联产线列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 工序关联产线列表
|
||||
*/
|
||||
List<ProdBaseProcessProdLineVo> queryList(ProdBaseProcessProdLineBo bo);
|
||||
|
||||
/**
|
||||
* 新增工序关联产线
|
||||
*
|
||||
* @param bo 工序关联产线
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(ProdBaseProcessProdLineBo bo);
|
||||
|
||||
/**
|
||||
* 修改工序关联产线
|
||||
*
|
||||
* @param bo 工序关联产线
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(ProdBaseProcessProdLineBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除工序关联产线信息
|
||||
*
|
||||
* @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.ProdBaseProcessUser;
|
||||
import org.dromara.mes.domain.vo.ProdBaseProcessUserVo;
|
||||
import org.dromara.mes.domain.bo.ProdBaseProcessUserBo;
|
||||
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 zangch
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
public interface IProdBaseProcessUserService {
|
||||
|
||||
/**
|
||||
* 查询工序关联人员
|
||||
*
|
||||
* @param processId 主键
|
||||
* @return 工序关联人员
|
||||
*/
|
||||
ProdBaseProcessUserVo queryById(Long processId);
|
||||
|
||||
/**
|
||||
* 分页查询工序关联人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 工序关联人员分页列表
|
||||
*/
|
||||
TableDataInfo<ProdBaseProcessUserVo> queryPageList(ProdBaseProcessUserBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的工序关联人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 工序关联人员列表
|
||||
*/
|
||||
List<ProdBaseProcessUserVo> queryList(ProdBaseProcessUserBo bo);
|
||||
|
||||
/**
|
||||
* 新增工序关联人员
|
||||
*
|
||||
* @param bo 工序关联人员
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(ProdBaseProcessUserBo bo);
|
||||
|
||||
/**
|
||||
* 修改工序关联人员
|
||||
*
|
||||
* @param bo 工序关联人员
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(ProdBaseProcessUserBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除工序关联人员信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
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 com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.mes.domain.bo.ProdBaseProcessProdLineBo;
|
||||
import org.dromara.mes.domain.vo.ProdBaseProcessProdLineVo;
|
||||
import org.dromara.mes.domain.ProdBaseProcessProdLine;
|
||||
import org.dromara.mes.mapper.ProdBaseProcessProdLineMapper;
|
||||
import org.dromara.mes.service.IProdBaseProcessProdLineService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 工序关联产线Service业务层处理
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ProdBaseProcessProdLineServiceImpl implements IProdBaseProcessProdLineService {
|
||||
|
||||
private final ProdBaseProcessProdLineMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询工序关联产线
|
||||
*
|
||||
* @param processId 主键
|
||||
* @return 工序关联产线
|
||||
*/
|
||||
@Override
|
||||
public ProdBaseProcessProdLineVo queryById(Long processId){
|
||||
return baseMapper.selectVoById(processId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询工序关联产线列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 工序关联产线分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ProdBaseProcessProdLineVo> queryPageList(ProdBaseProcessProdLineBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<ProdBaseProcessProdLine> lqw = buildQueryWrapper(bo);
|
||||
Page<ProdBaseProcessProdLineVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的工序关联产线列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 工序关联产线列表
|
||||
*/
|
||||
@Override
|
||||
public List<ProdBaseProcessProdLineVo> queryList(ProdBaseProcessProdLineBo bo) {
|
||||
MPJLambdaWrapper<ProdBaseProcessProdLine> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<ProdBaseProcessProdLine> buildQueryWrapper(ProdBaseProcessProdLineBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<ProdBaseProcessProdLine> lqw = JoinWrappers.lambda(ProdBaseProcessProdLine.class)
|
||||
.selectAll(ProdBaseProcessProdLine.class)
|
||||
.eq(bo.getProcessId() != null, ProdBaseProcessProdLine::getProcessId, bo.getProcessId())
|
||||
.eq(bo.getProdLineId() != null, ProdBaseProcessProdLine::getProdLineId, bo.getProdLineId())
|
||||
.orderByDesc(ProdBaseProcessProdLine::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工序关联产线
|
||||
*
|
||||
* @param bo 工序关联产线
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ProdBaseProcessProdLineBo bo) {
|
||||
ProdBaseProcessProdLine add = MapstructUtils.convert(bo, ProdBaseProcessProdLine.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setProcessId(add.getProcessId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工序关联产线
|
||||
*
|
||||
* @param bo 工序关联产线
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ProdBaseProcessProdLineBo bo) {
|
||||
ProdBaseProcessProdLine update = MapstructUtils.convert(bo, ProdBaseProcessProdLine.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ProdBaseProcessProdLine 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,134 @@
|
||||
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 com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.mes.domain.bo.ProdBaseProcessUserBo;
|
||||
import org.dromara.mes.domain.vo.ProdBaseProcessUserVo;
|
||||
import org.dromara.mes.domain.ProdBaseProcessUser;
|
||||
import org.dromara.mes.mapper.ProdBaseProcessUserMapper;
|
||||
import org.dromara.mes.service.IProdBaseProcessUserService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 工序关联人员Service业务层处理
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-09
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ProdBaseProcessUserServiceImpl implements IProdBaseProcessUserService {
|
||||
|
||||
private final ProdBaseProcessUserMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询工序关联人员
|
||||
*
|
||||
* @param processId 主键
|
||||
* @return 工序关联人员
|
||||
*/
|
||||
@Override
|
||||
public ProdBaseProcessUserVo queryById(Long processId){
|
||||
return baseMapper.selectVoById(processId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询工序关联人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 工序关联人员分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ProdBaseProcessUserVo> queryPageList(ProdBaseProcessUserBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<ProdBaseProcessUser> lqw = buildQueryWrapper(bo);
|
||||
Page<ProdBaseProcessUserVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的工序关联人员列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 工序关联人员列表
|
||||
*/
|
||||
@Override
|
||||
public List<ProdBaseProcessUserVo> queryList(ProdBaseProcessUserBo bo) {
|
||||
MPJLambdaWrapper<ProdBaseProcessUser> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<ProdBaseProcessUser> buildQueryWrapper(ProdBaseProcessUserBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<ProdBaseProcessUser> lqw = JoinWrappers.lambda(ProdBaseProcessUser.class)
|
||||
.selectAll(ProdBaseProcessUser.class)
|
||||
.eq(bo.getProcessId() != null, ProdBaseProcessUser::getProcessId, bo.getProcessId())
|
||||
.eq(bo.getUserId() != null, ProdBaseProcessUser::getUserId, bo.getUserId())
|
||||
.like(StringUtils.isNotBlank(bo.getUserName()), ProdBaseProcessUser::getUserName, bo.getUserName())
|
||||
.orderByDesc(ProdBaseProcessUser::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增工序关联人员
|
||||
*
|
||||
* @param bo 工序关联人员
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ProdBaseProcessUserBo bo) {
|
||||
ProdBaseProcessUser add = MapstructUtils.convert(bo, ProdBaseProcessUser.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setProcessId(add.getProcessId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工序关联人员
|
||||
*
|
||||
* @param bo 工序关联人员
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ProdBaseProcessUserBo bo) {
|
||||
ProdBaseProcessUser update = MapstructUtils.convert(bo, ProdBaseProcessUser.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ProdBaseProcessUser 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.ProdBaseProcessProdLineMapper">
|
||||
|
||||
</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.ProdBaseProcessUserMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue