成品检验

This commit is contained in:
z 2026-05-20 09:05:30 +08:00
parent b39f2aba0b
commit 2eef93f948
82 changed files with 6402 additions and 36 deletions

View File

@ -0,0 +1,98 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo.HeadNoPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo.HeadNoRespVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo.HeadNoSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.headno.HeadNoDO;
import com.ningxia.yunxi.chemmes.module.biz.service.headno.HeadNoService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 工序抬头单")
@RestController
@RequestMapping("/tpo/head-no")
@Validated
public class HeadNoController {
@Resource
private HeadNoService headNoService;
@PostMapping("/create")
@Operation(summary = "创建工序抬头单")
@PreAuthorize("@ss.hasPermission('tpo:head-no:create')")
public CommonResult<Integer> createHeadNo(@Valid @RequestBody HeadNoSaveReqVO createReqVO) {
return success(headNoService.createHeadNo(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新工序抬头单")
@PreAuthorize("@ss.hasPermission('tpo:head-no:update')")
public CommonResult<Boolean> updateHeadNo(@Valid @RequestBody HeadNoSaveReqVO updateReqVO) {
headNoService.updateHeadNo(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工序抬头单")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('tpo:head-no:delete')")
public CommonResult<Boolean> deleteHeadNo(@RequestParam("id") Integer id) {
headNoService.deleteHeadNo(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得工序抬头单")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('tpo:head-no:query')")
public CommonResult<HeadNoRespVO> getHeadNo(@RequestParam("id") Integer id) {
HeadNoDO headNo = headNoService.getHeadNo(id);
return success(BeanUtils.toBean(headNo, HeadNoRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得工序抬头单分页")
@PreAuthorize("@ss.hasPermission('tpo:head-no:query')")
public CommonResult<PageResult<HeadNoRespVO>> getHeadNoPage(@Valid HeadNoPageReqVO pageReqVO) {
PageResult<HeadNoDO> pageResult = headNoService.getHeadNoPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, HeadNoRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出工序抬头单 Excel")
@PreAuthorize("@ss.hasPermission('tpo:head-no:export')")
@OperateLog(type = EXPORT)
public void exportHeadNoExcel(@Valid HeadNoPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<HeadNoDO> list = headNoService.getHeadNoPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "工序抬头单.xls", "数据", HeadNoRespVO.class,
BeanUtils.toBean(list, HeadNoRespVO.class));
}
}

View File

@ -0,0 +1,67 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 工序抬头单分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class HeadNoPageReqVO extends PageParam {
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "抬头单号(H+年份+月份+ 日 +2位流水号)")
private String headNo;
@Schema(description = "生产日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDate[] proDate;
@Schema(description = "生产班组")
private String groupCd;
@Schema(description = "生产班次")
private String shiftCd;
@Schema(description = "生产计划id", example = "8302")
private Integer planId;
@Schema(description = "生产计划号")
private String planNo;
@Schema(description = "备注", example = "你猜")
private String remark;
@Schema(description = "机台编码")
private String machineCd;
@Schema(description = "机台名称", example = "芋艿")
private String machineName;
@Schema(description = "机台id", example = "2201")
private Integer machineId;
@Schema(description = "产线编码")
private String lineCd;
@Schema(description = "产线名称", example = "李四")
private String lineName;
@Schema(description = "产线id", example = "5923")
private Integer lineId;
@Schema(description = "计划状态2 执行中 3 已完成 4 暂停)", example = "2")
private String proStatus;
}

View File

@ -0,0 +1,82 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
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 HeadNoRespVO {
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "6312")
@ExcelProperty("自增字段")
private Integer id;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "抬头单号(H+年份+月份+ 日 +2位流水号)")
@ExcelProperty("抬头单号(H+年份+月份+ 日 +2位流水号)")
private String headNo;
@Schema(description = "生产日期")
@ExcelProperty("生产日期")
private LocalDate proDate;
@Schema(description = "生产班组")
@ExcelProperty("生产班组")
private String groupCd;
@Schema(description = "生产班次")
@ExcelProperty("生产班次")
private String shiftCd;
@Schema(description = "生产计划id", example = "8302")
@ExcelProperty("生产计划id")
private Integer planId;
@Schema(description = "生产计划号")
@ExcelProperty("生产计划号")
private String planNo;
@Schema(description = "备注", example = "你猜")
@ExcelProperty("备注")
private String remark;
@Schema(description = "机台编码")
@ExcelProperty("机台编码")
private String machineCd;
@Schema(description = "机台名称", example = "芋艿")
@ExcelProperty("机台名称")
private String machineName;
@Schema(description = "机台id", example = "2201")
@ExcelProperty("机台id")
private Integer machineId;
@Schema(description = "产线编码")
@ExcelProperty("产线编码")
private String lineCd;
@Schema(description = "产线名称", example = "李四")
@ExcelProperty("产线名称")
private String lineName;
@Schema(description = "产线id", example = "5923")
@ExcelProperty("产线id")
private Integer lineId;
@Schema(description = "计划状态2 执行中 3 已完成 4 暂停)", example = "2")
@ExcelProperty("计划状态2 执行中 3 已完成 4 暂停)")
private String proStatus;
}

View File

@ -0,0 +1,60 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
@Schema(description = "管理后台 - 工序抬头单新增/修改 Request VO")
@Data
public class HeadNoSaveReqVO {
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "6312")
private Integer id;
@Schema(description = "抬头单号(H+年份+月份+ 日 +2位流水号)")
private String headNo;
@Schema(description = "生产日期")
private LocalDate proDate;
@Schema(description = "生产班组")
private String groupCd;
@Schema(description = "生产班次")
private String shiftCd;
@Schema(description = "生产计划id", example = "8302")
private Integer planId;
@Schema(description = "生产计划号")
private String planNo;
@Schema(description = "备注", example = "你猜")
private String remark;
@Schema(description = "机台编码")
private String machineCd;
@Schema(description = "机台名称", example = "芋艿")
private String machineName;
@Schema(description = "机台id", example = "2201")
private Integer machineId;
@Schema(description = "产线编码")
private String lineCd;
@Schema(description = "产线名称", example = "李四")
private String lineName;
@Schema(description = "产线id", example = "5923")
private Integer lineId;
@Schema(description = "计划状态2 执行中 3 已完成 4 暂停)", example = "2")
private String proStatus;
}

View File

@ -104,8 +104,9 @@ public class InspPlanItemController {
@GetMapping("/selectMaterialId")
@Operation(summary = "获得检验项目")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
public CommonResult<List<InspPlanItemDO>> selectMaterialId(@RequestParam("id") Integer id) {
return success(inspPlanItemService.selectMaterialId(id));
@Parameter(name = "schemeType", description = "方案类型", required = true, example = "1")
public CommonResult<List<InspPlanItemDO>> selectMaterialId(@RequestParam("id") Integer id, @RequestParam("schemeType") String schemeType) {
return success(inspPlanItemService.selectMaterialId(id, schemeType));
}
}

View File

@ -0,0 +1,98 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo.MatOutPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo.MatOutRespVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo.MatOutSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matout.MatOutDO;
import com.ningxia.yunxi.chemmes.module.biz.service.matout.MatOutService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 产出主")
@RestController
@RequestMapping("/tpo/mat-out")
@Validated
public class MatOutController {
@Resource
private MatOutService matOutService;
@PostMapping("/create")
@Operation(summary = "创建产出主")
@PreAuthorize("@ss.hasPermission('tpo:mat-out:create')")
public CommonResult<Integer> createMatOut(@Valid @RequestBody MatOutSaveReqVO createReqVO) {
return success(matOutService.createMatOut(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新产出主")
@PreAuthorize("@ss.hasPermission('tpo:mat-out:update')")
public CommonResult<Boolean> updateMatOut(@Valid @RequestBody MatOutSaveReqVO updateReqVO) {
matOutService.updateMatOut(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除产出主")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('tpo:mat-out:delete')")
public CommonResult<Boolean> deleteMatOut(@RequestParam("id") Integer id) {
matOutService.deleteMatOut(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得产出主")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('tpo:mat-out:query')")
public CommonResult<MatOutRespVO> getMatOut(@RequestParam("id") Integer id) {
MatOutDO matOut = matOutService.getMatOut(id);
return success(BeanUtils.toBean(matOut, MatOutRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得产出主分页")
@PreAuthorize("@ss.hasPermission('tpo:mat-out:query')")
public CommonResult<PageResult<MatOutRespVO>> getMatOutPage(@Valid MatOutPageReqVO pageReqVO) {
PageResult<MatOutDO> pageResult = matOutService.getMatOutPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MatOutRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出产出主 Excel")
@PreAuthorize("@ss.hasPermission('tpo:mat-out:export')")
@OperateLog(type = EXPORT)
public void exportMatOutExcel(@Valid MatOutPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MatOutDO> list = matOutService.getMatOutPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "产出主.xls", "数据", MatOutRespVO.class,
BeanUtils.toBean(list, MatOutRespVO.class));
}
}

View File

@ -0,0 +1,49 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 产出主分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class MatOutPageReqVO extends PageParam {
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "产出单号(O+年份+月份+ 日 +2位流水号)")
private String outNo;
@Schema(description = "生产计划id", example = "10045")
private Integer planId;
@Schema(description = "生产计划号")
private String planNo;
@Schema(description = "入库id", example = "7307")
private Integer whInId;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "产出人id", example = "19477")
private Integer outEmpId;
@Schema(description = "产出人名称", example = "赵六")
private String outEmpName;
@Schema(description = "抬头单号")
private String headNo;
@Schema(description = "抬头单id", example = "3863")
private Integer headId;
}

View File

@ -0,0 +1,62 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
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 MatOutRespVO {
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "8054")
@ExcelProperty("自增字段")
private Integer id;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "产出单号(O+年份+月份+ 日 +2位流水号)")
@ExcelProperty("产出单号(O+年份+月份+ 日 +2位流水号)")
private String outNo;
@Schema(description = "生产计划id", example = "10045")
@ExcelProperty("生产计划id")
private Integer planId;
@Schema(description = "生产计划号")
@ExcelProperty("生产计划号")
private String planNo;
@Schema(description = "入库id", example = "7307")
@ExcelProperty("入库id")
private Integer whInId;
@Schema(description = "备注", example = "随便")
@ExcelProperty("备注")
private String remark;
@Schema(description = "产出人id", example = "19477")
@ExcelProperty("产出人id")
private Integer outEmpId;
@Schema(description = "产出人名称", example = "赵六")
@ExcelProperty("产出人名称")
private String outEmpName;
@Schema(description = "抬头单号")
@ExcelProperty("抬头单号")
private String headNo;
@Schema(description = "抬头单id", example = "3863")
@ExcelProperty("抬头单id")
private Integer headId;
private LocalDateTime outDate;
}

View File

@ -0,0 +1,43 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
@Schema(description = "管理后台 - 产出主新增/修改 Request VO")
@Data
public class MatOutSaveReqVO {
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "8054")
private Integer id;
@Schema(description = "产出单号(O+年份+月份+ 日 +2位流水号)")
private String outNo;
@Schema(description = "生产计划id", example = "10045")
private Integer planId;
@Schema(description = "生产计划号")
private String planNo;
@Schema(description = "入库id", example = "7307")
private Integer whInId;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "产出人id", example = "19477")
private Integer outEmpId;
@Schema(description = "产出人名称", example = "赵六")
private String outEmpName;
@Schema(description = "抬头单号")
private String headNo;
@Schema(description = "抬头单id", example = "3863")
private Integer headId;
}

View File

@ -0,0 +1,98 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo.MatOutDetailPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo.MatOutDetailRespVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo.MatOutDetailSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matoutdetail.MatOutDetailDO;
import com.ningxia.yunxi.chemmes.module.biz.service.matoutdetail.MatOutDetailService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 工序产出子")
@RestController
@RequestMapping("/tpo/mat-out-detail")
@Validated
public class MatOutDetailController {
@Resource
private MatOutDetailService matOutDetailService;
@PostMapping("/create")
@Operation(summary = "创建工序产出子")
@PreAuthorize("@ss.hasPermission('tpo:mat-out-detail:create')")
public CommonResult<Integer> createMatOutDetail(@Valid @RequestBody MatOutDetailSaveReqVO createReqVO) {
return success(matOutDetailService.createMatOutDetail(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新工序产出子")
@PreAuthorize("@ss.hasPermission('tpo:mat-out-detail:update')")
public CommonResult<Boolean> updateMatOutDetail(@Valid @RequestBody MatOutDetailSaveReqVO updateReqVO) {
matOutDetailService.updateMatOutDetail(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除工序产出子")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('tpo:mat-out-detail:delete')")
public CommonResult<Boolean> deleteMatOutDetail(@RequestParam("id") Integer id) {
matOutDetailService.deleteMatOutDetail(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得工序产出子")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('tpo:mat-out-detail:query')")
public CommonResult<MatOutDetailRespVO> getMatOutDetail(@RequestParam("id") Integer id) {
MatOutDetailDO matOutDetail = matOutDetailService.getMatOutDetail(id);
return success(BeanUtils.toBean(matOutDetail, MatOutDetailRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得工序产出子分页")
@PreAuthorize("@ss.hasPermission('tpo:mat-out-detail:query')")
public CommonResult<PageResult<MatOutDetailRespVO>> getMatOutDetailPage(@Valid MatOutDetailPageReqVO pageReqVO) {
PageResult<MatOutDetailDO> pageResult = matOutDetailService.getMatOutDetailPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MatOutDetailRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出工序产出子 Excel")
@PreAuthorize("@ss.hasPermission('tpo:mat-out-detail:export')")
@OperateLog(type = EXPORT)
public void exportMatOutDetailExcel(@Valid MatOutDetailPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MatOutDetailDO> list = matOutDetailService.getMatOutDetailPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "工序产出子.xls", "数据", MatOutDetailRespVO.class,
BeanUtils.toBean(list, MatOutDetailRespVO.class));
}
}

View File

@ -0,0 +1,95 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 工序产出子分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class MatOutDetailPageReqVO extends PageParam {
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "产出单号")
private String outNo;
@Schema(description = "备注", example = "你猜")
private String remark;
@Schema(description = "产出主表id", example = "16062")
private Integer outId;
@Schema(description = "物料id", example = "31382")
private Integer materialId;
@Schema(description = "物料编码")
private String materialCode;
@Schema(description = "物料名称", example = "芋艿")
private String materialName;
@Schema(description = "规格型号")
private String spec;
@Schema(description = "单位")
private String unit;
@Schema(description = "产出数量")
private BigDecimal outQty;
@Schema(description = "入库子表id", example = "10874")
private Integer whInDetailId;
@Schema(description = "物料批次号")
private String lotNo;
@Schema(description = "判定结果(1 合格 2 不合格)")
private String judgResult;
@Schema(description = "物料类型(1 原材料 2 半成品 3 成品 4 联产品 )", example = "2")
private String matType;
@Schema(description = "是否需要检验0-是 1 否)")
private String isInsp;
@Schema(description = "检验状态0-未检验 1已检验", example = "2")
private String inspStatus;
@Schema(description = "采集数量")
private BigDecimal atoQty;
@Schema(description = "仓储id", example = "8377")
private Integer storeHouseId;
@Schema(description = "库区id", example = "4590")
private Integer storeAreaId;
@Schema(description = "仓储编码")
private String storeHouseCd;
@Schema(description = "仓储名称", example = "王五")
private String storeHouseName;
@Schema(description = "库区编码")
private String storeAreCd;
@Schema(description = "库区名称", example = "王五")
private String storeAreaName;
@Schema(description = "检验日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate[] outDate;
}

View File

@ -0,0 +1,119 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 工序产出子 Response VO")
@Data
@ExcelIgnoreUnannotated
public class MatOutDetailRespVO {
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "31581")
@ExcelProperty("自增字段")
private Integer id;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "产出单号")
@ExcelProperty("产出单号")
private String outNo;
@Schema(description = "备注", example = "你猜")
@ExcelProperty("备注")
private String remark;
@Schema(description = "产出主表id", example = "16062")
@ExcelProperty("产出主表id")
private Integer outId;
@Schema(description = "物料id", example = "31382")
@ExcelProperty("物料id")
private Integer materialId;
@Schema(description = "物料编码")
@ExcelProperty("物料编码")
private String materialCode;
@Schema(description = "物料名称", example = "芋艿")
@ExcelProperty("物料名称")
private String materialName;
@Schema(description = "规格型号")
@ExcelProperty("规格型号")
private String spec;
@Schema(description = "单位")
@ExcelProperty("单位")
private String unit;
@Schema(description = "产出数量")
@ExcelProperty("产出数量")
private BigDecimal outQty;
@Schema(description = "入库子表id", example = "10874")
@ExcelProperty("入库子表id")
private Integer whInDetailId;
@Schema(description = "物料批次号")
@ExcelProperty("物料批次号")
private String lotNo;
@Schema(description = "判定结果(1 合格 2 不合格)")
@ExcelProperty("判定结果(1 合格 2 不合格)")
private String judgResult;
@Schema(description = "物料类型(1 原材料 2 半成品 3 成品 4 联产品 )", example = "2")
@ExcelProperty("物料类型(1 原材料 2 半成品 3 成品 4 联产品 )")
private String matType;
@Schema(description = "是否需要检验0-是 1 否)")
@ExcelProperty("是否需要检验0-是 1 否)")
private String isInsp;
@Schema(description = "检验状态0-未检验 1已检验", example = "2")
@ExcelProperty("检验状态0-未检验 1已检验")
private String inspStatus;
@Schema(description = "采集数量")
@ExcelProperty("采集数量")
private BigDecimal atoQty;
@Schema(description = "仓储id", example = "8377")
@ExcelProperty("仓储id")
private Integer storeHouseId;
@Schema(description = "库区id", example = "4590")
@ExcelProperty("库区id")
private Integer storeAreaId;
@Schema(description = "仓储编码")
@ExcelProperty("仓储编码")
private String storeHouseCd;
@Schema(description = "仓储名称", example = "王五")
@ExcelProperty("仓储名称")
private String storeHouseName;
@Schema(description = "库区编码")
@ExcelProperty("库区编码")
private String storeAreCd;
@Schema(description = "库区名称", example = "王五")
@ExcelProperty("库区名称")
private String storeAreaName;
private Integer planId;
private String planNo;
private LocalDateTime outDate;
private String shiftCd;
private String machineName;
}

View File

@ -0,0 +1,83 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
import java.math.BigDecimal;
@Schema(description = "管理后台 - 工序产出子新增/修改 Request VO")
@Data
public class MatOutDetailSaveReqVO {
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "31581")
private Integer id;
@Schema(description = "产出单号")
private String outNo;
@Schema(description = "备注", example = "你猜")
private String remark;
@Schema(description = "产出主表id", example = "16062")
private Integer outId;
@Schema(description = "物料id", example = "31382")
private Integer materialId;
@Schema(description = "物料编码")
private String materialCode;
@Schema(description = "物料名称", example = "芋艿")
private String materialName;
@Schema(description = "规格型号")
private String spec;
@Schema(description = "单位")
private String unit;
@Schema(description = "产出数量")
private BigDecimal outQty;
@Schema(description = "入库子表id", example = "10874")
private Integer whInDetailId;
@Schema(description = "物料批次号")
private String lotNo;
@Schema(description = "判定结果(1 合格 2 不合格)")
private String judgResult;
@Schema(description = "物料类型(1 原材料 2 半成品 3 成品 4 联产品 )", example = "2")
private String matType;
@Schema(description = "是否需要检验0-是 1 否)")
private String isInsp;
@Schema(description = "检验状态0-未检验 1已检验", example = "2")
private String inspStatus;
@Schema(description = "采集数量")
private BigDecimal atoQty;
@Schema(description = "仓储id", example = "8377")
private Integer storeHouseId;
@Schema(description = "库区id", example = "4590")
private Integer storeAreaId;
@Schema(description = "仓储编码")
private String storeHouseCd;
@Schema(description = "仓储名称", example = "王五")
private String storeHouseName;
@Schema(description = "库区编码")
private String storeAreCd;
@Schema(description = "库区名称", example = "王五")
private String storeAreaName;
}

View File

@ -0,0 +1,98 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo.MillParamActPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo.MillParamActRespVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo.MillParamActSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.millparamact.MillParamActDO;
import com.ningxia.yunxi.chemmes.module.biz.service.millparamact.MillParamActService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 制粉工序参数实绩")
@RestController
@RequestMapping("/tpo/mill-param-act")
@Validated
public class MillParamActController {
@Resource
private MillParamActService millParamActService;
@PostMapping("/create")
@Operation(summary = "创建制粉工序参数实绩")
@PreAuthorize("@ss.hasPermission('tpo:mill-param-act:create')")
public CommonResult<Integer> createMillParamAct(@Valid @RequestBody MillParamActSaveReqVO createReqVO) {
return success(millParamActService.createMillParamAct(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新制粉工序参数实绩")
@PreAuthorize("@ss.hasPermission('tpo:mill-param-act:update')")
public CommonResult<Boolean> updateMillParamAct(@Valid @RequestBody MillParamActSaveReqVO updateReqVO) {
millParamActService.updateMillParamAct(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除制粉工序参数实绩")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('tpo:mill-param-act:delete')")
public CommonResult<Boolean> deleteMillParamAct(@RequestParam("id") Integer id) {
millParamActService.deleteMillParamAct(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得制粉工序参数实绩")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('tpo:mill-param-act:query')")
public CommonResult<MillParamActRespVO> getMillParamAct(@RequestParam("id") Integer id) {
MillParamActDO millParamAct = millParamActService.getMillParamAct(id);
return success(BeanUtils.toBean(millParamAct, MillParamActRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得制粉工序参数实绩分页")
@PreAuthorize("@ss.hasPermission('tpo:mill-param-act:query')")
public CommonResult<PageResult<MillParamActRespVO>> getMillParamActPage(@Valid MillParamActPageReqVO pageReqVO) {
PageResult<MillParamActDO> pageResult = millParamActService.getMillParamActPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, MillParamActRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出制粉工序参数实绩 Excel")
@PreAuthorize("@ss.hasPermission('tpo:mill-param-act:export')")
@OperateLog(type = EXPORT)
public void exportMillParamActExcel(@Valid MillParamActPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<MillParamActDO> list = millParamActService.getMillParamActPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "制粉工序参数实绩.xls", "数据", MillParamActRespVO.class,
BeanUtils.toBean(list, MillParamActRespVO.class));
}
}

View File

@ -0,0 +1,77 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 制粉工序参数实绩分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class MillParamActPageReqVO extends PageParam {
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "备注", example = "你说的对")
private String remark;
@Schema(description = "采集时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] collectTime;
@Schema(description = "采集班次")
private String shiftCd;
@Schema(description = "生产计划id", example = "6299")
private Integer planId;
@Schema(description = "生产计划号")
private String planNo;
@Schema(description = "工序id", example = "3190")
private Integer procCdId;
@Schema(description = "工序编码")
private String procCd;
@Schema(description = "工序名称", example = "赵六")
private String procName;
@Schema(description = "机台id", example = "22303")
private Integer machineId;
@Schema(description = "机台编码")
private String machineNo;
@Schema(description = "磨机电流")
private String grndMacCurr;
@Schema(description = "数据来源(1 自动采集 2 人工录入)")
private String dataSource;
@Schema(description = "磨机速度")
private String grndMacSpeed;
@Schema(description = "出粉温度")
private String outPowTemp;
@Schema(description = "进风温度")
private String inAirTemp;
@Schema(description = "磨机出口负压")
private String grndOutPress;
@Schema(description = "采集日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDate[] collectDate;
}

View File

@ -0,0 +1,92 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
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 MillParamActRespVO {
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "7478")
@ExcelProperty("自增字段")
private Integer id;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "备注", example = "你说的对")
@ExcelProperty("备注")
private String remark;
@Schema(description = "采集时间")
@ExcelProperty("采集时间")
private LocalDateTime collectTime;
@Schema(description = "采集班次")
@ExcelProperty("采集班次")
private String shiftCd;
@Schema(description = "生产计划id", example = "6299")
@ExcelProperty("生产计划id")
private Integer planId;
@Schema(description = "生产计划号")
@ExcelProperty("生产计划号")
private String planNo;
@Schema(description = "工序id", example = "3190")
@ExcelProperty("工序id")
private Integer procCdId;
@Schema(description = "工序编码")
@ExcelProperty("工序编码")
private String procCd;
@Schema(description = "工序名称", example = "赵六")
@ExcelProperty("工序名称")
private String procName;
@Schema(description = "机台id", example = "22303")
@ExcelProperty("机台id")
private Integer machineId;
@Schema(description = "机台编码")
@ExcelProperty("机台编码")
private String machineNo;
@Schema(description = "磨机电流")
@ExcelProperty("磨机电流")
private String grndMacCurr;
@Schema(description = "数据来源(1 自动采集 2 人工录入)")
@ExcelProperty("数据来源(1 自动采集 2 人工录入)")
private String dataSource;
@Schema(description = "磨机速度")
@ExcelProperty("磨机速度")
private String grndMacSpeed;
@Schema(description = "出粉温度")
@ExcelProperty("出粉温度")
private String outPowTemp;
@Schema(description = "进风温度")
@ExcelProperty("进风温度")
private String inAirTemp;
@Schema(description = "磨机出口负压")
@ExcelProperty("磨机出口负压")
private String grndOutPress;
@Schema(description = "采集日期")
@ExcelProperty("采集日期")
private LocalDate collectDate;
}

View File

@ -0,0 +1,69 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 制粉工序参数实绩新增/修改 Request VO")
@Data
public class MillParamActSaveReqVO {
@Schema(description = "自增字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "7478")
private Integer id;
@Schema(description = "备注", example = "你说的对")
private String remark;
@Schema(description = "采集时间")
private LocalDateTime collectTime;
@Schema(description = "采集班次")
private String shiftCd;
@Schema(description = "生产计划id", example = "6299")
private Integer planId;
@Schema(description = "生产计划号")
private String planNo;
@Schema(description = "工序id", example = "3190")
private Integer procCdId;
@Schema(description = "工序编码")
private String procCd;
@Schema(description = "工序名称", example = "赵六")
private String procName;
@Schema(description = "机台id", example = "22303")
private Integer machineId;
@Schema(description = "机台编码")
private String machineNo;
@Schema(description = "磨机电流")
private String grndMacCurr;
@Schema(description = "数据来源(1 自动采集 2 人工录入)")
private String dataSource;
@Schema(description = "磨机速度")
private String grndMacSpeed;
@Schema(description = "出粉温度")
private String outPowTemp;
@Schema(description = "进风温度")
private String inAirTemp;
@Schema(description = "磨机出口负压")
private String grndOutPress;
@Schema(description = "采集日期")
private LocalDate collectDate;
}

View File

@ -0,0 +1,98 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo.ProctionInspDetailPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo.ProctionInspDetailRespVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo.ProctionInspDetailSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninspdetail.ProctionInspDetailDO;
import com.ningxia.yunxi.chemmes.module.biz.service.proctioninspdetail.ProctionInspDetailService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 产品料检验值明细")
@RestController
@RequestMapping("/tqm/proction-insp-detail")
@Validated
public class ProctionInspDetailController {
@Resource
private ProctionInspDetailService proctionInspDetailService;
@PostMapping("/create")
@Operation(summary = "创建产品料检验值明细")
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-detail:create')")
public CommonResult<Integer> createProctionInspDetail(@Valid @RequestBody ProctionInspDetailSaveReqVO createReqVO) {
return success(proctionInspDetailService.createProctionInspDetail(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新产品料检验值明细")
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-detail:update')")
public CommonResult<Boolean> updateProctionInspDetail(@Valid @RequestBody ProctionInspDetailSaveReqVO updateReqVO) {
proctionInspDetailService.updateProctionInspDetail(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除产品料检验值明细")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-detail:delete')")
public CommonResult<Boolean> deleteProctionInspDetail(@RequestParam("id") Integer id) {
proctionInspDetailService.deleteProctionInspDetail(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得产品料检验值明细")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-detail:query')")
public CommonResult<ProctionInspDetailRespVO> getProctionInspDetail(@RequestParam("id") Integer id) {
ProctionInspDetailDO proctionInspDetail = proctionInspDetailService.getProctionInspDetail(id);
return success(BeanUtils.toBean(proctionInspDetail, ProctionInspDetailRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得产品料检验值明细分页")
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-detail:query')")
public CommonResult<PageResult<ProctionInspDetailRespVO>> getProctionInspDetailPage(@Valid ProctionInspDetailPageReqVO pageReqVO) {
PageResult<ProctionInspDetailDO> pageResult = proctionInspDetailService.getProctionInspDetailPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ProctionInspDetailRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出产品料检验值明细 Excel")
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-detail:export')")
@OperateLog(type = EXPORT)
public void exportProctionInspDetailExcel(@Valid ProctionInspDetailPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ProctionInspDetailDO> list = proctionInspDetailService.getProctionInspDetailPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "产品料检验值明细.xls", "数据", ProctionInspDetailRespVO.class,
BeanUtils.toBean(list, ProctionInspDetailRespVO.class));
}
}

View File

@ -0,0 +1,48 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 产品料检验值明细分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProctionInspDetailPageReqVO extends PageParam {
@Schema(description = "检测值")
private String actValue;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "质检方案id", example = "19535")
private Integer inspPlanId;
@Schema(description = "质检方案明细id", example = "24580")
private Integer inspPlanItemId;
@Schema(description = "主表id", example = "18343")
private Integer proctionInspId;
@Schema(description = "界面展示顺序")
private Integer seqNo;
@Schema(description = "检验编码")
private String checkCode;
@Schema(description = "成品检验值汇总表id", example = "26147")
private Integer inspTotalId;
}

View File

@ -0,0 +1,58 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
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 ProctionInspDetailRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8908")
@ExcelProperty("主键")
private Integer id;
@Schema(description = "检测值")
@ExcelProperty("检测值")
private String actValue;
@Schema(description = "备注", example = "随便")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "质检方案id", example = "19535")
@ExcelProperty("质检方案id")
private Integer inspPlanId;
@Schema(description = "质检方案明细id", example = "24580")
@ExcelProperty("质检方案明细id")
private Integer inspPlanItemId;
@Schema(description = "主表id", example = "18343")
@ExcelProperty("主表id")
private Integer proctionInspId;
@Schema(description = "界面展示顺序")
@ExcelProperty("界面展示顺序")
private Integer seqNo;
@Schema(description = "检验编码")
@ExcelProperty("检验编码")
private String checkCode;
@Schema(description = "成品检验值汇总表id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26147")
@ExcelProperty("成品检验值汇总表id")
private Integer inspTotalId;
}

View File

@ -0,0 +1,44 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
@Schema(description = "管理后台 - 产品料检验值明细新增/修改 Request VO")
@Data
public class ProctionInspDetailSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8908")
private Integer id;
@Schema(description = "检测值")
private String actValue;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "质检方案id", example = "19535")
private Integer inspPlanId;
@Schema(description = "质检方案明细id", example = "24580")
private Integer inspPlanItemId;
@Schema(description = "主表id", example = "18343")
private Integer proctionInspId;
@Schema(description = "界面展示顺序")
private Integer seqNo;
@Schema(description = "检验编码")
private String checkCode;
@Schema(description = "成品检验值汇总表id", requiredMode = Schema.RequiredMode.REQUIRED, example = "26147")
@NotNull(message = "成品检验值汇总表id不能为空")
private Integer inspTotalId;
@Schema(description = "流程id", example = "22124")
private String fFlowId;
}

View File

@ -0,0 +1,98 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo.ProctionInspTotalPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo.ProctionInspTotalRespVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo.ProctionInspTotalSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninsptotal.ProctionInspTotalDO;
import com.ningxia.yunxi.chemmes.module.biz.service.proctioninsptotal.ProctionInspTotalService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 产品检验值汇总")
@RestController
@RequestMapping("/tqm/proction-insp-total")
@Validated
public class ProctionInspTotalController {
@Resource
private ProctionInspTotalService proctionInspTotalService;
@PostMapping("/create")
@Operation(summary = "创建产品检验值汇总")
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-total:create')")
public CommonResult<Integer> createProctionInspTotal(@Valid @RequestBody ProctionInspTotalSaveReqVO createReqVO) {
return success(proctionInspTotalService.createProctionInspTotal(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新产品检验值汇总")
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-total:update')")
public CommonResult<Boolean> updateProctionInspTotal(@Valid @RequestBody ProctionInspTotalSaveReqVO updateReqVO) {
proctionInspTotalService.updateProctionInspTotal(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除产品检验值汇总")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-total:delete')")
public CommonResult<Boolean> deleteProctionInspTotal(@RequestParam("id") Integer id) {
proctionInspTotalService.deleteProctionInspTotal(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得产品检验值汇总")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-total:query')")
public CommonResult<ProctionInspTotalRespVO> getProctionInspTotal(@RequestParam("id") Integer id) {
ProctionInspTotalDO proctionInspTotal = proctionInspTotalService.getProctionInspTotal(id);
return success(BeanUtils.toBean(proctionInspTotal, ProctionInspTotalRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得产品检验值汇总分页")
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-total:query')")
public CommonResult<PageResult<ProctionInspTotalRespVO>> getProctionInspTotalPage(@Valid ProctionInspTotalPageReqVO pageReqVO) {
PageResult<ProctionInspTotalDO> pageResult = proctionInspTotalService.getProctionInspTotalPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ProctionInspTotalRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出产品检验值汇总 Excel")
@PreAuthorize("@ss.hasPermission('tqm:proction-insp-total:export')")
@OperateLog(type = EXPORT)
public void exportProctionInspTotalExcel(@Valid ProctionInspTotalPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ProctionInspTotalDO> list = proctionInspTotalService.getProctionInspTotalPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "产品检验值汇总.xls", "数据", ProctionInspTotalRespVO.class,
BeanUtils.toBean(list, ProctionInspTotalRespVO.class));
}
}

View File

@ -0,0 +1,67 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 产品检验值汇总分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProctionInspTotalPageReqVO extends PageParam {
@Schema(description = "平均值")
private String actValue;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "质检方案id", example = "28139")
private Integer inspPlanId;
@Schema(description = "质检方案明细id", example = "13406")
private Integer inspPlanItemId;
@Schema(description = "主表id", example = "8955")
private String proctionInspId;
@Schema(description = "界面展示顺序")
private Integer seqNo;
@Schema(description = "检验编码")
private String checkCode;
@Schema(description = "判定结果0表示合格1表示不合格")
private String checkResult;
@Schema(description = "检验项目id", example = "20233")
private Integer itemId;
@Schema(description = "检验项名称", example = "李四")
private String itemName;
@Schema(description = "标准值")
private String standardValue;
@Schema(description = "上限值")
private String upperLimit;
@Schema(description = "下限值")
private String lowerLimit;
@Schema(description = "检验方法")
private String checkMethod;
@Schema(description = "标准值类型1、不变 2、区间 3大于等于 4、小于等于")
private String printItem;
}

View File

@ -0,0 +1,84 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
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 ProctionInspTotalRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14835")
@ExcelProperty("主键")
private Integer id;
@Schema(description = "平均值")
@ExcelProperty("平均值")
private String actValue;
@Schema(description = "备注", example = "随便")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "质检方案id", example = "28139")
@ExcelProperty("质检方案id")
private Integer inspPlanId;
@Schema(description = "质检方案明细id", example = "13406")
@ExcelProperty("质检方案明细id")
private Integer inspPlanItemId;
@Schema(description = "主表id", example = "8955")
@ExcelProperty("主表id")
private String proctionInspId;
@Schema(description = "界面展示顺序")
@ExcelProperty("界面展示顺序")
private Integer seqNo;
@Schema(description = "检验编码")
@ExcelProperty("检验编码")
private String checkCode;
@Schema(description = "判定结果0表示合格1表示不合格")
@ExcelProperty("判定结果0表示合格1表示不合格")
private String checkResult;
@Schema(description = "检验项目id", example = "20233")
@ExcelProperty("检验项目id")
private Integer itemId;
@Schema(description = "检验项名称", example = "李四")
@ExcelProperty("检验项名称")
private String itemName;
@Schema(description = "标准值")
@ExcelProperty("标准值")
private String standardValue;
@Schema(description = "上限值")
@ExcelProperty("上限值")
private String upperLimit;
@Schema(description = "下限值")
@ExcelProperty("下限值")
private String lowerLimit;
@Schema(description = "检验方法")
@ExcelProperty("检验方法")
private String checkMethod;
@Schema(description = "标准值类型1、不变 2、区间 3大于等于 4、小于等于")
@ExcelProperty("标准值类型1、不变 2、区间 3大于等于 4、小于等于")
private String printItem;
}

View File

@ -0,0 +1,61 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
@Schema(description = "管理后台 - 产品检验值汇总新增/修改 Request VO")
@Data
public class ProctionInspTotalSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14835")
private Integer id;
@Schema(description = "平均值")
private String actValue;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "质检方案id", example = "28139")
private Integer inspPlanId;
@Schema(description = "质检方案明细id", example = "13406")
private Integer inspPlanItemId;
@Schema(description = "主表id", example = "8955")
private String proctionInspId;
@Schema(description = "界面展示顺序")
private Integer seqNo;
@Schema(description = "检验编码")
private String checkCode;
@Schema(description = "判定结果0表示合格1表示不合格")
private String checkResult;
@Schema(description = "检验项目id", example = "20233")
private Integer itemId;
@Schema(description = "检验项名称", example = "李四")
private String itemName;
@Schema(description = "标准值")
private String standardValue;
@Schema(description = "上限值")
private String upperLimit;
@Schema(description = "下限值")
private String lowerLimit;
@Schema(description = "检验方法")
private String checkMethod;
@Schema(description = "标准值类型1、不变 2、区间 3大于等于 4、小于等于")
private String printItem;
}

View File

@ -0,0 +1,98 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo.ProductionInspPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo.ProductionInspRespVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo.ProductionInspSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.productioninsp.ProductionInspDO;
import com.ningxia.yunxi.chemmes.module.biz.service.productioninsp.ProductionInspService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.pojo.CommonResult.success;
import com.ningxia.yunxi.chemmes.framework.excel.core.util.ExcelUtils;
import com.ningxia.yunxi.chemmes.framework.operatelog.core.annotations.OperateLog;
import static com.ningxia.yunxi.chemmes.framework.operatelog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 产品检验主")
@RestController
@RequestMapping("/tqm/production-insp")
@Validated
public class ProductionInspController {
@Resource
private ProductionInspService productionInspService;
@PostMapping("/create")
@Operation(summary = "创建产品检验主")
@PreAuthorize("@ss.hasPermission('tqm:production-insp:create')")
public CommonResult<String> createProductionInsp(@Valid @RequestBody ProductionInspSaveReqVO createReqVO) {
return success(productionInspService.createProductionInsp(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新产品检验主")
@PreAuthorize("@ss.hasPermission('tqm:production-insp:update')")
public CommonResult<Boolean> updateProductionInsp(@Valid @RequestBody ProductionInspSaveReqVO updateReqVO) {
productionInspService.updateProductionInsp(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除产品检验主")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('tqm:production-insp:delete')")
public CommonResult<Boolean> deleteProductionInsp(@RequestParam("id") String id) {
productionInspService.deleteProductionInsp(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得产品检验主")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('tqm:production-insp:query')")
public CommonResult<ProductionInspRespVO> getProductionInsp(@RequestParam("id") String id) {
ProductionInspDO productionInsp = productionInspService.getProductionInsp(id);
return success(BeanUtils.toBean(productionInsp, ProductionInspRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得产品检验主分页")
@PreAuthorize("@ss.hasPermission('tqm:production-insp:query')")
public CommonResult<PageResult<ProductionInspRespVO>> getProductionInspPage(@Valid ProductionInspPageReqVO pageReqVO) {
PageResult<ProductionInspDO> pageResult = productionInspService.getProductionInspPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ProductionInspRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出产品检验主 Excel")
@PreAuthorize("@ss.hasPermission('tqm:production-insp:export')")
@OperateLog(type = EXPORT)
public void exportProductionInspExcel(@Valid ProductionInspPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ProductionInspDO> list = productionInspService.getProductionInspPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "产品检验主.xls", "数据", ProductionInspRespVO.class,
BeanUtils.toBean(list, ProductionInspRespVO.class));
}
}

View File

@ -0,0 +1,100 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
import static com.ningxia.yunxi.chemmes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 产品检验主分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProductionInspPageReqVO extends PageParam {
@Schema(description = "检验单号CP+年月日+两位流水号")
private String checkCode;
@Schema(description = "计划id", example = "14853")
private Integer planId;
@Schema(description = "生产计划号")
private String proNo;
@Schema(description = "产品id", example = "18345")
private Integer materialId;
@Schema(description = "产品编码")
private String matCode;
@Schema(description = "产品名称", example = "张三")
private String matName;
@Schema(description = "规格型号")
private String spec;
@Schema(description = "批次号")
private String lotNo;
@Schema(description = "生产日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDate[] outDate;
@Schema(description = "检验日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private LocalDate[] checkDate;
@Schema(description = "检验结果(0 合格 1 不合格 2让步接收)")
private String checkResult;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "表单编号")
private String formCode;
@Schema(description = "质检方案id", example = "17121")
private String qaSchemeBaseId;
@Schema(description = "检验值数量")
private Integer testNum;
@Schema(description = "检验人员id", example = "5837")
private Integer checkUserId;
@Schema(description = "审核人员id", example = "5536")
private Integer checkExUserId;
@Schema(description = "审核日期")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDate[] checkExDate;
@Schema(description = "单据状态( 0-已创建 1-已确认 2- 已审核 3-已驳回 )", example = "1")
private String checkStatus;
@Schema(description = "审核原因", example = "随便")
private String checkRemark;
@Schema(description = "检验人员名称", example = "王五")
private String checkUserName;
@Schema(description = "审核人员名称", example = "王五")
private String checkExUserName;
@Schema(description = "产出单id", example = "5341")
private Integer outId;
@Schema(description = "产出明细id", example = "24259")
private Integer outMatId;
}

View File

@ -0,0 +1,123 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninsptotal.ProctionInspTotalDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
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 ProductionInspRespVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1410")
@ExcelProperty("id")
private String id;
@Schema(description = "检验单号CP+年月日+两位流水号", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("检验单号CP+年月日+两位流水号")
private String checkCode;
@Schema(description = "计划id", example = "14853")
@ExcelProperty("计划id")
private Integer planId;
@Schema(description = "生产计划号")
@ExcelProperty("生产计划号")
private String proNo;
@Schema(description = "产品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18345")
@ExcelProperty("产品id")
private Integer materialId;
@Schema(description = "产品编码")
@ExcelProperty("产品编码")
private String matCode;
@Schema(description = "产品名称", example = "张三")
@ExcelProperty("产品名称")
private String matName;
@Schema(description = "规格型号")
@ExcelProperty("规格型号")
private String spec;
@Schema(description = "批次号")
@ExcelProperty("批次号")
private String lotNo;
@Schema(description = "生产日期")
@ExcelProperty("生产日期")
private LocalDate outDate;
@Schema(description = "检验日期", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("检验日期")
private LocalDate checkDate;
@Schema(description = "检验结果(0 合格 1 不合格 2让步接收)")
@ExcelProperty("检验结果(0 合格 1 不合格 2让步接收)")
private String checkResult;
@Schema(description = "备注", example = "随便")
@ExcelProperty("备注")
private String remark;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "表单编号")
@ExcelProperty("表单编号")
private String formCode;
@Schema(description = "质检方案id", example = "17121")
@ExcelProperty("质检方案id")
private String qaSchemeBaseId;
@Schema(description = "检验值数量")
@ExcelProperty("检验值数量")
private Integer testNum;
@Schema(description = "检验人员id", example = "5837")
@ExcelProperty("检验人员id")
private Integer checkUserId;
@Schema(description = "审核人员id", example = "5536")
@ExcelProperty("审核人员id")
private Integer checkExUserId;
@Schema(description = "审核日期")
@ExcelProperty("审核日期")
private LocalDate checkExDate;
@Schema(description = "单据状态( 0-已创建 1-已确认 2- 已审核 3-已驳回 )", example = "1")
@ExcelProperty("单据状态( 0-已创建 1-已确认 2- 已审核 3-已驳回 )")
private String checkStatus;
@Schema(description = "审核原因", example = "随便")
@ExcelProperty("审核原因")
private String checkRemark;
@Schema(description = "检验人员名称", example = "王五")
@ExcelProperty("检验人员名称")
private String checkUserName;
@Schema(description = "审核人员名称", example = "王五")
@ExcelProperty("审核人员名称")
private String checkExUserName;
@Schema(description = "产出单id", example = "5341")
@ExcelProperty("产出单id")
private Integer outId;
@Schema(description = "产出明细id", example = "24259")
@ExcelProperty("产出明细id")
private Integer outMatId;
private List<ProctionInspTotalDO> proctionInspTotalList;
}

View File

@ -0,0 +1,94 @@
package com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninsptotal.ProctionInspTotalDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import javax.validation.constraints.*;
import java.util.*;
@Schema(description = "管理后台 - 产品检验主新增/修改 Request VO")
@Data
public class ProductionInspSaveReqVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1410")
private String id;
@Schema(description = "检验单号CP+年月日+两位流水号", requiredMode = Schema.RequiredMode.REQUIRED)
private String checkCode;
@Schema(description = "计划id", example = "14853")
private Integer planId;
@Schema(description = "生产计划号")
private String proNo;
@Schema(description = "产品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "18345")
private Integer materialId;
@Schema(description = "产品编码")
private String matCode;
@Schema(description = "产品名称", example = "张三")
private String matName;
@Schema(description = "规格型号")
private String spec;
@Schema(description = "批次号")
private String lotNo;
@Schema(description = "生产日期")
private LocalDate outDate;
@Schema(description = "检验日期", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDate checkDate;
@Schema(description = "检验结果(0 合格 1 不合格 2让步接收)")
private String checkResult;
@Schema(description = "备注", example = "随便")
private String remark;
@Schema(description = "表单编号")
private String formCode;
@Schema(description = "质检方案id", example = "17121")
private String qaSchemeBaseId;
@Schema(description = "检验值数量")
private Integer testNum;
@Schema(description = "检验人员id", example = "5837")
private Integer checkUserId;
@Schema(description = "审核人员id", example = "5536")
private Integer checkExUserId;
@Schema(description = "审核日期")
private LocalDate checkExDate;
@Schema(description = "单据状态( 0-已创建 1-已确认 2- 已审核 3-已驳回 )", example = "1")
private String checkStatus;
@Schema(description = "审核原因", example = "随便")
private String checkRemark;
@Schema(description = "检验人员名称", example = "王五")
private String checkUserName;
@Schema(description = "审核人员名称", example = "王五")
private String checkExUserName;
@Schema(description = "产出单id", example = "5341")
private Integer outId;
@Schema(description = "产出明细id", example = "24259")
private Integer outMatId;
private List<ProctionInspTotalDO> proctionInspTotalList;
}

View File

@ -100,6 +100,6 @@ public class RawMaterialInspSaveReqVO {
@Schema(description = "采购订单号")
private String purOrdNo;
@Schema(description = "采购订单号")
private List<RawMaterialInspTotalDO> rawMaterialInspTotalList;
}

View File

@ -0,0 +1,89 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.headno;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
/**
* 工序抬头单 DO
*
* @author 管理员
*/
@TableName("tpo_head_no")
@KeySequence("tpo_head_no_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class HeadNoDO extends BaseDO {
/**
* 自增字段
*/
@TableId
private Integer id;
/**
* 抬头单号(H+年份+月份+ +2位流水号)
*/
private String headNo;
/**
* 生产日期
*/
private LocalDate proDate;
/**
* 生产班组
*/
private String groupCd;
/**
* 生产班次
*/
private String shiftCd;
/**
* 生产计划id
*/
private Integer planId;
/**
* 生产计划号
*/
private String planNo;
/**
* 备注
*/
private String remark;
/**
* 机台编码
*/
private String machineCd;
/**
* 机台名称
*/
private String machineName;
/**
* 机台id
*/
private Integer machineId;
/**
* 产线编码
*/
private String lineCd;
/**
* 产线名称
*/
private String lineName;
/**
* 产线id
*/
private Integer lineId;
/**
* 计划状态2 执行中 3 已完成 4 暂停
*/
private String proStatus;
}

View File

@ -0,0 +1,71 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matout;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
/**
* 产出主 DO
*
* @author 管理员
*/
@TableName("tpo_mat_out")
@KeySequence("tpo_mat_out_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MatOutDO extends BaseDO {
/**
* 自增字段
*/
@TableId
private Integer id;
/**
* 产出单号(O+年份+月份+ +2位流水号)
*/
private String outNo;
/**
* 生产计划id
*/
private Integer planId;
/**
* 生产计划号
*/
private String planNo;
/**
* 入库id
*/
private Integer whInId;
/**
* 备注
*/
private String remark;
/**
* 产出人id
*/
private Integer outEmpId;
/**
* 产出人名称
*/
private String outEmpName;
/**
* 抬头单号
*/
private String headNo;
/**
* 抬头单id
*/
private Integer headId;
/**
* 生产日期
*/
private LocalDateTime outDate;
}

View File

@ -0,0 +1,130 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matoutdetail;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.math.BigDecimal;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
/**
* 工序产出子 DO
*
* @author 管理员
*/
@TableName("tpo_mat_out_detail")
@KeySequence("tpo_mat_out_detail_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MatOutDetailDO extends BaseDO {
/**
* 自增字段
*/
@TableId
private Integer id;
/**
* 产出单号
*/
private String outNo;
/**
* 备注
*/
private String remark;
/**
* 产出主表id
*/
private Integer outId;
/**
* 物料id
*/
private Integer materialId;
/**
* 物料编码
*/
private String materialCode;
/**
* 物料名称
*/
private String materialName;
/**
* 规格型号
*/
private String spec;
/**
* 单位
*/
private String unit;
/**
* 产出数量
*/
private BigDecimal outQty;
/**
* 入库子表id
*/
private Integer whInDetailId;
/**
* 物料批次号
*/
private String lotNo;
/**
* 判定结果(1 合格 2 不合格)
*/
private String judgResult;
/**
* 物料类型(1 原材料 2 半成品 3 成品 4 联产品 )
*/
private String matType;
/**
* 是否需要检验0- 1
*/
private String isInsp;
/**
* 检验状态0-未检验 1已检验
*/
private String inspStatus;
/**
* 采集数量
*/
private BigDecimal atoQty;
/**
* 仓储id
*/
private Integer storeHouseId;
/**
* 库区id
*/
private Integer storeAreaId;
/**
* 仓储编码
*/
private String storeHouseCd;
/**
* 仓储名称
*/
private String storeHouseName;
/**
* 库区编码
*/
private String storeAreCd;
/**
* 库区名称
*/
private String storeAreaName;
@TableField(exist = false)
private Integer planId;
@TableField(exist = false)
private String planNo;
@TableField(exist = false)
private LocalDateTime outDate;
@TableField(exist = false)
private String shiftCd;
@TableField(exist = false)
private String machineName;
}

View File

@ -0,0 +1,102 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.millparamact;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
/**
* 制粉工序参数实绩 DO
*
* @author 管理员
*/
@TableName("tpo_mill_param_act")
@KeySequence("tpo_mill_param_act_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MillParamActDO extends BaseDO {
/**
* 自增字段
*/
@TableId
private Integer id;
/**
* 备注
*/
private String remark;
/**
* 采集时间
*/
private LocalDateTime collectTime;
/**
* 采集班次
*/
private String shiftCd;
/**
* 生产计划id
*/
private Integer planId;
/**
* 生产计划号
*/
private String planNo;
/**
* 工序id
*/
private Integer procCdId;
/**
* 工序编码
*/
private String procCd;
/**
* 工序名称
*/
private String procName;
/**
* 机台id
*/
private Integer machineId;
/**
* 机台编码
*/
private String machineNo;
/**
* 磨机电流
*/
private String grndMacCurr;
/**
* 数据来源(1 自动采集 2 人工录入)
*/
private String dataSource;
/**
* 磨机速度
*/
private String grndMacSpeed;
/**
* 出粉温度
*/
private String outPowTemp;
/**
* 进风温度
*/
private String inAirTemp;
/**
* 磨机出口负压
*/
private String grndOutPress;
/**
* 采集日期
*/
private LocalDate collectDate;
}

View File

@ -0,0 +1,65 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninspdetail;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
/**
* 产品料检验值明细 DO
*
* @author 管理员
*/
@TableName("tqm_proction_insp_detail")
@KeySequence("tqm_proction_insp_detail_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProctionInspDetailDO extends BaseDOWithoutLogic {
/**
* 主键
*/
@TableId
private Integer id;
/**
* 检测值
*/
private String actValue;
/**
* 备注
*/
private String remark;
/**
* 质检方案id
*/
private Integer inspPlanId;
/**
* 质检方案明细id
*/
private Integer inspPlanItemId;
/**
* 主表id
*/
private Integer proctionInspId;
/**
* 界面展示顺序
*/
private Integer seqNo;
/**
* 检验编码
*/
private String checkCode;
/**
* 成品检验值汇总表id
*/
private Integer inspTotalId;
}

View File

@ -0,0 +1,103 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninsptotal;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninspdetail.ProctionInspDetailDO;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
/**
* 产品检验值汇总 DO
*
* @author 管理员
*/
@TableName("tqm_proction_insp_total")
@KeySequence("tqm_proction_insp_total_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProctionInspTotalDO extends BaseDOWithoutLogic {
/**
* 主键
*/
@TableId
private Integer id;
/**
* 平均值
*/
private String actValue;
/**
* 备注
*/
private String remark;
/**
* 质检方案id
*/
private Integer inspPlanId;
/**
* 质检方案明细id
*/
private Integer inspPlanItemId;
/**
* 主表id
*/
private String proctionInspId;
/**
* 界面展示顺序
*/
private Integer seqNo;
/**
* 检验编码
*/
private String checkCode;
/**
* 判定结果0表示合格1表示不合格
*/
private String checkResult;
/**
* 检验项目id
*/
private Integer itemId;
/**
* 检验项名称
*/
private String itemName;
/**
* 标准值
*/
private String standardValue;
/**
* 上限值
*/
private String upperLimit;
/**
* 下限值
*/
private String lowerLimit;
/**
* 检验方法
*/
private String checkMethod;
/**
* 标准值类型1不变 2区间 3大于等于 4小于等于
*/
private String printItem;
@TableField(exist = false)
private List<ProctionInspDetailDO> proctionInspDetailList;
@TableField(exist = false)
private String itemValueType;
@TableField(exist = false)
private String itemContent;
@TableField(exist = false)
private Integer testNum;
@TableField(exist = false)
private Integer floatNum;
}

View File

@ -0,0 +1,134 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.productioninsp;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDOWithoutLogic;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninsptotal.ProctionInspTotalDO;
import lombok.*;
import java.time.LocalDate;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.dataobject.BaseDO;
/**
* 产品检验主 DO
*
* @author 管理员
*/
@TableName("tqm_production_insp")
@KeySequence("tqm_production_insp_seq") // 用于 OraclePostgreSQLKingbaseDB2H2 数据库的主键自增如果是 MySQL 等数据库可不写
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProductionInspDO extends BaseDOWithoutLogic {
/**
* id
*/
@TableId
private Integer id;
/**
* 检验单号CP+年月日+两位流水号
*/
private String checkCode;
/**
* 计划id
*/
private Integer planId;
/**
* 生产计划号
*/
private String proNo;
/**
* 产品id
*/
private Integer materialId;
/**
* 产品编码
*/
private String matCode;
/**
* 产品名称
*/
private String matName;
/**
* 规格型号
*/
private String spec;
/**
* 批次号
*/
private String lotNo;
/**
* 生产日期
*/
private LocalDate outDate;
/**
* 检验日期
*/
private LocalDate checkDate;
/**
* 检验结果(0 合格 1 不合格 2让步接收)
*/
private String checkResult;
/**
* 备注
*/
private String remark;
/**
* 表单编号
*/
private String formCode;
/**
* 质检方案id
*/
private String qaSchemeBaseId;
/**
* 检验值数量
*/
private Integer testNum;
/**
* 检验人员id
*/
private Integer checkUserId;
/**
* 审核人员id
*/
private Integer checkExUserId;
/**
* 审核日期
*/
private LocalDate checkExDate;
/**
* 单据状态( 0-已创建 1-已确认 2- 已审核 3-已驳回 )
*/
private String checkStatus;
/**
* 审核原因
*/
private String checkRemark;
/**
* 检验人员名称
*/
private String checkUserName;
/**
* 审核人员名称
*/
private String checkExUserName;
/**
* 产出单id
*/
private Integer outId;
/**
* 产出明细id
*/
private Integer outMatId;
@TableField(exist = false)
private List<ProctionInspTotalDO> proctionInspTotalList;
}

View File

@ -0,0 +1,40 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.headno;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo.HeadNoPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.headno.HeadNoDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 工序抬头单 Mapper
*
* @author 管理员
*/
@Mapper
public interface HeadNoMapper extends BaseMapperX<HeadNoDO> {
default PageResult<HeadNoDO> selectPage(HeadNoPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<HeadNoDO>()
.betweenIfPresent(HeadNoDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(HeadNoDO::getHeadNo, reqVO.getHeadNo())
.betweenIfPresent(HeadNoDO::getProDate, reqVO.getProDate())
.eqIfPresent(HeadNoDO::getGroupCd, reqVO.getGroupCd())
.eqIfPresent(HeadNoDO::getShiftCd, reqVO.getShiftCd())
.eqIfPresent(HeadNoDO::getPlanId, reqVO.getPlanId())
.eqIfPresent(HeadNoDO::getPlanNo, reqVO.getPlanNo())
.eqIfPresent(HeadNoDO::getRemark, reqVO.getRemark())
.eqIfPresent(HeadNoDO::getMachineCd, reqVO.getMachineCd())
.likeIfPresent(HeadNoDO::getMachineName, reqVO.getMachineName())
.eqIfPresent(HeadNoDO::getMachineId, reqVO.getMachineId())
.eqIfPresent(HeadNoDO::getLineCd, reqVO.getLineCd())
.likeIfPresent(HeadNoDO::getLineName, reqVO.getLineName())
.eqIfPresent(HeadNoDO::getLineId, reqVO.getLineId())
.eqIfPresent(HeadNoDO::getProStatus, reqVO.getProStatus())
.orderByDesc(HeadNoDO::getId));
}
}

View File

@ -61,7 +61,7 @@ public interface InspPlanItemMapper extends BaseMapperX<InspPlanItemDO> {
.eq(InspPlanItemDO::getSchemeId, schemeId));
}
default List<InspPlanItemDO> selectMaterialId(Integer id){
default List<InspPlanItemDO> selectMaterialId(Integer id, String schemeType){
MPJLambdaWrapperX<InspPlanItemDO> query = new MPJLambdaWrapperX<>();
query.selectAll(InspPlanItemDO.class)
.select("p.test_Num as tolNum")
@ -72,7 +72,7 @@ public interface InspPlanItemMapper extends BaseMapperX<InspPlanItemDO> {
.leftJoin(InspPlanDO.class,"p",InspPlanDO::getId,InspPlanItemDO::getSchemeId)
.leftJoin(MaterialDO.class,"m",MaterialDO::getSchemeId,InspPlanDO::getId)
.disableSubLogicDel().orderByAsc(InspPlanItemDO::getSeqNo);
query.eq(MaterialDO::getId,id).eq(InspPlanDO::getSchemeType,"1");
query.eq(MaterialDO::getId,id).eq(InspPlanDO::getSchemeType,schemeType);
return selectList(query);
}
}

View File

@ -0,0 +1,35 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.matout;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo.MatOutPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matout.MatOutDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 产出主 Mapper
*
* @author 管理员
*/
@Mapper
public interface MatOutMapper extends BaseMapperX<MatOutDO> {
default PageResult<MatOutDO> selectPage(MatOutPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<MatOutDO>()
.betweenIfPresent(MatOutDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(MatOutDO::getOutNo, reqVO.getOutNo())
.eqIfPresent(MatOutDO::getPlanId, reqVO.getPlanId())
.eqIfPresent(MatOutDO::getPlanNo, reqVO.getPlanNo())
.eqIfPresent(MatOutDO::getWhInId, reqVO.getWhInId())
.eqIfPresent(MatOutDO::getRemark, reqVO.getRemark())
.eqIfPresent(MatOutDO::getOutEmpId, reqVO.getOutEmpId())
.likeIfPresent(MatOutDO::getOutEmpName, reqVO.getOutEmpName())
.eqIfPresent(MatOutDO::getHeadNo, reqVO.getHeadNo())
.eqIfPresent(MatOutDO::getHeadId, reqVO.getHeadId())
.orderByDesc(MatOutDO::getId));
}
}

View File

@ -0,0 +1,42 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.matoutdetail;
import java.util.*;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.MPJLambdaWrapperX;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo.MatOutDetailPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.headno.HeadNoDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matout.MatOutDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matoutdetail.MatOutDetailDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 工序产出子 Mapper
*
* @author 管理员
*/
@Mapper
public interface MatOutDetailMapper extends BaseMapperX<MatOutDetailDO> {
default PageResult<MatOutDetailDO> selectPage(MatOutDetailPageReqVO reqVO) {
MPJLambdaWrapperX<MatOutDetailDO> query = new MPJLambdaWrapperX<>();
query.selectAll(MatOutDetailDO.class)
.select("m.plan_id as planId","m.plan_no as planNo","m.out_date as outDate")
.select("h.shift_cd as shiftCd","h.machine_name as machineName")
.leftJoin(MatOutDO.class,"m",MatOutDO::getId,MatOutDetailDO::getOutId)
.leftJoin(HeadNoDO.class,"h",HeadNoDO::getId,MatOutDO::getHeadId)
.disableSubLogicDel()
.orderByDesc(MatOutDO::getOutDate);
query.between(ObjectUtil.isNotEmpty(reqVO.getOutDate()),MatOutDO::getOutDate, reqVO.getOutDate()[0].atStartOfDay(), reqVO.getOutDate()[1].atTime(23, 59, 59))
.like(ObjectUtil.isNotEmpty(reqVO.getLotNo()),MatOutDetailDO::getLotNo,reqVO.getLotNo())
.eq(ObjectUtil.isNotEmpty(reqVO.getMatType()),MatOutDetailDO::getMatType,reqVO.getMatType())
.eq(ObjectUtil.isNotEmpty(reqVO.getInspStatus()),MatOutDetailDO::getInspStatus,reqVO.getInspStatus());
return selectPage(reqVO, query);
}
}

View File

@ -0,0 +1,43 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.millparamact;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo.MillParamActPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.millparamact.MillParamActDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 制粉工序参数实绩 Mapper
*
* @author 管理员
*/
@Mapper
public interface MillParamActMapper extends BaseMapperX<MillParamActDO> {
default PageResult<MillParamActDO> selectPage(MillParamActPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<MillParamActDO>()
.betweenIfPresent(MillParamActDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(MillParamActDO::getRemark, reqVO.getRemark())
.betweenIfPresent(MillParamActDO::getCollectTime, reqVO.getCollectTime())
.eqIfPresent(MillParamActDO::getShiftCd, reqVO.getShiftCd())
.eqIfPresent(MillParamActDO::getPlanId, reqVO.getPlanId())
.eqIfPresent(MillParamActDO::getPlanNo, reqVO.getPlanNo())
.eqIfPresent(MillParamActDO::getProcCdId, reqVO.getProcCdId())
.eqIfPresent(MillParamActDO::getProcCd, reqVO.getProcCd())
.likeIfPresent(MillParamActDO::getProcName, reqVO.getProcName())
.eqIfPresent(MillParamActDO::getMachineId, reqVO.getMachineId())
.eqIfPresent(MillParamActDO::getMachineNo, reqVO.getMachineNo())
.eqIfPresent(MillParamActDO::getGrndMacCurr, reqVO.getGrndMacCurr())
.eqIfPresent(MillParamActDO::getDataSource, reqVO.getDataSource())
.eqIfPresent(MillParamActDO::getGrndMacSpeed, reqVO.getGrndMacSpeed())
.eqIfPresent(MillParamActDO::getOutPowTemp, reqVO.getOutPowTemp())
.eqIfPresent(MillParamActDO::getInAirTemp, reqVO.getInAirTemp())
.eqIfPresent(MillParamActDO::getGrndOutPress, reqVO.getGrndOutPress())
.betweenIfPresent(MillParamActDO::getCollectDate, reqVO.getCollectDate())
.orderByDesc(MillParamActDO::getId));
}
}

View File

@ -28,7 +28,7 @@ public interface PlanMapper extends BaseMapperX<PlanDO> {
.leftJoin(TechProcDO.class, "e",TechProcDO::getId,PlanDO::getProcessFlow)
.disableSubLogicDel()
.orderByDesc(PlanDO::getCreateTime);
query.between(ObjectUtil.isNotEmpty(reqVO.getProDate()), PlanDO::getProDate, reqVO.getProDate()[0], reqVO.getProDate()[1])
query.between(ObjectUtil.isNotEmpty(reqVO.getProDate()), PlanDO::getProDate, reqVO.getProDate()[0], reqVO.getProDate()[1].atTime(23, 59, 59))
.like(ObjectUtil.isNotEmpty(reqVO.getProNo()),PlanDO::getProNo, reqVO.getProNo())
.like(ObjectUtil.isNotEmpty(reqVO.getSpec()),PlanDO::getSpec, reqVO.getSpec())
.eq(ObjectUtil.isNotEmpty(reqVO.getPlanStatus()),PlanDO::getPlanStatus, reqVO.getPlanStatus())

View File

@ -0,0 +1,44 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.proctioninspdetail;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo.ProctionInspDetailPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninspdetail.ProctionInspDetailDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 产品料检验值明细 Mapper
*
* @author 管理员
*/
@Mapper
public interface ProctionInspDetailMapper extends BaseMapperX<ProctionInspDetailDO> {
default PageResult<ProctionInspDetailDO> selectPage(ProctionInspDetailPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ProctionInspDetailDO>()
.eqIfPresent(ProctionInspDetailDO::getActValue, reqVO.getActValue())
.eqIfPresent(ProctionInspDetailDO::getRemark, reqVO.getRemark())
.betweenIfPresent(ProctionInspDetailDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ProctionInspDetailDO::getInspPlanId, reqVO.getInspPlanId())
.eqIfPresent(ProctionInspDetailDO::getInspPlanItemId, reqVO.getInspPlanItemId())
.eqIfPresent(ProctionInspDetailDO::getProctionInspId, reqVO.getProctionInspId())
.eqIfPresent(ProctionInspDetailDO::getSeqNo, reqVO.getSeqNo())
.eqIfPresent(ProctionInspDetailDO::getCheckCode, reqVO.getCheckCode())
.eqIfPresent(ProctionInspDetailDO::getInspTotalId, reqVO.getInspTotalId())
.orderByDesc(ProctionInspDetailDO::getId));
}
/**
* 根据主表id删除
*/
default void deleteByProctionInspId(Integer proctionInspId) {
delete(new LambdaQueryWrapperX<ProctionInspDetailDO>()
.eq(ProctionInspDetailDO::getProctionInspId, proctionInspId));
}
}

View File

@ -0,0 +1,67 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.proctioninsptotal;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.MPJLambdaWrapperX;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo.ProctionInspTotalPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.checkitem.CheckItemDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninsptotal.ProctionInspTotalDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 产品检验值汇总 Mapper
*
* @author 管理员
*/
@Mapper
public interface ProctionInspTotalMapper extends BaseMapperX<ProctionInspTotalDO> {
default PageResult<ProctionInspTotalDO> selectPage(ProctionInspTotalPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ProctionInspTotalDO>()
.eqIfPresent(ProctionInspTotalDO::getActValue, reqVO.getActValue())
.eqIfPresent(ProctionInspTotalDO::getRemark, reqVO.getRemark())
.betweenIfPresent(ProctionInspTotalDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ProctionInspTotalDO::getInspPlanId, reqVO.getInspPlanId())
.eqIfPresent(ProctionInspTotalDO::getInspPlanItemId, reqVO.getInspPlanItemId())
.eqIfPresent(ProctionInspTotalDO::getProctionInspId, reqVO.getProctionInspId())
.eqIfPresent(ProctionInspTotalDO::getSeqNo, reqVO.getSeqNo())
.eqIfPresent(ProctionInspTotalDO::getCheckCode, reqVO.getCheckCode())
.eqIfPresent(ProctionInspTotalDO::getCheckResult, reqVO.getCheckResult())
.eqIfPresent(ProctionInspTotalDO::getItemId, reqVO.getItemId())
.likeIfPresent(ProctionInspTotalDO::getItemName, reqVO.getItemName())
.eqIfPresent(ProctionInspTotalDO::getStandardValue, reqVO.getStandardValue())
.eqIfPresent(ProctionInspTotalDO::getUpperLimit, reqVO.getUpperLimit())
.eqIfPresent(ProctionInspTotalDO::getLowerLimit, reqVO.getLowerLimit())
.eqIfPresent(ProctionInspTotalDO::getCheckMethod, reqVO.getCheckMethod())
.eqIfPresent(ProctionInspTotalDO::getPrintItem, reqVO.getPrintItem())
.orderByDesc(ProctionInspTotalDO::getId));
}
/**
* 根据主表id删除
*/
default void deleteByProctionInspId(String proctionInspId) {
delete(new LambdaQueryWrapperX<ProctionInspTotalDO>()
.eq(ProctionInspTotalDO::getProctionInspId, proctionInspId));
}
/**
* 根据主表id查询汇总列表
*/
default List<ProctionInspTotalDO> selectByProctionInspId(Integer proctionInspId) {
MPJLambdaWrapperX<ProctionInspTotalDO> query = new MPJLambdaWrapperX<>();
query.selectAll(ProctionInspTotalDO.class)
.select("c.item_value_type as itemValueType","c.item_content as itemContent")
.select("c.test_num as testNum","c.float_num as floatNum")
.leftJoin(CheckItemDO.class,"c",CheckItemDO::getId,ProctionInspTotalDO::getItemId)
.disableSubLogicDel()
.orderByAsc(ProctionInspTotalDO::getSeqNo);
query.eq(ProctionInspTotalDO::getProctionInspId, proctionInspId);
return selectList(query);
}
}

View File

@ -0,0 +1,60 @@
package com.ningxia.yunxi.chemmes.module.biz.dal.mysql.productioninsp;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.mapper.BaseMapperX;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo.ProductionInspPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.productioninsp.ProductionInspDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 产品检验主 Mapper
*
* @author 管理员
*/
@Mapper
public interface ProductionInspMapper extends BaseMapperX<ProductionInspDO> {
default PageResult<ProductionInspDO> selectPage(ProductionInspPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<ProductionInspDO>()
.eqIfPresent(ProductionInspDO::getCheckCode, reqVO.getCheckCode())
.eqIfPresent(ProductionInspDO::getPlanId, reqVO.getPlanId())
.eqIfPresent(ProductionInspDO::getProNo, reqVO.getProNo())
.eqIfPresent(ProductionInspDO::getMaterialId, reqVO.getMaterialId())
.eqIfPresent(ProductionInspDO::getMatCode, reqVO.getMatCode())
.likeIfPresent(ProductionInspDO::getMatName, reqVO.getMatName())
.eqIfPresent(ProductionInspDO::getSpec, reqVO.getSpec())
.eqIfPresent(ProductionInspDO::getLotNo, reqVO.getLotNo())
.betweenIfPresent(ProductionInspDO::getOutDate, reqVO.getOutDate())
.betweenIfPresent(ProductionInspDO::getCheckDate, reqVO.getCheckDate())
.eqIfPresent(ProductionInspDO::getCheckResult, reqVO.getCheckResult())
.eqIfPresent(ProductionInspDO::getRemark, reqVO.getRemark())
.betweenIfPresent(ProductionInspDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(ProductionInspDO::getFormCode, reqVO.getFormCode())
.eqIfPresent(ProductionInspDO::getQaSchemeBaseId, reqVO.getQaSchemeBaseId())
.eqIfPresent(ProductionInspDO::getTestNum, reqVO.getTestNum())
.eqIfPresent(ProductionInspDO::getCheckUserId, reqVO.getCheckUserId())
.eqIfPresent(ProductionInspDO::getCheckExUserId, reqVO.getCheckExUserId())
.betweenIfPresent(ProductionInspDO::getCheckExDate, reqVO.getCheckExDate())
.eqIfPresent(ProductionInspDO::getCheckStatus, reqVO.getCheckStatus())
.eqIfPresent(ProductionInspDO::getCheckRemark, reqVO.getCheckRemark())
.likeIfPresent(ProductionInspDO::getCheckUserName, reqVO.getCheckUserName())
.likeIfPresent(ProductionInspDO::getCheckExUserName, reqVO.getCheckExUserName())
.eqIfPresent(ProductionInspDO::getOutId, reqVO.getOutId())
.eqIfPresent(ProductionInspDO::getOutMatId, reqVO.getOutMatId())
.orderByDesc(ProductionInspDO::getId));
}
/**
* 查询最大检验单号
*/
default String selectMaxCheckCode() {
ProductionInspDO result = selectOne(new LambdaQueryWrapperX<ProductionInspDO>()
.orderByDesc(ProductionInspDO::getCheckCode)
.last("LIMIT 1"));
return result == null ? null : result.getCheckCode();
}
}

View File

@ -58,7 +58,7 @@ public interface RawMaterialInspMapper extends BaseMapperX<RawMaterialInspDO> {
.likeIfPresent(RawMaterialInspDO::getCheckExUserName, reqVO.getCheckExUserName())
.eqIfPresent(RawMaterialInspDO::getPurOrdId, reqVO.getPurOrdId())
.eqIfPresent(RawMaterialInspDO::getPurOrdNo, reqVO.getPurOrdNo())
.orderByDesc(RawMaterialInspDO::getId));
.orderByDesc(RawMaterialInspDO::getCheckDate));
}
}

View File

@ -0,0 +1,56 @@
package com.ningxia.yunxi.chemmes.module.biz.service.headno;
import java.util.*;
import javax.validation.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo.HeadNoPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo.HeadNoSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.headno.HeadNoDO;
/**
* 工序抬头单 Service 接口
*
* @author 管理员
*/
public interface HeadNoService {
/**
* 创建工序抬头单
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createHeadNo(@Valid HeadNoSaveReqVO createReqVO);
/**
* 更新工序抬头单
*
* @param updateReqVO 更新信息
*/
void updateHeadNo(@Valid HeadNoSaveReqVO updateReqVO);
/**
* 删除工序抬头单
*
* @param id 编号
*/
void deleteHeadNo(Integer id);
/**
* 获得工序抬头单
*
* @param id 编号
* @return 工序抬头单
*/
HeadNoDO getHeadNo(Integer id);
/**
* 获得工序抬头单分页
*
* @param pageReqVO 分页查询
* @return 工序抬头单分页
*/
PageResult<HeadNoDO> getHeadNoPage(HeadNoPageReqVO pageReqVO);
}

View File

@ -0,0 +1,75 @@
package com.ningxia.yunxi.chemmes.module.biz.service.headno;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo.HeadNoPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.headno.vo.HeadNoSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.headno.HeadNoDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.headno.HeadNoMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 工序抬头单 Service 实现类
*
* @author 管理员
*/
@Service
@Validated
public class HeadNoServiceImpl implements HeadNoService {
@Resource
private HeadNoMapper headNoMapper;
@Override
public Integer createHeadNo(HeadNoSaveReqVO createReqVO) {
// 插入
HeadNoDO headNo = BeanUtils.toBean(createReqVO, HeadNoDO.class);
headNoMapper.insert(headNo);
// 返回
return headNo.getId();
}
@Override
public void updateHeadNo(HeadNoSaveReqVO updateReqVO) {
// 校验存在
validateHeadNoExists(updateReqVO.getId());
// 更新
HeadNoDO updateObj = BeanUtils.toBean(updateReqVO, HeadNoDO.class);
headNoMapper.updateById(updateObj);
}
@Override
public void deleteHeadNo(Integer id) {
// 校验存在
validateHeadNoExists(id);
// 删除
headNoMapper.deleteById(id);
}
private void validateHeadNoExists(Integer id) {
if (headNoMapper.selectById(id) == null) {
throw exception("数据不存在");
}
}
@Override
public HeadNoDO getHeadNo(Integer id) {
return headNoMapper.selectById(id);
}
@Override
public PageResult<HeadNoDO> getHeadNoPage(HeadNoPageReqVO pageReqVO) {
return headNoMapper.selectPage(pageReqVO);
}
}

View File

@ -55,5 +55,5 @@ public interface InspPlanItemService {
PageResult<InspPlanItemDO> getInspPlanItemPage(InspPlanItemPageReqVO pageReqVO);
List<InspPlanItemDO> getInspPlanItemByPlanId(Integer planId);
List<InspPlanItemDO> selectMaterialId(Integer id);
List<InspPlanItemDO> selectMaterialId(Integer id, String schemeType);
}

View File

@ -74,7 +74,7 @@ public class InspPlanItemServiceImpl implements InspPlanItemService {
return inspPlanItemMapper.getInspPlanItemByPlanId(planId);
}
@Override
public List<InspPlanItemDO> selectMaterialId(Integer id) {
return inspPlanItemMapper.selectMaterialId(id);
public List<InspPlanItemDO> selectMaterialId(Integer id, String schemeType) {
return inspPlanItemMapper.selectMaterialId(id, schemeType);
}
}

View File

@ -0,0 +1,56 @@
package com.ningxia.yunxi.chemmes.module.biz.service.matout;
import java.util.*;
import javax.validation.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo.MatOutPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo.MatOutSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matout.MatOutDO;
/**
* 产出主 Service 接口
*
* @author 管理员
*/
public interface MatOutService {
/**
* 创建产出主
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createMatOut(@Valid MatOutSaveReqVO createReqVO);
/**
* 更新产出主
*
* @param updateReqVO 更新信息
*/
void updateMatOut(@Valid MatOutSaveReqVO updateReqVO);
/**
* 删除产出主
*
* @param id 编号
*/
void deleteMatOut(Integer id);
/**
* 获得产出主
*
* @param id 编号
* @return 产出主
*/
MatOutDO getMatOut(Integer id);
/**
* 获得产出主分页
*
* @param pageReqVO 分页查询
* @return 产出主分页
*/
PageResult<MatOutDO> getMatOutPage(MatOutPageReqVO pageReqVO);
}

View File

@ -0,0 +1,75 @@
package com.ningxia.yunxi.chemmes.module.biz.service.matout;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo.MatOutPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matout.vo.MatOutSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matout.MatOutDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.matout.MatOutMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 产出主 Service 实现类
*
* @author 管理员
*/
@Service
@Validated
public class MatOutServiceImpl implements MatOutService {
@Resource
private MatOutMapper matOutMapper;
@Override
public Integer createMatOut(MatOutSaveReqVO createReqVO) {
// 插入
MatOutDO matOut = BeanUtils.toBean(createReqVO, MatOutDO.class);
matOutMapper.insert(matOut);
// 返回
return matOut.getId();
}
@Override
public void updateMatOut(MatOutSaveReqVO updateReqVO) {
// 校验存在
validateMatOutExists(updateReqVO.getId());
// 更新
MatOutDO updateObj = BeanUtils.toBean(updateReqVO, MatOutDO.class);
matOutMapper.updateById(updateObj);
}
@Override
public void deleteMatOut(Integer id) {
// 校验存在
validateMatOutExists(id);
// 删除
matOutMapper.deleteById(id);
}
private void validateMatOutExists(Integer id) {
if (matOutMapper.selectById(id) == null) {
throw exception("数据不存在");
}
}
@Override
public MatOutDO getMatOut(Integer id) {
return matOutMapper.selectById(id);
}
@Override
public PageResult<MatOutDO> getMatOutPage(MatOutPageReqVO pageReqVO) {
return matOutMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,56 @@
package com.ningxia.yunxi.chemmes.module.biz.service.matoutdetail;
import java.util.*;
import javax.validation.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo.MatOutDetailPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo.MatOutDetailSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matoutdetail.MatOutDetailDO;
/**
* 工序产出子 Service 接口
*
* @author 管理员
*/
public interface MatOutDetailService {
/**
* 创建工序产出子
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createMatOutDetail(@Valid MatOutDetailSaveReqVO createReqVO);
/**
* 更新工序产出子
*
* @param updateReqVO 更新信息
*/
void updateMatOutDetail(@Valid MatOutDetailSaveReqVO updateReqVO);
/**
* 删除工序产出子
*
* @param id 编号
*/
void deleteMatOutDetail(Integer id);
/**
* 获得工序产出子
*
* @param id 编号
* @return 工序产出子
*/
MatOutDetailDO getMatOutDetail(Integer id);
/**
* 获得工序产出子分页
*
* @param pageReqVO 分页查询
* @return 工序产出子分页
*/
PageResult<MatOutDetailDO> getMatOutDetailPage(MatOutDetailPageReqVO pageReqVO);
}

View File

@ -0,0 +1,75 @@
package com.ningxia.yunxi.chemmes.module.biz.service.matoutdetail;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo.MatOutDetailPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.matoutdetail.vo.MatOutDetailSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.matoutdetail.MatOutDetailDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.matoutdetail.MatOutDetailMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 工序产出子 Service 实现类
*
* @author 管理员
*/
@Service
@Validated
public class MatOutDetailServiceImpl implements MatOutDetailService {
@Resource
private MatOutDetailMapper matOutDetailMapper;
@Override
public Integer createMatOutDetail(MatOutDetailSaveReqVO createReqVO) {
// 插入
MatOutDetailDO matOutDetail = BeanUtils.toBean(createReqVO, MatOutDetailDO.class);
matOutDetailMapper.insert(matOutDetail);
// 返回
return matOutDetail.getId();
}
@Override
public void updateMatOutDetail(MatOutDetailSaveReqVO updateReqVO) {
// 校验存在
validateMatOutDetailExists(updateReqVO.getId());
// 更新
MatOutDetailDO updateObj = BeanUtils.toBean(updateReqVO, MatOutDetailDO.class);
matOutDetailMapper.updateById(updateObj);
}
@Override
public void deleteMatOutDetail(Integer id) {
// 校验存在
validateMatOutDetailExists(id);
// 删除
matOutDetailMapper.deleteById(id);
}
private void validateMatOutDetailExists(Integer id) {
if (matOutDetailMapper.selectById(id) == null) {
throw exception("数据不存在");
}
}
@Override
public MatOutDetailDO getMatOutDetail(Integer id) {
return matOutDetailMapper.selectById(id);
}
@Override
public PageResult<MatOutDetailDO> getMatOutDetailPage(MatOutDetailPageReqVO pageReqVO) {
return matOutDetailMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,56 @@
package com.ningxia.yunxi.chemmes.module.biz.service.millparamact;
import java.util.*;
import javax.validation.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo.MillParamActPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo.MillParamActSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.millparamact.MillParamActDO;
/**
* 制粉工序参数实绩 Service 接口
*
* @author 管理员
*/
public interface MillParamActService {
/**
* 创建制粉工序参数实绩
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createMillParamAct(@Valid MillParamActSaveReqVO createReqVO);
/**
* 更新制粉工序参数实绩
*
* @param updateReqVO 更新信息
*/
void updateMillParamAct(@Valid MillParamActSaveReqVO updateReqVO);
/**
* 删除制粉工序参数实绩
*
* @param id 编号
*/
void deleteMillParamAct(Integer id);
/**
* 获得制粉工序参数实绩
*
* @param id 编号
* @return 制粉工序参数实绩
*/
MillParamActDO getMillParamAct(Integer id);
/**
* 获得制粉工序参数实绩分页
*
* @param pageReqVO 分页查询
* @return 制粉工序参数实绩分页
*/
PageResult<MillParamActDO> getMillParamActPage(MillParamActPageReqVO pageReqVO);
}

View File

@ -0,0 +1,75 @@
package com.ningxia.yunxi.chemmes.module.biz.service.millparamact;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo.MillParamActPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.millparamact.vo.MillParamActSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.millparamact.MillParamActDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.millparamact.MillParamActMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 制粉工序参数实绩 Service 实现类
*
* @author 管理员
*/
@Service
@Validated
public class MillParamActServiceImpl implements MillParamActService {
@Resource
private MillParamActMapper millParamActMapper;
@Override
public Integer createMillParamAct(MillParamActSaveReqVO createReqVO) {
// 插入
MillParamActDO millParamAct = BeanUtils.toBean(createReqVO, MillParamActDO.class);
millParamActMapper.insert(millParamAct);
// 返回
return millParamAct.getId();
}
@Override
public void updateMillParamAct(MillParamActSaveReqVO updateReqVO) {
// 校验存在
validateMillParamActExists(updateReqVO.getId());
// 更新
MillParamActDO updateObj = BeanUtils.toBean(updateReqVO, MillParamActDO.class);
millParamActMapper.updateById(updateObj);
}
@Override
public void deleteMillParamAct(Integer id) {
// 校验存在
validateMillParamActExists(id);
// 删除
millParamActMapper.deleteById(id);
}
private void validateMillParamActExists(Integer id) {
if (millParamActMapper.selectById(id) == null) {
throw exception("数据不存在");
}
}
@Override
public MillParamActDO getMillParamAct(Integer id) {
return millParamActMapper.selectById(id);
}
@Override
public PageResult<MillParamActDO> getMillParamActPage(MillParamActPageReqVO pageReqVO) {
return millParamActMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,56 @@
package com.ningxia.yunxi.chemmes.module.biz.service.proctioninspdetail;
import java.util.*;
import javax.validation.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo.ProctionInspDetailPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo.ProctionInspDetailSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninspdetail.ProctionInspDetailDO;
/**
* 产品料检验值明细 Service 接口
*
* @author 管理员
*/
public interface ProctionInspDetailService {
/**
* 创建产品料检验值明细
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createProctionInspDetail(@Valid ProctionInspDetailSaveReqVO createReqVO);
/**
* 更新产品料检验值明细
*
* @param updateReqVO 更新信息
*/
void updateProctionInspDetail(@Valid ProctionInspDetailSaveReqVO updateReqVO);
/**
* 删除产品料检验值明细
*
* @param id 编号
*/
void deleteProctionInspDetail(Integer id);
/**
* 获得产品料检验值明细
*
* @param id 编号
* @return 产品料检验值明细
*/
ProctionInspDetailDO getProctionInspDetail(Integer id);
/**
* 获得产品料检验值明细分页
*
* @param pageReqVO 分页查询
* @return 产品料检验值明细分页
*/
PageResult<ProctionInspDetailDO> getProctionInspDetailPage(ProctionInspDetailPageReqVO pageReqVO);
}

View File

@ -0,0 +1,75 @@
package com.ningxia.yunxi.chemmes.module.biz.service.proctioninspdetail;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo.ProctionInspDetailPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninspdetail.vo.ProctionInspDetailSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninspdetail.ProctionInspDetailDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.proctioninspdetail.ProctionInspDetailMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 产品料检验值明细 Service 实现类
*
* @author 管理员
*/
@Service
@Validated
public class ProctionInspDetailServiceImpl implements ProctionInspDetailService {
@Resource
private ProctionInspDetailMapper proctionInspDetailMapper;
@Override
public Integer createProctionInspDetail(ProctionInspDetailSaveReqVO createReqVO) {
// 插入
ProctionInspDetailDO proctionInspDetail = BeanUtils.toBean(createReqVO, ProctionInspDetailDO.class);
proctionInspDetailMapper.insert(proctionInspDetail);
// 返回
return proctionInspDetail.getId();
}
@Override
public void updateProctionInspDetail(ProctionInspDetailSaveReqVO updateReqVO) {
// 校验存在
validateProctionInspDetailExists(updateReqVO.getId());
// 更新
ProctionInspDetailDO updateObj = BeanUtils.toBean(updateReqVO, ProctionInspDetailDO.class);
proctionInspDetailMapper.updateById(updateObj);
}
@Override
public void deleteProctionInspDetail(Integer id) {
// 校验存在
validateProctionInspDetailExists(id);
// 删除
proctionInspDetailMapper.deleteById(id);
}
private void validateProctionInspDetailExists(Integer id) {
if (proctionInspDetailMapper.selectById(id) == null) {
throw exception("数据不存在");
}
}
@Override
public ProctionInspDetailDO getProctionInspDetail(Integer id) {
return proctionInspDetailMapper.selectById(id);
}
@Override
public PageResult<ProctionInspDetailDO> getProctionInspDetailPage(ProctionInspDetailPageReqVO pageReqVO) {
return proctionInspDetailMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,56 @@
package com.ningxia.yunxi.chemmes.module.biz.service.proctioninsptotal;
import java.util.*;
import javax.validation.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo.ProctionInspTotalPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo.ProctionInspTotalSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninsptotal.ProctionInspTotalDO;
/**
* 产品检验值汇总 Service 接口
*
* @author 管理员
*/
public interface ProctionInspTotalService {
/**
* 创建产品检验值汇总
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createProctionInspTotal(@Valid ProctionInspTotalSaveReqVO createReqVO);
/**
* 更新产品检验值汇总
*
* @param updateReqVO 更新信息
*/
void updateProctionInspTotal(@Valid ProctionInspTotalSaveReqVO updateReqVO);
/**
* 删除产品检验值汇总
*
* @param id 编号
*/
void deleteProctionInspTotal(Integer id);
/**
* 获得产品检验值汇总
*
* @param id 编号
* @return 产品检验值汇总
*/
ProctionInspTotalDO getProctionInspTotal(Integer id);
/**
* 获得产品检验值汇总分页
*
* @param pageReqVO 分页查询
* @return 产品检验值汇总分页
*/
PageResult<ProctionInspTotalDO> getProctionInspTotalPage(ProctionInspTotalPageReqVO pageReqVO);
}

View File

@ -0,0 +1,75 @@
package com.ningxia.yunxi.chemmes.module.biz.service.proctioninsptotal;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo.ProctionInspTotalPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.proctioninsptotal.vo.ProctionInspTotalSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninsptotal.ProctionInspTotalDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.proctioninsptotal.ProctionInspTotalMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 产品检验值汇总 Service 实现类
*
* @author 管理员
*/
@Service
@Validated
public class ProctionInspTotalServiceImpl implements ProctionInspTotalService {
@Resource
private ProctionInspTotalMapper proctionInspTotalMapper;
@Override
public Integer createProctionInspTotal(ProctionInspTotalSaveReqVO createReqVO) {
// 插入
ProctionInspTotalDO proctionInspTotal = BeanUtils.toBean(createReqVO, ProctionInspTotalDO.class);
proctionInspTotalMapper.insert(proctionInspTotal);
// 返回
return proctionInspTotal.getId();
}
@Override
public void updateProctionInspTotal(ProctionInspTotalSaveReqVO updateReqVO) {
// 校验存在
validateProctionInspTotalExists(updateReqVO.getId());
// 更新
ProctionInspTotalDO updateObj = BeanUtils.toBean(updateReqVO, ProctionInspTotalDO.class);
proctionInspTotalMapper.updateById(updateObj);
}
@Override
public void deleteProctionInspTotal(Integer id) {
// 校验存在
validateProctionInspTotalExists(id);
// 删除
proctionInspTotalMapper.deleteById(id);
}
private void validateProctionInspTotalExists(Integer id) {
if (proctionInspTotalMapper.selectById(id) == null) {
throw exception("数据不存在");
}
}
@Override
public ProctionInspTotalDO getProctionInspTotal(Integer id) {
return proctionInspTotalMapper.selectById(id);
}
@Override
public PageResult<ProctionInspTotalDO> getProctionInspTotalPage(ProctionInspTotalPageReqVO pageReqVO) {
return proctionInspTotalMapper.selectPage(pageReqVO);
}
}

View File

@ -0,0 +1,56 @@
package com.ningxia.yunxi.chemmes.module.biz.service.productioninsp;
import java.util.*;
import javax.validation.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo.ProductionInspPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo.ProductionInspSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.productioninsp.ProductionInspDO;
/**
* 产品检验主 Service 接口
*
* @author 管理员
*/
public interface ProductionInspService {
/**
* 创建产品检验主
*
* @param createReqVO 创建信息
* @return 编号
*/
String createProductionInsp(@Valid ProductionInspSaveReqVO createReqVO);
/**
* 更新产品检验主
*
* @param updateReqVO 更新信息
*/
void updateProductionInsp(@Valid ProductionInspSaveReqVO updateReqVO);
/**
* 删除产品检验主
*
* @param id 编号
*/
void deleteProductionInsp(String id);
/**
* 获得产品检验主
*
* @param id 编号
* @return 产品检验主
*/
ProductionInspDO getProductionInsp(String id);
/**
* 获得产品检验主分页
*
* @param pageReqVO 分页查询
* @return 产品检验主分页
*/
PageResult<ProductionInspDO> getProductionInspPage(ProductionInspPageReqVO pageReqVO);
}

View File

@ -0,0 +1,281 @@
package com.ningxia.yunxi.chemmes.module.biz.service.productioninsp;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo.ProductionInspPageReqVO;
import com.ningxia.yunxi.chemmes.module.biz.controller.admin.productioninsp.vo.ProductionInspSaveReqVO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninspdetail.ProctionInspDetailDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.proctioninsptotal.ProctionInspTotalDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.productioninsp.ProductionInspDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsp.RawMaterialInspDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinspdetail.RawMaterialInspDetailDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.dataobject.rawmaterialinsptotal.RawMaterialInspTotalDO;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.proctioninspdetail.ProctionInspDetailMapper;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.proctioninsptotal.ProctionInspTotalMapper;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.productioninsp.ProductionInspMapper;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinsp.RawMaterialInspMapper;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinspdetail.RawMaterialInspDetailMapper;
import com.ningxia.yunxi.chemmes.module.biz.dal.mysql.rawmaterialinsptotal.RawMaterialInspTotalMapper;
import com.ningxia.yunxi.chemmes.module.system.dal.dataobject.user.AdminUserDO;
import com.ningxia.yunxi.chemmes.module.system.dal.mysql.user.AdminUserMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import static com.ningxia.yunxi.chemmes.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static com.ningxia.yunxi.chemmes.module.infra.enums.ErrorCodeConstants.*;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageResult;
import com.ningxia.yunxi.chemmes.framework.common.pojo.PageParam;
import com.ningxia.yunxi.chemmes.framework.common.util.object.BeanUtils;
import com.ningxia.yunxi.chemmes.framework.mybatis.core.query.LambdaQueryWrapperX;
import static com.ningxia.yunxi.chemmes.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 产品检验主 Service 实现类
*
* @author 管理员
*/
@Service
@Validated
public class ProductionInspServiceImpl implements ProductionInspService {
@Resource
private ProductionInspMapper productionInspMapper;
@Resource
private AdminUserMapper adminUserMapper;
@Resource
private ProctionInspTotalMapper proctionInspTotalMapper;
@Resource
private ProctionInspDetailMapper proctionInspDetailMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public String createProductionInsp(ProductionInspSaveReqVO createReqVO) {
// 生成检验单号
String checkCode = generateCheckCode();
// 设置检验人信息为当前登录用户
Long userId = getLoginUserId();
AdminUserDO adminUserDO = adminUserMapper.selectById(userId);
createReqVO.setCheckUserId(Integer.parseInt(String.valueOf(userId)));
createReqVO.setCheckUserName(adminUserDO.getNickname());
// 1. 插入主表 tqm_raw_material_insp
ProductionInspDO productionInsp = BeanUtils.toBean(createReqVO, ProductionInspDO.class);
productionInsp.setCheckCode(checkCode);
productionInspMapper.insert(productionInsp);
Integer proctionInspId = productionInsp.getId();
// 2. 循环插入汇总表 tqm_proction_insp_total顺序号由后台生成
List<ProctionInspTotalDO> totalList = createReqVO.getProctionInspTotalList();
if (totalList != null && !totalList.isEmpty()) {
int totalSeq = 0;
for (ProctionInspTotalDO totalDO : totalList) {
totalSeq++;
// 插入汇总表
ProctionInspTotalDO total = ProctionInspTotalDO.builder()
.proctionInspId(String.valueOf(proctionInspId))
.checkCode(checkCode)
.itemId(totalDO.getItemId())
.itemName(totalDO.getItemName())
.standardValue(totalDO.getStandardValue())
.upperLimit(totalDO.getUpperLimit())
.lowerLimit(totalDO.getLowerLimit())
.checkMethod(totalDO.getCheckMethod())
.actValue(totalDO.getActValue())
.checkResult(totalDO.getCheckResult())
.seqNo(totalSeq)
.inspPlanId(totalDO.getInspPlanId())
.inspPlanItemId(totalDO.getInspPlanItemId())
.remark(totalDO.getRemark())
.build();
proctionInspTotalMapper.insert(total);
Integer totalId = total.getId();
// 3. 如果实测值有数据批量插入明细表 tqm_proction_insp_detail
List<ProctionInspDetailDO> detailList = totalDO.getProctionInspDetailList();
if (detailList != null && !detailList.isEmpty()) {
int detailSeq = 0;
for (ProctionInspDetailDO detailDO : detailList) {
// 只有实测值有数据才插入
if (StrUtil.isEmpty(detailDO.getActValue())) {
continue;
}
detailSeq++;
ProctionInspDetailDO detail = ProctionInspDetailDO.builder()
.proctionInspId(proctionInspId)
.inspTotalId(totalId)
.checkCode(checkCode)
.actValue(detailDO.getActValue())
.seqNo(detailSeq)
.inspPlanId(totalDO.getInspPlanId())
.inspPlanItemId(totalDO.getInspPlanItemId())
.build();
proctionInspDetailMapper.insert(detail);
}
}
}
}
// 返回检验单号
return checkCode;
}
@Override
public void updateProductionInsp(ProductionInspSaveReqVO updateReqVO) {
// 校验存在
validateProductionInspExists(updateReqVO.getId());
String checkCode = updateReqVO.getCheckCode();
// 设置检验人信息为当前登录用户
Long userId = getLoginUserId();
AdminUserDO adminUserDO = adminUserMapper.selectById(userId);
updateReqVO.setCheckUserId(Integer.parseInt(String.valueOf(userId)));
updateReqVO.setCheckUserName(adminUserDO.getNickname());
// 1. 插入主表 tqm_raw_material_insp
ProductionInspDO productionInsp = BeanUtils.toBean(updateReqVO, ProductionInspDO.class);
productionInspMapper.updateById(productionInsp);
Integer proctionInspId = productionInsp.getId();
// 2. 先删除旧的子表数据
proctionInspDetailMapper.deleteByProctionInspId(Integer.parseInt(updateReqVO.getId()));
proctionInspTotalMapper.deleteByProctionInspId(updateReqVO.getId());
// 3. 循环插入汇总表 tqm_proction_insp_total顺序号由后台生成
List<ProctionInspTotalDO> totalList = updateReqVO.getProctionInspTotalList();
if (totalList != null && !totalList.isEmpty()) {
int totalSeq = 0;
for (ProctionInspTotalDO totalDO : totalList) {
totalSeq++;
// 插入汇总表
ProctionInspTotalDO total = ProctionInspTotalDO.builder()
.proctionInspId(String.valueOf(proctionInspId))
.checkCode(checkCode)
.itemId(totalDO.getItemId())
.itemName(totalDO.getItemName())
.standardValue(totalDO.getStandardValue())
.upperLimit(totalDO.getUpperLimit())
.lowerLimit(totalDO.getLowerLimit())
.checkMethod(totalDO.getCheckMethod())
.actValue(totalDO.getActValue())
.checkResult(totalDO.getCheckResult())
.seqNo(totalSeq)
.inspPlanId(totalDO.getInspPlanId())
.inspPlanItemId(totalDO.getInspPlanItemId())
.remark(totalDO.getRemark())
.build();
proctionInspTotalMapper.insert(total);
Integer totalId = total.getId();
// 4. 如果实测值有数据批量插入明细表 tqm_proction_insp_detail
List<ProctionInspDetailDO> detailList = totalDO.getProctionInspDetailList();
if (detailList != null && !detailList.isEmpty()) {
int detailSeq = 0;
for (ProctionInspDetailDO detailDO : detailList) {
// 只有实测值有数据才插入
if (StrUtil.isEmpty(detailDO.getActValue())) {
continue;
}
detailSeq++;
ProctionInspDetailDO detail = ProctionInspDetailDO.builder()
.proctionInspId(proctionInspId)
.inspTotalId(totalId)
.checkCode(checkCode)
.actValue(detailDO.getActValue())
.seqNo(detailSeq)
.inspPlanId(totalDO.getInspPlanId())
.inspPlanItemId(totalDO.getInspPlanItemId())
.build();
proctionInspDetailMapper.insert(detail);
}
}
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteProductionInsp(String id) {
// 校验存在
ProductionInspDO productionInspDO = productionInspMapper.selectById(id);
if (ObjectUtil.isEmpty(productionInspDO)) {
throw exception("该检验单不存在,请刷新界面!");
}
// 校验状态已确认或已审核的不允许删除
if ("1".equals(productionInspDO.getCheckStatus())) {
throw exception("该单据已确认不允许删除,请刷新界面!");
}
// 删除明细表
proctionInspDetailMapper.deleteByProctionInspId(Integer.parseInt(id));
// 删除汇总表
proctionInspTotalMapper.deleteByProctionInspId(id);
// 删除主表
productionInspMapper.deleteById(id);
}
private void validateProductionInspExists(String id) {
if (productionInspMapper.selectById(id) == null) {
throw exception("数据不存在");
}
}
/**
* 生成检验单号
* 格式: CP + 年月日(YYYYMMDD) + 两位流水号
*/
private String generateCheckCode() {
LocalDate now = LocalDate.now();
String ym = now.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
String maxCheckCode = productionInspMapper.selectMaxCheckCode();
if (maxCheckCode == null || !maxCheckCode.substring(2, 10).equals(ym)) {
// 查不到数据 年月不同从01开始
return "CP" + ym + "01";
} else {
// 年月相同流水号+1
String prefix = maxCheckCode.substring(0, 10);
int seq = Integer.parseInt(maxCheckCode.substring(10)) + 1;
return prefix + String.format("%02d", seq);
}
}
@Override
public ProductionInspDO getProductionInsp(String id) {
ProductionInspDO productionInspDO = productionInspMapper.selectById(id);
if (productionInspDO == null) {
return null;
}
// 查询汇总表数据
List<ProctionInspTotalDO> totalList = proctionInspTotalMapper.selectByProctionInspId(productionInspDO.getId());
// 填充明细数据到汇总表的 proctionInspDetailList
if (totalList != null && !totalList.isEmpty()) {
for (ProctionInspTotalDO total : totalList) {
List<ProctionInspDetailDO> detailList = proctionInspDetailMapper.selectList(
new LambdaQueryWrapperX<ProctionInspDetailDO>()
.eq(ProctionInspDetailDO::getInspTotalId, total.getId())
.orderByAsc(ProctionInspDetailDO::getSeqNo)
);
total.setProctionInspDetailList(detailList);
}
}
productionInspDO.setProctionInspTotalList(totalList);
return productionInspDO;
}
@Override
public PageResult<ProductionInspDO> getProductionInspPage(ProductionInspPageReqVO pageReqVO) {
return productionInspMapper.selectPage(pageReqVO);
}
}

View File

@ -51,6 +51,6 @@ export const getInspPlanItemByPlanId = async (id: number) => {
return await request.get({ url: `/tba/insp-plan-item/getInspPlanItemByPlanId?planId=` + id })
}
export const selectMaterialId = async (id: number) => {
return await request.get({ url: `/tba/insp-plan-item/selectMaterialId?id=` + id })
export const selectMaterialId = async (id: number, schemeType: string) => {
return await request.get({ url: `/tba/insp-plan-item/selectMaterialId?id=` + id + `&schemeType=` + schemeType })
}

View File

@ -0,0 +1,44 @@
import request from '@/config/axios'
export interface MatOutVO {
id: number
outNo: string
planId: number
planNo: string
whInId: number
remark: string
outEmpId: number
outEmpName: string
headNo: string
headId: number
}
// 查询产出主分页
export const getMatOutPage = async (params) => {
return await request.get({ url: `/tpo/mat-out/page`, params })
}
// 查询产出主详情
export const getMatOut = async (id: number) => {
return await request.get({ url: `/tpo/mat-out/get?id=` + id })
}
// 新增产出主
export const createMatOut = async (data: MatOutVO) => {
return await request.post({ url: `/tpo/mat-out/create`, data })
}
// 修改产出主
export const updateMatOut = async (data: MatOutVO) => {
return await request.put({ url: `/tpo/mat-out/update`, data })
}
// 删除产出主
export const deleteMatOut = async (id: number) => {
return await request.delete({ url: `/tpo/mat-out/delete?id=` + id })
}
// 导出产出主 Excel
export const exportMatOut = async (params) => {
return await request.download({ url: `/tpo/mat-out/export-excel`, params })
}

View File

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface MatOutDetailVO {
id: number
outNo: string
remark: string
outId: number
materialId: number
materialCode: string
materialName: string
spec: string
unit: string
outQty: number
whInDetailId: number
lotNo: string
judgResult: string
matType: string
isInsp: string
inspStatus: string
atoQty: number
storeHouseId: number
storeAreaId: number
storeHouseCd: string
storeHouseName: string
storeAreCd: string
storeAreaName: string
}
// 查询工序产出子分页
export const getMatOutDetailPage = async (params) => {
return await request.get({ url: `/tpo/mat-out-detail/page`, params })
}
// 查询工序产出子详情
export const getMatOutDetail = async (id: number) => {
return await request.get({ url: `/tpo/mat-out-detail/get?id=` + id })
}
// 新增工序产出子
export const createMatOutDetail = async (data: MatOutDetailVO) => {
return await request.post({ url: `/tpo/mat-out-detail/create`, data })
}
// 修改工序产出子
export const updateMatOutDetail = async (data: MatOutDetailVO) => {
return await request.put({ url: `/tpo/mat-out-detail/update`, data })
}
// 删除工序产出子
export const deleteMatOutDetail = async (id: number) => {
return await request.delete({ url: `/tpo/mat-out-detail/delete?id=` + id })
}
// 导出工序产出子 Excel
export const exportMatOutDetail = async (params) => {
return await request.download({ url: `/tpo/mat-out-detail/export-excel`, params })
}

View File

@ -0,0 +1,52 @@
import request from '@/config/axios'
export interface MillParamActVO {
id: number
remark: string
collectTime: Date
shiftCd: string
planId: number
planNo: string
procCdId: number
procCd: string
procName: string
machineId: number
machineNo: string
grndMacCurr: string
dataSource: string
grndMacSpeed: string
outPowTemp: string
inAirTemp: string
grndOutPress: string
collectDate: localdate
}
// 查询制粉工序参数实绩分页
export const getMillParamActPage = async (params) => {
return await request.get({ url: `/tpo/mill-param-act/page`, params })
}
// 查询制粉工序参数实绩详情
export const getMillParamAct = async (id: number) => {
return await request.get({ url: `/tpo/mill-param-act/get?id=` + id })
}
// 新增制粉工序参数实绩
export const createMillParamAct = async (data: MillParamActVO) => {
return await request.post({ url: `/tpo/mill-param-act/create`, data })
}
// 修改制粉工序参数实绩
export const updateMillParamAct = async (data: MillParamActVO) => {
return await request.put({ url: `/tpo/mill-param-act/update`, data })
}
// 删除制粉工序参数实绩
export const deleteMillParamAct = async (id: number) => {
return await request.delete({ url: `/tpo/mill-param-act/delete?id=` + id })
}
// 导出制粉工序参数实绩 Excel
export const exportMillParamAct = async (params) => {
return await request.download({ url: `/tpo/mill-param-act/export-excel`, params })
}

View File

@ -0,0 +1,44 @@
import request from '@/config/axios'
export interface ProctionInspDetailVO {
id: number
actValue: string
remark: string
inspPlanId: number
inspPlanItemId: number
proctionInspId: number
seqNo: number
checkCode: string
inspTotalId: number
fFlowId: string
}
// 查询产品料检验值明细分页
export const getProctionInspDetailPage = async (params) => {
return await request.get({ url: `/tqm/proction-insp-detail/page`, params })
}
// 查询产品料检验值明细详情
export const getProctionInspDetail = async (id: number) => {
return await request.get({ url: `/tqm/proction-insp-detail/get?id=` + id })
}
// 新增产品料检验值明细
export const createProctionInspDetail = async (data: ProctionInspDetailVO) => {
return await request.post({ url: `/tqm/proction-insp-detail/create`, data })
}
// 修改产品料检验值明细
export const updateProctionInspDetail = async (data: ProctionInspDetailVO) => {
return await request.put({ url: `/tqm/proction-insp-detail/update`, data })
}
// 删除产品料检验值明细
export const deleteProctionInspDetail = async (id: number) => {
return await request.delete({ url: `/tqm/proction-insp-detail/delete?id=` + id })
}
// 导出产品料检验值明细 Excel
export const exportProctionInspDetail = async (params) => {
return await request.download({ url: `/tqm/proction-insp-detail/export-excel`, params })
}

View File

@ -0,0 +1,50 @@
import request from '@/config/axios'
export interface ProctionInspTotalVO {
id: number
actValue: string
remark: string
inspPlanId: number
inspPlanItemId: number
proctionInspId: string
seqNo: number
checkCode: string
checkResult: string
itemId: number
itemName: string
standardValue: string
upperLimit: string
lowerLimit: string
checkMethod: string
printItem: string
}
// 查询产品检验值汇总分页
export const getProctionInspTotalPage = async (params) => {
return await request.get({ url: `/tqm/proction-insp-total/page`, params })
}
// 查询产品检验值汇总详情
export const getProctionInspTotal = async (id: number) => {
return await request.get({ url: `/tqm/proction-insp-total/get?id=` + id })
}
// 新增产品检验值汇总
export const createProctionInspTotal = async (data: ProctionInspTotalVO) => {
return await request.post({ url: `/tqm/proction-insp-total/create`, data })
}
// 修改产品检验值汇总
export const updateProctionInspTotal = async (data: ProctionInspTotalVO) => {
return await request.put({ url: `/tqm/proction-insp-total/update`, data })
}
// 删除产品检验值汇总
export const deleteProctionInspTotal = async (id: number) => {
return await request.delete({ url: `/tqm/proction-insp-total/delete?id=` + id })
}
// 导出产品检验值汇总 Excel
export const exportProctionInspTotal = async (params) => {
return await request.download({ url: `/tqm/proction-insp-total/export-excel`, params })
}

View File

@ -0,0 +1,59 @@
import request from '@/config/axios'
export interface ProductionInspVO {
id: string
checkCode: string
planId: number
proNo: string
materialId: number
matCode: string
matName: string
spec: string
lotNo: string
outDate: Date
checkDate: Date
checkResult: string
remark: string
formCode: string
qaSchemeBaseId: string
testNum: number
checkUserId: number
checkExUserId: number
checkExDate: Date
checkStatus: string
checkRemark: string
checkUserName: string
checkExUserName: string
outId: number
outMatId: number
}
// 查询产品检验主分页
export const getProductionInspPage = async (params) => {
return await request.get({ url: `/tqm/production-insp/page`, params })
}
// 查询产品检验主详情
export const getProductionInsp = async (id: number) => {
return await request.get({ url: `/tqm/production-insp/get?id=` + id })
}
// 新增产品检验主
export const createProductionInsp = async (data: ProductionInspVO) => {
return await request.post({ url: `/tqm/production-insp/create`, data })
}
// 修改产品检验主
export const updateProductionInsp = async (data: ProductionInspVO) => {
return await request.put({ url: `/tqm/production-insp/update`, data })
}
// 删除产品检验主
export const deleteProductionInsp = async (id: number) => {
return await request.delete({ url: `/tqm/production-insp/delete?id=` + id })
}
// 导出产品检验主 Excel
export const exportProductionInsp = async (params) => {
return await request.download({ url: `/tqm/production-insp/export-excel`, params })
}

View File

@ -11,7 +11,6 @@ declare module 'vue' {
AppLinkSelectDialog: typeof import('./../components/AppLinkInput/AppLinkSelectDialog.vue')['default']
Backtop: typeof import('./../components/Backtop/src/Backtop.vue')['default']
CardTitle: typeof import('./../components/Card/src/CardTitle.vue')['default']
'CheckstyleIdea.xml': typeof import('./../../.idea/checkstyle-idea.xml.tmp')['default']
ColorInput: typeof import('./../components/ColorInput/index.vue')['default']
ComponentContainer: typeof import('./../components/DiyEditor/components/ComponentContainer.vue')['default']
ComponentContainerProperty: typeof import('./../components/DiyEditor/components/ComponentContainerProperty.vue')['default']
@ -33,13 +32,27 @@ declare module 'vue' {
Echart: typeof import('./../components/Echart/src/Echart.vue')['default']
Editor: typeof import('./../components/Editor/src/Editor.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']
ElAside: typeof import('element-plus/es')['ElAside']
ElAutoResizer: typeof import('element-plus/es')['ElAutoResizer']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElButton: typeof import('element-plus/es')['ElButton']
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
ElCard: typeof import('element-plus/es')['ElCard']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
ElCascader: typeof import('element-plus/es')['ElCascader']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
ElCol: typeof import('element-plus/es')['ElCol']
ElCollapse: typeof import('element-plus/es')['ElCollapse']
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
ElCollapseTransition: typeof import('element-plus/es')['ElCollapseTransition']
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']
@ -55,27 +68,41 @@ declare module 'vue' {
ElementTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/ElementTask.vue')['default']
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElHeader: typeof import('element-plus/es')['ElHeader']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElImage: typeof import('element-plus/es')['ElImage']
ElImageViewer: typeof import('element-plus/es')['ElImageViewer']
ElInput: typeof import('element-plus/es')['ElInput']
ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElMain: typeof import('element-plus/es')['ElMain']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElRate: typeof import('element-plus/es')['ElRate']
ElRow: typeof import('element-plus/es')['ElRow']
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
ElSlider: typeof import('element-plus/es')['ElSlider']
ElSpace: typeof import('element-plus/es')['ElSpace']
ElSwitch: typeof import('element-plus/es')['ElSwitch']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTableV2: typeof import('element-plus/es')['ElTableV2']
ElTabPane: typeof import('element-plus/es')['ElTabPane']
ElTabs: typeof import('element-plus/es')['ElTabs']
ElTag: typeof import('element-plus/es')['ElTag']
ElText: typeof import('element-plus/es')['ElText']
ElTimeline: typeof import('element-plus/es')['ElTimeline']
ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTimeSelect: typeof import('element-plus/es')['ElTimeSelect']
ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTransfer: typeof import('element-plus/es')['ElTransfer']
ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload']
@ -91,23 +118,16 @@ declare module 'vue' {
InputPassword: typeof import('./../components/InputPassword/src/InputPassword.vue')['default']
InputWithColor: typeof import('./../components/InputWithColor/index.vue')['default']
MagicCubeEditor: typeof import('./../components/MagicCubeEditor/index.vue')['default']
MaterialSelectDialog: typeof import('./../views/biz/material/MaterialSelectDialog.vue')['default']
Pagination: typeof import('./../components/Pagination/index.vue')['default']
ProcessDesigner: typeof import('./../components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue')['default']
ProcessPalette: typeof import('./../components/bpmnProcessDesigner/package/palette/ProcessPalette.vue')['default']
ProcessViewer: typeof import('./../components/bpmnProcessDesigner/package/designer/ProcessViewer.vue')['default']
PropertiesPanel: typeof import('./../components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue')['default']
Purorder: typeof import('./../views/biz/purorder/index.vue')['default']
PurOrderDetail: typeof import('./../views/biz/purorder/PurOrderDetail.vue')['default']
PurOrderForm: typeof import('./../views/biz/purorder/PurOrderForm.vue')['default']
Purorderitem: typeof import('./../views/biz/purorderitem/index.vue')['default']
PurOrderItemForm: typeof import('./../views/biz/purorderitem/PurOrderItemForm.vue')['default']
Qrcode: typeof import('./../components/Qrcode/src/Qrcode.vue')['default']
ReceiveTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ReceiveTask.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterSearch: typeof import('./../components/RouterSearch/index.vue')['default']
RouterView: typeof import('vue-router')['RouterView']
SaleDeliveryDetail: typeof import('./../views/biz/saledelivery/SaleDeliveryDetail.vue')['default']
ScriptTask: typeof import('./../components/bpmnProcessDesigner/package/penal/task/task-components/ScriptTask.vue')['default']
Search: typeof import('./../components/Search/src/Search.vue')['default']
ShortcutDateRangePicker: typeof import('./../components/ShortcutDateRangePicker/index.vue')['default']
@ -126,7 +146,6 @@ declare module 'vue' {
VerifyPoints: typeof import('./../components/Verifition/src/Verify/VerifyPoints.vue')['default']
VerifySlide: typeof import('./../components/Verifition/src/Verify/VerifySlide.vue')['default']
VerticalButtonGroup: typeof import('./../components/VerticalButtonGroup/index.vue')['default']
'Workspace.xml': typeof import('./../../.idea/workspace.xml.tmp')['default']
XButton: typeof import('./../components/XButton/src/XButton.vue')['default']
XTextButton: typeof import('./../components/XButton/src/XTextButton.vue')['default']
}

View File

@ -7,6 +7,8 @@ export {}
declare global {
const DICT_TYPE: typeof import('@/utils/dict')['DICT_TYPE']
const EffectScope: typeof import('vue')['EffectScope']
const ElMessage: typeof import('element-plus/es')['ElMessage']
const ElMessageBox: typeof import('element-plus/es')['ElMessageBox']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const customRef: typeof import('vue')['customRef']

View File

@ -228,7 +228,7 @@ export enum DICT_TYPE {
MAT_TYPE='mat_type', // 物料类型
MAT_UNIT='mat_unit', // 物料单位
SHIFT_WORK_TYPE='shift_work_type', // 倒班类型
SHIFT_SCHEDULE='shift_schedule', // 班
SHIFT_SCHEDULE='shift_schedule', // 班
TEAM_OR_GROUP='team_or_group', // 班组
DEVICE_TYPE='device_type', // 设备类型
DEVICE_STATUS='device_status', // 设备状态
@ -258,6 +258,9 @@ export enum DICT_TYPE {
STOCK_OUT_STATUS='stock_out_status', // 出库状态
DELIVERY_METHOD='delivery_method', // 配送方式
BILL_STATUS='bill_status', // 单据状态
PROCTION_CHECK_STATUS='proction_check_status', // 成品检验单据状态
INSP_STATUS='insp_status', //检验状态

View File

@ -69,8 +69,8 @@
</el-table-column>
<el-table-column label="检验大类" align="center" prop="itemClass" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.RAW_MATERIALS_TYPE" :value="scope.row.itemType" v-if="scope.row.itemType==1"/>
<dict-tag :type="DICT_TYPE.FINISHED_PRODUCT_TYPE" :value="scope.row.itemType" v-if="scope.row.itemType==3"/>
<dict-tag :type="DICT_TYPE.RAW_MATERIALS_TYPE" :value="scope.row.itemClass" v-if="scope.row.itemType==1"/>
<dict-tag :type="DICT_TYPE.FINISHED_PRODUCT_TYPE" :value="scope.row.itemClass" v-if="scope.row.itemType==3"/>
<span v-if="scope.row.itemType!=1 && scope.row.itemType!=3"></span>
</template>
</el-table-column>

View File

@ -54,11 +54,14 @@
<el-table-column label="适用类型" align="center" prop="schemeType">
<template #default="scope">
<dict-tag :type="DICT_TYPE.MAT_TYPE" :value="scope.row.schemeType" />
</template>
</el-table-column>
<el-table-column label="产品大类" align="center" prop="tiemClass" >
<template #default="scope">
<dict-tag :type="DICT_TYPE.CLASSIFICATION_CODE" :value="scope.row.tiemClass" />
<dict-tag :type="DICT_TYPE.CLASSIFICATION_CODE" :value="scope.row.tiemClass" v-if="scope.row.schemeType==1" />
<span v-if="scope.row.schemeType!=1"></span>
</template>
</el-table-column>
<el-table-column label="表单编号" align="center" prop="formCode" />

View File

@ -0,0 +1,136 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="110px"
v-loading="formLoading"
>
<el-form-item label="产出单号(O+年份+月份+ 日 +2位流水号)" prop="outNo">
<el-input v-model="formData.outNo" placeholder="请输入产出单号(O+年份+月份+ 日 +2位流水号)" />
</el-form-item>
<el-form-item label="生产计划id" prop="planId">
<el-input v-model="formData.planId" placeholder="请输入生产计划id" />
</el-form-item>
<el-form-item label="生产计划号" prop="planNo">
<el-input v-model="formData.planNo" placeholder="请输入生产计划号" />
</el-form-item>
<el-form-item label="入库id" prop="whInId">
<el-input v-model="formData.whInId" placeholder="请输入入库id" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="产出人id" prop="outEmpId">
<el-input v-model="formData.outEmpId" placeholder="请输入产出人id" />
</el-form-item>
<el-form-item label="产出人名称" prop="outEmpName">
<el-input v-model="formData.outEmpName" placeholder="请输入产出人名称" />
</el-form-item>
<el-form-item label="抬头单号" prop="headNo">
<el-input v-model="formData.headNo" placeholder="请输入抬头单号" />
</el-form-item>
<el-form-item label="抬头单id" prop="headId">
<el-input v-model="formData.headId" placeholder="请输入抬头单id" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as MatOutApi from '@/api/biz/matout'
import { watch } from 'vue'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
outNo: undefined,
planId: undefined,
planNo: undefined,
whInId: undefined,
remark: undefined,
outEmpId: undefined,
outEmpName: undefined,
headNo: undefined,
headId: undefined,
})
/** 弹窗关闭时通知父组件 */
watch(dialogVisible, (val) => {
if (!val) {
emit('close')
}
})
const formRules = reactive({
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await MatOutApi.getMatOut(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success', 'close']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as MatOutApi.MatOutVO
if (formType.value === 'create') {
await MatOutApi.createMatOut(data)
message.success(t('common.createSuccess'))
} else {
await MatOutApi.updateMatOut(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
outNo: undefined,
planId: undefined,
planNo: undefined,
whInId: undefined,
remark: undefined,
outEmpId: undefined,
outEmpName: undefined,
headNo: undefined,
headId: undefined,
}
formRef.value?.resetFields()
}
</script>

View File

@ -0,0 +1,274 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="80px"
>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="产出单号(O+年份+月份+ 日 +2位流水号)" prop="outNo">
<el-input
v-model="queryParams.outNo"
placeholder="请输入产出单号(O+年份+月份+ 日 +2位流水号)"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="生产计划id" prop="planId">
<el-input
v-model="queryParams.planId"
placeholder="请输入生产计划id"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="生产计划号" prop="planNo">
<el-input
v-model="queryParams.planNo"
placeholder="请输入生产计划号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="入库id" prop="whInId">
<el-input
v-model="queryParams.whInId"
placeholder="请输入入库id"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
v-model="queryParams.remark"
placeholder="请输入备注"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="产出人id" prop="outEmpId">
<el-input
v-model="queryParams.outEmpId"
placeholder="请输入产出人id"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="产出人名称" prop="outEmpName">
<el-input
v-model="queryParams.outEmpName"
placeholder="请输入产出人名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="抬头单号" prop="headNo">
<el-input
v-model="queryParams.headNo"
placeholder="请输入抬头单号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="抬头单id" prop="headId">
<el-input
v-model="queryParams.headId"
placeholder="请输入抬头单id"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['tpo:mat-out:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['tpo:mat-out:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="序号" align="center" type="index" width="60px"/>
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="产出单号(O+年份+月份+ 日 +2位流水号)" align="center" prop="outNo" />
<el-table-column label="生产计划id" align="center" prop="planId" />
<el-table-column label="生产计划号" align="center" prop="planNo" />
<el-table-column label="入库id" align="center" prop="whInId" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="产出人id" align="center" prop="outEmpId" />
<el-table-column label="产出人名称" align="center" prop="outEmpName" />
<el-table-column label="抬头单号" align="center" prop="headNo" />
<el-table-column label="抬头单id" align="center" prop="headId" />
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['tpo:mat-out:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['tpo:mat-out:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<MatOutForm ref="formRef" @success="getList" @close="handleQuery"/>
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import * as MatOutApi from '@/api/biz/matout'
import MatOutForm from './MatOutForm.vue'
defineOptions({ name: 'MatOut' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(false) //
const list = ref([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
createTime: [],
outNo: undefined,
planId: undefined,
planNo: undefined,
whInId: undefined,
remark: undefined,
outEmpId: undefined,
outEmpName: undefined,
headNo: undefined,
headId: undefined,
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await MatOutApi.getMatOutPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await MatOutApi.deleteMatOut(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await MatOutApi.exportMatOut(queryParams)
download.excel(data, '产出主.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
//
})
</script>

View File

@ -0,0 +1,180 @@
<template>
<Dialog :title="'产品信息'" v-model="dialogVisible" width="1000px">
<!-- 搜索栏 -->
<el-form :model="queryParams" ref="queryFormRef" :inline="true" class="-mb-15px">
<el-form-item label="生产日期" prop="checkDate">
<el-date-picker
v-model="queryParams.outDate"
value-format="YYYY-MM-DD"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
class="!w-240px"
:clearable="false"
/>
</el-form-item>
<el-form-item label="批次号" prop="lotNo">
<el-input v-model="queryParams.lotNo" placeholder="请输入批次号" clearable class="!w-240px" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">
<Icon icon="ep:search" class="mr-5px" /> 搜索
</el-button>
<el-button @click="resetQuery">
<Icon icon="ep:refresh" class="mr-5px" /> 重置
</el-button>
</el-form-item>
</el-form>
<!-- 表格 -->
<el-table
v-loading="loading"
:data="list"
:stripe="true"
ref="tableRef"
@row-dblclick="handleRowDblclick"
border
>
<el-table-column width="60" align="center">
<template #default="scope">
<el-radio
:model-value="selectedRow?.id"
:label="scope.row.id"
@change="handleRadioChange(scope.row)"
>
<span></span>
</el-radio>
</template>
</el-table-column>
<el-table-column type="index" label="序号" width="60" align="center" />
<el-table-column label="批次号" prop="lotNo" align="center" min-width="120" />
<el-table-column label="物料名称" prop="materialName" align="center" min-width="150" />
<el-table-column label="生产日期" prop="outDate" align="center" min-width="120" :formatter="dateFormatter2"/>
<el-table-column label="生产班次" prop="shiftCd" align="center" min-width="100" >
<template #default="scope">
<dict-tag :type="DICT_TYPE.SHIFT_SCHEDULE" :value="scope.row.shiftCd" />
</template>
</el-table-column>
<el-table-column label="物料类型" prop="matType" align="center" width="100">
<template #default="scope">
<dict-tag :type="DICT_TYPE.MAT_TYPE" :value="scope.row.matType" />
</template>
</el-table-column>
<el-table-column label="检验状态" prop="inspStatus" align="center" width="100" >
<template #default="scope">
<dict-tag :type="DICT_TYPE.INSP_STATUS" :value="scope.row.inspStatus"/>
</template>
</el-table-column>
<el-table-column label="机台名称" prop="machineName" align="center" min-width="150" />
</el-table>
<template #footer>
<div style="display: flex; justify-content: flex-end; align-items: center; padding: 10px 0;">
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
style="margin-right: auto;"
/>
<div style="display: flex; gap: 10px; flex-shrink: 0;">
<el-button @click="handleConfirm" :disabled="!selectedRow" type="primary"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</div>
</div>
</template>
</Dialog>
</template>
<script setup lang="ts">
import * as MatoutDetailApi from '@/api/biz/matoutdetail'
import { DICT_TYPE } from '@/utils/dict'
import {dateFormatter2} from "@/utils/formatTime";
const dialogVisible = ref(false)
const loading = ref(false)
const list = ref<MatoutDetailApi.MatOutDetailVO[]>([])
const total = ref(0)
const selectedRow = ref<MatoutDetailApi.MatOutDetailVO | null>(null)
const tableRef = ref()
const queryFormRef = ref()
/** 获取当月第一天到今天的日期范围格式YYYY-MM-DD */
const getDefaultDateRange = (): [string, string] => {
const now = new Date()
const firstDay = new Date(now.getFullYear(), now.getMonth(), 1)
const pad = (n: number) => String(n).padStart(2, '0')
const fmt = (d: Date) =>
`${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
return [fmt(firstDay), fmt(now)]
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
outDate: getDefaultDateRange(),
matType: 3,
inspStatus:0,
lotNo:undefined
})
const emit = defineEmits(['confirm'])
//
const open = (selected?: MatoutDetailApi.MatOutDetailVO) => {
dialogVisible.value = true
selectedRow.value = selected || null
queryParams.lotNo=undefined
queryParams.pageNo=1
queryParams.outDate=getDefaultDateRange()
list.value=[]
total.value=0
// resetQuery()
}
defineExpose({ open })
//
const getList = async () => {
loading.value = true
try {
const data = await MatoutDetailApi.getMatOutDetailPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
//
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
//
const resetQuery = () => {
queryFormRef.value?.resetFields()
queryParams.pageNo = 1
getList()
}
// -
const handleRadioChange = (row: MatoutDetailApi.MatOutDetailVO) => {
selectedRow.value = row
}
// -
const handleRowDblclick = (row: MatoutDetailApi.MatOutDetailVO) => {
selectedRow.value = row
emit('confirm', row)
dialogVisible.value = false
}
//
const handleConfirm = () => {
if (selectedRow.value) {
emit('confirm', selectedRow.value)
dialogVisible.value = false
}
}
</script>

View File

@ -0,0 +1,787 @@
<template>
<el-card class="hl-card" style="position: relative">
<template #header>
<span><span v-html="dialogTitle"></span></span>
</template>
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="120px"
v-loading="formLoading"
:disabled="formType === 'details'"
>
<!-- 单据信息 -->
<el-card class="hl-card-info">
<template #header>
<div class="hl-card-info-icona"></div>
<span class="hl-card-info-text">单据信息</span>
</template>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="批次号" prop="lotNo" >
<el-select
v-model="formData.lotNo"
placeholder="请选择批次号"
class="!w-full"
clearable
@click="openLotNoDialog"
@clear="handleClearLotNo"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="产品名称" prop="matName" >
<el-select
v-model="formData.matName"
placeholder="请选择产品名称"
class="!w-full"
clearable
disabled
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="规格型号" prop="spec">
<el-input v-model="formData.spec" placeholder="请输入规格型号" disabled clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="检验单号" prop="checkCode">
<el-input v-model="formData.checkCode" placeholder="自动生成" disabled class="!w-full"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="计划号" prop="proNo">
<el-input v-model="formData.proNo" placeholder="请输入计划号" disabled clearable/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="生产日期" prop="outDate" >
<el-date-picker
v-model="formData.outDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择生产日期"
class="!w-full"
clearable
disabled
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="单据状态" prop="checkStatus" >
<el-select v-model="formData.checkStatus" placeholder="请选择单据状态" class="!w-full"
disabled clearable>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PROCTION_CHECK_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="实测数量" prop="testNum">
<el-input v-model="formData.testNum" placeholder="请输入实测数量" disabled class="!w-full"/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="检验日期" prop="checkDate" >
<el-date-picker
v-model="formData.checkDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择检验日期"
class="!w-full"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="检验结果" prop="checkResult" >
<el-select v-model="formData.checkResult" placeholder="请选择检验结果" class="!w-full"
clearable filterable>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.CHECK_RESULT)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input
v-model="formData.remark"
type="textarea"
:rows="4"
placeholder="请输入备注"
class="!w-full"
clearable
/>
</el-form-item>
</el-col>
</el-row>
<!-- 项目信息 -->
<el-card class="hl-card-info" style="margin-top: 20px;">
<template #header>
<div style="display: flex; justify-content: space-between; align-items: center;">
<div>
<div class="hl-card-info-icona"></div>
<span class="hl-card-info-text">项目信息</span>
</div>
</div>
</template>
<el-table :data="formData.proctionInspTotalList" border style="width: 100%" row-key="id" :row-class-name="getRowClassName">
<el-table-column type="expand" width="50" align="center">
<template #default="scope">
<div style="padding: 10px 20px;">
<el-row :gutter="4">
<el-col v-for="item in getExtraDetails(scope.row)" :key="item.index" :span="3" style="margin-bottom: 8px;">
<div style="text-align: center; margin-bottom: 4px; font-size: 12px;">实测值{{ item.index }}</div>
<!-- 数字类型 -->
<el-input-number
v-if="scope.row.itemValueType === 'I'"
v-model="item.item.actValue"
:precision="scope.row.floatNum ?? 2"
:controls="false"
placeholder="请输入"
class="!w-full"
clearable
@change="calcAverage(scope.row); autoJudge(scope.row)"
/>
<!-- 文本类型有绑定值则下拉无则手动录入 -->
<el-select
v-else-if="getItemContentOptions(scope.row.itemContent).length > 0"
v-model="item.item.actValue"
placeholder="请选择"
clearable
filterable
class="!w-full"
>
<el-option
v-for="opt in getItemContentOptions(scope.row.itemContent)"
:key="opt"
:label="opt"
:value="opt"
/>
</el-select>
<el-input
v-else
v-model="item.item.actValue"
placeholder="请输入"
class="!w-full"
clearable
/>
</el-col>
</el-row>
</div>
</template>
</el-table-column>
<el-table-column type="index" label="序号" width="60" align="center"/>
<el-table-column label="项目名称" prop="itemName" align="center" width="200px"/>
<el-table-column label="检验标准" prop="checkMethod" align="center" width="200px"/>
<!-- 前5个实测值 -->
<el-table-column
v-for="index in formData.testNum"
:key="index"
label="实测值"
align="center"
width="120"
>
<template #default="scope">
<template v-if=" scope.row.proctionInspDetailList && scope.row.proctionInspDetailList[index - 1]">
<!-- 数字类型 -->
<el-input-number
v-if="scope.row.itemValueType === 'I'"
v-model.number="scope.row.proctionInspDetailList[index - 1].actValue"
:precision="scope.row.floatNum ?? 2"
:controls="false"
placeholder="请输入"
class="!w-full"
clearable
@change="calcAverage(scope.row); autoJudge(scope.row)"
/>
<!-- 文本类型有绑定值则下拉 -->
<el-select
v-else-if="getItemContentOptions(scope.row.itemContent).length > 0"
v-model="scope.row.proctionInspDetailList[index - 1].actValue"
placeholder="请选择"
clearable
filterable
class="!w-full"
>
<el-option
v-for="opt in getItemContentOptions(scope.row.itemContent)"
:key="opt"
:label="opt"
:value="opt"
/>
</el-select>
<!-- 文本类型无绑定值则手动录入 -->
<el-input
v-else
v-model="scope.row.proctionInspDetailList[index - 1].actValue"
placeholder="请输入"
class="!w-full"
clearable
/>
</template>
<span v-else></span>
</template>
</el-table-column>
<!-- 平均值数字类型自动计算只读文本类型手动录入 -->
<el-table-column label="平均值" align="center" width="120">
<template #default="scope">
<el-input
v-if="scope.row.itemValueType === 'T'"
v-model="scope.row.actValue"
placeholder="请输入"
clearable
/>
<span v-else>{{ scope.row.actValue != null ? scope.row.actValue : '' }}</span>
</template>
</el-table-column>
<!-- 单项判定数字类型自动判定文本类型手动选择 -->
<el-table-column label="单项判定" align="center" width="120">
<template #default="scope">
<el-select
v-if="scope.row.itemValueType "
v-model="scope.row.checkResult"
placeholder="请选择"
clearable
filterable
@change="handleSingleJudgmentChange()"
>
<el-option
v-for="dict in getCheckResultOptions()"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column label="标准值" prop="standardValue" align="center" width="120">
<template #default="scope">
<el-input v-model="scope.row.standardValue" placeholder="请输入" clearable/>
</template>
</el-table-column>
<el-table-column label="上限值" prop="upperLimit" align="center" width="120">
<template #default="scope">
<el-input v-model="scope.row.upperLimit" placeholder="请输入" clearable/>
</template>
</el-table-column>
<el-table-column label="下限值" prop="lowerLimit" align="center" width="120">
<template #default="scope">
<el-input v-model="scope.row.lowerLimit" placeholder="请输入" clearable/>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark" align="center" width="180">
<template #default="scope">
<el-input v-model="scope.row.remark" placeholder="请输入" clearable/>
</template>
</el-table-column>
<el-table-column label="展示顺序" prop="seqNo" align="center" width="100" />
</el-table>
</el-card>
</el-card>
</el-form>
<!-- 底部按钮 -->
<div style="display: flex; justify-content: center; gap: 16px; margin-top: 24px;">
<template v-if="formType !== 'details'">
<el-button type="primary" @click="handleSave" :loading="formLoading">保存</el-button>
<el-button type="primary" @click="handleIssue" :loading="formLoading">确认</el-button>
</template>
<el-button @click="goBack()">取消</el-button>
</div>
</el-card>
<LotNoDialog ref="LotNoDialogRef" @confirm="handleLotNoConfirm"/>
</template>
<script setup lang="ts">
import * as productionInspApi from '@/api/biz/productioninsp'
import * as InspplanitemApi from '@/api/biz/inspplanitem'
import {nextTick, watch} from 'vue'
import {DICT_TYPE, getStrDictOptions} from "@/utils/dict";
import { useTagsViewStore } from '@/store/modules/tagsView'
import dayjs from "dayjs";
import LotNoDialog from "./LotNoDialog.vue";
const {query} = useRoute()
const { t } = useI18n() //
const message = useMessage() //
const router = useRouter()
const LotNoDialogRef = ref()
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
checkCode: undefined,
planId: undefined,
proNo: undefined,
materialId: undefined,
matCode: undefined,
matName: undefined,
spec: undefined,
lotNo: undefined,
outDate: undefined as string | undefined,
checkDate: undefined as string | undefined,
checkResult: '0',
remark: undefined,
formCode: undefined,
qaSchemeBaseId: undefined,
testNum: undefined,
checkUserId: undefined,
checkExUserId: undefined,
checkExDate: undefined,
checkStatus: '0',
checkRemark: undefined,
checkUserName: undefined,
checkExUserName: undefined,
outId: undefined,
outMatId: undefined,
proctionInspTotalList: [] as any
})
/** 弹窗关闭时通知父组件 */
watch(dialogVisible, (val) => {
if (!val) {
emit('close')
}
})
// clearable
watch(
() => formData.value.proctionInspTotalList,
(list) => {
if (!list || list.length === 0) return
list.forEach((item: any) => {
if (item.itemValueType === 'I') {
//
const hasValue = (item.proctionInspDetailList || []).some(
(d: any) => d.actValue != null && d.actValue !== ''
)
if (hasValue || item.actValue != null) {
calcAverage(item)
autoJudge(item)
}
}
})
updateOverallCheckResult()
},
{ deep: true }
)
const formRules = reactive({
lotNo: [{ required: true, message: '批次号不能为空', trigger: 'chang' }],
matName: [{ required: true, message: '产品名称不能为空', trigger: 'chang' }],
checkDate: [{ required: true, message: '检验日期不能为空', trigger: 'chang' }],
outDate: [{ required: true, message: '生产日期不能为空', trigger: 'chang' }],
checkStatus: [{ required: true, message: '单据状态不能为空', trigger: 'chang' }],
checkResult: [{ required: true, message: '检验结果不能为空', trigger: 'chang' }],
})
const formRef = ref() // Ref
// class
const getRowClassName = ({ row }: { row: any }) => {
if (!row.testNum || row.testNum <= 0) {
return 'hl-row-no-expand'
}
return ''
}
const getExtraDetails = (row: any) => {
const details = row.proctionInspDetailList || []
return details
.map((item: any, i: number) => ({ index: i + 1, item }))
.filter(item => item.index <= (row.testNum || 0))
}
// itemContent
const getItemContentOptions = (itemContent?: string) => {
if (!itemContent) return []
return itemContent.split(',').map(s => s.trim()).filter(Boolean)
}
// 3
const getCheckResultOptions = () => {
return getStrDictOptions(DICT_TYPE.CHECK_RESULT).filter(d => d.value != '2')
}
//
const calcAverage = (row: any) => {
if (row.itemValueType !== 'I') return
const values = (row.proctionInspDetailList || [])
.filter((d: any) => d.actValue != null && d.actValue !== '')
.map((d: any) => Number(d.actValue))
.filter((v: number) => !isNaN(v))
if (values.length === 0) {
// autoJudge
row.actValue = undefined
autoJudge(row)
return
}
const sum = values.reduce((a: number, b: number) => a + b, 0)
const avg = sum / values.length
const floatNum = row.floatNum ?? 2
row.actValue = avg.toFixed(floatNum)
}
//
const autoJudge = (row: any) => {
if (row.itemValueType !== 'I') return
const values = (row.proctionInspDetailList || [])
.filter((d: any) => d.actValue != null && d.actValue !== '')
.map((d: any) => Number(d.actValue))
.filter((v: number) => !isNaN(v))
//
if (values.length === 0 || row.actValue == null) {
row.checkResult = undefined
updateOverallCheckResult()
return
}
const val = Number(row.actValue)
const upper = row.upperLimit != null ? Number(row.upperLimit) : undefined
const lower = row.lowerLimit != null ? Number(row.lowerLimit) : undefined
if (upper != null && lower != null) {
row.checkResult = (val >= lower && val <= upper) ? '0' : '1'
} else if (upper != null) {
row.checkResult = val <= upper ? '0' : '1'
} else if (lower != null) {
row.checkResult = val >= lower ? '0' : '1'
}
updateOverallCheckResult()
}
//
const handleSingleJudgmentChange = () => {
updateOverallCheckResult()
}
//
const updateOverallCheckResult = () => {
const list = formData.value.proctionInspTotalList
if (!list || list.length === 0) {
formData.value.checkResult = '0'
return
}
//
const valuedItems = list.filter((item: any) => item.checkResult != null && item.checkResult !== '')
if (valuedItems.length === 0) {
formData.value.checkResult = '0'
return
}
// '1'=
const hasUnqualified = valuedItems.some((item: any) => item.checkResult === '1')
// '0'=
const allQualified = valuedItems.every((item: any) => item.checkResult === '0')
if (hasUnqualified) {
formData.value.checkResult = '1'
} else if (allQualified) {
formData.value.checkResult = '0'
}
//
}
let initialized = false
onMounted(() => {
if (initialized) return
initialized = true
queryData(query.active as string, query.id ? Number(query.id) : undefined).catch((error) => {
console.error('初始化失败:', error)
})
})
/** 打开弹窗 */
const queryData = async (type: string, id ?: number) => {
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
formLoading.value = true
try {
if (id) {
formData.value = await productionInspApi.getProductionInsp(id)
formData.value.checkDate = formData.value.checkDate ? dayjs(formData.value.checkDate).format('YYYY-MM-DD') : undefined
formData.value.outDate = formData.value.outDate ? dayjs(formData.value.outDate).format('YYYY-MM-DD') : undefined
// proctionInspDetailList
const totalList = formData.value.proctionInspTotalList || []
totalList.forEach((item: any) => {
if (!item.proctionInspDetailList) {
item.proctionInspDetailList = []
}
const num = (item.testNum || 0) > (formData.value.testNum || 0) ? (item.testNum || 0) : (formData.value.testNum || 0)
for (let i = item.proctionInspDetailList.length; i < num; i++) {
item.proctionInspDetailList.push({ actValue: undefined })
}
})
}
} catch (error) {
console.error('加载数据失败:', error)
message.error('数据加载失败')
} finally {
formLoading.value = false
await nextTick(() => formRef.value?.clearValidate())
}
}
//
const goBack = async () => {
//
const currentRoute = router.currentRoute.value
const tagsViewStore = useTagsViewStore()
tagsViewStore.delView(currentRoute)
sessionStorage.setItem('NEED_REFRESH_LIST', 'true')
router.replace({ name: 'ProductionInsp' })
}
//
const handleSave = async () => {
formData.value.checkStatus = '0' as any
await doSave('保存成功')
}
//
const handleIssue = async () => {
formData.value.checkStatus = '1' as any
await doSave('确认成功')
}
//
const doSave = async (successMsg: string) => {
if (formLoading.value) return
formLoading.value = true
try {
await formRef.value.validate()
//
validateBizRules()
const data = formData.value as unknown as productionInspApi.ProductionInspVO
if (formType.value === 'create') {
await productionInspApi.createProductionInsp(data)
} else {
await productionInspApi.updateProductionInsp(data)
}
message.success(successMsg)
//
await goBack()
} catch (e: any) {
// validate rejectElement Plus
// API catch
if (typeof e === 'string') {
message.warning(e)
}
} finally {
formLoading.value = false
}
}
//
const validateBizRules = () => {
// 2.
const testNum = formData.value.testNum
if (testNum == null || Number(testNum) === 0) {
throw '该原料没有维护质检方案,请先维护质检方案!'
}
// 3.
if (formData.value.checkResult == null || formData.value.checkResult === '') {
throw '检验结果不能为空,请确认!'
}
// 4.
const list = formData.value.proctionInspTotalList || []
for (const item of list) {
const itemName = item.itemName || '未知项目'
// 4c.
if (item.itemValueType === 'I') {
//
const details = item.proctionInspDetailList || []
for (let i = 0; i < details.length; i++) {
const val = details[i].actValue
if (val != null && val !== '' && isNaN(Number(val))) {
throw `检验项目(${itemName})第${i + 1}个实测值请输入有效数字`
}
}
//
;['standardValue', 'upperLimit', 'lowerLimit'].forEach((field) => {
const fv = item[field]
if (fv != null && fv !== '' && isNaN(Number(fv))) {
const fieldLabel = field === 'standardValue' ? '标准值' : field === 'upperLimit' ? '上限值' : '下限值'
throw `检验项目(${itemName}${fieldLabel}请输入有效数字`
}
})
}
// 4b.
const details = item.proctionInspDetailList || []
let foundEmpty = false
for (let i = 0; i < details.length; i++) {
const val = details[i].actValue
if (val == null || val === '') {
foundEmpty = true
} else if (foundEmpty) {
//
throw `检验项目(${itemName})实测值必须按顺序录入,请确认!`
}
}
// 4a.
const hasDetailValue = details.some((d: any) => d.actValue != null && d.actValue !== '')
if (hasDetailValue && (item.checkResult == null || item.checkResult === '')) {
throw `检验项目(${itemName}),实测值已录入,单项判定不能为空!`
}
}
}
//
const handleLotNoConfirm = async (row: any) => {
console.log(row)
formData.value.materialId = row.materialId
formData.value.matCode = row.materialCode
formData.value.matName = row.materialName
formData.value.spec = row.spec
formData.value.lotNo = row.lotNo
formData.value.outDate = row.outDate ? dayjs(row.outDate).format('YYYY-MM-DD') : undefined
formData.value.planId = row.planId
formData.value.proNo = row.planNo
formData.value.outId = row.outId
formData.value.outMatId = row.id
const list = await InspplanitemApi.selectMaterialId(row.materialId, '3')
if (list && list.length > 0) {
//
list.forEach((item: any) => {
if (!item.proctionInspDetailList) {
item.proctionInspDetailList = []
}
const num = (item.testNum || 0) > (item.tolNum || 0) ? (item.testNum || 0) : (item.tolNum || 0)
for (let i = item.proctionInspDetailList.length; i < num; i++) {
item.proctionInspDetailList.push({ actValue: undefined })
}
})
//
list.forEach((item: any) => {
item.inspPlanItemId = item.id
item.inspPlanId = item.schemeId
})
formData.value.proctionInspTotalList = list
formData.value.testNum = list[0].tolNum
formData.value.formCode = list[0].formCode
formData.value.qaSchemeBaseId = list[0].schemeId
//
list.forEach((item: any) => {
if (item.itemValueType === 'I') {
calcAverage(item)
autoJudge(item)
}
})
updateOverallCheckResult()
} else {
formData.value.proctionInspTotalList = []
formData.value.testNum = undefined
}
}
//
const openLotNoDialog = () => {
if (formData.value.lotNo) {
LotNoDialogRef.value?.open({
id: formData.value.outMatId
})
} else {
LotNoDialogRef.value?.open()
}
}
//
const handleClearLotNo = () => {
formData.value.materialId = undefined
formData.value.matCode = undefined
formData.value.matName = undefined
formData.value.spec = undefined
formData.value.lotNo = undefined
formData.value.outDate =undefined
formData.value.planId = undefined
formData.value.proNo = undefined
formData.value.outId = undefined
formData.value.outMatId = undefined
formData.value.testNum = undefined
formData.value.formCode = undefined
formData.value.qaSchemeBaseId = undefined
}
/** 提交表单 */
const emit = defineEmits(['success', 'close']) // success
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
checkCode: undefined,
planId: undefined,
proNo: undefined,
materialId: undefined,
matCode: undefined,
matName: undefined,
spec: undefined,
lotNo: undefined,
outDate: undefined as string | undefined,
checkDate: undefined as string | undefined,
checkResult: '0',
remark: undefined,
formCode: undefined,
qaSchemeBaseId: undefined,
testNum: undefined,
checkUserId: undefined,
checkExUserId: undefined,
checkExDate: undefined,
checkStatus: '0',
checkRemark: undefined,
checkUserName: undefined,
checkExUserName: undefined,
outId: undefined,
outMatId: undefined,
proctionInspTotalList: [],
}
formRef.value?.resetFields()
}
</script>
<style scoped>
/* el-input-number 输入框文本左对齐 */
.el-input-number :deep(.el-input__inner) {
text-align: left !important;
}
/* testNum <= 5 时隐藏展开箭头 */
:deep(.hl-row-no-expand .el-table__expand-icon) {
visibility: hidden;
pointer-events: none;
}
</style>

View File

@ -0,0 +1,238 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="80px"
>
<el-form-item label="检验日期" prop="checkDate">
<el-date-picker
v-model="queryParams.checkDate"
value-format="YYYY-MM-DD"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
class="!w-240px"
:clearable="false"
/>
</el-form-item>
<el-form-item label="物料名称" prop="matName">
<el-input
v-model="queryParams.matName"
placeholder="请输入物料名称"
clearable
@keyup.enter="handleQuery"
class="!w-200px"
/>
</el-form-item>
<el-form-item label="单据状态" prop="checkStatus">
<el-select
v-model="queryParams.checkStatus"
placeholder="请选择单据状态"
clearable
class="!w-240px"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PROCTION_CHECK_STATUS)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/> </el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button
type="primary"
plain
@click="openForm('create')"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true" border>
<el-table-column label="序号" align="center" type="index" width="60px"/>
<el-table-column label="检验单号" align="center" prop="checkCode" width="150" />
<el-table-column label="产品名称" align="center" prop="matName" width="150"/>
<el-table-column label="规格型号" align="center" prop="spec" width="150" />
<el-table-column label="检验结果" align="center" prop="checkResult" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.CHECK_RESULT" :value="scope.row.checkResult"/>
</template>
</el-table-column>
<el-table-column label="检验人员" align="center" prop="checkUserName" width="120"/>
<el-table-column label="生产日期" align="center" prop="outDate" :formatter="dateFormatter2" width="120"/>
<el-table-column label="批次号" align="center" prop="lotNo" width="150"/>
<el-table-column label="检验日期" align="center" prop="checkDate" :formatter="dateFormatter2" width="120"/>
<el-table-column label="生产计划号" align="center" prop="proNo" width="150"/>
<el-table-column label="单据状态" align="center" prop="checkStatus" fixed="right" width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.PROCTION_CHECK_STATUS" :value="scope.row.checkStatus"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="180">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-if="scope.row.checkStatus === '0'"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-if="scope.row.checkStatus === '0'"
>
删除
</el-button>
<el-button
link
type="primary"
@click="openForm('details', scope.row.id)"
v-if="scope.row.checkStatus === '1'"
>
详情
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
</template>
<script setup lang="ts">
import { dateFormatter2} from '@/utils/formatTime'
import * as ProductionInspApi from '@/api/biz/productioninsp'
import {getStrDictOptions,DICT_TYPE} from "@/utils/dict";
import router from "@/router";
defineOptions({ name: 'ProductionInsp' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(false) //
const list = ref([]) //
const total = ref(0) //
/** 获取当月第一天到今天的日期范围格式YYYY-MM-DD */
const getDefaultDateRange = (): [string, string] => {
const now = new Date()
const firstDay = new Date(now.getFullYear(), now.getMonth(), 1)
const pad = (n: number) => String(n).padStart(2, '0')
const fmt = (d: Date) =>
`${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`
return [fmt(firstDay), fmt(now)]
}
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
checkCode: undefined,
planId: undefined,
proNo: undefined,
materialId: undefined,
matCode: undefined,
matName: undefined,
spec: undefined,
lotNo: undefined,
outDate: [],
checkDate: getDefaultDateRange(),
checkResult: undefined,
remark: undefined,
createTime: [],
formCode: undefined,
qaSchemeBaseId: undefined,
testNum: undefined,
checkUserId: undefined,
checkExUserId: undefined,
checkExDate: [],
checkStatus: undefined,
checkRemark: undefined,
checkUserName: undefined,
checkExUserName: undefined,
outId: undefined,
outMatId: undefined,
})
const queryFormRef = ref() //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await ProductionInspApi.getProductionInspPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const openForm = (type: string, id?: number) => {
sessionStorage.setItem('NEED_REFRESH_LIST', 'true')
router.push({
name: 'ProductionInspForm',
query: {
active: type,
id: id
}
})
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await ProductionInspApi.deleteProductionInsp(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 初始化与缓存激活 **/
onActivated(() => {
//
if (sessionStorage.getItem('NEED_REFRESH_LIST') === 'true') {
sessionStorage.removeItem('NEED_REFRESH_LIST')
getList()
}
})
</script>

View File

@ -142,7 +142,7 @@
<el-select v-model="formData.checkResult" placeholder="请选择检验结果" class="!w-full"
clearable filterable>
<el-option
v-for="dict in getCheckResultOptions()"
v-for="dict in getStrDictOptions(DICT_TYPE.CHECK_RESULT)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -238,16 +238,16 @@
<el-table-column type="index" label="序号" width="60" align="center"/>
<el-table-column label="项目名称" prop="itemName" align="center" width="200px"/>
<el-table-column label="检验标准" prop="checkMethod" align="center" width="200px"/>
<!-- 前5个实测值 -->
<el-table-column
v-for="index in 5"
v-for="index in formData.testNum"
:key="index"
label="实测值"
align="center"
width="120"
>
<template #default="scope">
<template v-if="index <= scope.row.testNum && scope.row.rawMaterialInspDetailList && scope.row.rawMaterialInspDetailList[index - 1]">
<template v-if="scope.row.rawMaterialInspDetailList && scope.row.rawMaterialInspDetailList[index - 1]">
<!-- 数字类型 -->
<el-input-number
v-if="scope.row.itemValueType === 'I'"
@ -473,7 +473,7 @@ const formRef = ref() // 表单 Ref
// if (!item.rawMaterialInspDetailList) {
// item.rawMaterialInspDetailList = []
// }
// const num = item.testNum || 0
// const num = list[0].tolNum || 0
// for (let i = item.rawMaterialInspDetailList.length; i < num; i++) {
// item.rawMaterialInspDetailList.push({ actValue: undefined })
// }
@ -488,16 +488,18 @@ const formRef = ref() // 表单 Ref
// class
const getRowClassName = ({ row }: { row: any }) => {
if (!row.testNum || row.testNum <= 5) {
if (!row.testNum ||row.testNum <= 0 ) {
return 'hl-row-no-expand'
}
return ''
}
// 1
// 1testNum
const getExtraDetails = (row: any) => {
const details = row.rawMaterialInspDetailList || []
return details.map((item: any, i: number) => ({ index: i + 1, item }))
return details
.map((item: any, i: number) => ({ index: i + 1, item }))
.filter(item => item.index <= (row.testNum || 0))
}
// itemContent
@ -610,14 +612,15 @@ const handleMaterialConfirm = async (row: any) => {
formData.value.spec = row.spec
const list = await InspplanitemApi.selectMaterialId(row.id)
const list = await InspplanitemApi.selectMaterialId(row.id, '1')
if (list && list.length > 0) {
//
list.forEach((item: any) => {
if (!item.rawMaterialInspDetailList) {
item.rawMaterialInspDetailList = []
}
const num = item.testNum || 0
const num = list[0].tolNum || 0
for (let i = item.rawMaterialInspDetailList.length; i < num; i++) {
item.rawMaterialInspDetailList.push({ actValue: undefined })
}
@ -670,7 +673,7 @@ const queryData = async (type: string, id ?: number) => {
if (!item.rawMaterialInspDetailList) {
item.rawMaterialInspDetailList = []
}
const num = item.testNum || 0
const num = (item.testNum || 0) > (formData.value.testNum || 0) ? (item.testNum || 0) : (formData.value.testNum || 0)
for (let i = item.rawMaterialInspDetailList.length; i < num; i++) {
item.rawMaterialInspDetailList.push({ actValue: undefined })
}

View File

@ -89,6 +89,7 @@
link
type="primary"
@click="openForm('update', scope.row.id)"
v-if="scope.row.checkStatus === '1'"
>
编辑
</el-button>
@ -96,6 +97,7 @@
link
type="danger"
@click="handleDelete(scope.row.id)"
v-if="scope.row.checkStatus === '1'"
>
删除
</el-button>
@ -103,6 +105,7 @@
link
type="primary"
@click="openForm('details', scope.row.id)"
v-if="scope.row.checkStatus === '2'"
>
详情
</el-button>