质量规划
This commit is contained in:
parent
848eb60f43
commit
96f9808e02
@ -74,6 +74,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
"/websocket/**",
|
"/websocket/**",
|
||||||
"/influx/**",
|
"/influx/**",
|
||||||
"/basic/**",
|
"/basic/**",
|
||||||
|
"/qualityPlanning/**",
|
||||||
"/processInspection/**",
|
"/processInspection/**",
|
||||||
"/captcha").anonymous()
|
"/captcha").anonymous()
|
||||||
// .antMatchers("/testCors").hasAuthority("system:dept:list222")
|
// .antMatchers("/testCors").hasAuthority("system:dept:list222")
|
||||||
|
@ -2,6 +2,7 @@ package com.cnbm.basic.controller;
|
|||||||
|
|
||||||
import com.cnbm.admin.annotation.LogOperation;
|
import com.cnbm.admin.annotation.LogOperation;
|
||||||
import com.cnbm.admin.params.IdParam;
|
import com.cnbm.admin.params.IdParam;
|
||||||
|
import com.cnbm.basic.dto.UnitDTO;
|
||||||
import com.cnbm.common.constant.Constant;
|
import com.cnbm.common.constant.Constant;
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.utils.ExcelUtils;
|
import com.cnbm.common.utils.ExcelUtils;
|
||||||
@ -127,4 +128,9 @@ public class ProductTypeController {
|
|||||||
return new Result();
|
return new Result();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "list")
|
||||||
|
@ApiOperation(value = "获取产品类型列表")
|
||||||
|
private List<ProductTypeDTO> list(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
|
return productTypeService.list(params);
|
||||||
|
}
|
||||||
}
|
}
|
@ -20,10 +20,12 @@ import io.swagger.annotations.ApiImplicitParams;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.groups.Default;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -124,4 +126,9 @@ public class UnitController {
|
|||||||
return new Result();
|
return new Result();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "list")
|
||||||
|
@ApiOperation(value = "获取单位列表")
|
||||||
|
private List<UnitDTO> list(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
|
return unitService.list(params);
|
||||||
|
}
|
||||||
}
|
}
|
@ -2,6 +2,7 @@ package com.cnbm.basic.controller;
|
|||||||
|
|
||||||
import com.cnbm.admin.annotation.LogOperation;
|
import com.cnbm.admin.annotation.LogOperation;
|
||||||
import com.cnbm.admin.params.IdParam;
|
import com.cnbm.admin.params.IdParam;
|
||||||
|
import com.cnbm.basic.dto.UnitDTO;
|
||||||
import com.cnbm.common.constant.Constant;
|
import com.cnbm.common.constant.Constant;
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.utils.ExcelUtils;
|
import com.cnbm.common.utils.ExcelUtils;
|
||||||
@ -134,4 +135,10 @@ public class WorkingProcedureController {
|
|||||||
return new Result<List<WorkingProcedureDTO>>().ok(list);
|
return new Result<List<WorkingProcedureDTO>>().ok(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "list")
|
||||||
|
@ApiOperation(value = "获取工序列表")
|
||||||
|
private List<WorkingProcedureDTO> list(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
|
return workingProcedureService.list(params);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -2,6 +2,7 @@ package com.cnbm.basic.controller;
|
|||||||
|
|
||||||
import com.cnbm.admin.annotation.LogOperation;
|
import com.cnbm.admin.annotation.LogOperation;
|
||||||
import com.cnbm.admin.params.IdParam;
|
import com.cnbm.admin.params.IdParam;
|
||||||
|
import com.cnbm.basic.dto.WorkingProcedureDTO;
|
||||||
import com.cnbm.common.constant.Constant;
|
import com.cnbm.common.constant.Constant;
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.utils.ExcelUtils;
|
import com.cnbm.common.utils.ExcelUtils;
|
||||||
@ -124,4 +125,10 @@ public class WorkingProcedureTypeController {
|
|||||||
return new Result();
|
return new Result();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "list")
|
||||||
|
@ApiOperation(value = "获取工序类型列表")
|
||||||
|
private List<WorkingProcedureTypeDTO> list(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
|
return workingProcedureTypeService.list(params);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,6 +1,5 @@
|
|||||||
package com.cnbm.basic.service;
|
package com.cnbm.basic.service;
|
||||||
|
|
||||||
import com.cnbm.basic.dto.FactoryDTO;
|
|
||||||
import com.cnbm.common.page.PageData;
|
import com.cnbm.common.page.PageData;
|
||||||
import com.cnbm.common.service.CrudService;
|
import com.cnbm.common.service.CrudService;
|
||||||
import com.cnbm.basic.dto.ProductTypeDTO;
|
import com.cnbm.basic.dto.ProductTypeDTO;
|
||||||
|
@ -0,0 +1,143 @@
|
|||||||
|
package com.cnbm.processInspection.controller;
|
||||||
|
|
||||||
|
import com.cnbm.admin.annotation.LogOperation;
|
||||||
|
import com.cnbm.common.constant.Constant;
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.utils.ExcelUtils;
|
||||||
|
import com.cnbm.common.utils.Result;
|
||||||
|
import com.cnbm.common.validator.AssertUtils;
|
||||||
|
import com.cnbm.common.validator.ValidatorUtils;
|
||||||
|
import com.cnbm.common.validator.group.AddGroup;
|
||||||
|
import com.cnbm.common.validator.group.DefaultGroup;
|
||||||
|
import com.cnbm.common.validator.group.UpdateGroup;
|
||||||
|
import com.cnbm.processInspection.dto.InspectionSheetDTO;
|
||||||
|
import com.cnbm.processInspection.excel.InspectionSheetExcel;
|
||||||
|
import com.cnbm.processInspection.service.IInspectionSheetService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验单 表 前端控制器
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-17
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/processInspection/inspectionSheet")
|
||||||
|
@Api(tags="检验单 表")
|
||||||
|
public class InspectionSheetController {
|
||||||
|
@Autowired
|
||||||
|
private IInspectionSheetService inspectionSheetService;
|
||||||
|
|
||||||
|
@GetMapping("page")
|
||||||
|
@ApiOperation("分页")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||||
|
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataTypeClass = LocalDateTime.class),
|
||||||
|
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataTypeClass = LocalDateTime.class),
|
||||||
|
@ApiImplicitParam(name = "inspectionSite", value = "检验站点", paramType = "query", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "productId", value = "产品id", paramType = "query", dataTypeClass = Integer.class),
|
||||||
|
@ApiImplicitParam(name = "workingProcedureId", value = "工序id", paramType = "query", dataTypeClass = Integer.class),
|
||||||
|
@ApiImplicitParam(name = "machineId", value = "机台id", paramType = "query", dataTypeClass = Integer.class),
|
||||||
|
@ApiImplicitParam(name = "orderNumber", value = "订单号", paramType = "query", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "batchNumber", value = "批次号", paramType = "query", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "id", value = "检验单号", paramType = "query", dataTypeClass = Integer.class)
|
||||||
|
})
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:inspectionSheet:page')")
|
||||||
|
public Result<PageData<InspectionSheetDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||||
|
PageData<InspectionSheetDTO> page = inspectionSheetService.page(params);
|
||||||
|
|
||||||
|
return new Result<PageData<InspectionSheetDTO>>().ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@ApiOperation("信息")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:inspectionSheet:info')")
|
||||||
|
public Result<InspectionSheetDTO> get(@PathVariable("id") Long id){
|
||||||
|
InspectionSheetDTO data = inspectionSheetService.get(id);
|
||||||
|
|
||||||
|
return new Result<InspectionSheetDTO>().ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@ApiOperation("保存")
|
||||||
|
// @LogOperation("保存")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:inspectionSheet:save')")
|
||||||
|
public Result<Long> save(@RequestBody InspectionSheetDTO dto){
|
||||||
|
//效验数据
|
||||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||||
|
|
||||||
|
inspectionSheetService.save(dto);
|
||||||
|
|
||||||
|
return new Result<Long>().ok(dto.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@ApiOperation("修改")
|
||||||
|
// @LogOperation("修改")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:inspectionSheet:update')")
|
||||||
|
public Result<Long> update(@RequestBody InspectionSheetDTO dto){
|
||||||
|
//效验数据
|
||||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||||
|
|
||||||
|
inspectionSheetService.update(dto);
|
||||||
|
|
||||||
|
return new Result<Long>().ok(dto.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@ApiOperation("删除")
|
||||||
|
// @LogOperation("删除")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:inspectionSheet:delete')")
|
||||||
|
public Result delete(@RequestBody Long[] ids){
|
||||||
|
//效验数据
|
||||||
|
AssertUtils.isArrayEmpty(ids, "id");
|
||||||
|
|
||||||
|
inspectionSheetService.delete(ids);
|
||||||
|
|
||||||
|
return new Result();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("export")
|
||||||
|
@ApiOperation("导出")
|
||||||
|
// @LogOperation("导出")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:inspectionSheet:export')")
|
||||||
|
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||||
|
List<InspectionSheetDTO> list = inspectionSheetService.list(params);
|
||||||
|
|
||||||
|
ExcelUtils.exportExcelToTarget(response, null, list, InspectionSheetExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping(value = "list")
|
||||||
|
@ApiOperation(value = "获取检验单列表")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataTypeClass = LocalDateTime.class),
|
||||||
|
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataTypeClass = LocalDateTime.class),
|
||||||
|
@ApiImplicitParam(name = "inspectionSite", value = "检验站点", paramType = "query", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "productId", value = "产品id", paramType = "query", dataTypeClass = Integer.class),
|
||||||
|
@ApiImplicitParam(name = "workingProcedureId", value = "工序id", paramType = "query", dataTypeClass = Integer.class),
|
||||||
|
@ApiImplicitParam(name = "machineId", value = "机台id", paramType = "query", dataTypeClass = Integer.class),
|
||||||
|
@ApiImplicitParam(name = "orderNumber", value = "订单号", paramType = "query", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "batchNumber", value = "批次号", paramType = "query", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "id", value = "检验单号", paramType = "query", dataTypeClass = Integer.class)
|
||||||
|
})
|
||||||
|
private List<InspectionSheetDTO> list(@ApiIgnore @RequestParam Map<String, Object> params) {
|
||||||
|
return inspectionSheetService.list(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,114 @@
|
|||||||
|
package com.cnbm.processInspection.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验单 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "检验单 表DTO对象")
|
||||||
|
public class InspectionSheetDTO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单号,手动输入")
|
||||||
|
private String orderNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "批次号,手填")
|
||||||
|
private String batchNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "检验站点,手填")
|
||||||
|
private String inspectionSite;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "产品id,关联product表")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "产品名称,关联product表")
|
||||||
|
private String productName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "检验阶段;1 进货检验、 2 过程检验、 3 成品检验、 4 出货检验;; 如果有多个用逗号隔开,比如 1,4 就代表选中了进货检验和出货检验")
|
||||||
|
private String inspectionStage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工序id,关联working_procedure表")
|
||||||
|
private Long workingProcedureId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工序名称,关联working_procedure表")
|
||||||
|
private String workingProcedureName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机台id,关联machine表")
|
||||||
|
private Long machineId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "机台名称,关联machine表")
|
||||||
|
private String machineName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班次id,关联shift表")
|
||||||
|
private Long shiftId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班次名称,关联shift表")
|
||||||
|
private String shiftName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分组样本数(就是这个产品下所有检测参数 的 最大样本数),只给用户查看,值是后台自动计算的")
|
||||||
|
private Integer numberOfGroupedSamples;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "样本大小(就是检验单(母体)下的子样个数),只给用户查看,值是后台自动计算的")
|
||||||
|
private Integer numberOfSamples;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "缺陷数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||||
|
private Integer numberOfDefects;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "不良数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||||
|
private Integer defectiveQuantity;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "生产人")
|
||||||
|
private String producer;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "检验人")
|
||||||
|
private String inspector;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "产品特性类型:1 计量型;2 计数型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "1 可用,0 不可用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
package com.cnbm.processInspection.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 检验单 表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("inspection_sheet")
|
||||||
|
@ApiModel(value = "InspectionSheet对象", description = "检验单 表")
|
||||||
|
public class InspectionSheet implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("订单号,手动输入")
|
||||||
|
private String orderNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("批次号,手填")
|
||||||
|
private String batchNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("检验站点,手填")
|
||||||
|
private String inspectionSite;
|
||||||
|
|
||||||
|
@ApiModelProperty("产品id,关联product表")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@ApiModelProperty("检验阶段;1 进货检验、 2 过程检验、 3 成品检验、 4 出货检验;; 如果有多个用逗号隔开,比如 1,4 就代表选中了进货检验和出货检验")
|
||||||
|
private String inspectionStage;
|
||||||
|
|
||||||
|
@ApiModelProperty("工序id,关联working_procedure表")
|
||||||
|
private Long workingProcedureId;
|
||||||
|
|
||||||
|
@ApiModelProperty("机台id,关联machine表")
|
||||||
|
private Long machineId;
|
||||||
|
|
||||||
|
@ApiModelProperty("班次id,关联shift表")
|
||||||
|
private Long shiftId;
|
||||||
|
|
||||||
|
@ApiModelProperty("分组样本数(就是这个产品下所有检测参数 的 最大样本数),只给用户查看,值是后台自动计算的")
|
||||||
|
private Integer numberOfGroupedSamples;
|
||||||
|
|
||||||
|
@ApiModelProperty("样本大小(就是检验单(母体)下的子样个数),只给用户查看,值是后台自动计算的")
|
||||||
|
private Integer numberOfSamples;
|
||||||
|
|
||||||
|
@ApiModelProperty("缺陷数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||||
|
private Integer numberOfDefects;
|
||||||
|
|
||||||
|
@ApiModelProperty("不良数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||||
|
private Integer defectiveQuantity;
|
||||||
|
|
||||||
|
@ApiModelProperty("生产人")
|
||||||
|
private String producer;
|
||||||
|
|
||||||
|
@ApiModelProperty("检验人")
|
||||||
|
private String inspector;
|
||||||
|
|
||||||
|
@ApiModelProperty("产品特性类型:1 计量型;2 计数型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("1 可用,0 不可用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.cnbm.processInspection.excel;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验单 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class InspectionSheetExcel {
|
||||||
|
@Excel(name = "ID")
|
||||||
|
private Long id;
|
||||||
|
@Excel(name = "订单号,手动输入")
|
||||||
|
private String orderNumber;
|
||||||
|
@Excel(name = "批次号,手填")
|
||||||
|
private String batchNumber;
|
||||||
|
@Excel(name = "检验站点,手填")
|
||||||
|
private String inspectionSite;
|
||||||
|
@Excel(name = "产品id,关联product表")
|
||||||
|
private Long productId;
|
||||||
|
@Excel(name = "检验阶段;1 进货检验、 2 过程检验、 3 成品检验、 4 出货检验;; 如果有多个用逗号隔开,比如 1,4 就代表选中了进货检验和出货检验")
|
||||||
|
private String inspectionStage;
|
||||||
|
@Excel(name = "工序id,关联working_procedure表")
|
||||||
|
private Long workingProcedureId;
|
||||||
|
@Excel(name = "机台id,关联machine表")
|
||||||
|
private Long machineId;
|
||||||
|
@Excel(name = "班次id,关联shift表")
|
||||||
|
private Long shiftId;
|
||||||
|
@Excel(name = "分组样本数(就是这个产品下所有检测参数 的 最大样本数),只给用户查看,值是后台自动计算的")
|
||||||
|
private Integer numberOfGroupedSamples;
|
||||||
|
@Excel(name = "样本大小(就是检验单(母体)下的子样个数),只给用户查看,值是后台自动计算的")
|
||||||
|
private Integer numberOfSamples;
|
||||||
|
@Excel(name = "缺陷数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||||
|
private Integer numberOfDefects;
|
||||||
|
@Excel(name = "不良数量,只给用户查看,值是后台自动计算的(是以 这个检验单下 样本子样 为单位的 )")
|
||||||
|
private Integer defectiveQuantity;
|
||||||
|
@Excel(name = "生产人")
|
||||||
|
private String producer;
|
||||||
|
@Excel(name = "检验人")
|
||||||
|
private String inspector;
|
||||||
|
@Excel(name = "产品特性类型:1 计量型;2 计数型")
|
||||||
|
private Integer type;
|
||||||
|
@Excel(name = "1 可用,0 不可用")
|
||||||
|
private Integer status;
|
||||||
|
@Excel(name = "备注")
|
||||||
|
private String remark;
|
||||||
|
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
@Excel(name = "创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
@Excel(name = "创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
@Excel(name = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
@Excel(name = "更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
@Excel(name = "更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
@Excel(name = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
@Excel(name = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package com.cnbm.processInspection.mapper;
|
||||||
|
|
||||||
|
import com.cnbm.common.dao.BaseDao;
|
||||||
|
import com.cnbm.processInspection.dto.InspectionSheetDTO;
|
||||||
|
import com.cnbm.processInspection.entity.InspectionSheet;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验单 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-17
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface InspectionSheetMapper extends BaseDao<InspectionSheet> {
|
||||||
|
List<InspectionSheetDTO> list(Map<String, Object> params);
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.cnbm.processInspection.service;
|
||||||
|
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.service.CrudService;
|
||||||
|
import com.cnbm.processInspection.dto.InspectionSheetDTO;
|
||||||
|
import com.cnbm.processInspection.entity.InspectionSheet;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验单 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-17
|
||||||
|
*/
|
||||||
|
public interface IInspectionSheetService extends CrudService<InspectionSheet, InspectionSheetDTO> {
|
||||||
|
|
||||||
|
PageData<InspectionSheetDTO> page (Map<String, Object> params);
|
||||||
|
|
||||||
|
InspectionSheetDTO get(Long id);
|
||||||
|
|
||||||
|
void save(InspectionSheetDTO dto);
|
||||||
|
|
||||||
|
void update(InspectionSheetDTO dto);
|
||||||
|
|
||||||
|
void delete(Long[] ids);
|
||||||
|
|
||||||
|
List<InspectionSheetDTO> list(Map<String, Object> params);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,86 @@
|
|||||||
|
package com.cnbm.processInspection.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
|
import com.cnbm.common.utils.ConvertUtils;
|
||||||
|
import com.cnbm.processInspection.dto.InspectionSheetDTO;
|
||||||
|
import com.cnbm.processInspection.entity.InspectionSheet;
|
||||||
|
import com.cnbm.processInspection.mapper.InspectionSheetMapper;
|
||||||
|
import com.cnbm.processInspection.service.IInspectionSheetService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检验单 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-17
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InspectionSheetServiceImpl extends CrudServiceImpl<InspectionSheetMapper, InspectionSheet, InspectionSheetDTO> implements IInspectionSheetService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InspectionSheetMapper mapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryWrapper<InspectionSheet> getWrapper(Map<String, Object> params){
|
||||||
|
String id = (String)params.get("id");
|
||||||
|
|
||||||
|
QueryWrapper<InspectionSheet> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
|
||||||
|
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData<InspectionSheetDTO> page (Map<String, Object> params){
|
||||||
|
IPage<InspectionSheet> page = baseDao.selectPage(
|
||||||
|
getPage(params, "id", true),
|
||||||
|
getWrapper(params)
|
||||||
|
);
|
||||||
|
return getPageData(page, InspectionSheetDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InspectionSheetDTO get(Long id) {
|
||||||
|
InspectionSheet entity = baseDao.selectById(id);
|
||||||
|
return ConvertUtils.sourceToTarget(entity, InspectionSheetDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void save(InspectionSheetDTO dto) {
|
||||||
|
InspectionSheet entity = ConvertUtils.sourceToTarget(dto, InspectionSheet.class);
|
||||||
|
insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(InspectionSheetDTO dto) {
|
||||||
|
InspectionSheet entity = ConvertUtils.sourceToTarget(dto, InspectionSheet.class);
|
||||||
|
updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delete(Long[] ids) {
|
||||||
|
//删除
|
||||||
|
deleteBatchIds(Arrays.asList(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public List<InspectionSheetDTO> list(Map<String, Object> params) {
|
||||||
|
List<InspectionSheetDTO> list = mapper.list(params);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,67 @@
|
|||||||
|
<?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.cnbm.processInspection.mapper.InspectionSheetMapper">
|
||||||
|
<resultMap type="com.cnbm.processInspection.entity.InspectionSheet" id="InspectionSheetMap">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<id column="order_number" property="orderNumber" />
|
||||||
|
<id column="batch_number" property="batchNumber" />
|
||||||
|
<id column="inspection_site" property="inspectionSite" />
|
||||||
|
<id column="product_id" property="productId" />
|
||||||
|
<id column="inspection_stage" property="inspectionStage" />
|
||||||
|
<id column="working_procedure_id" property="workingProcedureId" />
|
||||||
|
<id column="machine_id" property="machineId" />
|
||||||
|
<id column="shift_id" property="shiftId" />
|
||||||
|
<id column="number_of_grouped_samples" property="numberOfGroupedSamples" />
|
||||||
|
<id column="number_of_samples" property="numberOfSamples" />
|
||||||
|
<id column="number_of_defects" property="numberOfDefects" />
|
||||||
|
<id column="defective_quantity" property="defectiveQuantity" />
|
||||||
|
<id column="producer" property="producer" />
|
||||||
|
<id column="inspector" property="inspector" />
|
||||||
|
<id column="type" property="type" />
|
||||||
|
<id column="status" property="status" />
|
||||||
|
<id column="remark" property="remark" />
|
||||||
|
<id column="valid" property="valid" />
|
||||||
|
<id column="creator_id" property="creatorId" />
|
||||||
|
<id column="creator_name" property="creatorName" />
|
||||||
|
<id column="create_time" property="createTime" />
|
||||||
|
<id column="updater_id" property="updaterId" />
|
||||||
|
<id column="updater_name" property="updaterName" />
|
||||||
|
<id column="update_time" property="updateTime" />
|
||||||
|
<id column="version" property="version" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.cnbm.processInspection.dto.InspectionSheetDTO">
|
||||||
|
SELECT i.*, p.name AS productName, wp.name AS workingProcedureName, m.name AS machineName, s.name AS shiftName
|
||||||
|
FROM inspection_sheet i
|
||||||
|
LEFT JOIN product p ON i.product_id=p.id
|
||||||
|
LEFT JOIN working_procedure wp ON i.working_procedure_id=wp.id
|
||||||
|
LEFT JOIN machine m ON i.machine_id=m.id
|
||||||
|
LEFT JOIN shift s ON i.shift_id=s.id
|
||||||
|
<where>
|
||||||
|
<if test="startTime != null and endTime != null">
|
||||||
|
and is.create_time BETWEEN #{startTime} AND #{endTime}
|
||||||
|
</if>
|
||||||
|
<if test="inspectionSite != null and inspectionSite != ''">
|
||||||
|
and is.inspection_site like CONCAT(CONCAT('%',#{inspectionSite}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="workingProcedureId != null and workingProcedureId != ''">
|
||||||
|
and is.working_procedure_id=#{workingProcedureId}
|
||||||
|
</if>
|
||||||
|
<if test="productId != null and productId != ''">
|
||||||
|
and is.product_id=#{productId}
|
||||||
|
</if>
|
||||||
|
<if test="machineId != null and machineId != ''">
|
||||||
|
and is.machine_id=#{machineId}
|
||||||
|
</if>
|
||||||
|
<if test="orderNumber != null and orderNumber != ''">
|
||||||
|
and is.order_number like CONCAT(CONCAT('%',#{orderNumber}),'%')
|
||||||
|
</if>
|
||||||
|
<if test="batchNumber != null and batchNumber != ''">
|
||||||
|
and is.batch_number like CONCAT(CONCAT('%',#{batchNumber}),'%')
|
||||||
|
</if>
|
||||||
|
AND i.valid = 1
|
||||||
|
</where>
|
||||||
|
order by i.id asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
@ -21,5 +21,11 @@
|
|||||||
<artifactId>ym-common</artifactId>
|
<artifactId>ym-common</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.cnbm</groupId>
|
||||||
|
<artifactId>ym-admin</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
@ -0,0 +1,117 @@
|
|||||||
|
package com.cnbm.qualityPlanning.controller;
|
||||||
|
|
||||||
|
import com.cnbm.admin.annotation.LogOperation;
|
||||||
|
import com.cnbm.common.constant.Constant;
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.utils.ExcelUtils;
|
||||||
|
import com.cnbm.common.utils.Result;
|
||||||
|
import com.cnbm.common.validator.AssertUtils;
|
||||||
|
import com.cnbm.common.validator.ValidatorUtils;
|
||||||
|
import com.cnbm.common.validator.group.AddGroup;
|
||||||
|
import com.cnbm.common.validator.group.DefaultGroup;
|
||||||
|
import com.cnbm.common.validator.group.UpdateGroup;
|
||||||
|
import com.cnbm.qualityPlanning.dto.ControlGraphDTO;
|
||||||
|
import com.cnbm.qualityPlanning.excel.ControlGraphExcel;
|
||||||
|
import com.cnbm.qualityPlanning.service.IControlGraphService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制图形 表 前端控制器
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qualityPlanning/controlGraph")
|
||||||
|
@Api(tags="控制图形 表")
|
||||||
|
public class ControlGraphController {
|
||||||
|
@Autowired
|
||||||
|
private IControlGraphService controlGraphService;
|
||||||
|
|
||||||
|
@GetMapping("page")
|
||||||
|
@ApiOperation("分页")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||||
|
@ApiImplicitParam(name = "type", value = "产品特征类型", paramType = "query", dataTypeClass = Integer.class)
|
||||||
|
})
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:controlGraph:page')")
|
||||||
|
public Result<PageData<ControlGraphDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||||
|
PageData<ControlGraphDTO> page = controlGraphService.page(params);
|
||||||
|
|
||||||
|
return new Result<PageData<ControlGraphDTO>>().ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@ApiOperation("信息")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:controlGraph:info')")
|
||||||
|
public Result<ControlGraphDTO> get(@PathVariable("id") Long id){
|
||||||
|
ControlGraphDTO data = controlGraphService.get(id);
|
||||||
|
|
||||||
|
return new Result<ControlGraphDTO>().ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@ApiOperation("保存")
|
||||||
|
// @LogOperation("保存")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:controlGraph:save')")
|
||||||
|
public Result<Long> save(@RequestBody ControlGraphDTO dto){
|
||||||
|
//效验数据
|
||||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||||
|
|
||||||
|
controlGraphService.save(dto);
|
||||||
|
|
||||||
|
return new Result<Long>().ok(dto.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@ApiOperation("修改")
|
||||||
|
// @LogOperation("修改")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:controlGraph:update')")
|
||||||
|
public Result<Long> update(@RequestBody ControlGraphDTO dto){
|
||||||
|
//效验数据
|
||||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||||
|
|
||||||
|
controlGraphService.update(dto);
|
||||||
|
|
||||||
|
return new Result<Long>().ok(dto.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@ApiOperation("删除")
|
||||||
|
// @LogOperation("删除")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:controlGraph:delete')")
|
||||||
|
public Result delete(@RequestBody Long[] ids){
|
||||||
|
//效验数据
|
||||||
|
AssertUtils.isArrayEmpty(ids, "id");
|
||||||
|
|
||||||
|
controlGraphService.delete(ids);
|
||||||
|
|
||||||
|
return new Result();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("export")
|
||||||
|
@ApiOperation("导出")
|
||||||
|
// @LogOperation("导出")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:controlGraph:export')")
|
||||||
|
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||||
|
List<ControlGraphDTO> list = controlGraphService.list(params);
|
||||||
|
|
||||||
|
ExcelUtils.exportExcelToTarget(response, null, list, ControlGraphExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,118 @@
|
|||||||
|
package com.cnbm.qualityPlanning.controller;
|
||||||
|
|
||||||
|
import com.cnbm.admin.annotation.LogOperation;
|
||||||
|
import com.cnbm.common.constant.Constant;
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.utils.ExcelUtils;
|
||||||
|
import com.cnbm.common.utils.Result;
|
||||||
|
import com.cnbm.common.validator.AssertUtils;
|
||||||
|
import com.cnbm.common.validator.ValidatorUtils;
|
||||||
|
import com.cnbm.common.validator.group.AddGroup;
|
||||||
|
import com.cnbm.common.validator.group.DefaultGroup;
|
||||||
|
import com.cnbm.common.validator.group.UpdateGroup;
|
||||||
|
import com.cnbm.qualityPlanning.dto.InterpretationSchemeDTO;
|
||||||
|
import com.cnbm.qualityPlanning.excel.InterpretationSchemeExcel;
|
||||||
|
import com.cnbm.qualityPlanning.service.IInterpretationSchemeService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表 前端控制器
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qualityPlanning/interpretationScheme")
|
||||||
|
@Api(tags="判读方案 表")
|
||||||
|
public class InterpretationSchemeController {
|
||||||
|
@Autowired
|
||||||
|
private IInterpretationSchemeService interpretationSchemeService;
|
||||||
|
|
||||||
|
@GetMapping("page")
|
||||||
|
@ApiOperation("分页")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||||
|
@ApiImplicitParam(name = "name", value = "名称", paramType = "query", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataTypeClass = String.class)
|
||||||
|
})
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:interpretationScheme:page')")
|
||||||
|
public Result<PageData<InterpretationSchemeDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||||
|
PageData<InterpretationSchemeDTO> page = interpretationSchemeService.page(params);
|
||||||
|
|
||||||
|
return new Result<PageData<InterpretationSchemeDTO>>().ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@ApiOperation("信息")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:interpretationScheme:info')")
|
||||||
|
public Result<InterpretationSchemeDTO> get(@PathVariable("id") Long id){
|
||||||
|
InterpretationSchemeDTO data = interpretationSchemeService.get(id);
|
||||||
|
|
||||||
|
return new Result<InterpretationSchemeDTO>().ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@ApiOperation("保存")
|
||||||
|
// @LogOperation("保存")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:interpretationScheme:save')")
|
||||||
|
public Result<Long> save(@RequestBody InterpretationSchemeDTO dto){
|
||||||
|
//效验数据
|
||||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||||
|
|
||||||
|
interpretationSchemeService.save(dto);
|
||||||
|
|
||||||
|
return new Result<Long>().ok(dto.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@ApiOperation("修改")
|
||||||
|
// @LogOperation("修改")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:interpretationScheme:update')")
|
||||||
|
public Result<Long> update(@RequestBody InterpretationSchemeDTO dto){
|
||||||
|
//效验数据
|
||||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||||
|
|
||||||
|
interpretationSchemeService.update(dto);
|
||||||
|
|
||||||
|
return new Result<Long>().ok(dto.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@ApiOperation("删除")
|
||||||
|
// @LogOperation("删除")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:interpretationScheme:delete')")
|
||||||
|
public Result delete(@RequestBody Long[] ids){
|
||||||
|
//效验数据
|
||||||
|
AssertUtils.isArrayEmpty(ids, "id");
|
||||||
|
|
||||||
|
interpretationSchemeService.delete(ids);
|
||||||
|
|
||||||
|
return new Result();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("export")
|
||||||
|
@ApiOperation("导出")
|
||||||
|
// @LogOperation("导出")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:interpretationScheme:export')")
|
||||||
|
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||||
|
List<InterpretationSchemeDTO> list = interpretationSchemeService.list(params);
|
||||||
|
|
||||||
|
ExcelUtils.exportExcelToTarget(response, null, list, InterpretationSchemeExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,118 @@
|
|||||||
|
package com.cnbm.qualityPlanning.controller;
|
||||||
|
|
||||||
|
import com.cnbm.admin.annotation.LogOperation;
|
||||||
|
import com.cnbm.common.constant.Constant;
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.utils.ExcelUtils;
|
||||||
|
import com.cnbm.common.utils.Result;
|
||||||
|
import com.cnbm.common.validator.AssertUtils;
|
||||||
|
import com.cnbm.common.validator.ValidatorUtils;
|
||||||
|
import com.cnbm.common.validator.group.AddGroup;
|
||||||
|
import com.cnbm.common.validator.group.DefaultGroup;
|
||||||
|
import com.cnbm.common.validator.group.UpdateGroup;
|
||||||
|
import com.cnbm.qualityPlanning.dto.MyInterpretationSchemeDTO;
|
||||||
|
import com.cnbm.qualityPlanning.excel.MyInterpretationSchemeExcel;
|
||||||
|
import com.cnbm.qualityPlanning.service.IMyInterpretationSchemeService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiImplicitParams;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表 前端控制器
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qualityPlanning/myInterpretationScheme")
|
||||||
|
@Api(tags="自定义判读方案 表")
|
||||||
|
public class MyInterpretationSchemeController {
|
||||||
|
@Autowired
|
||||||
|
private IMyInterpretationSchemeService myInterpretationSchemeService;
|
||||||
|
|
||||||
|
@GetMapping("page")
|
||||||
|
@ApiOperation("分页")
|
||||||
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码,从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
|
||||||
|
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class),
|
||||||
|
@ApiImplicitParam(name = "name", value = "名称", paramType = "query", dataTypeClass = String.class),
|
||||||
|
@ApiImplicitParam(name = "code", value = "编码", paramType = "query", dataTypeClass = String.class)
|
||||||
|
})
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:myInterpretationScheme:page')")
|
||||||
|
public Result<PageData<MyInterpretationSchemeDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||||
|
PageData<MyInterpretationSchemeDTO> page = myInterpretationSchemeService.page(params);
|
||||||
|
|
||||||
|
return new Result<PageData<MyInterpretationSchemeDTO>>().ok(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("{id}")
|
||||||
|
@ApiOperation("信息")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:myInterpretationScheme:info')")
|
||||||
|
public Result<MyInterpretationSchemeDTO> get(@PathVariable("id") Long id){
|
||||||
|
MyInterpretationSchemeDTO data = myInterpretationSchemeService.get(id);
|
||||||
|
|
||||||
|
return new Result<MyInterpretationSchemeDTO>().ok(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@ApiOperation("保存")
|
||||||
|
// @LogOperation("保存")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:myInterpretationScheme:save')")
|
||||||
|
public Result<Long> save(@RequestBody MyInterpretationSchemeDTO dto){
|
||||||
|
//效验数据
|
||||||
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
|
||||||
|
|
||||||
|
myInterpretationSchemeService.save(dto);
|
||||||
|
|
||||||
|
return new Result<Long>().ok(dto.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@ApiOperation("修改")
|
||||||
|
// @LogOperation("修改")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:myInterpretationScheme:update')")
|
||||||
|
public Result<Long> update(@RequestBody MyInterpretationSchemeDTO dto){
|
||||||
|
//效验数据
|
||||||
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
|
||||||
|
|
||||||
|
myInterpretationSchemeService.update(dto);
|
||||||
|
|
||||||
|
return new Result<Long>().ok(dto.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@ApiOperation("删除")
|
||||||
|
// @LogOperation("删除")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:myInterpretationScheme:delete')")
|
||||||
|
public Result delete(@RequestBody Long[] ids){
|
||||||
|
//效验数据
|
||||||
|
AssertUtils.isArrayEmpty(ids, "id");
|
||||||
|
|
||||||
|
myInterpretationSchemeService.delete(ids);
|
||||||
|
|
||||||
|
return new Result();
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("export")
|
||||||
|
@ApiOperation("导出")
|
||||||
|
// @LogOperation("导出")
|
||||||
|
// @PreAuthorize("@ex.hasAuthority('code:myInterpretationScheme:export')")
|
||||||
|
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
|
||||||
|
List<MyInterpretationSchemeDTO> list = myInterpretationSchemeService.list(params);
|
||||||
|
|
||||||
|
ExcelUtils.exportExcelToTarget(response, null, list, MyInterpretationSchemeExcel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.cnbm.qualityPlanning.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制图形 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "控制图形 表DTO对象")
|
||||||
|
public class ControlGraphDTO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "控制图形 名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "控制图形 编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "产品特性类型:1 计量型;2 计数型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "1 可用,0 不可用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.cnbm.qualityPlanning.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "判读方案 表DTO对象")
|
||||||
|
public class InterpretationSchemeDTO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "判读方案编号(手动输入),一旦add了,就不允许update这个字段")
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "判读方案规则号(1-10)")
|
||||||
|
private Integer ruleNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "判读方案规则,(eg: 规则五:连续x点中有x点落在中心线同侧两倍标准差以外)")
|
||||||
|
private String ruleKey;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "判读方案vaule1,(3)")
|
||||||
|
private Integer ruleValue1;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "判读方案vaule2,(2)")
|
||||||
|
private Integer ruleValue2;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,63 @@
|
|||||||
|
package com.cnbm.qualityPlanning.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "判读方案 表DTO对象")
|
||||||
|
public class MyInterpretationSchemeDTO implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "判读方案编号")
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "自定义判读方案名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "判读方案id数组用逗号隔开,关联 interpretation_scheme id;; eg: id1,id2,id3")
|
||||||
|
private String interpretationSchemeIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
package com.cnbm.qualityPlanning.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 控制图形 表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("control_graph")
|
||||||
|
@ApiModel(value = "ControlGraph对象", description = "控制图形 表")
|
||||||
|
public class ControlGraph implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("控制图形 名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("控制图形 编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@ApiModelProperty("产品特性类型:1 计量型;2 计数型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty("1 可用,0 不可用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package com.cnbm.qualityPlanning.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 判读方案 表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("interpretation_scheme")
|
||||||
|
@ApiModel(value = "InterpretationScheme对象", description = "判读方案 表")
|
||||||
|
public class InterpretationScheme implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("判读方案编号(手动输入),一旦add了,就不允许update这个字段")
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
@ApiModelProperty("判读方案规则号(1-10)")
|
||||||
|
private Integer ruleNum;
|
||||||
|
|
||||||
|
@ApiModelProperty("判读方案规则,(eg: 规则五:连续x点中有x点落在中心线同侧两倍标准差以外)")
|
||||||
|
private String ruleKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("判读方案vaule1,(3)")
|
||||||
|
private Integer ruleValue1;
|
||||||
|
|
||||||
|
@ApiModelProperty("判读方案vaule2,(2)")
|
||||||
|
private Integer ruleValue2;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,66 @@
|
|||||||
|
package com.cnbm.qualityPlanning.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 判读方案 表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-16
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("my_interpretation_scheme")
|
||||||
|
@ApiModel(value = "MyInterpretationScheme对象", description = "判读方案 表")
|
||||||
|
public class MyInterpretationScheme implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@ApiModelProperty("判读方案编号")
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
@ApiModelProperty("自定义判读方案名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("判读方案id数组用逗号隔开,关联 interpretation_scheme id;; eg: id1,id2,id3")
|
||||||
|
private String interpretationSchemeIds;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
|
||||||
|
@ApiModelProperty("更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
package com.cnbm.qualityPlanning.excel;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制图形 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ControlGraphExcel {
|
||||||
|
@Excel(name = "ID")
|
||||||
|
private Long id;
|
||||||
|
@Excel(name = "控制图形 名")
|
||||||
|
private String name;
|
||||||
|
@Excel(name = "控制图形 编码")
|
||||||
|
private String code;
|
||||||
|
@Excel(name = "产品特性类型:1 计量型;2 计数型")
|
||||||
|
private Integer type;
|
||||||
|
@Excel(name = "1 可用,0 不可用")
|
||||||
|
private Integer status;
|
||||||
|
@Excel(name = "备注")
|
||||||
|
private String remark;
|
||||||
|
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
@Excel(name = "创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
@Excel(name = "创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
@Excel(name = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
@Excel(name = "更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
@Excel(name = "更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
@Excel(name = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
@Excel(name = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package com.cnbm.qualityPlanning.excel;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class InterpretationSchemeExcel {
|
||||||
|
@Excel(name = "ID")
|
||||||
|
private Long id;
|
||||||
|
@Excel(name = "判读方案编号(手动输入),一旦add了,就不允许update这个字段")
|
||||||
|
private Integer code;
|
||||||
|
@Excel(name = "判读方案规则号(1-10)")
|
||||||
|
private Integer ruleNum;
|
||||||
|
@Excel(name = "判读方案规则,(eg: 规则五:连续x点中有x点落在中心线同侧两倍标准差以外)")
|
||||||
|
private String ruleKey;
|
||||||
|
@Excel(name = "判读方案vaule1,(3)")
|
||||||
|
private Integer ruleValue1;
|
||||||
|
@Excel(name = "判读方案vaule2,(2)")
|
||||||
|
private Integer ruleValue2;
|
||||||
|
@Excel(name = "备注")
|
||||||
|
private String remark;
|
||||||
|
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
@Excel(name = "创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
@Excel(name = "创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
@Excel(name = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
@Excel(name = "更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
@Excel(name = "更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
@Excel(name = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
@Excel(name = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,43 @@
|
|||||||
|
package com.cnbm.qualityPlanning.excel;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class MyInterpretationSchemeExcel {
|
||||||
|
@Excel(name = "ID")
|
||||||
|
private Long id;
|
||||||
|
@Excel(name = "判读方案编号")
|
||||||
|
private Integer code;
|
||||||
|
@Excel(name = "自定义判读方案名")
|
||||||
|
private String name;
|
||||||
|
@Excel(name = "判读方案id数组用逗号隔开,关联 interpretation_scheme id;; eg: id1,id2,id3")
|
||||||
|
private String interpretationSchemeIds;
|
||||||
|
@Excel(name = "备注")
|
||||||
|
private String remark;
|
||||||
|
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
|
||||||
|
private Integer valid;
|
||||||
|
@Excel(name = "创建人")
|
||||||
|
private Long creatorId;
|
||||||
|
@Excel(name = "创建人姓名")
|
||||||
|
private String creatorName;
|
||||||
|
@Excel(name = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
@Excel(name = "更新人")
|
||||||
|
private Long updaterId;
|
||||||
|
@Excel(name = "更新人姓名")
|
||||||
|
private String updaterName;
|
||||||
|
@Excel(name = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
@Excel(name = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.cnbm.qualityPlanning.mapper;
|
||||||
|
|
||||||
|
import com.cnbm.common.dao.BaseDao;
|
||||||
|
import com.cnbm.qualityPlanning.entity.ControlGraph;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制图形 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ControlGraphMapper extends BaseDao<ControlGraph> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.cnbm.qualityPlanning.mapper;
|
||||||
|
|
||||||
|
import com.cnbm.common.dao.BaseDao;
|
||||||
|
import com.cnbm.qualityPlanning.dto.InterpretationSchemeDTO;
|
||||||
|
import com.cnbm.qualityPlanning.entity.InterpretationScheme;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface InterpretationSchemeMapper extends BaseDao<InterpretationScheme> {
|
||||||
|
|
||||||
|
List<InterpretationSchemeDTO> list();
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.cnbm.qualityPlanning.mapper;
|
||||||
|
|
||||||
|
import com.cnbm.common.dao.BaseDao;
|
||||||
|
import com.cnbm.qualityPlanning.entity.MyInterpretationScheme;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface MyInterpretationSchemeMapper extends BaseDao<MyInterpretationScheme> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
package com.cnbm.qualityPlanning.service;
|
||||||
|
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.service.CrudService;
|
||||||
|
import com.cnbm.qualityPlanning.dto.ControlGraphDTO;
|
||||||
|
import com.cnbm.qualityPlanning.entity.ControlGraph;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制图形 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
public interface IControlGraphService extends CrudService<ControlGraph, ControlGraphDTO> {
|
||||||
|
PageData<ControlGraphDTO> page (Map<String, Object> params);
|
||||||
|
|
||||||
|
ControlGraphDTO get(Long id);
|
||||||
|
|
||||||
|
void save(ControlGraphDTO dto);
|
||||||
|
|
||||||
|
void update(ControlGraphDTO dto);
|
||||||
|
|
||||||
|
void delete(Long[] ids);
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.cnbm.qualityPlanning.service;
|
||||||
|
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.service.CrudService;
|
||||||
|
import com.cnbm.qualityPlanning.dto.InterpretationSchemeDTO;
|
||||||
|
import com.cnbm.qualityPlanning.entity.InterpretationScheme;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
public interface IInterpretationSchemeService extends CrudService<InterpretationScheme, InterpretationSchemeDTO> {
|
||||||
|
|
||||||
|
PageData<InterpretationSchemeDTO> page (Map<String, Object> params);
|
||||||
|
|
||||||
|
InterpretationSchemeDTO get(Long id);
|
||||||
|
|
||||||
|
void save(InterpretationSchemeDTO dto);
|
||||||
|
|
||||||
|
void update(InterpretationSchemeDTO dto);
|
||||||
|
|
||||||
|
void delete(Long[] ids);
|
||||||
|
|
||||||
|
List<InterpretationSchemeDTO> list();
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package com.cnbm.qualityPlanning.service;
|
||||||
|
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.service.CrudService;
|
||||||
|
import com.cnbm.qualityPlanning.dto.MyInterpretationSchemeDTO;
|
||||||
|
import com.cnbm.qualityPlanning.entity.MyInterpretationScheme;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
public interface IMyInterpretationSchemeService extends CrudService<MyInterpretationScheme, MyInterpretationSchemeDTO> {
|
||||||
|
|
||||||
|
PageData<MyInterpretationSchemeDTO> page (Map<String, Object> params);
|
||||||
|
|
||||||
|
MyInterpretationSchemeDTO get(Long id);
|
||||||
|
|
||||||
|
void save(MyInterpretationSchemeDTO dto);
|
||||||
|
|
||||||
|
void update(MyInterpretationSchemeDTO dto);
|
||||||
|
|
||||||
|
void delete(Long[] ids);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,73 @@
|
|||||||
|
package com.cnbm.qualityPlanning.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
|
import com.cnbm.common.utils.ConvertUtils;
|
||||||
|
import com.cnbm.qualityPlanning.dto.ControlGraphDTO;
|
||||||
|
import com.cnbm.qualityPlanning.entity.ControlGraph;
|
||||||
|
import com.cnbm.qualityPlanning.mapper.ControlGraphMapper;
|
||||||
|
import com.cnbm.qualityPlanning.service.IControlGraphService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控制图形 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ControlGraphServiceImpl extends CrudServiceImpl<ControlGraphMapper, ControlGraph, ControlGraphDTO> implements IControlGraphService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryWrapper<ControlGraph> getWrapper(Map<String, Object> params){
|
||||||
|
|
||||||
|
QueryWrapper<ControlGraph> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.eq(ObjectUtils.isNotNull(params.get("type")), "type", params.get("type"));
|
||||||
|
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData<ControlGraphDTO> page (Map<String, Object> params){
|
||||||
|
IPage<ControlGraph> page = baseDao.selectPage(
|
||||||
|
getPage(params, "id", true),
|
||||||
|
getWrapper(params)
|
||||||
|
);
|
||||||
|
return getPageData(page, ControlGraphDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ControlGraphDTO get(Long id) {
|
||||||
|
ControlGraph entity = baseDao.selectById(id);
|
||||||
|
return ConvertUtils.sourceToTarget(entity, ControlGraphDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void save(ControlGraphDTO dto) {
|
||||||
|
ControlGraph entity = ConvertUtils.sourceToTarget(dto, ControlGraph.class);
|
||||||
|
insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(ControlGraphDTO dto) {
|
||||||
|
ControlGraph entity = ConvertUtils.sourceToTarget(dto, ControlGraph.class);
|
||||||
|
updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delete(Long[] ids) {
|
||||||
|
//删除
|
||||||
|
deleteBatchIds(Arrays.asList(ids));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
package com.cnbm.qualityPlanning.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
|
import com.cnbm.common.utils.ConvertUtils;
|
||||||
|
import com.cnbm.qualityPlanning.dto.InterpretationSchemeDTO;
|
||||||
|
import com.cnbm.qualityPlanning.entity.InterpretationScheme;
|
||||||
|
import com.cnbm.qualityPlanning.mapper.InterpretationSchemeMapper;
|
||||||
|
import com.cnbm.qualityPlanning.service.IInterpretationSchemeService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class InterpretationSchemeServiceImpl extends CrudServiceImpl<InterpretationSchemeMapper, InterpretationScheme, InterpretationSchemeDTO> implements IInterpretationSchemeService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private InterpretationSchemeMapper mapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryWrapper<InterpretationScheme> getWrapper(Map<String, Object> params){
|
||||||
|
String name = (String)params.get("name");
|
||||||
|
String code = (String)params.get("code");
|
||||||
|
|
||||||
|
QueryWrapper<InterpretationScheme> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.like(StringUtils.isNotBlank(name), "name", name);
|
||||||
|
wrapper.like(StringUtils.isNotBlank(code), "code", code);
|
||||||
|
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData<InterpretationSchemeDTO> page (Map<String, Object> params){
|
||||||
|
IPage<InterpretationScheme> page = baseDao.selectPage(
|
||||||
|
getPage(params, "id", true),
|
||||||
|
getWrapper(params)
|
||||||
|
);
|
||||||
|
return getPageData(page, InterpretationSchemeDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InterpretationSchemeDTO get(Long id) {
|
||||||
|
InterpretationScheme entity = baseDao.selectById(id);
|
||||||
|
return ConvertUtils.sourceToTarget(entity, InterpretationSchemeDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void save(InterpretationSchemeDTO dto) {
|
||||||
|
InterpretationScheme entity = ConvertUtils.sourceToTarget(dto, InterpretationScheme.class);
|
||||||
|
insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(InterpretationSchemeDTO dto) {
|
||||||
|
InterpretationScheme entity = ConvertUtils.sourceToTarget(dto, InterpretationScheme.class);
|
||||||
|
updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delete(Long[] ids) {
|
||||||
|
//删除
|
||||||
|
deleteBatchIds(Arrays.asList(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public List<InterpretationSchemeDTO> list() {
|
||||||
|
List<InterpretationSchemeDTO> list = mapper.list();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package com.cnbm.qualityPlanning.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.cnbm.common.page.PageData;
|
||||||
|
import com.cnbm.common.service.impl.CrudServiceImpl;
|
||||||
|
import com.cnbm.common.utils.ConvertUtils;
|
||||||
|
import com.cnbm.qualityPlanning.dto.MyInterpretationSchemeDTO;
|
||||||
|
import com.cnbm.qualityPlanning.entity.MyInterpretationScheme;
|
||||||
|
import com.cnbm.qualityPlanning.mapper.MyInterpretationSchemeMapper;
|
||||||
|
import com.cnbm.qualityPlanning.service.IMyInterpretationSchemeService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判读方案 表
|
||||||
|
*
|
||||||
|
* @author why
|
||||||
|
* @since 2022-08-15
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MyInterpretationSchemeServiceImpl extends CrudServiceImpl<MyInterpretationSchemeMapper, MyInterpretationScheme, MyInterpretationSchemeDTO> implements IMyInterpretationSchemeService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QueryWrapper<MyInterpretationScheme> getWrapper(Map<String, Object> params){
|
||||||
|
String name = (String)params.get("name");
|
||||||
|
String code = (String)params.get("code");
|
||||||
|
|
||||||
|
QueryWrapper<MyInterpretationScheme> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.like(StringUtils.isNotBlank(name), "name", name);
|
||||||
|
wrapper.like(StringUtils.isNotBlank(code), "code", code);
|
||||||
|
|
||||||
|
return wrapper;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageData<MyInterpretationSchemeDTO> page (Map<String, Object> params){
|
||||||
|
IPage<MyInterpretationScheme> page = baseDao.selectPage(
|
||||||
|
getPage(params, "id", true),
|
||||||
|
getWrapper(params)
|
||||||
|
);
|
||||||
|
return getPageData(page, MyInterpretationSchemeDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MyInterpretationSchemeDTO get(Long id) {
|
||||||
|
MyInterpretationScheme entity = baseDao.selectById(id);
|
||||||
|
return ConvertUtils.sourceToTarget(entity, MyInterpretationSchemeDTO.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void save(MyInterpretationSchemeDTO dto) {
|
||||||
|
MyInterpretationScheme entity = ConvertUtils.sourceToTarget(dto, MyInterpretationScheme.class);
|
||||||
|
insert(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void update(MyInterpretationSchemeDTO dto) {
|
||||||
|
MyInterpretationScheme entity = ConvertUtils.sourceToTarget(dto, MyInterpretationScheme.class);
|
||||||
|
updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delete(Long[] ids) {
|
||||||
|
//删除
|
||||||
|
deleteBatchIds(Arrays.asList(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -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.cnbm.generator.code.mapper.ControlGraphMapper">
|
||||||
|
<resultMap type="com.cnbm.qualityPlanning.entity.ControlGraph" id="ControlGraphMap">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<id column="name" property="name" />
|
||||||
|
<id column="code" property="code" />
|
||||||
|
<id column="type" property="type" />
|
||||||
|
<id column="status" property="status" />
|
||||||
|
<id column="remark" property="remark" />
|
||||||
|
<id column="valid" property="valid" />
|
||||||
|
<id column="creator_id" property="creatorId" />
|
||||||
|
<id column="creator_name" property="creatorName" />
|
||||||
|
<id column="create_time" property="createTime" />
|
||||||
|
<id column="updater_id" property="updaterId" />
|
||||||
|
<id column="updater_name" property="updaterName" />
|
||||||
|
<id column="update_time" property="updateTime" />
|
||||||
|
<id column="version" property="version" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
@ -0,0 +1,27 @@
|
|||||||
|
<?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.cnbm.generator.code.mapper.InterpretationSchemeMapper">
|
||||||
|
<resultMap type="com.cnbm.qualityPlanning.entity.InterpretationScheme" id="InterpretationSchemeMap">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<id column="code" property="code" />
|
||||||
|
<id column="rule_num" property="ruleNum" />
|
||||||
|
<id column="rule_key" property="ruleKey" />
|
||||||
|
<id column="rule_value1" property="ruleValue1" />
|
||||||
|
<id column="rule_value2" property="ruleValue2" />
|
||||||
|
<id column="remark" property="remark" />
|
||||||
|
<id column="valid" property="valid" />
|
||||||
|
<id column="creator_id" property="creatorId" />
|
||||||
|
<id column="creator_name" property="creatorName" />
|
||||||
|
<id column="create_time" property="createTime" />
|
||||||
|
<id column="updater_id" property="updaterId" />
|
||||||
|
<id column="updater_name" property="updaterName" />
|
||||||
|
<id column="update_time" property="updateTime" />
|
||||||
|
<id column="version" property="version" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="list" resultType="com.cnbm.qualityPlanning.dto.InterpretationSchemeDTO">
|
||||||
|
select * from interpretation_scheme
|
||||||
|
order by id asc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</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.cnbm.generator.code.mapper.MyInterpretationSchemeMapper">
|
||||||
|
<resultMap type="com.cnbm.qualityPlanning.entity.MyInterpretationScheme" id="MyInterpretationSchemeMap">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<id column="code" property="code" />
|
||||||
|
<id column="name" property="name" />
|
||||||
|
<id column="interpretation_scheme_ids" property="interpretationSchemeIds" />
|
||||||
|
<id column="remark" property="remark" />
|
||||||
|
<id column="valid" property="valid" />
|
||||||
|
<id column="creator_id" property="creatorId" />
|
||||||
|
<id column="creator_name" property="creatorName" />
|
||||||
|
<id column="create_time" property="createTime" />
|
||||||
|
<id column="updater_id" property="updaterId" />
|
||||||
|
<id column="updater_name" property="updaterName" />
|
||||||
|
<id column="update_time" property="updateTime" />
|
||||||
|
<id column="version" property="version" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue
Block a user