Merge branch 'main' into 'LiuZt'

# Conflicts:
#   cf-module-system/cf-module-system-api/src/main/java/com/cf/imes/module/system/enums/ErrorCodeConstants.java
#   cf-module-system/cf-module-system-biz/src/main/java/com/cf/imes/module/system/service/process/ProcessGroupService.java
#   cf-module-system/cf-module-system-biz/src/test/java/com/cf/imes/module/system/service/process/GroupServiceImplTest.java
This commit is contained in:
刘照田
2024-04-26 09:03:38 +00:00
496 changed files with 25208 additions and 7444 deletions
@@ -0,0 +1,23 @@
package com.cf.imes.module.system.api.dataSource;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author Beal
*/
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰:fallbackFactory =
@Tag(name = "RPC 服务 - 数据源")
public interface DataSourceApi {
String PREFIX = ApiConstants.PREFIX + "/dataSource";
@GetMapping(PREFIX + "/getSqlById")
@Operation(summary = "获得数据源sql")
CommonResult<String> getSqlById(@RequestParam(value = "id") Long id);
}
@@ -17,7 +17,7 @@ public class DeptRespDTO {
private Long parentId;
@Schema(description = "负责人的用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Long leaderUserId;
private String leader;
@Schema(description = "部门状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer status; // 参见 CommonStatusEnum 枚举
@@ -0,0 +1,45 @@
package com.cf.imes.module.system.api.machine;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.system.api.machine.dto.CuttingRespDTO;
import com.cf.imes.module.system.api.machine.dto.MachineDTO;
import com.cf.imes.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Collection;
import java.util.List;
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰:fallbackFactory =
@Tag(name = "RPC 服务 - 机台")
public interface MachineApi {
String PREFIX = ApiConstants.PREFIX + "/machine";
@GetMapping(PREFIX + "/get-cutting")
@Operation(summary = "获得开料机台信息")
@Parameter(name = "id", description = "机台id", example = "1024", required = true)
CommonResult<CuttingRespDTO> getCutting(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/get-drill")
@Operation(summary = "获得钻孔机台信息")
@Parameter(name = "id", description = "机台id", example = "1024", required = true)
CommonResult<CuttingRespDTO> getDrill(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/list")
@Operation(summary = "获得机台基本信息列表")
@Parameter(name = "ids", description = "机台id", example = "1024", required = true)
CommonResult<List<CuttingRespDTO>> list(@RequestParam("ids") Collection<Long> ids);
@GetMapping(PREFIX + "/get-machine-detail")
@Operation(summary = "获得机台详情")
@Parameter(name = "id", description = "机台id", example = "1024", required = true)
CommonResult<MachineDTO> getMachineDetail(@RequestParam("id") Long id);
}
@@ -0,0 +1,25 @@
package com.cf.imes.module.system.api.machine.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 机台 Response VO")
@Data
public class CuttingRespDTO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14092")
private Long id;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
private String name;
@Schema(description = "1机台设备 2CNC设备", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
private Integer machineType;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}
@@ -0,0 +1,38 @@
package com.cf.imes.module.system.api.machine.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
/**
* @author Beal
*
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class MachineDTO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14092")
private Long id;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
private String name;
@Schema(description = "1机台设备 2CNC设备", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
private Integer machineType;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "机台配置")
private String setting;
@Schema(description = "标签配置")
private String label;
}
@@ -26,6 +26,8 @@ public interface OAuth2TokenApi {
@SuppressWarnings("HttpUrlsUsage")
String URL_CHECK = "http://" + ApiConstants.NAME + PREFIX + "/check";
String URL_ORGAN = "http://" + ApiConstants.NAME + PREFIX + "/getOrganIdByToken";
@PostMapping(PREFIX + "/create")
@Operation(summary = "创建访问令牌")
CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(@Valid @RequestBody OAuth2AccessTokenCreateReqDTO reqDTO);
@@ -49,4 +51,10 @@ public interface OAuth2TokenApi {
CommonResult<OAuth2AccessTokenRespDTO> refreshAccessToken(@RequestParam("refreshToken") String refreshToken,
@RequestParam("clientId") String clientId);
@GetMapping(PREFIX + "/getOrganIdByToken")
@Operation(summary = "通过访问令牌获取组织id")
@Parameter(name = "accessToken", description = "访问令牌", required = true, example = "tudou")
CommonResult<Long> getOrganIdByToken(@RequestParam("accessToken") String accessToken);
}
@@ -30,5 +30,9 @@ public class OAuth2AccessTokenCheckRespDTO implements Serializable {
private Integer tableNo;
@Schema(description = "数据源编码")
private String dataCode;
@Schema(description = "用户昵称")
private String nickname;
@Schema(description = "是否超级管理员")
private Boolean isSupAdmin;
}
@@ -28,5 +28,10 @@ public class OAuth2AccessTokenCreateReqDTO implements Serializable {
@Schema(description = "授权范围的数组", example = "user_info")
private List<String> scopes;
@Schema(description = "组织id")
private Long organId;
@Schema(description = "数据源标识")
private String dataCode;
@Schema(description = "用户昵称")
private String nickname;
}
@@ -0,0 +1,23 @@
package com.cf.imes.module.system.api.process;
import com.cf.imes.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(name = ApiConstants.NAME) // TODO 晨丰:fallbackFactory =
@Tag(name = "RPC 服务 - 工序以及工序组")
public interface ProcessGroupApi {
String PREFIX = ApiConstants.PREFIX + "/process-group";
@GetMapping(PREFIX + "/get")
@Operation(summary = "工序组是否存在")
@Parameter(name = "groupId", description = "工序组编号", required = true, example = "1024")
Boolean getProcessGroup(@RequestParam("groupId") Long groupId);
}
@@ -0,0 +1,32 @@
package com.cf.imes.module.system.api.process.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
@Schema(description = "RPC 服务 - ProcessGroup 工序 Response DTO")
@Data
public class ProcessListReqDTO {
@Schema(description = "工序组 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10725")
private Long id;
@Schema(description = "工序组名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
private String name;
@Schema(description = "是否默认工序组:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean isDefault;
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
private Short sort;
@Schema(description = "明细,工序 ID 逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED)
private String items;
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
private String description;
@Schema(description = "工序列表", requiredMode = Schema.RequiredMode.REQUIRED)
private List<ProcessRespDTO> lists;
}
@@ -0,0 +1,55 @@
package com.cf.imes.module.system.api.process.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "RPC 服务 - Process 工序 Response DTO")
@Data
public class ProcessRespDTO {
@Schema(description = "工序 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20453")
private Long id;
@Schema(description = "工序名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
private String name;
@Schema(description = "计件工资", requiredMode = Schema.RequiredMode.REQUIRED)
private Double pieceRate;
@Schema(description = "计件类型:1 数量 2 长度 3 平方 4 宽 5 高 6 体积 7 生产单金额百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer pieceType;
@Schema(description = "工序类型:0 全部加工 1 开料 2 部件加工 3 异形封边 4 分堆 5 打包 6 出库 7 组件加工 8 板材", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
private Integer type;
@Schema(description = "是否推送终端客户:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean isCustom;
private Boolean isDealer;
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
private Short sort;
@Schema(description = "小时产量", requiredMode = Schema.RequiredMode.REQUIRED)
private Double hourCapacity;
@Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED)
private String unit;
@Schema(description = "是否启用:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean isEnabled;
@Schema(description = "准备时间", requiredMode = Schema.RequiredMode.REQUIRED)
private Double prepareTime;
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
private String description;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "工序中的用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12,13")
private String users;
}
@@ -3,7 +3,9 @@ package com.cf.imes.module.system.api.user;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.framework.common.util.collection.CollectionUtils;
import com.cf.imes.module.system.api.user.dto.AdminUserRespDTO;
import com.cf.imes.module.system.api.user.dto.OrganAdminUserRespDTO;
import com.cf.imes.module.system.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
@@ -58,4 +60,18 @@ public interface AdminUserApi {
@Parameter(name = "ids", description = "用户编号数组", example = "3,5", required = true)
CommonResult<Boolean> validateUserList(@RequestParam("ids") Set<Long> ids);
@GetMapping(PREFIX + "/validUser")
@Operation(summary = "通过用户名称获取用户信息")
@Parameters({
@Parameter(name = "name", description = "用户名称", example = "1", required = true),
@Parameter(name = "organId", description = "组织编号", example = "晨丰科技", required = true)
})
CommonResult<AdminUserRespDTO> validateUser(@RequestParam("name") String name, @RequestParam("organId") Long organId);
@GetMapping(PREFIX + "/getOrganAdminByOrganIds")
@Operation(summary = "通过组织 ID 查询组织管理员用户列表")
@Parameter(name = "organIds", description = "组织id列表", example = "1,3", required = true)
CommonResult<List<OrganAdminUserRespDTO>> getOrganAdminByOrganIds(@RequestParam("id") Collection<Long> organIds);
}
@@ -0,0 +1,26 @@
package com.cf.imes.module.system.api.user.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author Beal
* 组织管理员用户信息
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class OrganAdminUserRespDTO {
@Schema(description = "组织id")
private Long organId;
@Schema(description = "用户id")
private Long userId;
@Schema(description = "用户昵称")
private String nickname;
@Schema(description = "用户账号")
private String username;
}
@@ -26,4 +26,9 @@ public interface DictTypeConstants {
String SMS_SEND_STATUS = "system_sms_send_status"; // 短信发送状态
String SMS_RECEIVE_STATUS = "system_sms_receive_status"; // 短信接收状态
String YPOGRAPHY_TYPE = "ypographyType"; // 排版面
String GRAIN_TYPE = "grainType";//纹路类型
String DOOR_OPENING_DIRECTIONS = "doorOpeningDirections";//开门方向
String PRODUCT_TYPE = "productType";//产品类型
String SYNTHESIS_TYPE = "synthesisType";//订单状态
}
@@ -32,6 +32,7 @@ public interface ErrorCodeConstants {
ErrorCode ROLE_CAN_NOT_UPDATE_SYSTEM_TYPE_ROLE = new ErrorCode(1_002_002_003, "不能操作类型为系统内置的角色");
ErrorCode ROLE_IS_DISABLE = new ErrorCode(1_002_002_004, "名字为【{}】的角色已被禁用");
ErrorCode ROLE_ADMIN_CODE_ERROR = new ErrorCode(1_002_002_005, "编码【{}】不能使用");
ErrorCode ROLE_ME_ERROR = new ErrorCode(1_002_002_006, "不可为自身分配角色");
// ========== 用户模块 1-002-003-000 ==========
ErrorCode USER_USERNAME_EXISTS = new ErrorCode(1_002_003_000, "用户账号已经存在");
@@ -42,6 +43,7 @@ public interface ErrorCodeConstants {
ErrorCode USER_PASSWORD_FAILED = new ErrorCode(1_002_003_005, "用户密码校验失败");
ErrorCode USER_IS_DISABLE = new ErrorCode(1_002_003_006, "名字为【{}】的用户已被禁用");
ErrorCode USER_COUNT_MAX = new ErrorCode(1_002_003_008, "创建用户失败,原因:超过组织最大组织配额({})!");
ErrorCode USER_ME_ERROR = new ErrorCode(1_002_003_009, "不可操作用户自身");
// ========== 部门模块 1-002-004-000 ==========
ErrorCode DEPT_NAME_DUPLICATE = new ErrorCode(1_002_004_000, "已经存在该名字的部门");
@@ -109,11 +111,14 @@ public interface ErrorCodeConstants {
ErrorCode ORGAN_CAN_NOT_UPDATE_SYSTEM = new ErrorCode(1_002_015_003, "系统组织不能进行修改、删除等操作!");
ErrorCode ORGAN_NAME_DUPLICATE = new ErrorCode(1_002_015_004, "名字为【{}】的组织已存在");
ErrorCode ORGAN_WEBSITE_DUPLICATE = new ErrorCode(1_002_015_005, "域名为【{}】的组织已存在");
ErrorCode ORGAN_DATA_CODE_NOT_EXISTS = new ErrorCode(1_002_015_006, "组织未配置数据源标识");
// ========== 组织套餐 1-002-016-000 ==========
ErrorCode TENANT_PACKAGE_NOT_EXISTS = new ErrorCode(1_002_016_000, "组织套餐不存在");
ErrorCode TENANT_PACKAGE_USED = new ErrorCode(1_002_016_001, "组织正在使用该套餐,请给组织重新设置套餐后再尝试删除");
ErrorCode TENANT_PACKAGE_DISABLE = new ErrorCode(1_002_016_002, "名字为【{}】的组织套餐已被禁用");
ErrorCode TENANT_PACKAGE_DEPT_EXIT = new ErrorCode(1_002_016_003, "无法修改内置组织权限套餐");
ErrorCode TENANT_PACKAGE_DELETED_EXIT = new ErrorCode(1_002_016_004, "无法删除内置组织权限套餐");
// ========== 错误码模块 1-002-017-000 ==========
ErrorCode ERROR_CODE_NOT_EXISTS = new ErrorCode(1_002_017_000, "错误码不存在");
@@ -174,6 +179,8 @@ public interface ErrorCodeConstants {
//=========== 工序信息 1-002-028-000 ============
ErrorCode PROCESS_NOT_EXISTS = new ErrorCode(1_002_028_000, "工序不存在");
ErrorCode PROCESS_ID_IS_NULL = new ErrorCode(1_002_028_000, "工序ID填写错误不存在");
ErrorCode PROCESS_STATUS_DISABLE = new ErrorCode(1_002_028_000, "工序状态以已禁用");
//=========== 工序组信息 1-002-029-000 ============
ErrorCode PROCESS_GROUP_NOT_EXISTS = new ErrorCode(1_002_029_000, "工序组不存在");
@@ -182,10 +189,17 @@ public interface ErrorCodeConstants {
ErrorCode MACHINE_NOT_EXISTS = new ErrorCode(1_002_029_000, "机台不存在");
ErrorCode MACHINE_TEMPLATE_NOT_EXISTS = new ErrorCode(1_002_029_001, "机台模板不存在");
ErrorCode DEFAULT_TEMPLATE_COUNT = new ErrorCode(1_002_029_002, "默认模板数量异常");
ErrorCode DEFAULT_TEMPLATE_NOT_EXISTS = new ErrorCode(1_002_029_003, "该类型机台默认模板不存在");
ErrorCode DEFAULT_TEMPLATE_NOT_DELETED = new ErrorCode(1_002_029_004, "不能删除默认模板");
ErrorCode NOT_TEMPLATE_AUTH = new ErrorCode(1_002_029_005, "该组织无此机台模板权限");
ErrorCode NOT_MACHINE_AUTH = new ErrorCode(1_002_029_005, "该组织无此机台权限");
// ========== 标签模板 1-002-300-000 ==========
ErrorCode LABEL_TEMPLATE_NOT_EXISTS = new ErrorCode(1_002_300_000, "标签模板不存在");
ErrorCode LABEL_NOT_EXISTS = new ErrorCode(1_002_300_001, "标签不存在");
ErrorCode DEFAULT_LABEL_NOT_EXISTS = new ErrorCode(1_002_300_002, "该类型标签默认模板不存在");
ErrorCode MACHINE_USE_LABEL = new ErrorCode(1_002_300_003, "无法删除已有机台使用标签");
ErrorCode DEFAULT_NOT_DELETED = new ErrorCode(1_002_300_004, "默认标签模板无法删除");
// ========== 系统数据源 1_002_301_000 ==========
ErrorCode DATA_SOURCE_NOT_EXISTS = new ErrorCode(1_002_301_000, "系统数据源不存在");
@@ -201,14 +215,38 @@ public interface ErrorCodeConstants {
//=========== 板材信息 1-002-033-000 ============
ErrorCode REMAIN_PLATE_NOT_EXISTS = new ErrorCode(1_002_032_002, "板材不存在");
//=========== 板材信息 1-002-034-000 ============
ErrorCode PROCESS_USER_NOT_EXISTS = new ErrorCode(1_002_032_002, "工序用户不存在");
ErrorCode PROCESS_USER_EXISTS = new ErrorCode(1_002_032_003, "工序用户存在");
<<<<<<< cf-module-system/cf-module-system-api/src/main/java/com/cf/imes/module/system/enums/ErrorCodeConstants.java
//=========== 工序的生产状态 1-002-034-000 ============
ErrorCode UNPROCESSED_BEFORE_PROCESSING = new ErrorCode(1_002_034_001, "未加工状态方可进行加工");
ErrorCode UNPROCESSED_BEFORE_PROCESSING = new ErrorCode(1_002_034_666, "未加工状态方可进行加工");
// ========== 新增外部配件 1-002-035-000 ==========
ErrorCode THE_ACCESSORY_NAME_CANNOT_BE_DUPLICATED = new ErrorCode(1_002_035_001, "配件名称不能重复");
ErrorCode THE_ACCESSORY_NAME_CANNOT_BE_DUPLICATED = new ErrorCode(1_002_035_666, "配件名称不能重复");
=======
//=========== 板材信息 1-002-035-000 ============
ErrorCode RAW_GOODS_NOT_EXISTS = new ErrorCode(1_002_033_001, "设计板材不存再");
ErrorCode RAW_GOODS_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_002_033_002, "生产板材导入数据不可以为空");
//=========== 配件信息 1-002-035-000 ============
ErrorCode ORDER_PARTS_IMPORT_LIST_IS_EMPTY = new ErrorCode(1_002_034_001, "生产配件导入数据不可以为空");
//=========== 柜体信息 1-002-035-000 ============
ErrorCode ORDER_BODY_NOT_EXISTS = new ErrorCode(1_002_035_001, "柜体信息不存在");
//=========== 柜体信息 1-002-035-000 ============
ErrorCode ORDER_GROUP_NOT_EXISTS = new ErrorCode(1_002_036_001, "加工组信息不存在");
//=========== 应用信息 1-002-037-000 ============
ErrorCode APPLICATION_NOT_EXISTS = new ErrorCode(1_002_037_001, "应用信息不存在");
ErrorCode APPLICATION_LOGIN_USER_DISABLED = new ErrorCode(1_002_037_001, "应用登陆失败");
ErrorCode ERR = new ErrorCode(1_002_038_001, "未知错误");
>>>>>>> cf-module-system/cf-module-system-api/src/main/java/com/cf/imes/module/system/enums/ErrorCodeConstants.java
}