parent
c63df34f87
commit
d7ff3c54c8
10 changed files with 0 additions and 720 deletions
@ -1,242 +0,0 @@ |
|||||||
/** |
|
||||||
* Author: Tom Shuo |
|
||||||
*/ |
|
||||||
package org.springblade.desk.quality.controller; |
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag; |
|
||||||
import io.swagger.v3.oas.annotations.Operation; |
|
||||||
import io.swagger.v3.oas.annotations.Parameter; |
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
||||||
import jakarta.annotation.Resource; |
|
||||||
import jakarta.validation.Valid; |
|
||||||
|
|
||||||
import lombok.Data; |
|
||||||
import lombok.AllArgsConstructor; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import lombok.extern.slf4j.Slf4j; |
|
||||||
import org.springblade.core.secure.BladeUser; |
|
||||||
import org.springblade.core.secure.annotation.IsAdmin; |
|
||||||
import org.springblade.core.mp.support.Condition; |
|
||||||
import org.springblade.core.mp.support.Query; |
|
||||||
import org.springblade.core.tool.api.R; |
|
||||||
import org.springblade.core.tool.utils.Func; |
|
||||||
import org.springframework.http.ResponseEntity; |
|
||||||
import org.springframework.web.bind.annotation.*; |
|
||||||
import org.springframework.web.multipart.MultipartFile; |
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
import org.springblade.desk.quality.pojo.entity.Ng; |
|
||||||
import org.springblade.desk.quality.pojo.vo.NgVO; |
|
||||||
import org.springblade.desk.quality.excel.NgExcel; |
|
||||||
import org.springblade.desk.quality.wrapper.NgWrapper; |
|
||||||
import org.springblade.desk.quality.service.INgService; |
|
||||||
import org.springblade.core.boot.ctrl.BladeController; |
|
||||||
import org.springblade.core.tool.utils.DateUtil; |
|
||||||
import org.springblade.core.excel.util.ExcelUtil; |
|
||||||
import org.springblade.core.tool.constant.BladeConstant; |
|
||||||
|
|
||||||
import java.util.Map; |
|
||||||
import java.util.List; |
|
||||||
import java.util.stream.Collectors; |
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletResponse; |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 控制器 |
|
||||||
* |
|
||||||
* @author Tom Shuo |
|
||||||
* @since 2026-01-04 |
|
||||||
*/ |
|
||||||
@RestController |
|
||||||
@RequestMapping("/Ng") |
|
||||||
@Data |
|
||||||
@AllArgsConstructor |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
@Slf4j |
|
||||||
@Tag(name = "[缺陷]", description = "[缺陷]接口") |
|
||||||
public class NgController extends BladeController { |
|
||||||
|
|
||||||
@Resource |
|
||||||
private INgService service; |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 详情 |
|
||||||
*/ |
|
||||||
@GetMapping("/detail") |
|
||||||
@ApiOperationSupport(order = 10) |
|
||||||
@Operation(summary = "详情", description = "传入Ng Obj") |
|
||||||
public R<NgVO> detail(Ng ng) { |
|
||||||
QueryWrapper<Ng> qw = Condition.getQueryWrapper(ng); |
|
||||||
Ng detail = service.getOne(qw); |
|
||||||
NgVO detailVO = NgWrapper.build().entityVO(detail); |
|
||||||
service.setVOValue(detailVO); |
|
||||||
return R.data(detailVO); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] list分页 |
|
||||||
*/ |
|
||||||
@GetMapping("/list") |
|
||||||
@ApiOperationSupport(order = 20) |
|
||||||
@Operation(summary = "list分页", description = "传入Ng Obj") |
|
||||||
public R<IPage<NgVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> ng, |
|
||||||
Query query) { |
|
||||||
QueryWrapper<Ng> qw = Condition.getQueryWrapper(ng, Ng.class); |
|
||||||
IPage<Ng> pages = service.page(Condition.getPage(query), qw); |
|
||||||
IPage<NgVO> pagesVO = NgWrapper.build().pageVO(pages); |
|
||||||
pagesVO.getRecords() |
|
||||||
.stream() |
|
||||||
.peek(service::setVOValue) |
|
||||||
.collect(Collectors.toList()); |
|
||||||
return R.data(pagesVO); |
|
||||||
} |
|
||||||
|
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] page分页 |
|
||||||
*/ |
|
||||||
@GetMapping("/page") |
|
||||||
@ApiOperationSupport(order = 21) |
|
||||||
@Operation(summary = "page分页", description = "传入Ng Obj") |
|
||||||
public R<IPage<NgVO>> page(NgVO ng, Query query) { |
|
||||||
IPage<NgVO> pagesVO = service.selectNgPage( |
|
||||||
Condition.getPage(query), ng |
|
||||||
); |
|
||||||
return R.data(pagesVO); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] list下拉选择 |
|
||||||
*/ |
|
||||||
@GetMapping("/listForSelect") |
|
||||||
@ApiOperationSupport(order = 22) |
|
||||||
@Operation(summary = "list下拉选择", description = "") |
|
||||||
public R<List<NgVO>> listForSelect() { |
|
||||||
List<Ng> list = service.list(); |
|
||||||
List<NgVO> listVO = NgWrapper.build().listVO(list); |
|
||||||
return R.data(listVO); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 新增一条 |
|
||||||
*/ |
|
||||||
@PostMapping("/save") |
|
||||||
@ApiOperationSupport(order = 30) |
|
||||||
@Operation(summary = "新增一条", description = "传入Ng Obj") |
|
||||||
public R save(@Valid @RequestBody Ng addOne) { |
|
||||||
addOne.setId(null); |
|
||||||
return R.status(service.save(addOne)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 新增批量 |
|
||||||
*/ |
|
||||||
@PostMapping("/saveBat") |
|
||||||
@ApiOperationSupport(order = 31) |
|
||||||
@Operation(summary = "新增批量", description = "传入Ng List") |
|
||||||
public R saveBat(@Valid @RequestBody List<Ng> addList) { |
|
||||||
addList.forEach(one -> { |
|
||||||
one.setId(null); |
|
||||||
}); |
|
||||||
return R.status(service.saveBatch(addList)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 修改一条 |
|
||||||
*/ |
|
||||||
@PostMapping("/update") |
|
||||||
@ApiOperationSupport(order = 40) |
|
||||||
@Operation(summary = "修改一条", description = "传入Ng Obj") |
|
||||||
public R update(@Valid @RequestBody Ng updateOne) { |
|
||||||
return R.status(service.updateById(updateOne)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 修改批量 |
|
||||||
*/ |
|
||||||
@PostMapping("/updateBat") |
|
||||||
@ApiOperationSupport(order = 41) |
|
||||||
@Operation(summary = "修改批量", description = "传入Ng List") |
|
||||||
public R updateBat(@Valid @RequestBody List<Ng> updateList) { |
|
||||||
return R.status(service.updateBatchById(updateList)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 新增或修改一条 |
|
||||||
*/ |
|
||||||
@PostMapping("/submit") |
|
||||||
@ApiOperationSupport(order = 50) |
|
||||||
@Operation(summary = "新增或修改一条", description = "传入Ng Obj") |
|
||||||
public R submit(@Valid @RequestBody Ng mergeOne) { |
|
||||||
return R.status(service.saveOrUpdate(mergeOne)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 新增或修改批量 |
|
||||||
*/ |
|
||||||
@PostMapping("/submitBat") |
|
||||||
@ApiOperationSupport(order = 51) |
|
||||||
@Operation(summary = "新增或修改批量", description = "传入Ng List") |
|
||||||
public R submitBat(@Valid @RequestBody List<Ng> mergeList) { |
|
||||||
return R.status(service.saveOrUpdateBatch(mergeList)); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 逻辑删除 |
|
||||||
*/ |
|
||||||
@PostMapping("/remove") |
|
||||||
@ApiOperationSupport(order = 61) |
|
||||||
@Operation(summary = "逻辑删除", description = "传入ids") |
|
||||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) { |
|
||||||
return R.status(service.deleteLogic(Func.toLongList(ids))); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 导出Excel |
|
||||||
*/ |
|
||||||
@GetMapping("/exportExcel") |
|
||||||
@ApiOperationSupport(order = 70) |
|
||||||
@Operation(summary = "导出Excel", description = "传入Ng") |
|
||||||
public void exportExcel(@Parameter(hidden = true) @RequestParam Map<String, Object> ng, |
|
||||||
BladeUser bladeUser, HttpServletResponse response) { |
|
||||||
QueryWrapper<Ng> qw = Condition.getQueryWrapper(ng, Ng.class); |
|
||||||
//if (!AuthUtil.isAdministrator()) {
|
|
||||||
// queryWrapper.lambda().eq(Ng::getTenantId, bladeUser.getTenantId());
|
|
||||||
//}
|
|
||||||
//queryWrapper.lambda().eq(NgEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
|
||||||
List<NgExcel> list = service.exportNg(qw); |
|
||||||
ExcelUtil.export(response, "[缺陷]数据" + org.springblade.core.tool.utils.DateUtil.time(), |
|
||||||
"[缺陷]数据表", list, NgExcel.class); |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 下载Excel模板 |
|
||||||
*/ |
|
||||||
@GetMapping("/downloadExcelTemplate") |
|
||||||
@ApiOperationSupport(order = 71) |
|
||||||
@Operation(summary = "下载Excel模板", description = "") |
|
||||||
public ResponseEntity<org.springframework.core.io.Resource> downloadExcelTemplate() { |
|
||||||
// return ExcelExtUtil.downloadXlsTemplate(
|
|
||||||
// "Excel/QA/ImportTemplate-CycleTestItem.xls",
|
|
||||||
// "导入模版-周期试验项目.xls");
|
|
||||||
return null; |
|
||||||
} |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 导入Excel |
|
||||||
*/ |
|
||||||
@PostMapping("/importExcel") |
|
||||||
@ApiOperationSupport(order = 72) |
|
||||||
@Operation(summary = "导入Excel", description = "MultipartFile") |
|
||||||
public R importExcel(@RequestParam("file") MultipartFile file) { |
|
||||||
// R checkR = ExcelExtUtil.importExcelCheck(file);
|
|
||||||
// if (checkR != null) {
|
|
||||||
// return checkR;
|
|
||||||
// }
|
|
||||||
// List<Ng> importList = ExcelUtil.read(
|
|
||||||
// file, 0, 1, Ng.class
|
|
||||||
// );
|
|
||||||
// return R.status(service.saveBatch(importList));
|
|
||||||
return null; |
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,100 +0,0 @@ |
|||||||
/** |
|
||||||
* Author: Tom Shuo |
|
||||||
*/ |
|
||||||
package org.springblade.desk.quality.excel; |
|
||||||
|
|
||||||
|
|
||||||
import lombok.Data; |
|
||||||
|
|
||||||
import java.io.Serializable; |
|
||||||
import java.math.BigDecimal; |
|
||||||
import org.springblade.core.mp.base.BaseEntity; |
|
||||||
import com.alibaba.excel.annotation.ExcelProperty; |
|
||||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
|
||||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
|
||||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
|
||||||
import java.io.Serial; |
|
||||||
|
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] Excel实体类 |
|
||||||
* |
|
||||||
* @author Tom Shuo |
|
||||||
* @since 2026-01-04 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@ColumnWidth(25) |
|
||||||
@HeadRowHeight(20) |
|
||||||
@ContentRowHeight(18) |
|
||||||
public class NgExcel implements Serializable { |
|
||||||
|
|
||||||
@Serial |
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
/** |
|
||||||
* 编码 |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("编码") |
|
||||||
private String code; |
|
||||||
/** |
|
||||||
* 故障类型-[1]:故障特征;[2]:故障类别;[3]:问题大类;[4]:问题小类; |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("故障类型-[1]:故障特征;[2]:故障类别;[3]:问题大类;[4]:问题小类;") |
|
||||||
private Long ngType; |
|
||||||
/** |
|
||||||
* 名称 |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("名称") |
|
||||||
private String name; |
|
||||||
/** |
|
||||||
* 父级[不良原因]id |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("父级[不良原因]id") |
|
||||||
private BigDecimal parentId; |
|
||||||
/** |
|
||||||
* 排序 |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("排序") |
|
||||||
private Long sort; |
|
||||||
/** |
|
||||||
* 备注 |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("备注") |
|
||||||
private String remark; |
|
||||||
/** |
|
||||||
* 缺陷描述 |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("缺陷描述") |
|
||||||
private String desc; |
|
||||||
/** |
|
||||||
* [制品]id |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("[制品]id") |
|
||||||
private BigDecimal productId; |
|
||||||
/** |
|
||||||
* [制品]编码 |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("[制品]编码") |
|
||||||
private String productCode; |
|
||||||
/** |
|
||||||
* [工序]id |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("[工序]id") |
|
||||||
private BigDecimal processId; |
|
||||||
/** |
|
||||||
* [工序]编码 |
|
||||||
*/ |
|
||||||
@ColumnWidth(20) |
|
||||||
@ExcelProperty("[工序]编码") |
|
||||||
private String processCode; |
|
||||||
} |
|
||||||
@ -1,39 +0,0 @@ |
|||||||
/** |
|
||||||
* Author: Tom Shuo |
|
||||||
*/ |
|
||||||
package org.springblade.desk.quality.mapper; |
|
||||||
|
|
||||||
import org.springblade.desk.quality.pojo.entity.Ng; |
|
||||||
import org.springblade.desk.quality.pojo.vo.NgVO; |
|
||||||
import org.springblade.desk.quality.excel.NgExcel; |
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
import org.apache.ibatis.annotations.Param; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] Mapper 接口 |
|
||||||
* |
|
||||||
* @author Tom Shuo |
|
||||||
* @since 2026-01-04 |
|
||||||
*/ |
|
||||||
public interface NgMapper extends BaseMapper<Ng> { |
|
||||||
|
|
||||||
/** |
|
||||||
* 自定义分页 |
|
||||||
* |
|
||||||
* @param page 分页参数 |
|
||||||
* @param ng 查询参数 |
|
||||||
* @return List<NgVO> |
|
||||||
*/ |
|
||||||
List<NgVO> selectNgPage(IPage page, NgVO ng); |
|
||||||
|
|
||||||
/** |
|
||||||
* 获取导出数据 |
|
||||||
* |
|
||||||
* @param queryWrapper 查询条件 |
|
||||||
* @return List<NgExcel> |
|
||||||
*/ |
|
||||||
List<NgExcel> exportNg(@Param("ew") Wrapper<Ng> queryWrapper); |
|
||||||
} |
|
||||||
@ -1,27 +0,0 @@ |
|||||||
<?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.springblade.desk.quality.mapper.NgMapper"> |
|
||||||
|
|
||||||
<!-- 通用查询映射结果 --> |
|
||||||
<resultMap id="ngResultMap" type="org.springblade.desk.quality.pojo.entity.Ng"> |
|
||||||
<result column="CODE" property="code"/> |
|
||||||
<result column="NG_TYPE" property="ngType"/> |
|
||||||
<result column="NAME" property="name"/> |
|
||||||
<result column="PARENT_ID" property="parentId"/> |
|
||||||
<result column="SORT" property="sort"/> |
|
||||||
<result column="REMARK" property="remark"/> |
|
||||||
<result column="DESC" property="desc"/> |
|
||||||
<result column="PRODUCT_ID" property="productId"/> |
|
||||||
<result column="PRODUCT_CODE" property="productCode"/> |
|
||||||
<result column="PROCESS_ID" property="processId"/> |
|
||||||
<result column="PROCESS_CODE" property="processCode"/> |
|
||||||
</resultMap> |
|
||||||
|
|
||||||
<select id="selectNgPage" resultMap="ngResultMap"> |
|
||||||
SELECT * FROM QA_NG WHERE is_deleted = 0 |
|
||||||
</select> |
|
||||||
|
|
||||||
<select id="exportNg" resultType="org.springblade.desk.quality.excel.NgExcel"> |
|
||||||
SELECT * FROM QA_NG ${ew.customSqlSegment} |
|
||||||
</select> |
|
||||||
</mapper> |
|
||||||
@ -1,23 +0,0 @@ |
|||||||
/** |
|
||||||
* Author: Tom Shuo |
|
||||||
*/ |
|
||||||
package org.springblade.desk.quality.pojo.dto; |
|
||||||
|
|
||||||
import org.springblade.desk.quality.pojo.entity.Ng; |
|
||||||
import lombok.Data; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import java.io.Serial; |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 数据传输对象实体类 |
|
||||||
* |
|
||||||
* @author Tom Shuo |
|
||||||
* @since 2026-01-04 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
public class NgDTO extends Ng { |
|
||||||
@Serial |
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,129 +0,0 @@ |
|||||||
/** |
|
||||||
* Author: Tom Shuo |
|
||||||
*/ |
|
||||||
package org.springblade.desk.quality.pojo.entity; |
|
||||||
|
|
||||||
import lombok.Data; |
|
||||||
import io.swagger.v3.oas.annotations.media.Schema; |
|
||||||
import com.baomidou.mybatisplus.annotation.TableName; |
|
||||||
import java.math.BigDecimal; |
|
||||||
import org.springblade.core.mp.base.BaseEntity; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import java.io.Serial; |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 实体类 |
|
||||||
* |
|
||||||
* @author Tom Shuo |
|
||||||
* @since 2026-01-04 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@TableName("QA_NG") |
|
||||||
@Schema(description = "Ng Entity对象") |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
public class Ng extends BaseEntity { |
|
||||||
|
|
||||||
@Serial |
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
/** |
|
||||||
* 编码 |
|
||||||
*/ |
|
||||||
public static final String COL_CODE = "CODE"; |
|
||||||
/** |
|
||||||
* 故障类型-[1]:故障特征;[2]:故障类别;[3]:问题大类;[4]:问题小类; |
|
||||||
*/ |
|
||||||
public static final String COL_NG_TYPE = "NG_TYPE"; |
|
||||||
/** |
|
||||||
* 名称 |
|
||||||
*/ |
|
||||||
public static final String COL_NAME = "NAME"; |
|
||||||
/** |
|
||||||
* 父级[不良原因]id |
|
||||||
*/ |
|
||||||
public static final String COL_PARENT_ID = "PARENT_ID"; |
|
||||||
/** |
|
||||||
* 排序 |
|
||||||
*/ |
|
||||||
public static final String COL_SORT = "SORT"; |
|
||||||
/** |
|
||||||
* 备注 |
|
||||||
*/ |
|
||||||
public static final String COL_REMARK = "REMARK"; |
|
||||||
/** |
|
||||||
* 缺陷描述 |
|
||||||
*/ |
|
||||||
public static final String COL_DESC = "DESC"; |
|
||||||
/** |
|
||||||
* [制品]id |
|
||||||
*/ |
|
||||||
public static final String COL_PRODUCT_ID = "PRODUCT_ID"; |
|
||||||
/** |
|
||||||
* [制品]编码 |
|
||||||
*/ |
|
||||||
public static final String COL_PRODUCT_CODE = "PRODUCT_CODE"; |
|
||||||
/** |
|
||||||
* [工序]id |
|
||||||
*/ |
|
||||||
public static final String COL_PROCESS_ID = "PROCESS_ID"; |
|
||||||
/** |
|
||||||
* [工序]编码 |
|
||||||
*/ |
|
||||||
public static final String COL_PROCESS_CODE = "PROCESS_CODE"; |
|
||||||
|
|
||||||
/** |
|
||||||
* 编码 |
|
||||||
*/ |
|
||||||
@Schema(description = "编码") |
|
||||||
private String code; |
|
||||||
/** |
|
||||||
* 故障类型-[1]:故障特征;[2]:故障类别;[3]:问题大类;[4]:问题小类; |
|
||||||
*/ |
|
||||||
@Schema(description = "故障类型-[1]:故障特征;[2]:故障类别;[3]:问题大类;[4]:问题小类;") |
|
||||||
private Long ngType; |
|
||||||
/** |
|
||||||
* 名称 |
|
||||||
*/ |
|
||||||
@Schema(description = "名称") |
|
||||||
private String name; |
|
||||||
/** |
|
||||||
* 父级[不良原因]id |
|
||||||
*/ |
|
||||||
@Schema(description = "父级[不良原因]id") |
|
||||||
private BigDecimal parentId; |
|
||||||
/** |
|
||||||
* 排序 |
|
||||||
*/ |
|
||||||
@Schema(description = "排序") |
|
||||||
private Long sort; |
|
||||||
/** |
|
||||||
* 备注 |
|
||||||
*/ |
|
||||||
@Schema(description = "备注") |
|
||||||
private String remark; |
|
||||||
/** |
|
||||||
* 缺陷描述 |
|
||||||
*/ |
|
||||||
@Schema(description = "缺陷描述") |
|
||||||
private String desc; |
|
||||||
/** |
|
||||||
* [制品]id |
|
||||||
*/ |
|
||||||
@Schema(description = "[制品]id") |
|
||||||
private BigDecimal productId; |
|
||||||
/** |
|
||||||
* [制品]编码 |
|
||||||
*/ |
|
||||||
@Schema(description = "[制品]编码") |
|
||||||
private String productCode; |
|
||||||
/** |
|
||||||
* [工序]id |
|
||||||
*/ |
|
||||||
@Schema(description = "[工序]id") |
|
||||||
private BigDecimal processId; |
|
||||||
/** |
|
||||||
* [工序]编码 |
|
||||||
*/ |
|
||||||
@Schema(description = "[工序]编码") |
|
||||||
private String processCode; |
|
||||||
} |
|
||||||
@ -1,23 +0,0 @@ |
|||||||
/** |
|
||||||
* Author: Tom Shuo |
|
||||||
*/ |
|
||||||
package org.springblade.desk.quality.pojo.vo; |
|
||||||
|
|
||||||
import org.springblade.desk.quality.pojo.entity.Ng; |
|
||||||
import lombok.Data; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import java.io.Serial; |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 视图实体类 |
|
||||||
* |
|
||||||
* @author Tom Shuo |
|
||||||
* @since 2026-01-04 |
|
||||||
*/ |
|
||||||
@Data |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
public class NgVO extends Ng { |
|
||||||
@Serial |
|
||||||
private static final long serialVersionUID = 1L; |
|
||||||
|
|
||||||
} |
|
||||||
@ -1,43 +0,0 @@ |
|||||||
/** |
|
||||||
* Author: Tom Shuo |
|
||||||
*/ |
|
||||||
package org.springblade.desk.quality.service; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
||||||
import org.springblade.desk.quality.pojo.entity.Ng; |
|
||||||
import org.springblade.desk.quality.pojo.vo.NgVO; |
|
||||||
import org.springblade.desk.quality.excel.NgExcel; |
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
import org.springblade.core.mp.base.BaseService; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 服务类 |
|
||||||
* |
|
||||||
* @author Tom Shuo |
|
||||||
* @since 2026-01-04 |
|
||||||
*/ |
|
||||||
public interface INgService extends BaseService<Ng> { |
|
||||||
/** |
|
||||||
* 自定义分页 |
|
||||||
* |
|
||||||
* @param page 分页参数 |
|
||||||
* @param ng 查询参数 |
|
||||||
* @return IPage<NgVO> |
|
||||||
*/ |
|
||||||
IPage<NgVO> selectNgPage(IPage<NgVO> page, NgVO ng); |
|
||||||
|
|
||||||
/** |
|
||||||
* 导出数据 |
|
||||||
* |
|
||||||
* @param queryWrapper 查询条件 |
|
||||||
* @return List<NgExcel> |
|
||||||
*/ |
|
||||||
List<NgExcel> exportNg(Wrapper<Ng> queryWrapper); |
|
||||||
|
|
||||||
/** |
|
||||||
* VO |
|
||||||
* @param vo |
|
||||||
*/ |
|
||||||
void setVOValue(NgVO vo); |
|
||||||
} |
|
||||||
@ -1,59 +0,0 @@ |
|||||||
/** |
|
||||||
* Author: Tom Shuo |
|
||||||
*/ |
|
||||||
package org.springblade.desk.quality.service.impl; |
|
||||||
|
|
||||||
import jakarta.annotation.Resource; |
|
||||||
import lombok.Data; |
|
||||||
import lombok.AllArgsConstructor; |
|
||||||
import lombok.EqualsAndHashCode; |
|
||||||
import lombok.extern.slf4j.Slf4j; |
|
||||||
import org.springblade.desk.quality.pojo.entity.Ng; |
|
||||||
import org.springblade.desk.quality.pojo.vo.NgVO; |
|
||||||
import org.springblade.desk.quality.excel.NgExcel; |
|
||||||
import org.springblade.desk.quality.mapper.NgMapper; |
|
||||||
import org.springblade.desk.quality.service.INgService; |
|
||||||
import org.springblade.system.feign.IDictClient; |
|
||||||
import org.springframework.stereotype.Service; |
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
import org.springblade.core.mp.base.BaseServiceImpl; |
|
||||||
import java.util.List; |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 服务实现类 |
|
||||||
* |
|
||||||
* @author Tom Shuo |
|
||||||
* @since 2026-01-04 |
|
||||||
*/ |
|
||||||
@Service |
|
||||||
@Data |
|
||||||
@AllArgsConstructor |
|
||||||
@EqualsAndHashCode(callSuper = true) |
|
||||||
@Slf4j |
|
||||||
public class NgServiceImpl extends BaseServiceImpl<NgMapper, Ng> implements INgService { |
|
||||||
|
|
||||||
// @Resource
|
|
||||||
// private IUserClient userClient;
|
|
||||||
@Resource |
|
||||||
private IDictClient dictClient; |
|
||||||
|
|
||||||
@Override |
|
||||||
public IPage<NgVO> selectNgPage(IPage<NgVO> page, NgVO ng) { |
|
||||||
return page.setRecords(baseMapper.selectNgPage(page, ng)); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public List<NgExcel> exportNg(Wrapper<Ng> queryWrapper) { |
|
||||||
List<NgExcel> ngList = baseMapper.exportNg(queryWrapper); |
|
||||||
//ngList.forEach(ng -> {
|
|
||||||
// ng.setTypeName(DictCache.getValue(DictEnum.YES_NO, Ng.getType()));
|
|
||||||
//});
|
|
||||||
return ngList; |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public void setVOValue(NgVO vo) { |
|
||||||
|
|
||||||
} |
|
||||||
} |
|
||||||
@ -1,35 +0,0 @@ |
|||||||
/** |
|
||||||
* Author: Tom Shuo |
|
||||||
*/ |
|
||||||
package org.springblade.desk.quality.wrapper; |
|
||||||
|
|
||||||
import org.springblade.core.mp.support.BaseEntityWrapper; |
|
||||||
import org.springblade.core.tool.utils.BeanUtil; |
|
||||||
import org.springblade.desk.quality.pojo.entity.Ng; |
|
||||||
import org.springblade.desk.quality.pojo.vo.NgVO; |
|
||||||
import java.util.Objects; |
|
||||||
|
|
||||||
/** |
|
||||||
* [缺陷] 包装类,返回视图层所需的字段 |
|
||||||
* |
|
||||||
* @author Tom Shuo |
|
||||||
* @since 2026-01-04 |
|
||||||
*/ |
|
||||||
public class NgWrapper extends BaseEntityWrapper<Ng, NgVO> { |
|
||||||
|
|
||||||
public static NgWrapper build() { |
|
||||||
return new NgWrapper(); |
|
||||||
} |
|
||||||
|
|
||||||
@Override |
|
||||||
public NgVO entityVO(Ng ng) { |
|
||||||
NgVO VO = Objects.requireNonNull(BeanUtil.copyProperties(ng, NgVO.class)); |
|
||||||
|
|
||||||
//User createUser = UserCache.getUser(ng.getCreateUser());
|
|
||||||
//User updateUser = UserCache.getUser(ng.getUpdateUser());
|
|
||||||
//ngVO.setCreateUserName(createUser.getName());
|
|
||||||
//ngVO.setUpdateUserName(updateUser.getName());
|
|
||||||
|
|
||||||
return VO; |
|
||||||
} |
|
||||||
} |
|
||||||
Loading…
Reference in new issue