mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
1、装配设置接口说明补充;2、新增单个装配设置查询接口;
This commit is contained in:
+16
-2
@@ -3,9 +3,11 @@ package com.cf.imes.module.system.controller.admin.assemblyconfig;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigImportReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigListRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigSaveReqVO;
|
||||
import com.cf.imes.module.system.service.assemblyconfig.AssemblyConfigService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
@@ -44,13 +46,21 @@ public class AssemblyConfigController {
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "查询装配设置")
|
||||
@Operation(summary = "查询组织装配设置列表")
|
||||
public CommonResult<List<AssemblyConfigListRespVO>> getAssemblyConfigList() {
|
||||
return CommonResult.success(assemblyConfigService.getOrgAssemblyConfigList());
|
||||
}
|
||||
|
||||
@GetMapping("/{configId}")
|
||||
@Operation(summary = "查询装配设置")
|
||||
@Parameter(name = "configId", description = "装配设置编号", required = true)
|
||||
public CommonResult<AssemblyConfigRespVO> getAssemblyConfig(@PathVariable Long configId) {
|
||||
return CommonResult.success(assemblyConfigService.getAssemblyConfig(configId));
|
||||
}
|
||||
|
||||
@PostMapping("/{configId}")
|
||||
@Operation(summary = "待选部件转加工部件")
|
||||
@Parameter(name = "configId", description = "装配设置编号", required = true)
|
||||
public CommonResult<Boolean> doConfig(@PathVariable Long configId) {
|
||||
assemblyConfigService.doConfig(configId);
|
||||
return CommonResult.success(true);
|
||||
@@ -58,6 +68,7 @@ public class AssemblyConfigController {
|
||||
|
||||
@PostMapping("/cover/{configId}")
|
||||
@Operation(summary = "覆盖原有加工部件")
|
||||
@Parameter(name = "configId", description = "装配设置编号", required = true)
|
||||
public CommonResult<Boolean> coverConfig(@PathVariable Long configId) {
|
||||
assemblyConfigService.coverConfig(configId);
|
||||
return CommonResult.success(true);
|
||||
@@ -65,13 +76,16 @@ public class AssemblyConfigController {
|
||||
|
||||
@PostMapping("/new/{configId}")
|
||||
@Operation(summary = "新增加工部件")
|
||||
public CommonResult<Boolean> newConfig(@PathVariable Long configId, @RequestParam("name") String name) {
|
||||
@Parameter(name = "configId", description = "装配设置编号", required = true)
|
||||
@Parameter(name = "name", description = "新装配设置名称", required = true)
|
||||
public CommonResult<Boolean> newConfig(@PathVariable Long configId, @RequestParam(value = "name") String name) {
|
||||
assemblyConfigService.newConfig(configId, name);
|
||||
return CommonResult.success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/configured/remove/{configId}")
|
||||
@Operation(summary = "删除已配置的加工部件,恢复到待选")
|
||||
@Parameter(name = "configId", description = "装配设置编号", required = true)
|
||||
public CommonResult<Boolean> removeConfigured(@PathVariable Long configId) {
|
||||
assemblyConfigService.removeConfigured(configId);
|
||||
return CommonResult.success(true);
|
||||
|
||||
+2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.assemblyconfig.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -13,6 +14,7 @@ import lombok.Data;
|
||||
@Data
|
||||
@Builder
|
||||
@Schema(description = "管理后台 - 装配设置 - 列表 Response VO")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class AssemblyConfigListRespVO {
|
||||
@Schema(description = "装配设置ID")
|
||||
private Long id;
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.cf.imes.module.system.controller.admin.assemblyconfig.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2026/2/27 16:11
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@Schema(description = "管理后台 - 装配设置 Response VO")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class AssemblyConfigRespVO {
|
||||
@Schema(description = "主键", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "装备设置名称", example = "张三")
|
||||
private String componentName;
|
||||
|
||||
@Schema(description = "描述", example = "描述")
|
||||
private AssemblyConfigStructureVO structure;
|
||||
}
|
||||
+1
-1
@@ -19,5 +19,5 @@ public class AssemblyConfigSaveReqVO {
|
||||
|
||||
@Schema(description = "装备设置树形结构", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "{assembly.config.save.structure.config.notNull}")
|
||||
private AssemblyConfigSaveStructureReqVO config;
|
||||
private AssemblyConfigSaveStructureVO config;
|
||||
}
|
||||
+3
-3
@@ -12,8 +12,8 @@ import java.util.List;
|
||||
* @since 2026/2/26 17:15
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "管理后台 - 装配设置保存树形结构 Request VO")
|
||||
public class AssemblyConfigSaveStructureReqVO {
|
||||
@Schema(description = "管理后台 - 装配设置保存树形结构 VO")
|
||||
public class AssemblyConfigSaveStructureVO {
|
||||
@Schema(description = "部件名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "门")
|
||||
private String name;
|
||||
|
||||
@@ -21,5 +21,5 @@ public class AssemblyConfigSaveStructureReqVO {
|
||||
private boolean process;
|
||||
|
||||
@Schema(description = "子部件列表")
|
||||
private List<AssemblyConfigSaveStructureReqVO> children;
|
||||
private List<AssemblyConfigSaveStructureVO> children;
|
||||
}
|
||||
+9
@@ -2,6 +2,7 @@ package com.cf.imes.module.system.service.assemblyconfig;
|
||||
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigImportReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigListRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigSaveReqVO;
|
||||
|
||||
import java.util.List;
|
||||
@@ -27,6 +28,14 @@ public interface AssemblyConfigService {
|
||||
*/
|
||||
List<AssemblyConfigListRespVO> getOrgAssemblyConfigList();
|
||||
|
||||
/**
|
||||
* 获取装配设置
|
||||
*
|
||||
* @param configId
|
||||
* @return
|
||||
*/
|
||||
AssemblyConfigRespVO getAssemblyConfig(Long configId);
|
||||
|
||||
/**
|
||||
* 待选部件转加工部件
|
||||
*
|
||||
|
||||
+24
-2
@@ -3,6 +3,7 @@ package com.cf.imes.module.system.service.assemblyconfig;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.crypto.digest.DigestUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.cf.imes.framework.common.enums.DeletedCodeEnum;
|
||||
@@ -16,8 +17,9 @@ import com.cf.imes.module.executor.api.ordercomponent.dto.OrderComponentListReqD
|
||||
import com.cf.imes.module.executor.api.ordercomponent.dto.OrderComponentListRespDTO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigImportReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigListRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigSaveReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigSaveStructureReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigSaveStructureVO;
|
||||
import com.cf.imes.module.system.controller.admin.assemblyconfig.vo.AssemblyConfigStructureVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.assemblyconfig.AssemblyConfigDO;
|
||||
import com.cf.imes.module.system.dal.mysql.assemblyconfig.AssemblyConfigMapper;
|
||||
@@ -236,6 +238,26 @@ public class AssemblyConfigServiceImpl implements AssemblyConfigService {
|
||||
return BeanUtil.copyToList(list, AssemblyConfigListRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AssemblyConfigRespVO getAssemblyConfig(Long configId) {
|
||||
Long organId = SecurityFrameworkUtils.getUserOrganId();
|
||||
|
||||
// 1、校验本身
|
||||
AssemblyConfigDO assemblyConfigDO = getById(configId, organId);
|
||||
|
||||
// 2、只有已配置才能查看
|
||||
AssertUtils.notEquals(assemblyConfigDO.getStatus(), AssemblyConfigStatusEnum.CONFIGURED.getStatus(), ASSEMBLY_CONFIG_NOT_EXIST);
|
||||
|
||||
// 3、解压结构
|
||||
AssemblyConfigStructureVO structure = JSON.parseObject(JsonUtils.unzipString(assemblyConfigDO.getStructureJson()), AssemblyConfigStructureVO.class);
|
||||
|
||||
return AssemblyConfigRespVO.builder()
|
||||
.id(assemblyConfigDO.getId())
|
||||
.componentName(assemblyConfigDO.getComponentName())
|
||||
.structure(structure)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询部件设置
|
||||
*
|
||||
@@ -368,7 +390,7 @@ public class AssemblyConfigServiceImpl implements AssemblyConfigService {
|
||||
AssemblyConfigDO assemblyConfigDO = getById(reqVO.getId(), organId);
|
||||
|
||||
// 2、更新hash和json
|
||||
AssemblyConfigSaveStructureReqVO config = reqVO.getConfig();
|
||||
AssemblyConfigSaveStructureVO config = reqVO.getConfig();
|
||||
|
||||
AssemblyConfigStructureVO structureVO = BeanUtil.toBean(config, AssemblyConfigStructureVO.class);
|
||||
computeHashRecursively(structureVO);
|
||||
|
||||
Reference in New Issue
Block a user