Merge branch 'dev' of http://222.71.165.188:3000/yunxi/mes-majoys into dev
commit
62b0e4da2e
@ -0,0 +1,22 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发货单状态枚举
|
||||||
|
* @author chenxi
|
||||||
|
* @date 2024-01-26 12:38
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum SystemParmetersEnum {
|
||||||
|
|
||||||
|
TPLUS_INTERFACE_SWITCH("TPlus_interface_whether"),
|
||||||
|
NEGATIVE_INVENTORY_SWITCH( "negative_inventory_whether"),
|
||||||
|
OVERTASK_CENTER_LIST("overtask_center_list");
|
||||||
|
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
SystemParmetersEnum(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.app.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app 版本信息
|
||||||
|
* @author chenxi
|
||||||
|
* @date 2024-04-25 09:56
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class OverTaskVO {
|
||||||
|
|
||||||
|
@Schema(description = "")
|
||||||
|
private String isAllow;
|
||||||
|
|
||||||
|
@Schema(description = "允许的车间列表")
|
||||||
|
private String workShops;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,95 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.process;
|
||||||
|
|
||||||
|
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.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.process.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.process.ProcessDO;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.service.process.ProcessService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 工艺路线")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/biz/process")
|
||||||
|
@Validated
|
||||||
|
public class ProcessController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProcessService processService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建工艺路线")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process:create')")
|
||||||
|
public CommonResult<Long> createProcess(@Valid @RequestBody ProcessSaveReqVO createReqVO) {
|
||||||
|
return success(processService.createProcess(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新工艺路线")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process:update')")
|
||||||
|
public CommonResult<Boolean> updateProcess(@Valid @RequestBody ProcessSaveReqVO updateReqVO) {
|
||||||
|
processService.updateProcess(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除工艺路线")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process:delete')")
|
||||||
|
public CommonResult<Boolean> deleteProcess(@RequestParam("id") Long id) {
|
||||||
|
processService.deleteProcess(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得工艺路线")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process:query')")
|
||||||
|
public CommonResult<ProcessRespVO> getProcess(@RequestParam("id") Long id) {
|
||||||
|
ProcessDO process = processService.getProcess(id);
|
||||||
|
return success(BeanUtils.toBean(process, ProcessRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得工艺路线分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process:query')")
|
||||||
|
public CommonResult<PageResult<ProcessRespVO>> getProcessPage(@Valid ProcessPageReqVO pageReqVO) {
|
||||||
|
PageResult<ProcessDO> pageResult = processService.getProcessPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ProcessRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出工艺路线 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportProcessExcel(@Valid ProcessPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ProcessDO> list = processService.getProcessPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "工艺路线.xls", "数据", ProcessRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ProcessRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,95 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.processdetail;
|
||||||
|
|
||||||
|
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.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.processdetail.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.processdetail.ProcessDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.service.processdetail.ProcessDetailService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 工艺路线明细")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/biz/process-detail")
|
||||||
|
@Validated
|
||||||
|
public class ProcessDetailController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProcessDetailService processDetailService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建工艺路线明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process-detail:create')")
|
||||||
|
public CommonResult<Long> createProcessDetail(@Valid @RequestBody ProcessDetailSaveReqVO createReqVO) {
|
||||||
|
return success(processDetailService.createProcessDetail(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新工艺路线明细")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process-detail:update')")
|
||||||
|
public CommonResult<Boolean> updateProcessDetail(@Valid @RequestBody ProcessDetailSaveReqVO updateReqVO) {
|
||||||
|
processDetailService.updateProcessDetail(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除工艺路线明细")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process-detail:delete')")
|
||||||
|
public CommonResult<Boolean> deleteProcessDetail(@RequestParam("id") Long id) {
|
||||||
|
processDetailService.deleteProcessDetail(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得工艺路线明细")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process-detail:query')")
|
||||||
|
public CommonResult<ProcessDetailRespVO> getProcessDetail(@RequestParam("id") Long id) {
|
||||||
|
ProcessDetailDO processDetail = processDetailService.getProcessDetail(id);
|
||||||
|
return success(BeanUtils.toBean(processDetail, ProcessDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得工艺路线明细分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process-detail:query')")
|
||||||
|
public CommonResult<PageResult<ProcessDetailRespVO>> getProcessDetailPage(@Valid ProcessDetailPageReqVO pageReqVO) {
|
||||||
|
PageResult<ProcessDetailDO> pageResult = processDetailService.getProcessDetailPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ProcessDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出工艺路线明细 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:process-detail:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportProcessDetailExcel(@Valid ProcessDetailPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ProcessDetailDO> list = processDetailService.getProcessDetailPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "工艺路线明细.xls", "数据", ProcessDetailRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ProcessDetailRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,95 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.systemparameters;
|
||||||
|
|
||||||
|
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.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.CommonResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.excel.core.util.ExcelUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.operatelog.core.annotations.OperateLog;
|
||||||
|
import static com.chanko.yunxi.mes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.systemparameters.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.systemparameters.SystemParametersDO;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.service.systemparameters.SystemParametersService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 系统参数设置")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/biz/system-parameters")
|
||||||
|
@Validated
|
||||||
|
public class SystemParametersController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SystemParametersService systemParametersService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建系统参数设置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:system-parameters:create')")
|
||||||
|
public CommonResult<Long> createSystemParameters(@Valid @RequestBody SystemParametersSaveReqVO createReqVO) {
|
||||||
|
return success(systemParametersService.createSystemParameters(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新系统参数设置")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:system-parameters:update')")
|
||||||
|
public CommonResult<Boolean> updateSystemParameters(@Valid @RequestBody SystemParametersSaveReqVO updateReqVO) {
|
||||||
|
systemParametersService.updateSystemParameters(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除系统参数设置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:system-parameters:delete')")
|
||||||
|
public CommonResult<Boolean> deleteSystemParameters(@RequestParam("id") Long id) {
|
||||||
|
systemParametersService.deleteSystemParameters(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得系统参数设置")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:system-parameters:query')")
|
||||||
|
public CommonResult<SystemParametersRespVO> getSystemParameters(@RequestParam("id") Long id) {
|
||||||
|
SystemParametersDO systemParameters = systemParametersService.getSystemParameters(id);
|
||||||
|
return success(BeanUtils.toBean(systemParameters, SystemParametersRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得系统参数设置分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:system-parameters:query')")
|
||||||
|
public CommonResult<PageResult<SystemParametersRespVO>> getSystemParametersPage(@Valid SystemParametersPageReqVO pageReqVO) {
|
||||||
|
PageResult<SystemParametersDO> pageResult = systemParametersService.getSystemParametersPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, SystemParametersRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出系统参数设置 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('biz:system-parameters:export')")
|
||||||
|
@OperateLog(type = EXPORT)
|
||||||
|
public void exportSystemParametersExcel(@Valid SystemParametersPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<SystemParametersDO> list = systemParametersService.getSystemParametersPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "系统参数设置.xls", "数据", SystemParametersRespVO.class,
|
||||||
|
BeanUtils.toBean(list, SystemParametersRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.systemparameters.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static com.chanko.yunxi.mes.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 SystemParametersPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段,唯一")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "参数编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "值范围")
|
||||||
|
private String scope;
|
||||||
|
|
||||||
|
@Schema(description = "当前值")
|
||||||
|
private String currentValue;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.systemparameters.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 SystemParametersRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("自增字段,唯一")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "参数编码")
|
||||||
|
@ExcelProperty("参数编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称")
|
||||||
|
@ExcelProperty("参数名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "值范围")
|
||||||
|
@ExcelProperty("值范围")
|
||||||
|
private String scope;
|
||||||
|
|
||||||
|
@Schema(description = "当前值")
|
||||||
|
@ExcelProperty("当前值")
|
||||||
|
private String currentValue;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.systemparameters.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 SystemParametersSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "自增字段,唯一", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "参数编码")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "参数名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "值范围")
|
||||||
|
private String scope;
|
||||||
|
|
||||||
|
@Schema(description = "当前值")
|
||||||
|
private String currentValue;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.controller.admin.unqualifiednotification.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotEmpty;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 品质异常通知单附件信息 Request VO")
|
||||||
|
@Data
|
||||||
|
public class UnqualifiedNotificationFileReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "时间戳")
|
||||||
|
private String k;
|
||||||
|
|
||||||
|
@Schema(description = "文件地址url")
|
||||||
|
private String v;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.dal.mysql.process;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.process.ProcessDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.process.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ProcessMapper extends BaseMapperX<ProcessDO> {
|
||||||
|
|
||||||
|
default PageResult<ProcessDO> selectPage(ProcessPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ProcessDO>()
|
||||||
|
.eqIfPresent(ProcessDO::getId, reqVO.getId())
|
||||||
|
.eqIfPresent(ProcessDO::getCode, reqVO.getCode())
|
||||||
|
.likeIfPresent(ProcessDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(ProcessDO::getStatus, reqVO.getStatus())
|
||||||
|
.betweenIfPresent(ProcessDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(ProcessDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.dal.mysql.processdetail;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.processdetail.ProcessDetailDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.processdetail.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线明细 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ProcessDetailMapper extends BaseMapperX<ProcessDetailDO> {
|
||||||
|
|
||||||
|
default PageResult<ProcessDetailDO> selectPage(ProcessDetailPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ProcessDetailDO>()
|
||||||
|
.eqIfPresent(ProcessDetailDO::getId, reqVO.getId())
|
||||||
|
.eqIfPresent(ProcessDetailDO::getProcedureId, reqVO.getProcedureId())
|
||||||
|
.eqIfPresent(ProcessDetailDO::getProcedureSort, reqVO.getProcedureSort())
|
||||||
|
.eqIfPresent(ProcessDetailDO::getProcedureEquipId, reqVO.getProcedureEquipId())
|
||||||
|
.eqIfPresent(ProcessDetailDO::getType, reqVO.getType())
|
||||||
|
.eqIfPresent(ProcessDetailDO::getMaterialId, reqVO.getMaterialId())
|
||||||
|
.betweenIfPresent(ProcessDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(ProcessDetailDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.dal.mysql.systemparameters;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import com.chanko.yunxi.mes.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.systemparameters.SystemParametersDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.systemparameters.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统参数设置 Mapper
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface SystemParametersMapper extends BaseMapperX<SystemParametersDO> {
|
||||||
|
|
||||||
|
default PageResult<SystemParametersDO> selectPage(SystemParametersPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<SystemParametersDO>()
|
||||||
|
.eqIfPresent(SystemParametersDO::getId, reqVO.getId())
|
||||||
|
.betweenIfPresent(SystemParametersDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.likeIfPresent(SystemParametersDO::getCode, reqVO.getCode())
|
||||||
|
.likeIfPresent(SystemParametersDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(SystemParametersDO::getScope, reqVO.getScope())
|
||||||
|
.eqIfPresent(SystemParametersDO::getCurrentValue, reqVO.getCurrentValue())
|
||||||
|
.eqIfPresent(SystemParametersDO::getDescription, reqVO.getDescription())
|
||||||
|
.orderByDesc(SystemParametersDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.service.process;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.process.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.process.ProcessDO;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface ProcessService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建工艺路线
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createProcess(@Valid ProcessSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工艺路线
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateProcess(@Valid ProcessSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工艺路线
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteProcess(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工艺路线
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 工艺路线
|
||||||
|
*/
|
||||||
|
ProcessDO getProcess(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工艺路线分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 工艺路线分页
|
||||||
|
*/
|
||||||
|
PageResult<ProcessDO> getProcessPage(ProcessPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.service.process;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.process.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.process.ProcessDO;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.mysql.process.ProcessMapper;
|
||||||
|
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.chanko.yunxi.mes.module.biz.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ProcessServiceImpl implements ProcessService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProcessMapper processMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createProcess(ProcessSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ProcessDO process = BeanUtils.toBean(createReqVO, ProcessDO.class);
|
||||||
|
processMapper.insert(process);
|
||||||
|
// 返回
|
||||||
|
return process.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProcess(ProcessSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateProcessExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ProcessDO updateObj = BeanUtils.toBean(updateReqVO, ProcessDO.class);
|
||||||
|
processMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteProcess(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateProcessExists(id);
|
||||||
|
// 删除
|
||||||
|
processMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateProcessExists(Long id) {
|
||||||
|
if (processMapper.selectById(id) == null) {
|
||||||
|
throw exception(PROCESS_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProcessDO getProcess(Long id) {
|
||||||
|
return processMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ProcessDO> getProcessPage(ProcessPageReqVO pageReqVO) {
|
||||||
|
return processMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.service.processdetail;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.processdetail.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.processdetail.ProcessDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线明细 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface ProcessDetailService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建工艺路线明细
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createProcessDetail(@Valid ProcessDetailSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新工艺路线明细
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateProcessDetail(@Valid ProcessDetailSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工艺路线明细
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteProcessDetail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工艺路线明细
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 工艺路线明细
|
||||||
|
*/
|
||||||
|
ProcessDetailDO getProcessDetail(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得工艺路线明细分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 工艺路线明细分页
|
||||||
|
*/
|
||||||
|
PageResult<ProcessDetailDO> getProcessDetailPage(ProcessDetailPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.service.processdetail;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.processdetail.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.processdetail.ProcessDetailDO;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.mysql.processdetail.ProcessDetailMapper;
|
||||||
|
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.chanko.yunxi.mes.module.biz.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工艺路线明细 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ProcessDetailServiceImpl implements ProcessDetailService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ProcessDetailMapper processDetailMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createProcessDetail(ProcessDetailSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ProcessDetailDO processDetail = BeanUtils.toBean(createReqVO, ProcessDetailDO.class);
|
||||||
|
processDetailMapper.insert(processDetail);
|
||||||
|
// 返回
|
||||||
|
return processDetail.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateProcessDetail(ProcessDetailSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateProcessDetailExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ProcessDetailDO updateObj = BeanUtils.toBean(updateReqVO, ProcessDetailDO.class);
|
||||||
|
processDetailMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteProcessDetail(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateProcessDetailExists(id);
|
||||||
|
// 删除
|
||||||
|
processDetailMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateProcessDetailExists(Long id) {
|
||||||
|
if (processDetailMapper.selectById(id) == null) {
|
||||||
|
throw exception(PROCESS_DETAIL_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProcessDetailDO getProcessDetail(Long id) {
|
||||||
|
return processDetailMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ProcessDetailDO> getProcessDetailPage(ProcessDetailPageReqVO pageReqVO) {
|
||||||
|
return processDetailMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.service.systemparameters;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import javax.validation.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.systemparameters.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.systemparameters.SystemParametersDO;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统参数设置 Service 接口
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
public interface SystemParametersService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建系统参数设置
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createSystemParameters(@Valid SystemParametersSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新系统参数设置
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateSystemParameters(@Valid SystemParametersSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除系统参数设置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteSystemParameters(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得系统参数设置
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 系统参数设置
|
||||||
|
*/
|
||||||
|
SystemParametersDO getSystemParameters(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得系统参数设置分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 系统参数设置分页
|
||||||
|
*/
|
||||||
|
PageResult<SystemParametersDO> getSystemParametersPage(SystemParametersPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,74 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.service.systemparameters;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.systemparameters.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.systemparameters.SystemParametersDO;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageParam;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.mysql.systemparameters.SystemParametersMapper;
|
||||||
|
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static com.chanko.yunxi.mes.module.biz.enums.ErrorCodeConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统参数设置 Service 实现类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class SystemParametersServiceImpl implements SystemParametersService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SystemParametersMapper systemParametersMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createSystemParameters(SystemParametersSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
SystemParametersDO systemParameters = BeanUtils.toBean(createReqVO, SystemParametersDO.class);
|
||||||
|
systemParametersMapper.insert(systemParameters);
|
||||||
|
// 返回
|
||||||
|
return systemParameters.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateSystemParameters(SystemParametersSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateSystemParametersExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
SystemParametersDO updateObj = BeanUtils.toBean(updateReqVO, SystemParametersDO.class);
|
||||||
|
systemParametersMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteSystemParameters(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateSystemParametersExists(id);
|
||||||
|
// 删除
|
||||||
|
systemParametersMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateSystemParametersExists(Long id) {
|
||||||
|
if (systemParametersMapper.selectById(id) == null) {
|
||||||
|
throw exception(SYSTEM_PARAMETERS_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SystemParametersDO getSystemParameters(Long id) {
|
||||||
|
return systemParametersMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<SystemParametersDO> getSystemParametersPage(SystemParametersPageReqVO pageReqVO) {
|
||||||
|
return systemParametersMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,154 @@
|
|||||||
|
package com.chanko.yunxi.mes.module.biz.service.systemparameters;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Disabled;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.framework.test.core.ut.BaseDbUnitTest;
|
||||||
|
|
||||||
|
import com.chanko.yunxi.mes.module.biz.controller.admin.systemparameters.vo.*;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.dataobject.systemparameters.SystemParametersDO;
|
||||||
|
import com.chanko.yunxi.mes.module.biz.dal.mysql.systemparameters.SystemParametersMapper;
|
||||||
|
import com.chanko.yunxi.mes.framework.common.pojo.PageResult;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.springframework.context.annotation.Import;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.hutool.core.util.RandomUtil.*;
|
||||||
|
import static com.chanko.yunxi.mes.module.biz.enums.ErrorCodeConstants.*;
|
||||||
|
import static com.chanko.yunxi.mes.framework.test.core.util.AssertUtils.*;
|
||||||
|
import static com.chanko.yunxi.mes.framework.test.core.util.RandomUtils.*;
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.util.date.LocalDateTimeUtils.*;
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.util.object.ObjectUtils.*;
|
||||||
|
import static com.chanko.yunxi.mes.framework.common.util.date.DateUtils.*;
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
import static org.mockito.Mockito.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link SystemParametersServiceImpl} 的单元测试类
|
||||||
|
*
|
||||||
|
* @author 管理员
|
||||||
|
*/
|
||||||
|
@Import(SystemParametersServiceImpl.class)
|
||||||
|
public class SystemParametersServiceImplTest extends BaseDbUnitTest {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SystemParametersServiceImpl systemParametersService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SystemParametersMapper systemParametersMapper;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testCreateSystemParameters_success() {
|
||||||
|
// 准备参数
|
||||||
|
SystemParametersSaveReqVO createReqVO = randomPojo(SystemParametersSaveReqVO.class).setId(null);
|
||||||
|
|
||||||
|
// 调用
|
||||||
|
Long systemParametersId = systemParametersService.createSystemParameters(createReqVO);
|
||||||
|
// 断言
|
||||||
|
assertNotNull(systemParametersId);
|
||||||
|
// 校验记录的属性是否正确
|
||||||
|
SystemParametersDO systemParameters = systemParametersMapper.selectById(systemParametersId);
|
||||||
|
assertPojoEquals(createReqVO, systemParameters, "id");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testUpdateSystemParameters_success() {
|
||||||
|
// mock 数据
|
||||||
|
SystemParametersDO dbSystemParameters = randomPojo(SystemParametersDO.class);
|
||||||
|
systemParametersMapper.insert(dbSystemParameters);// @Sql: 先插入出一条存在的数据
|
||||||
|
// 准备参数
|
||||||
|
SystemParametersSaveReqVO updateReqVO = randomPojo(SystemParametersSaveReqVO.class, o -> {
|
||||||
|
o.setId(dbSystemParameters.getId()); // 设置更新的 ID
|
||||||
|
});
|
||||||
|
|
||||||
|
// 调用
|
||||||
|
systemParametersService.updateSystemParameters(updateReqVO);
|
||||||
|
// 校验是否更新正确
|
||||||
|
SystemParametersDO systemParameters = systemParametersMapper.selectById(updateReqVO.getId()); // 获取最新的
|
||||||
|
assertPojoEquals(updateReqVO, systemParameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testUpdateSystemParameters_notExists() {
|
||||||
|
// 准备参数
|
||||||
|
SystemParametersSaveReqVO updateReqVO = randomPojo(SystemParametersSaveReqVO.class);
|
||||||
|
|
||||||
|
// 调用, 并断言异常
|
||||||
|
assertServiceException(() -> systemParametersService.updateSystemParameters(updateReqVO), SYSTEM_PARAMETERS_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDeleteSystemParameters_success() {
|
||||||
|
// mock 数据
|
||||||
|
SystemParametersDO dbSystemParameters = randomPojo(SystemParametersDO.class);
|
||||||
|
systemParametersMapper.insert(dbSystemParameters);// @Sql: 先插入出一条存在的数据
|
||||||
|
// 准备参数
|
||||||
|
Long id = dbSystemParameters.getId();
|
||||||
|
|
||||||
|
// 调用
|
||||||
|
systemParametersService.deleteSystemParameters(id);
|
||||||
|
// 校验数据不存在了
|
||||||
|
assertNull(systemParametersMapper.selectById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDeleteSystemParameters_notExists() {
|
||||||
|
// 准备参数
|
||||||
|
Long id = randomLongId();
|
||||||
|
|
||||||
|
// 调用, 并断言异常
|
||||||
|
assertServiceException(() -> systemParametersService.deleteSystemParameters(id), SYSTEM_PARAMETERS_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解
|
||||||
|
public void testGetSystemParametersPage() {
|
||||||
|
// mock 数据
|
||||||
|
SystemParametersDO dbSystemParameters = randomPojo(SystemParametersDO.class, o -> { // 等会查询到
|
||||||
|
o.setId(null);
|
||||||
|
o.setCreateTime(null);
|
||||||
|
o.setCode(null);
|
||||||
|
o.setName(null);
|
||||||
|
o.setRange(null);
|
||||||
|
o.setCurrentValue(null);
|
||||||
|
o.setDescription(null);
|
||||||
|
});
|
||||||
|
systemParametersMapper.insert(dbSystemParameters);
|
||||||
|
// 测试 id 不匹配
|
||||||
|
systemParametersMapper.insert(cloneIgnoreId(dbSystemParameters, o -> o.setId(null)));
|
||||||
|
// 测试 createTime 不匹配
|
||||||
|
systemParametersMapper.insert(cloneIgnoreId(dbSystemParameters, o -> o.setCreateTime(null)));
|
||||||
|
// 测试 code 不匹配
|
||||||
|
systemParametersMapper.insert(cloneIgnoreId(dbSystemParameters, o -> o.setCode(null)));
|
||||||
|
// 测试 name 不匹配
|
||||||
|
systemParametersMapper.insert(cloneIgnoreId(dbSystemParameters, o -> o.setName(null)));
|
||||||
|
// 测试 range 不匹配
|
||||||
|
systemParametersMapper.insert(cloneIgnoreId(dbSystemParameters, o -> o.setRange(null)));
|
||||||
|
// 测试 currentValue 不匹配
|
||||||
|
systemParametersMapper.insert(cloneIgnoreId(dbSystemParameters, o -> o.setCurrentValue(null)));
|
||||||
|
// 测试 description 不匹配
|
||||||
|
systemParametersMapper.insert(cloneIgnoreId(dbSystemParameters, o -> o.setDescription(null)));
|
||||||
|
// 准备参数
|
||||||
|
SystemParametersPageReqVO reqVO = new SystemParametersPageReqVO();
|
||||||
|
reqVO.setId(null);
|
||||||
|
reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28));
|
||||||
|
reqVO.setCode(null);
|
||||||
|
reqVO.setName(null);
|
||||||
|
reqVO.setRange(null);
|
||||||
|
reqVO.setCurrentValue(null);
|
||||||
|
reqVO.setDescription(null);
|
||||||
|
|
||||||
|
// 调用
|
||||||
|
PageResult<SystemParametersDO> pageResult = systemParametersService.getSystemParametersPage(reqVO);
|
||||||
|
// 断言
|
||||||
|
assertEquals(1, pageResult.getTotal());
|
||||||
|
assertEquals(1, pageResult.getList().size());
|
||||||
|
assertPojoEquals(dbSystemParameters, pageResult.getList().get(0));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface ProcessVO {
|
||||||
|
id: number
|
||||||
|
code: string
|
||||||
|
name: string
|
||||||
|
status: number
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询工艺路线分页
|
||||||
|
export const getProcessPage = async (params) => {
|
||||||
|
return await request.get({ url: `/biz/process/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询工艺路线详情
|
||||||
|
export const getProcess = async (id: number) => {
|
||||||
|
return await request.get({ url: `/biz/process/get?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增工艺路线
|
||||||
|
export const createProcess = async (data: ProcessVO) => {
|
||||||
|
return await request.post({ url: `/biz/process/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改工艺路线
|
||||||
|
export const updateProcess = async (data: ProcessVO) => {
|
||||||
|
return await request.put({ url: `/biz/process/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除工艺路线
|
||||||
|
export const deleteProcess = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/biz/process/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出工艺路线 Excel
|
||||||
|
export const exportProcess = async (params) => {
|
||||||
|
return await request.download({ url: `/biz/process/export-excel`, params })
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface ProcessVO {
|
||||||
|
id: number
|
||||||
|
code: string
|
||||||
|
name: string
|
||||||
|
status: number
|
||||||
|
matList:[]
|
||||||
|
procedureList:[]
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询工艺路线分页
|
||||||
|
export const getProcessPage = async (params) => {
|
||||||
|
return await request.get({ url: `/biz/process/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询工艺路线详情
|
||||||
|
export const getProcess = async (id: number) => {
|
||||||
|
return await request.get({ url: `/biz/process/get?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增工艺路线
|
||||||
|
export const createProcess = async (data: ProcessVO) => {
|
||||||
|
return await request.post({ url: `/biz/process/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改工艺路线
|
||||||
|
export const updateProcess = async (data: ProcessVO) => {
|
||||||
|
return await request.put({ url: `/biz/process/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除工艺路线
|
||||||
|
export const deleteProcess = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/biz/process/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出工艺路线 Excel
|
||||||
|
export const exportProcess = async (params) => {
|
||||||
|
return await request.download({ url: `/biz/process/export-excel`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询工艺路线明细分页
|
||||||
|
export const getProcessDetailPage = async (params) => {
|
||||||
|
return await request.get({ url: `/biz/process-detail/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询工艺路线明细详情
|
||||||
|
export const getProcessDetail = async (id: number) => {
|
||||||
|
return await request.get({ url: `/biz/process-detail/get?id=` + id })
|
||||||
|
}
|
||||||
|
//===========================================================
|
||||||
|
|
||||||
|
export interface ProcessDetailVO {
|
||||||
|
id: number
|
||||||
|
procedureId: number
|
||||||
|
procedureSort: number
|
||||||
|
procedureEquipId: number
|
||||||
|
type: number
|
||||||
|
materialId: number
|
||||||
|
}
|
||||||
|
// 新增工艺路线明细
|
||||||
|
export const createProcessDetail = async (data: ProcessDetailVO) => {
|
||||||
|
return await request.post({ url: `/biz/process-detail/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改工艺路线明细
|
||||||
|
export const updateProcessDetail = async (data: ProcessDetailVO) => {
|
||||||
|
return await request.put({ url: `/biz/process-detail/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除工艺路线明细
|
||||||
|
export const deleteProcessDetail = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/biz/process-detail/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出工艺路线明细 Excel
|
||||||
|
export const exportProcessDetail = async (params) => {
|
||||||
|
return await request.download({ url: `/biz/process-detail/export-excel`, params })
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
|
||||||
|
export interface SystemParametersVO {
|
||||||
|
id: number
|
||||||
|
code: string
|
||||||
|
name: string
|
||||||
|
scope: string
|
||||||
|
currentValue: string
|
||||||
|
description: string
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询系统参数设置分页
|
||||||
|
export const getSystemParametersPage = async (params) => {
|
||||||
|
return await request.get({ url: `/biz/system-parameters/page`, params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询系统参数设置详情
|
||||||
|
export const getSystemParameters = async (id: number) => {
|
||||||
|
return await request.get({ url: `/biz/system-parameters/get?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增系统参数设置
|
||||||
|
export const createSystemParameters = async (data: SystemParametersVO) => {
|
||||||
|
return await request.post({ url: `/biz/system-parameters/create`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改系统参数设置
|
||||||
|
export const updateSystemParameters = async (data: SystemParametersVO) => {
|
||||||
|
return await request.put({ url: `/biz/system-parameters/update`, data })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除系统参数设置
|
||||||
|
export const deleteSystemParameters = async (id: number) => {
|
||||||
|
return await request.delete({ url: `/biz/system-parameters/delete?id=` + id })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出系统参数设置 Excel
|
||||||
|
export const exportSystemParameters = async (params) => {
|
||||||
|
return await request.download({ url: `/biz/system-parameters/export-excel`, params })
|
||||||
|
}
|
@ -0,0 +1,260 @@
|
|||||||
|
<template>
|
||||||
|
<el-card class="hl-card">
|
||||||
|
<template #header>
|
||||||
|
<span>工艺路线</span>
|
||||||
|
</template>
|
||||||
|
<ContentWrap class="borderxx">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="115px"
|
||||||
|
>
|
||||||
|
<el-form-item label="工艺路线编码">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.code"
|
||||||
|
class="!w-240px"
|
||||||
|
clearable
|
||||||
|
placeholder="工艺路线编码"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="工艺路线名称">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.name"
|
||||||
|
class="!w-240px"
|
||||||
|
clearable
|
||||||
|
placeholder="工艺路线编码"
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item style="margin-left: 20px">
|
||||||
|
<el-button @click="handleQuery" type="primary">
|
||||||
|
<Icon icon="ep:search" class="mr-5px" /> 查询
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="resetQuery">
|
||||||
|
<Icon icon="ep:refresh" class="mr-5px" /> 重置
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="openDetail('create')" plain type="primary">
|
||||||
|
<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"
|
||||||
|
class="hl-table"
|
||||||
|
>
|
||||||
|
<el-table-column fixed label="序号" type="index" width="60" align="center" />
|
||||||
|
<el-table-column fixed label="工艺路线编码" align="center" prop="code" min-width="160">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openDetail('detail', scope.row.id)">
|
||||||
|
{{ scope.row.code }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="工艺路线名称" align="center" prop="name" min-width="120" />
|
||||||
|
<el-table-column
|
||||||
|
fixed="right"
|
||||||
|
label="创建人"
|
||||||
|
align="center"
|
||||||
|
prop="ownerName"
|
||||||
|
min-width="120"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="submitTime"
|
||||||
|
:formatter="dateFormatter2"
|
||||||
|
min-width="140"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
fixed="right"
|
||||||
|
label="修改人"
|
||||||
|
align="center"
|
||||||
|
prop="updataName"
|
||||||
|
min-width="120"
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
label="修改时间"
|
||||||
|
align="center"
|
||||||
|
prop="updataTime"
|
||||||
|
:formatter="dateFormatter2"
|
||||||
|
min-width="140"
|
||||||
|
/>
|
||||||
|
<el-table-column label="启用状态" align="center" prop="status">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.BIZ_COMMON_STATUS" :value="scope.row.status" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column fixed="right" label="操作" align="center" min-width="140">
|
||||||
|
<template #header>
|
||||||
|
<span style="margin-right: 30%">操作</span>
|
||||||
|
</template>
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openDetail('update', scope.row.id)">
|
||||||
|
编辑
|
||||||
|
</el-button>
|
||||||
|
<!-- <el-dropdown>
|
||||||
|
<span class="el-dropdown-link"
|
||||||
|
>更多
|
||||||
|
<el-icon class="el-icon--right">
|
||||||
|
<arrow-down />
|
||||||
|
</el-icon>
|
||||||
|
</span>
|
||||||
|
<template #dropdown>
|
||||||
|
<el-dropdown-menu>
|
||||||
|
<el-dropdown-item @click="handleDelete(scope.row.id)">删除</el-dropdown-item>
|
||||||
|
<el-dropdown-item @click="openDetail('detail', scope.row.id)"
|
||||||
|
>查看详情</el-dropdown-item
|
||||||
|
>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</template>
|
||||||
|
</el-dropdown> -->
|
||||||
|
<!-- <el-button link type="danger" @click="handleDelete(scope.row.id)">
|
||||||
|
删除
|
||||||
|
</el-button>-->
|
||||||
|
<el-button link type="primary" @click="openDetail('detail', scope.row.id)">
|
||||||
|
查看详情
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getStrDictOptions, DICT_TYPE, getDictLabel, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { dateFormatter, dateFormatter2, formatDate } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import * as EquipMaintenanceRecordApi from '@/api/biz/equipmaintenancerecord'
|
||||||
|
|
||||||
|
import { useCommonStateWithOut } from '@/store/modules/common'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
|
import WorkshopSelect from '@/views/biz/hlvuestyle/workshopSelect.vue'
|
||||||
|
import EquipmentSelect from '@/views/biz/hlvuestyle/equipmentSelect.vue'
|
||||||
|
defineOptions({ name: 'ProcessDesign3D' })
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const router = useRouter()
|
||||||
|
const commonStore = useCommonStateWithOut()
|
||||||
|
const userStore = useUserStore()
|
||||||
|
const username = userStore.getUser.nickname
|
||||||
|
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
code: undefined,
|
||||||
|
name: undefined
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await EquipMaintenanceRecordApi.getEquipMaintenanceRecordPage(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 openDetail = (type: string, id?: number) => {
|
||||||
|
commonStore.setStore('active', type)
|
||||||
|
commonStore.setStore('id', id)
|
||||||
|
router.push({
|
||||||
|
name: 'productcraftpathdetail',
|
||||||
|
query: {
|
||||||
|
active: type,
|
||||||
|
id: id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
const handleDelete = async (id: number) => {
|
||||||
|
try {
|
||||||
|
// 删除的二次确认
|
||||||
|
await message.delConfirm()
|
||||||
|
// 发起删除
|
||||||
|
// await EquipMaintenanceRecordApi.deleteEquipMaintenanceRecord(id)
|
||||||
|
message.success(t('common.delSuccess'))
|
||||||
|
// 刷新列表
|
||||||
|
await getList()
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = async () => {
|
||||||
|
try {
|
||||||
|
// 导出的二次确认
|
||||||
|
await message.exportConfirm()
|
||||||
|
// 发起导出
|
||||||
|
exportLoading.value = true
|
||||||
|
const data = await ProcessDesignApi.exportProcessDesign(queryParams)
|
||||||
|
download.excel(data, '工艺设计.xls')
|
||||||
|
} catch {
|
||||||
|
} finally {
|
||||||
|
exportLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.el-dropdown-link {
|
||||||
|
cursor: pointer;
|
||||||
|
margin: 6px;
|
||||||
|
color: var(--el-color-primary);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,300 @@
|
|||||||
|
<template>
|
||||||
|
<el-card class="hl-card">
|
||||||
|
<template #header>
|
||||||
|
<span>出库审核</span>
|
||||||
|
</template>
|
||||||
|
<ContentWrap class="borderxx">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<el-form
|
||||||
|
class="-mb-15px"
|
||||||
|
:model="queryParams"
|
||||||
|
ref="queryFormRef"
|
||||||
|
:inline="true"
|
||||||
|
label-width="108px"
|
||||||
|
>
|
||||||
|
<el-form-item label="出库单号" prop="stockNo">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.stockNo"
|
||||||
|
placeholder="出库单号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="上游单号" prop="headerNo">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.headerNo"
|
||||||
|
placeholder="上游单号"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料编码" prop="matNo">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.matNo"
|
||||||
|
placeholder="物料编码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="物料名称" prop="matName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.matName"
|
||||||
|
placeholder="物料名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter="handleQuery"
|
||||||
|
class="!w-240px"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出库类型" prop="stockInType">
|
||||||
|
<el-select
|
||||||
|
v-model="queryParams.stockInType"
|
||||||
|
placeholder="下拉选择"
|
||||||
|
clearable
|
||||||
|
class="!w-240px"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.BIZ_STORAGE_OUT_TYPE)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="出库仓库" prop="whId">
|
||||||
|
<el-select v-model="queryParams.whId" placeholder="下拉选择" clearable class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in warehouseList"
|
||||||
|
:key="dict.id"
|
||||||
|
:label="dict.whName"
|
||||||
|
:value="dict.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<!-- <el-form-item label="单据状态" prop="status">
|
||||||
|
<el-select v-model="queryParams.status" placeholder="下拉选择" clearable class="!w-240px">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in getIntDictOptions(DICT_TYPE.BIZ_STORAGE_STATUS)"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item> -->
|
||||||
|
|
||||||
|
<el-form-item style="margin-left:15px">
|
||||||
|
<el-button @click="handleQuery" type="primary"><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="openDetail('create')">
|
||||||
|
<Icon icon="ep:plus" class="mr-5px" /> 新增
|
||||||
|
</el-button> -->
|
||||||
|
<!-- <el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
@click="handleExport"
|
||||||
|
:loading="exportLoading"
|
||||||
|
v-hasPermi="['biz:storage: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" class="hl-table">
|
||||||
|
<!-- <el-table-column label="主键id" align="center" prop="id" /> -->
|
||||||
|
<el-table-column type="index" width="100" fixed label="序号" align="center" />
|
||||||
|
<el-table-column label="出库单号" align="center" prop="stockNo" fixed min-width="220" >
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button text type="primary" @click="openDetail('review',scope.row.id)">
|
||||||
|
{{scope.row.stockNo}}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="出库类型" align="center" prop="stockInType" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.BIZ_STORAGE_OUT_TYPE" :value="scope.row.stockInType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="上游单号" align="center" prop="headerNo" min-width="180" />
|
||||||
|
<el-table-column label="出库仓库" align="center" prop="whId" min-width="140">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ warehouseList.find((tag) => tag.id === scope.row.whId)?.whName }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="备注" align="center" prop="description" min-width="120"/>
|
||||||
|
<el-table-column label="创建人" align="center" prop="creator" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ userList.find((user) => user.id === scope.row.creator)?.nickname }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
align="center"
|
||||||
|
prop="createTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
min-width="240"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<el-table-column label="提交人" align="center" prop="keeper" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ userList.find((user) => user.id == scope.row.outbound)?.nickname }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="提交时间"
|
||||||
|
align="center"
|
||||||
|
prop="outboundTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
min-width="240"
|
||||||
|
/>
|
||||||
|
<el-table-column label="作废人" align="center" prop="cancel" min-width="120">
|
||||||
|
<template #default="scope">
|
||||||
|
{{ userList.find((user) => user.id == scope.row.cancel)?.nickname }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="作废时间"
|
||||||
|
align="center"
|
||||||
|
prop="cancelTime"
|
||||||
|
:formatter="dateFormatter"
|
||||||
|
min-width="240"
|
||||||
|
/>
|
||||||
|
<el-table-column label="单据状态" align="center" prop="status" min-width="120" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :type="DICT_TYPE.BIZ_STORAGE_STATUS" :value="scope.row.status" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" align="center" width="180" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button link type="primary" @click="openDetail('audit', scope.row.id)" v-if="scope.row.status != 3">
|
||||||
|
审核
|
||||||
|
</el-button>
|
||||||
|
<el-button link type="primary" @click="openDetail('review', scope.row.id)">
|
||||||
|
查看详情
|
||||||
|
</el-button>
|
||||||
|
<!-- <el-button
|
||||||
|
link
|
||||||
|
type="danger"
|
||||||
|
@click="handleDelete(scope.row.id)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!-- 分页 -->
|
||||||
|
<Pagination
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNo"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</ContentWrap>
|
||||||
|
</el-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
import download from '@/utils/download'
|
||||||
|
import * as StorageApi from '@/api/biz/storage'
|
||||||
|
import * as WarehouseApi from '@/api/biz/warehouse'
|
||||||
|
import * as UserApi from '@/api/system/user'
|
||||||
|
|
||||||
|
defineOptions({ name: 'Storage' })
|
||||||
|
import { useCommonStateWithOut } from '@/store/modules/common'
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
const { t } = useI18n() // 国际化
|
||||||
|
const router = useRouter() // 路由
|
||||||
|
const commonStore = useCommonStateWithOut()
|
||||||
|
const loading = ref(true) // 列表的加载中
|
||||||
|
const list = ref([]) // 列表的数据
|
||||||
|
const total = ref(0) // 列表的总页数
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
stockType: 2,
|
||||||
|
stockInType: undefined,
|
||||||
|
stockOutType: undefined,
|
||||||
|
stockNo: undefined,
|
||||||
|
headerNo: undefined,
|
||||||
|
description: undefined,
|
||||||
|
status: 2,
|
||||||
|
whId: undefined,
|
||||||
|
creator: undefined,
|
||||||
|
createTime: [],
|
||||||
|
updater: undefined,
|
||||||
|
updateTime: [],
|
||||||
|
keeper: undefined,
|
||||||
|
keeperTime: [],
|
||||||
|
outbound: undefined,
|
||||||
|
outboundTime: [],
|
||||||
|
cancel: undefined,
|
||||||
|
cancelTime: [],
|
||||||
|
matNo: undefined,
|
||||||
|
matName: undefined
|
||||||
|
})
|
||||||
|
const queryFormRef = ref() // 搜索的表单
|
||||||
|
const exportLoading = ref(false) // 导出的加载中
|
||||||
|
const warehouseList = ref([])
|
||||||
|
const userList = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
|
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
const data = await StorageApi.getStoragePage(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 openDetail = (active: string, id?: number) => {
|
||||||
|
commonStore.setStore('active', active)
|
||||||
|
commonStore.setStore('id', id)
|
||||||
|
router.push({ path: '/inventory/storageoutdetail', query: { type: active, id: id } })
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 初始化 **/
|
||||||
|
onMounted(async () => {
|
||||||
|
const queryParamsWarehouse = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 99
|
||||||
|
})
|
||||||
|
warehouseList.value = await WarehouseApi.getWarehouseSimpList()
|
||||||
|
|
||||||
|
|
||||||
|
userList.value = await UserApi.getSimpleUserList()
|
||||||
|
|
||||||
|
await getList()
|
||||||
|
})
|
||||||
|
onActivated(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
</script>
|
Loading…
Reference in new issue