移除旧的班组判定,新增新的班组判定与班组判定配置
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessSubParentSampleAssessmentService;
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 班组判定数据业务")
|
||||
@RestController
|
||||
@RequestMapping("/qms/business-sub-parent-sample-assessment")
|
||||
@Validated
|
||||
public class BusinessSubParentSampleAssessmentController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private BusinessSubParentSampleAssessmentService businessSubParentSampleAssessmentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建班组判定数据业务")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:create')")
|
||||
public CommonResult<BusinessSubParentSampleAssessmentRespVO> createBusinessSubParentSampleAssessment(@Valid @RequestBody BusinessSubParentSampleAssessmentSaveReqVO createReqVO) {
|
||||
return success(businessSubParentSampleAssessmentService.createBusinessSubParentSampleAssessment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新班组判定数据业务")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:update')")
|
||||
public CommonResult<Boolean> updateBusinessSubParentSampleAssessment(@Valid @RequestBody BusinessSubParentSampleAssessmentSaveReqVO updateReqVO) {
|
||||
businessSubParentSampleAssessmentService.updateBusinessSubParentSampleAssessment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除班组判定数据业务")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:delete')")
|
||||
public CommonResult<Boolean> deleteBusinessSubParentSampleAssessment(@RequestParam("id") Long id) {
|
||||
businessSubParentSampleAssessmentService.deleteBusinessSubParentSampleAssessment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除班组判定数据业务")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:delete')")
|
||||
public CommonResult<Boolean> deleteBusinessSubParentSampleAssessmentList(@RequestBody BatchDeleteReqVO req) {
|
||||
businessSubParentSampleAssessmentService.deleteBusinessSubParentSampleAssessmentListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得班组判定数据业务")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:query')")
|
||||
public CommonResult<BusinessSubParentSampleAssessmentRespVO> getBusinessSubParentSampleAssessment(@RequestParam("id") Long id) {
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessment = businessSubParentSampleAssessmentService.getBusinessSubParentSampleAssessment(id);
|
||||
return success(BeanUtils.toBean(businessSubParentSampleAssessment, BusinessSubParentSampleAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得班组判定数据业务分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:query')")
|
||||
public CommonResult<PageResult<BusinessSubParentSampleAssessmentRespVO>> getBusinessSubParentSampleAssessmentPage(@Valid BusinessSubParentSampleAssessmentPageReqVO pageReqVO) {
|
||||
PageResult<BusinessSubParentSampleAssessmentDO> pageResult = businessSubParentSampleAssessmentService.getBusinessSubParentSampleAssessmentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BusinessSubParentSampleAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出班组判定数据业务 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-sub-parent-sample-assessment:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBusinessSubParentSampleAssessmentExcel(@Valid BusinessSubParentSampleAssessmentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BusinessSubParentSampleAssessmentDO> list = businessSubParentSampleAssessmentService.getBusinessSubParentSampleAssessmentPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "班组判定数据业务.xls", "数据", BusinessSubParentSampleAssessmentRespVO.class,
|
||||
BeanUtils.toBean(list, BusinessSubParentSampleAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
package com.zt.plat.module.qms.business.bus.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessTeamAssessmentPageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessTeamAssessmentRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessTeamAssessmentSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessTeamAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.service.BusinessTeamAssessmentService;
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 班组判定数据业务")
|
||||
@RestController
|
||||
@RequestMapping("/qms/business-team-assessment")
|
||||
@Validated
|
||||
public class BusinessTeamAssessmentController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private BusinessTeamAssessmentService businessTeamAssessmentService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建班组判定数据业务")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-team-assessment:create')")
|
||||
public CommonResult<BusinessTeamAssessmentRespVO> createBusinessTeamAssessment(@Valid @RequestBody BusinessTeamAssessmentSaveReqVO createReqVO) {
|
||||
return success(businessTeamAssessmentService.createBusinessTeamAssessment(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新班组判定数据业务")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-team-assessment:update')")
|
||||
public CommonResult<Boolean> updateBusinessTeamAssessment(@Valid @RequestBody BusinessTeamAssessmentSaveReqVO updateReqVO) {
|
||||
businessTeamAssessmentService.updateBusinessTeamAssessment(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除班组判定数据业务")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-team-assessment:delete')")
|
||||
public CommonResult<Boolean> deleteBusinessTeamAssessment(@RequestParam("id") Long id) {
|
||||
businessTeamAssessmentService.deleteBusinessTeamAssessment(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除班组判定数据业务")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-team-assessment:delete')")
|
||||
public CommonResult<Boolean> deleteBusinessTeamAssessmentList(@RequestBody BatchDeleteReqVO req) {
|
||||
businessTeamAssessmentService.deleteBusinessTeamAssessmentListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得班组判定数据业务")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-team-assessment:query')")
|
||||
public CommonResult<BusinessTeamAssessmentRespVO> getBusinessTeamAssessment(@RequestParam("id") Long id) {
|
||||
BusinessTeamAssessmentDO businessTeamAssessment = businessTeamAssessmentService.getBusinessTeamAssessment(id);
|
||||
return success(BeanUtils.toBean(businessTeamAssessment, BusinessTeamAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得班组判定数据业务分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-team-assessment:query')")
|
||||
public CommonResult<PageResult<BusinessTeamAssessmentRespVO>> getBusinessTeamAssessmentPage(@Valid BusinessTeamAssessmentPageReqVO pageReqVO) {
|
||||
PageResult<BusinessTeamAssessmentDO> pageResult = businessTeamAssessmentService.getBusinessTeamAssessmentPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BusinessTeamAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出班组判定数据业务 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:business-team-assessment:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportBusinessTeamAssessmentExcel(@Valid BusinessTeamAssessmentPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<BusinessTeamAssessmentDO> list = businessTeamAssessmentService.getBusinessTeamAssessmentPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "班组判定数据业务.xls", "数据", BusinessTeamAssessmentRespVO.class,
|
||||
BeanUtils.toBean(list, BusinessTeamAssessmentRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,21 +11,21 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
|
||||
@Schema(description = "管理后台 - 班组判定数据业务分页 Request VO")
|
||||
@Data
|
||||
public class BusinessTeamAssessmentPageReqVO extends PageParam {
|
||||
public class BusinessSubParentSampleAssessmentPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "样品分样ID", example = "27568")
|
||||
@Schema(description = "样品分样ID", example = "23188")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "15259")
|
||||
@Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", example = "17642")
|
||||
private Long dictionaryProjectId;
|
||||
|
||||
@Schema(description = "检测方法分析项目配置ID", example = "10333")
|
||||
@Schema(description = "检测方法分析项目配置ID", example = "7653")
|
||||
private Long configAssayMethodProjectId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", example = "7558")
|
||||
@Schema(description = "检测方法配置ID", example = "16271")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "1")
|
||||
@Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", example = "2")
|
||||
private String dataType;
|
||||
|
||||
@Schema(description = "小数位")
|
||||
@@ -34,10 +34,10 @@ public class BusinessTeamAssessmentPageReqVO extends PageParam {
|
||||
@Schema(description = "判定值")
|
||||
private String assessmentValue;
|
||||
|
||||
@Schema(description = "上报对应列", example = "芋艿")
|
||||
@Schema(description = "上报对应列", example = "张三")
|
||||
private String columnName;
|
||||
|
||||
@Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "1")
|
||||
@Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", example = "2")
|
||||
private String assessmentStatus;
|
||||
|
||||
@Schema(description = "是否已上报")
|
||||
@@ -57,7 +57,7 @@ public class BusinessTeamAssessmentPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "乐观锁", example = "7663")
|
||||
@Schema(description = "乐观锁", example = "16999")
|
||||
private Integer updateCount;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@@ -10,29 +10,29 @@ import com.alibaba.excel.annotation.*;
|
||||
@Schema(description = "管理后台 - 班组判定数据业务 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class BusinessTeamAssessmentRespVO {
|
||||
public class BusinessSubParentSampleAssessmentRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1643")
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5014")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27568")
|
||||
@Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23188")
|
||||
@ExcelProperty("样品分样ID")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "15259")
|
||||
@Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "17642")
|
||||
@ExcelProperty("检测项目ID,字典表【T_DIC_PRJ】")
|
||||
private Long dictionaryProjectId;
|
||||
|
||||
@Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10333")
|
||||
@Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7653")
|
||||
@ExcelProperty("检测方法分析项目配置ID")
|
||||
private Long configAssayMethodProjectId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7558")
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16271")
|
||||
@ExcelProperty("检测方法配置ID")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间")
|
||||
private String dataType;
|
||||
|
||||
@@ -44,11 +44,11 @@ public class BusinessTeamAssessmentRespVO {
|
||||
@ExcelProperty("判定值")
|
||||
private String assessmentValue;
|
||||
|
||||
@Schema(description = "上报对应列", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@Schema(description = "上报对应列", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("上报对应列")
|
||||
private String columnName;
|
||||
|
||||
@Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差")
|
||||
private String assessmentStatus;
|
||||
|
||||
@@ -64,7 +64,7 @@ public class BusinessTeamAssessmentRespVO {
|
||||
@ExcelProperty("上报时间")
|
||||
private LocalDateTime reportTime;
|
||||
|
||||
@Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@@ -72,7 +72,7 @@ public class BusinessTeamAssessmentRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "7663")
|
||||
@Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16999")
|
||||
@ExcelProperty("乐观锁")
|
||||
private Integer updateCount;
|
||||
|
||||
@@ -9,28 +9,28 @@ import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 班组判定数据业务新增/修改 Request VO")
|
||||
@Data
|
||||
public class BusinessTeamAssessmentSaveReqVO {
|
||||
public class BusinessSubParentSampleAssessmentSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1643")
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5014")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27568")
|
||||
@Schema(description = "样品分样ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "23188")
|
||||
@NotNull(message = "样品分样ID不能为空")
|
||||
private Long businessSubParentSampleId;
|
||||
|
||||
@Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "15259")
|
||||
@Schema(description = "检测项目ID,字典表【T_DIC_PRJ】", requiredMode = Schema.RequiredMode.REQUIRED, example = "17642")
|
||||
@NotNull(message = "检测项目ID,字典表【T_DIC_PRJ】不能为空")
|
||||
private Long dictionaryProjectId;
|
||||
|
||||
@Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10333")
|
||||
@Schema(description = "检测方法分析项目配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7653")
|
||||
@NotNull(message = "检测方法分析项目配置ID不能为空")
|
||||
private Long configAssayMethodProjectId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7558")
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "16271")
|
||||
@NotNull(message = "检测方法配置ID不能为空")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@Schema(description = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "数据类型,字典表【T_DIC_BSN】string-字符串,int-整数,decimal-小数,date-日期,datetime-时间不能为空")
|
||||
private String dataType;
|
||||
|
||||
@@ -40,11 +40,12 @@ public class BusinessTeamAssessmentSaveReqVO {
|
||||
@Schema(description = "判定值")
|
||||
private String assessmentValue;
|
||||
|
||||
@Schema(description = "上报对应列", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
@Schema(description = "上报对应列", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "上报对应列不能为空")
|
||||
private String columnName;
|
||||
|
||||
@Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@Schema(description = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差不能为空")
|
||||
private String assessmentStatus;
|
||||
|
||||
@Schema(description = "是否已上报", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -59,10 +60,11 @@ public class BusinessTeamAssessmentSaveReqVO {
|
||||
@NotNull(message = "上报时间不能为空")
|
||||
private LocalDateTime reportTime;
|
||||
|
||||
@Schema(description = "所属部门", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "7663")
|
||||
@Schema(description = "乐观锁", requiredMode = Schema.RequiredMode.REQUIRED, example = "16999")
|
||||
@NotNull(message = "乐观锁不能为空")
|
||||
private Integer updateCount;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@@ -12,8 +12,8 @@ import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_bsn_tam_asmt")
|
||||
@KeySequence("t_bsn_tam_asmt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@TableName("t_bsn_sb_prn_smp_asmt")
|
||||
@KeySequence("t_bsn_sb_prn_smp_asmt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@@ -23,7 +23,7 @@ import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class BusinessTeamAssessmentDO extends BusinessBaseDO {
|
||||
public class BusinessSubParentSampleAssessmentDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class BusinessTeamAssessmentDO extends BusinessBaseDO {
|
||||
@TableField("DEC_POS")
|
||||
private Integer decimalPosition;
|
||||
/**
|
||||
* 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差
|
||||
* 判定值
|
||||
*/
|
||||
@TableField("ASMT_VAL")
|
||||
private String assessmentValue;
|
||||
@@ -73,7 +73,7 @@ public class BusinessTeamAssessmentDO extends BusinessBaseDO {
|
||||
@TableField("COLN_NAME")
|
||||
private String columnName;
|
||||
/**
|
||||
* 超差标注
|
||||
* 判定状态,in_progress-进行中 normal-正常,exceeds_tolerance-超差
|
||||
*/
|
||||
@TableField("ASMT_STS")
|
||||
private String assessmentStatus;
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.zt.plat.module.qms.business.bus.dal.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 班组判定数据业务 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface BusinessSubParentSampleAssessmentMapper extends BaseMapperX<BusinessSubParentSampleAssessmentDO> {
|
||||
|
||||
default PageResult<BusinessSubParentSampleAssessmentDO> selectPage(BusinessSubParentSampleAssessmentPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessSubParentSampleAssessmentDO>()
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getDataType, reqVO.getDataType())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getDecimalPosition, reqVO.getDecimalPosition())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssessmentValue, reqVO.getAssessmentValue())
|
||||
.likeIfPresent(BusinessSubParentSampleAssessmentDO::getColumnName, reqVO.getColumnName())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getAssessmentStatus, reqVO.getAssessmentStatus())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getIsReported, reqVO.getIsReported())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getReporter, reqVO.getReporter())
|
||||
.betweenIfPresent(BusinessSubParentSampleAssessmentDO::getReportTime, reqVO.getReportTime())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(BusinessSubParentSampleAssessmentDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getUpdateCount, reqVO.getUpdateCount())
|
||||
.eqIfPresent(BusinessSubParentSampleAssessmentDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(BusinessSubParentSampleAssessmentDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
package com.zt.plat.module.qms.business.bus.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessTeamAssessmentPageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessTeamAssessmentDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 班组判定数据业务 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface BusinessTeamAssessmentMapper extends BaseMapperX<BusinessTeamAssessmentDO> {
|
||||
|
||||
default PageResult<BusinessTeamAssessmentDO> selectPage(BusinessTeamAssessmentPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessTeamAssessmentDO>()
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getBusinessSubParentSampleId, reqVO.getBusinessSubParentSampleId())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getDictionaryProjectId, reqVO.getDictionaryProjectId())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getConfigAssayMethodProjectId, reqVO.getConfigAssayMethodProjectId())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getDataType, reqVO.getDataType())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getDecimalPosition, reqVO.getDecimalPosition())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getAssessmentValue, reqVO.getAssessmentValue())
|
||||
.likeIfPresent(BusinessTeamAssessmentDO::getColumnName, reqVO.getColumnName())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getAssessmentStatus, reqVO.getAssessmentStatus())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getIsReported, reqVO.getIsReported())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getReporter, reqVO.getReporter())
|
||||
.betweenIfPresent(BusinessTeamAssessmentDO::getReportTime, reqVO.getReportTime())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(BusinessTeamAssessmentDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getUpdateCount, reqVO.getUpdateCount())
|
||||
.eqIfPresent(BusinessTeamAssessmentDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(BusinessTeamAssessmentDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import com.zt.plat.framework.common.exception.ServiceException;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSampleEntrustRegistrationDO;
|
||||
import com.zt.plat.module.qms.business.bus.liteflow.slot.SampleEntrustContext;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigEntrustSourceDO;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
|
||||
/**
|
||||
* 样品委托检查
|
||||
@@ -30,7 +31,7 @@ public class SampleEntrustCheckCmp extends NodeComponent {
|
||||
throw new ServiceException(500, "委托来源id不正确");
|
||||
}
|
||||
|
||||
sampleEntrustRegistration.setDataCheckStatus("success");
|
||||
sampleEntrustRegistration.setDataCheckStatus(QmsCommonConstant.SUCCESS);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessTeamAssessmentPageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessTeamAssessmentRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessTeamAssessmentSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessTeamAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
@@ -16,7 +12,7 @@ import com.zt.plat.framework.common.pojo.PageParam;
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface BusinessTeamAssessmentService {
|
||||
public interface BusinessSubParentSampleAssessmentService {
|
||||
|
||||
/**
|
||||
* 创建班组判定数据业务
|
||||
@@ -24,28 +20,28 @@ public interface BusinessTeamAssessmentService {
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
BusinessTeamAssessmentRespVO createBusinessTeamAssessment(@Valid BusinessTeamAssessmentSaveReqVO createReqVO);
|
||||
BusinessSubParentSampleAssessmentRespVO createBusinessSubParentSampleAssessment(@Valid BusinessSubParentSampleAssessmentSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新班组判定数据业务
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateBusinessTeamAssessment(@Valid BusinessTeamAssessmentSaveReqVO updateReqVO);
|
||||
void updateBusinessSubParentSampleAssessment(@Valid BusinessSubParentSampleAssessmentSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除班组判定数据业务
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteBusinessTeamAssessment(Long id);
|
||||
void deleteBusinessSubParentSampleAssessment(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除班组判定数据业务
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteBusinessTeamAssessmentListByIds(List<Long> ids);
|
||||
void deleteBusinessSubParentSampleAssessmentListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得班组判定数据业务
|
||||
@@ -53,7 +49,7 @@ public interface BusinessTeamAssessmentService {
|
||||
* @param id 编号
|
||||
* @return 班组判定数据业务
|
||||
*/
|
||||
BusinessTeamAssessmentDO getBusinessTeamAssessment(Long id);
|
||||
BusinessSubParentSampleAssessmentDO getBusinessSubParentSampleAssessment(Long id);
|
||||
|
||||
/**
|
||||
* 获得班组判定数据业务分页
|
||||
@@ -61,6 +57,6 @@ public interface BusinessTeamAssessmentService {
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 班组判定数据业务分页
|
||||
*/
|
||||
PageResult<BusinessTeamAssessmentDO> getBusinessTeamAssessmentPage(BusinessTeamAssessmentPageReqVO pageReqVO);
|
||||
PageResult<BusinessSubParentSampleAssessmentDO> getBusinessSubParentSampleAssessmentPage(BusinessSubParentSampleAssessmentPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import java.util.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubParentSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 班组判定数据业务 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BusinessSubParentSampleAssessmentServiceImpl implements BusinessSubParentSampleAssessmentService {
|
||||
|
||||
@Resource
|
||||
private BusinessSubParentSampleAssessmentMapper businessSubParentSampleAssessmentMapper;
|
||||
|
||||
@Override
|
||||
public BusinessSubParentSampleAssessmentRespVO createBusinessSubParentSampleAssessment(BusinessSubParentSampleAssessmentSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
BusinessSubParentSampleAssessmentDO businessSubParentSampleAssessment = BeanUtils.toBean(createReqVO, BusinessSubParentSampleAssessmentDO.class);
|
||||
businessSubParentSampleAssessmentMapper.insert(businessSubParentSampleAssessment);
|
||||
// 返回
|
||||
return BeanUtils.toBean(businessSubParentSampleAssessment, BusinessSubParentSampleAssessmentRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBusinessSubParentSampleAssessment(BusinessSubParentSampleAssessmentSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateBusinessSubParentSampleAssessmentExists(updateReqVO.getId());
|
||||
// 更新
|
||||
BusinessSubParentSampleAssessmentDO updateObj = BeanUtils.toBean(updateReqVO, BusinessSubParentSampleAssessmentDO.class);
|
||||
businessSubParentSampleAssessmentMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBusinessSubParentSampleAssessment(Long id) {
|
||||
// 校验存在
|
||||
validateBusinessSubParentSampleAssessmentExists(id);
|
||||
// 删除
|
||||
businessSubParentSampleAssessmentMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBusinessSubParentSampleAssessmentListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateBusinessSubParentSampleAssessmentExists(ids);
|
||||
// 删除
|
||||
businessSubParentSampleAssessmentMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateBusinessSubParentSampleAssessmentExists(List<Long> ids) {
|
||||
List<BusinessSubParentSampleAssessmentDO> list = businessSubParentSampleAssessmentMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateBusinessSubParentSampleAssessmentExists(Long id) {
|
||||
if (businessSubParentSampleAssessmentMapper.selectById(id) == null) {
|
||||
throw exception(BUSINESS_SUB_PARENT_SAMPLE_ASSESSMENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusinessSubParentSampleAssessmentDO getBusinessSubParentSampleAssessment(Long id) {
|
||||
return businessSubParentSampleAssessmentMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BusinessSubParentSampleAssessmentDO> getBusinessSubParentSampleAssessmentPage(BusinessSubParentSampleAssessmentPageReqVO pageReqVO) {
|
||||
return businessSubParentSampleAssessmentMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
package com.zt.plat.module.qms.business.bus.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessTeamAssessmentPageReqVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessTeamAssessmentRespVO;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.BusinessTeamAssessmentSaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.qms.business.bus.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessTeamAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessTeamAssessmentMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 班组判定数据业务 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class BusinessTeamAssessmentServiceImpl implements BusinessTeamAssessmentService {
|
||||
|
||||
@Resource
|
||||
private BusinessTeamAssessmentMapper businessTeamAssessmentMapper;
|
||||
|
||||
@Override
|
||||
public BusinessTeamAssessmentRespVO createBusinessTeamAssessment(BusinessTeamAssessmentSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
BusinessTeamAssessmentDO businessTeamAssessment = BeanUtils.toBean(createReqVO, BusinessTeamAssessmentDO.class);
|
||||
businessTeamAssessmentMapper.insert(businessTeamAssessment);
|
||||
// 返回
|
||||
return BeanUtils.toBean(businessTeamAssessment, BusinessTeamAssessmentRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBusinessTeamAssessment(BusinessTeamAssessmentSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateBusinessTeamAssessmentExists(updateReqVO.getId());
|
||||
// 更新
|
||||
BusinessTeamAssessmentDO updateObj = BeanUtils.toBean(updateReqVO, BusinessTeamAssessmentDO.class);
|
||||
businessTeamAssessmentMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBusinessTeamAssessment(Long id) {
|
||||
// 校验存在
|
||||
validateBusinessTeamAssessmentExists(id);
|
||||
// 删除
|
||||
businessTeamAssessmentMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteBusinessTeamAssessmentListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateBusinessTeamAssessmentExists(ids);
|
||||
// 删除
|
||||
businessTeamAssessmentMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateBusinessTeamAssessmentExists(List<Long> ids) {
|
||||
List<BusinessTeamAssessmentDO> list = businessTeamAssessmentMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(BUSINESS_TEAM_ASSESSMENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateBusinessTeamAssessmentExists(Long id) {
|
||||
if (businessTeamAssessmentMapper.selectById(id) == null) {
|
||||
throw exception(BUSINESS_TEAM_ASSESSMENT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public BusinessTeamAssessmentDO getBusinessTeamAssessment(Long id) {
|
||||
return businessTeamAssessmentMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<BusinessTeamAssessmentDO> getBusinessTeamAssessmentPage(BusinessTeamAssessmentPageReqVO pageReqVO) {
|
||||
return businessTeamAssessmentMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,7 +35,6 @@ import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessAssayTaskDataD
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessBaseSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessSubSampleDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.dataobject.BusinessTeamAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayParameterDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayProjectDataMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayReportDataMapper;
|
||||
@@ -45,7 +44,6 @@ import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessAssayTaskMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessBaseSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleAssessmentMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubSampleMapper;
|
||||
import com.zt.plat.module.qms.business.bus.dal.mapper.BusinessTeamAssessmentMapper;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigAssayMethodProjectAssessmentDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigReportFieldDO;
|
||||
@@ -101,8 +99,8 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
@Resource
|
||||
private ConfigAssayMethodProjectAssessmentMapper configAssayMethodProjectAssessmentMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessTeamAssessmentMapper businessTeamAssessmentMapper;
|
||||
// @Resource
|
||||
// private BusinessTeamAssessmentMapper businessTeamAssessmentMapper;
|
||||
|
||||
@Resource
|
||||
private BusinessSubSampleAssessmentMapper businessSubSampleAssessmentMapper;
|
||||
@@ -251,7 +249,7 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
String nickName = SecurityFrameworkUtils.getLoginUserNickname();
|
||||
|
||||
//班组长双杯判定记录
|
||||
List<BusinessTeamAssessmentDO> businessTeamAssessmentDOList = new ArrayList<>();
|
||||
// List<BusinessTeamAssessmentDO> businessTeamAssessmentDOList = new ArrayList<>();
|
||||
|
||||
//平行样判定记录
|
||||
List<BusinessSubSampleAssessmentDO> saveBusinessSubSampleAssessmentDOList = new ArrayList<>();
|
||||
@@ -406,9 +404,9 @@ public class SampleAnalysisAuditServiceImpl implements SampleAnalysisAuditServic
|
||||
}
|
||||
|
||||
//插入双杯判定记录
|
||||
if (businessTeamAssessmentDOList.size() > 0) {
|
||||
businessTeamAssessmentMapper.insertBatch(businessTeamAssessmentDOList);
|
||||
}
|
||||
// if (businessTeamAssessmentDOList.size() > 0) {
|
||||
// businessTeamAssessmentMapper.insertBatch(businessTeamAssessmentDOList);
|
||||
// }
|
||||
}
|
||||
|
||||
// 查找匹配的允差区间
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.admin;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.service.ConfigSubSampleParentMethodService;
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 分样与检测方法配置")
|
||||
@RestController
|
||||
@RequestMapping("/qms/config-sub-sample-parent-method")
|
||||
@Validated
|
||||
public class ConfigSubSampleParentMethodController implements BusinessControllerMarker {
|
||||
|
||||
|
||||
@Resource
|
||||
private ConfigSubSampleParentMethodService configSubSampleParentMethodService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建分样与检测方法配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:create')")
|
||||
public CommonResult<ConfigSubSampleParentMethodRespVO> createConfigSubSampleParentMethod(@Valid @RequestBody ConfigSubSampleParentMethodSaveReqVO createReqVO) {
|
||||
return success(configSubSampleParentMethodService.createConfigSubSampleParentMethod(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新分样与检测方法配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:update')")
|
||||
public CommonResult<Boolean> updateConfigSubSampleParentMethod(@Valid @RequestBody ConfigSubSampleParentMethodSaveReqVO updateReqVO) {
|
||||
configSubSampleParentMethodService.updateConfigSubSampleParentMethod(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除分样与检测方法配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:delete')")
|
||||
public CommonResult<Boolean> deleteConfigSubSampleParentMethod(@RequestParam("id") Long id) {
|
||||
configSubSampleParentMethodService.deleteConfigSubSampleParentMethod(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除分样与检测方法配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:delete')")
|
||||
public CommonResult<Boolean> deleteConfigSubSampleParentMethodList(@RequestBody BatchDeleteReqVO req) {
|
||||
configSubSampleParentMethodService.deleteConfigSubSampleParentMethodListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得分样与检测方法配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:query')")
|
||||
public CommonResult<ConfigSubSampleParentMethodRespVO> getConfigSubSampleParentMethod(@RequestParam("id") Long id) {
|
||||
ConfigSubSampleParentMethodDO configSubSampleParentMethod = configSubSampleParentMethodService.getConfigSubSampleParentMethod(id);
|
||||
return success(BeanUtils.toBean(configSubSampleParentMethod, ConfigSubSampleParentMethodRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得分样与检测方法配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:query')")
|
||||
public CommonResult<PageResult<ConfigSubSampleParentMethodRespVO>> getConfigSubSampleParentMethodPage(@Valid ConfigSubSampleParentMethodPageReqVO pageReqVO) {
|
||||
PageResult<ConfigSubSampleParentMethodDO> pageResult = configSubSampleParentMethodService.getConfigSubSampleParentMethodPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ConfigSubSampleParentMethodRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出分样与检测方法配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:config-sub-sample-parent-method:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportConfigSubSampleParentMethodExcel(@Valid ConfigSubSampleParentMethodPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ConfigSubSampleParentMethodDO> list = configSubSampleParentMethodService.getConfigSubSampleParentMethodPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "分样与检测方法配置.xls", "数据", ConfigSubSampleParentMethodRespVO.class,
|
||||
BeanUtils.toBean(list, ConfigSubSampleParentMethodRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 分样与检测方法配置分页 Request VO")
|
||||
@Data
|
||||
public class ConfigSubSampleParentMethodPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "分样配置ID", example = "14933")
|
||||
private Long configSubSampleParentId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", example = "24094")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
||||
private String resultTreatmentWay;
|
||||
|
||||
@Schema(description = "计算方法,average-平均值,other-其他(扩展)")
|
||||
private String calculateMethod;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 分样与检测方法配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ConfigSubSampleParentMethodRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25289")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14933")
|
||||
@ExcelProperty("分样配置ID")
|
||||
private Long configSubSampleParentId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24094")
|
||||
@ExcelProperty("检测方法配置ID")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
||||
@ExcelProperty("结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
||||
private String resultTreatmentWay;
|
||||
|
||||
@Schema(description = "计算方法,average-平均值,other-其他(扩展)")
|
||||
@ExcelProperty("计算方法,average-平均值,other-其他(扩展)")
|
||||
private String calculateMethod;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.zt.plat.module.qms.business.config.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
@Schema(description = "管理后台 - 分样与检测方法配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class ConfigSubSampleParentMethodSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "25289")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "分样配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "14933")
|
||||
@NotNull(message = "分样配置ID不能为空")
|
||||
private Long configSubSampleParentId;
|
||||
|
||||
@Schema(description = "检测方法配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24094")
|
||||
@NotNull(message = "检测方法配置ID不能为空")
|
||||
private Long configAssayMethodId;
|
||||
|
||||
@Schema(description = "结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改")
|
||||
private String resultTreatmentWay;
|
||||
|
||||
@Schema(description = "计算方法,average-平均值,other-其他(扩展)")
|
||||
private String calculateMethod;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.zt.plat.module.qms.business.config.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 分样与检测方法配置 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_cfg_sb_smp_prn_mthd")
|
||||
@KeySequence("t_cfg_sb_smp_prn_mthd_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class ConfigSubSampleParentMethodDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 分样配置ID
|
||||
*/
|
||||
@TableField("CFG_SB_SMP_PRN_ID")
|
||||
private Long configSubSampleParentId;
|
||||
/**
|
||||
* 检测方法配置ID
|
||||
*/
|
||||
@TableField("CFG_ASY_MTHD_ID")
|
||||
private Long configAssayMethodId;
|
||||
/**
|
||||
* 结果处理方式,automatic-自动报出(不超差),manual-手动报出,modify-允许修改
|
||||
*/
|
||||
@TableField("RSLT_TMT_WY")
|
||||
private String resultTreatmentWay;
|
||||
/**
|
||||
* 计算方法,average-平均值,other-其他(扩展)
|
||||
*/
|
||||
@TableField("CALT_MTHD")
|
||||
private String calculateMethod;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.qms.business.config.dal.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
/**
|
||||
* 分样与检测方法配置 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface ConfigSubSampleParentMethodMapper extends BaseMapperX<ConfigSubSampleParentMethodDO> {
|
||||
|
||||
default PageResult<ConfigSubSampleParentMethodDO> selectPage(ConfigSubSampleParentMethodPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ConfigSubSampleParentMethodDO>()
|
||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getConfigSubSampleParentId, reqVO.getConfigSubSampleParentId())
|
||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getConfigAssayMethodId, reqVO.getConfigAssayMethodId())
|
||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getResultTreatmentWay, reqVO.getResultTreatmentWay())
|
||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getCalculateMethod, reqVO.getCalculateMethod())
|
||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.betweenIfPresent(ConfigSubSampleParentMethodDO::getCreateTime, reqVO.getCreateTime())
|
||||
.eqIfPresent(ConfigSubSampleParentMethodDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(ConfigSubSampleParentMethodDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.zt.plat.module.qms.business.config.service;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 分样与检测方法配置 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface ConfigSubSampleParentMethodService {
|
||||
|
||||
/**
|
||||
* 创建分样与检测方法配置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
ConfigSubSampleParentMethodRespVO createConfigSubSampleParentMethod(@Valid ConfigSubSampleParentMethodSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新分样与检测方法配置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateConfigSubSampleParentMethod(@Valid ConfigSubSampleParentMethodSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除分样与检测方法配置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteConfigSubSampleParentMethod(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除分样与检测方法配置
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteConfigSubSampleParentMethodListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得分样与检测方法配置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 分样与检测方法配置
|
||||
*/
|
||||
ConfigSubSampleParentMethodDO getConfigSubSampleParentMethod(Long id);
|
||||
|
||||
/**
|
||||
* 获得分样与检测方法配置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 分样与检测方法配置分页
|
||||
*/
|
||||
PageResult<ConfigSubSampleParentMethodDO> getConfigSubSampleParentMethodPage(ConfigSubSampleParentMethodPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.zt.plat.module.qms.business.config.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.qms.business.config.controller.vo.*;
|
||||
import com.zt.plat.module.qms.business.config.dal.dataobject.ConfigSubSampleParentMethodDO;
|
||||
import com.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleParentMethodMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 分样与检测方法配置 Service 实现类
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ConfigSubSampleParentMethodServiceImpl implements ConfigSubSampleParentMethodService {
|
||||
|
||||
@Resource
|
||||
private ConfigSubSampleParentMethodMapper configSubSampleParentMethodMapper;
|
||||
|
||||
@Override
|
||||
public ConfigSubSampleParentMethodRespVO createConfigSubSampleParentMethod(ConfigSubSampleParentMethodSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ConfigSubSampleParentMethodDO configSubSampleParentMethod = BeanUtils.toBean(createReqVO, ConfigSubSampleParentMethodDO.class);
|
||||
configSubSampleParentMethodMapper.insert(configSubSampleParentMethod);
|
||||
// 返回
|
||||
return BeanUtils.toBean(configSubSampleParentMethod, ConfigSubSampleParentMethodRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateConfigSubSampleParentMethod(ConfigSubSampleParentMethodSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateConfigSubSampleParentMethodExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ConfigSubSampleParentMethodDO updateObj = BeanUtils.toBean(updateReqVO, ConfigSubSampleParentMethodDO.class);
|
||||
configSubSampleParentMethodMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteConfigSubSampleParentMethod(Long id) {
|
||||
// 校验存在
|
||||
validateConfigSubSampleParentMethodExists(id);
|
||||
// 删除
|
||||
configSubSampleParentMethodMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteConfigSubSampleParentMethodListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateConfigSubSampleParentMethodExists(ids);
|
||||
// 删除
|
||||
configSubSampleParentMethodMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateConfigSubSampleParentMethodExists(List<Long> ids) {
|
||||
List<ConfigSubSampleParentMethodDO> list = configSubSampleParentMethodMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(CONFIG_SUB_SAMPLE_PARENT_METHOD_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateConfigSubSampleParentMethodExists(Long id) {
|
||||
if (configSubSampleParentMethodMapper.selectById(id) == null) {
|
||||
throw exception(CONFIG_SUB_SAMPLE_PARENT_METHOD_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigSubSampleParentMethodDO getConfigSubSampleParentMethod(Long id) {
|
||||
return configSubSampleParentMethodMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ConfigSubSampleParentMethodDO> getConfigSubSampleParentMethodPage(ConfigSubSampleParentMethodPageReqVO pageReqVO) {
|
||||
return configSubSampleParentMethodMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?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.zt.plat.module.qms.business.bus.dal.mapper.BusinessTeamAssessmentMapper">
|
||||
<mapper namespace="com.zt.plat.module.qms.business.bus.dal.mapper.BusinessSubParentSampleAssessmentMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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.zt.plat.module.qms.business.config.dal.mapper.ConfigSubSampleParentMethodMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user