mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
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:
+23
@@ -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);
|
||||
}
|
||||
+1
-1
@@ -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 枚举
|
||||
|
||||
+45
@@ -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);
|
||||
|
||||
}
|
||||
+25
@@ -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;
|
||||
|
||||
|
||||
}
|
||||
+38
@@ -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;
|
||||
}
|
||||
+8
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
+6
-1
@@ -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;
|
||||
}
|
||||
|
||||
+23
@@ -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);
|
||||
|
||||
}
|
||||
+32
@@ -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;
|
||||
|
||||
}
|
||||
+55
@@ -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;
|
||||
|
||||
}
|
||||
+16
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
+26
@@ -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;
|
||||
}
|
||||
+5
@@ -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";//订单状态
|
||||
}
|
||||
|
||||
+40
-2
@@ -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
|
||||
}
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.system.api.datasource;
|
||||
|
||||
import com.cf.imes.framework.common.exception.ErrorCode;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.module.system.api.dataSource.DataSourceApi;
|
||||
import com.cf.imes.module.system.dal.dataobject.datasource.DataSourceDO;
|
||||
import com.cf.imes.module.system.dal.mysql.datasource.DataSourceMapper;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
@RestController
|
||||
public class DataSourceApiImpl implements DataSourceApi {
|
||||
|
||||
@Resource
|
||||
private DataSourceMapper dataSourceMapper;
|
||||
|
||||
@Override
|
||||
public CommonResult<String> getSqlById(Long id) {
|
||||
DataSourceDO dataSourceDO = dataSourceMapper.selectById(id);
|
||||
if(Objects.isNull(dataSourceDO)) {
|
||||
throw exception(new ErrorCode(2133,"数据源不存在"));
|
||||
}
|
||||
return CommonResult.success(dataSourceDO.getSqlStr()) ;
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package com.cf.imes.module.system.api.machine;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.json.JsonUtils;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
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.controller.admin.label.vo.LabelRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.CuttingRespVO;
|
||||
import com.cf.imes.module.system.service.lable.LabelService;
|
||||
import com.cf.imes.module.system.service.machine.MachineService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class MachineApiImpl implements MachineApi {
|
||||
|
||||
@Resource
|
||||
private MachineService machineService;
|
||||
|
||||
@Resource
|
||||
private LabelService labelService;
|
||||
|
||||
@Override
|
||||
public CommonResult<CuttingRespDTO> getCutting(Long id) {
|
||||
return success(BeanUtils.toBean(machineService.getCutting(id), CuttingRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<CuttingRespDTO> getDrill(Long id) {
|
||||
return success(BeanUtils.toBean(machineService.getDrill(id), CuttingRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<CuttingRespDTO>> list(Collection<Long> ids) {
|
||||
return success(BeanUtils.toBean(machineService.list(ids), CuttingRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<MachineDTO> getMachineDetail(Long id) {
|
||||
CuttingRespVO cutting = machineService.getCutting(id);
|
||||
LabelRespVO label = labelService.getLabel(cutting.getLabelId());
|
||||
MachineDTO machineDTO = MachineDTO.builder()
|
||||
.id(cutting.getId())
|
||||
.machineType(cutting.getMachineType())
|
||||
.name(cutting.getName())
|
||||
.setting(cutting.getMachineSettingDO().toJSONString())
|
||||
.label(JsonUtils.toJsonString(label))
|
||||
.build();
|
||||
return success(machineDTO);
|
||||
}
|
||||
}
|
||||
+11
-4
@@ -34,20 +34,21 @@ public class OAuth2TokenApiImpl implements OAuth2TokenApi {
|
||||
@Override
|
||||
@Operation(description = "创建访问令牌")
|
||||
public CommonResult<OAuth2AccessTokenRespDTO> createAccessToken(OAuth2AccessTokenCreateReqDTO reqDTO) {
|
||||
Long organId = OrganContextHolder.getOrganId();
|
||||
/* Long organId = OrganContextHolder.getOrganId();
|
||||
OrganizationDO organ = organService.getOrgan(organId);
|
||||
if(Objects.isNull(organ)) {
|
||||
throw new ServerException(10023,"组织不存在");
|
||||
}
|
||||
}*/
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.createAccessToken(
|
||||
reqDTO.getUserId(), reqDTO.getUserType(), reqDTO.getClientId(), reqDTO.getScopes(),organ.getLarge(), organ.getDbNo(), organ.getTableNo(), organ.getDataSourceCode());
|
||||
reqDTO.getUserId(), reqDTO.getUserType(), reqDTO.getClientId(), reqDTO.getScopes(), null, null, null, reqDTO.getDataCode(), reqDTO.getOrganId(), reqDTO.getNickname());
|
||||
return success(BeanUtils.toBean(accessTokenDO, OAuth2AccessTokenRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<OAuth2AccessTokenCheckRespDTO> checkAccessToken(String accessToken) {
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.checkAccessToken(accessToken);
|
||||
return success(BeanUtils.toBean(accessTokenDO, OAuth2AccessTokenCheckRespDTO.class));
|
||||
OAuth2AccessTokenCheckRespDTO bean = BeanUtils.toBean(accessTokenDO, OAuth2AccessTokenCheckRespDTO.class);
|
||||
return success(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,4 +63,10 @@ public class OAuth2TokenApiImpl implements OAuth2TokenApi {
|
||||
return success(BeanUtils.toBean(accessTokenDO, OAuth2AccessTokenRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Long> getOrganIdByToken(String accessToken) {
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2TokenService.checkAccessToken(accessToken);
|
||||
return success(accessTokenDO.getOrganId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-1
@@ -36,7 +36,8 @@ public class PermissionApiImpl implements PermissionApi {
|
||||
|
||||
@Override
|
||||
public CommonResult<DeptDataPermissionRespDTO> getDeptDataPermission(Long userId) {
|
||||
return success(permissionService.getDeptDataPermission(userId));
|
||||
DeptDataPermissionRespDTO deptDataPermission = permissionService.getDeptDataPermission(userId);
|
||||
return success(deptDataPermission);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.cf.imes.module.system.api.process;
|
||||
|
||||
import com.cf.imes.module.system.dal.mysql.process.ProcessGroupMapper;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.PROCESS_GROUP_NOT_EXISTS;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class ProcessGroupApiImpl implements ProcessGroupApi {
|
||||
|
||||
@Resource
|
||||
private ProcessGroupMapper processGroupMapper;
|
||||
|
||||
@Override
|
||||
public Boolean getProcessGroup(Long groupId) {
|
||||
if (processGroupMapper.selectById(groupId) == null)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+13
@@ -3,6 +3,7 @@ package com.cf.imes.module.system.api.user;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
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.dal.dataobject.user.AdminUserDO;
|
||||
import com.cf.imes.module.system.service.user.AdminUserService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -52,4 +53,16 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<AdminUserRespDTO> validateUser(String name, Long organId) {
|
||||
AdminUserDO user = userService.getUserByUsername(name, organId);
|
||||
return success(BeanUtils.toBean(user, AdminUserRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<OrganAdminUserRespDTO>> getOrganAdminByOrganIds(Collection<Long> organIds) {
|
||||
return success(userService.getOrganAdminByOrganIds(organIds));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.cf.imes.module.system.controller.admin.application;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationPageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.application.ApplicationSaveReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.application.vo.auth.ApplicationLoginRespVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.application.ApplicationDO;
|
||||
import com.cf.imes.module.system.service.application.ApplicationService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 应用注册信息")
|
||||
@RestController
|
||||
@RequestMapping("/system/application")
|
||||
@Validated
|
||||
public class ApplicationController {
|
||||
|
||||
@Resource
|
||||
private ApplicationService applicationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "新建应用注册")
|
||||
@PreAuthorize("@ss.hasPermission('system:application:create')")
|
||||
public CommonResult<Integer> createApplication(@Valid @RequestBody ApplicationSaveReqVO createReqVO) {
|
||||
return success(applicationService.createApplication(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新应用注册")
|
||||
@PreAuthorize("@ss.hasPermission('system:application:update')")
|
||||
public CommonResult<Boolean> updateApplication(@Valid @RequestBody ApplicationSaveReqVO updateReqVO) {
|
||||
applicationService.updateApplication(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除应用注册")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:application:delete')")
|
||||
public CommonResult<Boolean> deleteApplication(@RequestParam("id") Long id) {
|
||||
applicationService.deleteApplication(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得应用注册")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:application:query')")
|
||||
public CommonResult<ApplicationRespVO> getApplication(@RequestParam("id") Long id) {
|
||||
ApplicationDO applicationDO = applicationService.getApplication(id);
|
||||
return success(BeanUtils.toBean(applicationDO, ApplicationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得应用注册分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:application:query')")
|
||||
public CommonResult<PageResult<ApplicationRespVO>> getApplicationPage(@Valid ApplicationPageReqVO pageReqVO) {
|
||||
PageResult<ApplicationDO> pageResult = applicationService.getApplicationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ApplicationRespVO.class));
|
||||
}
|
||||
|
||||
@PostMapping("/appLogin")
|
||||
@Operation(summary = "应用登陆")
|
||||
@PreAuthorize("@ss.hasPermission('system:application:create')")
|
||||
public CommonResult<ApplicationLoginRespVO> loginApplication(@Valid @RequestBody ApplicationRespVO applicationRespVO) {
|
||||
return success(applicationService.loginApplication(applicationRespVO));
|
||||
}
|
||||
|
||||
}
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package com.cf.imes.module.system.controller.admin.application.vo.application;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.cf.imes.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 ApplicationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "应用标识", example = "okk")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "应用密钥", example = "121gfrsg5sb4gs")
|
||||
private String appKey;
|
||||
|
||||
@Schema(description = "服务器IP列表", example = "0.0.0.0")
|
||||
private String serverIp;
|
||||
|
||||
@Schema(description = "应用简称")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "应用名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "应用主体")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "状态: 0停用,1正常")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package com.cf.imes.module.system.controller.admin.application.vo.application;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 应用注册表 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ApplicationRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4109")
|
||||
@ExcelProperty("主键")
|
||||
private int id;
|
||||
|
||||
@Schema(description = "应用标识", example = "okk")
|
||||
@ExcelProperty("应用标识")
|
||||
private String appId;
|
||||
|
||||
@Schema(description = "应用密钥", example = "121gfrsg5sb4gs")
|
||||
@ExcelProperty("应用密钥")
|
||||
private String appKey;
|
||||
|
||||
@Schema(description = "服务器IP列表", example = "0.0.0.0")
|
||||
@ExcelProperty("服务器IP列表")
|
||||
private String serverIp;
|
||||
|
||||
@Schema(description = "应用简称")
|
||||
@ExcelProperty("应用简称")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "应用名")
|
||||
@ExcelProperty("应用名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "应用主体")
|
||||
@ExcelProperty("应用主体")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "状态: 0停用,1正常")
|
||||
@ExcelProperty("状态")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.cf.imes.module.system.controller.admin.application.vo.application;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 应用注册表新增/修改 Request VO")
|
||||
@Data
|
||||
public class ApplicationSaveReqVO{
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4109")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "应用标识", example = "okk")
|
||||
@NotNull(message = "应用标识不能为空")
|
||||
private String appId;
|
||||
|
||||
// @Schema(description = "应用密钥", example = "121gfrsg5sb4gs")
|
||||
// @NotNull(message = "应用密钥不能为空")
|
||||
// private String appKey;
|
||||
|
||||
// private String appSecret;
|
||||
|
||||
@Schema(description = "服务器IP列表", example = "0.0.0.0")
|
||||
@NotNull(message = "服务器IP列表不能为空")
|
||||
private String serverIp;
|
||||
|
||||
@Schema(description = "应用简称")
|
||||
@NotNull(message = "应用简称不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "应用名")
|
||||
@NotNull(message = "应用名不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "应用主体")
|
||||
@NotNull(message = "应用主体不能为空")
|
||||
private String company;
|
||||
|
||||
@Schema(description = "状态: 0停用,1正常")
|
||||
@NotNull(message = "不能为空")
|
||||
private Boolean status;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.cf.imes.module.system.controller.admin.application.vo.auth;
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 应用登录 Response VO")
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
public class ApplicationLoginRespVO {
|
||||
|
||||
@Schema(description = "应用编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Integer appId;
|
||||
|
||||
@Schema(description = "访问令牌", requiredMode = Schema.RequiredMode.REQUIRED, example = "happy")
|
||||
private String accessToken;
|
||||
|
||||
@Schema(description = "刷新令牌", requiredMode = Schema.RequiredMode.REQUIRED, example = "nice")
|
||||
private String refreshToken;
|
||||
|
||||
@Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime expiresTime;
|
||||
|
||||
}
|
||||
+6
-3
@@ -113,12 +113,15 @@ public class AuthController {
|
||||
if (CollUtil.isEmpty(roleIds)) {
|
||||
return success(AuthConvert.INSTANCE.convert(user, Collections.emptyList(), Collections.emptyList()));
|
||||
}
|
||||
List<RoleDO> roles = roleService.getRoleList(roleIds);
|
||||
//List<RoleDO> roles = roleService.getRoleList(roleIds);
|
||||
List<RoleDO> roles = roleService.getRoleList1(roleIds);
|
||||
roles.removeIf(role -> !CommonStatusEnum.ENABLE.getStatus().equals(role.getStatus())); // 移除禁用的角色
|
||||
|
||||
// 1.3 获得菜单列表
|
||||
Set<Long> menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId));
|
||||
List<MenuDO> menuList = menuService.getMenuList(menuIds);
|
||||
//Set<Long> menuIds = permissionService.getRoleMenuListByRoleId(convertSet(roles, RoleDO::getId));
|
||||
Set<Long> menuIds = permissionService.getRoleMenuListByRoleId2(convertSet(roles, RoleDO::getId));
|
||||
//List<MenuDO> menuList = menuService.getMenuList(menuIds);
|
||||
List<MenuDO> menuList = menuService.getMenuList1(menuIds);
|
||||
menuList.removeIf(menu -> !CommonStatusEnum.ENABLE.getStatus().equals(menu.getStatus())); // 移除禁用的菜单
|
||||
|
||||
// 2. 拼接结果返回
|
||||
|
||||
+2
@@ -44,6 +44,8 @@ public class AuthPermissionInfoRespVO {
|
||||
@Schema(description = "用户头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.cf.com/xx.jpg")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
}
|
||||
|
||||
@Schema(description = "管理后台 - 登录用户的菜单信息 Response VO")
|
||||
|
||||
+12
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.datasource;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -38,7 +39,7 @@ public class DataSourceController {
|
||||
@Resource
|
||||
private DataSourceService dataSourceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
/* @PostMapping("/create")
|
||||
@Operation(summary = "创建系统数据源")
|
||||
@PreAuthorize("@ss.hasPermission('system:data-source:create')")
|
||||
public CommonResult<Long> createDataSource(@Valid @RequestBody DataSourceSaveReqVO createReqVO) {
|
||||
@@ -77,6 +78,16 @@ public class DataSourceController {
|
||||
public CommonResult<PageResult<DataSourceRespVO>> getDataSourcePage(@Valid DataSourcePageReqVO pageReqVO) {
|
||||
PageResult<DataSourceDO> pageResult = dataSourceService.getDataSourcePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DataSourceRespVO.class));
|
||||
}*/
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得系统数据源列表")
|
||||
//@PreAuthorize("@ss.hasPermission('system:data-source:query')")
|
||||
public CommonResult<List<DataSourceRespVO>> list( ) {
|
||||
return success(dataSourceService.list());
|
||||
|
||||
/*List<DataSourceDO> list =
|
||||
return success(BeanUtils.toBean(list, DataSourceRespVO.class));*/
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ public class DataSourcePageReqVO extends PageParam {
|
||||
private String name;
|
||||
|
||||
@Schema(description = "sql")
|
||||
private String sql;
|
||||
private String sqlStr;
|
||||
|
||||
@Schema(description = "数据源类型", example = "2")
|
||||
private Integer type;
|
||||
|
||||
+5
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.datasource.vo;
|
||||
|
||||
import com.cf.imes.module.system.dal.dataobject.datasource.DataSourceFiledDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
@@ -23,7 +24,7 @@ public class DataSourceRespVO {
|
||||
|
||||
@Schema(description = "sql", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("sql")
|
||||
private String sql;
|
||||
private String sqlStr;
|
||||
|
||||
@Schema(description = "数据源类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("数据源类型")
|
||||
@@ -33,4 +34,7 @@ public class DataSourceRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "字段列表")
|
||||
private List<DataSourceFiledDO> filedList;
|
||||
|
||||
}
|
||||
+1
-1
@@ -58,7 +58,7 @@ public class DeptController {
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取部门列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:dept:query')")
|
||||
//@PreAuthorize("@ss.hasPermission('system:dept:query')")
|
||||
public CommonResult<List<DeptRespVO>> getDeptList(DeptListReqVO reqVO) {
|
||||
List<DeptDO> list = deptService.getDeptList(reqVO);
|
||||
return success(BeanUtils.toBean(list, DeptRespVO.class));
|
||||
|
||||
+2
-2
@@ -75,9 +75,9 @@ public class PostController {
|
||||
|
||||
@GetMapping(value = {"/list-all-simple", "simple-list"})
|
||||
@Operation(summary = "获取岗位全列表", description = "只包含被开启的岗位,主要用于前端的下拉选项")
|
||||
public CommonResult<List<PostSimpleRespVO>> getSimplePostList() {
|
||||
public CommonResult<List<PostSimpleRespVO>> getSimplePostList(@RequestParam(value = "organId", required = false) Long organId) {
|
||||
// 获得岗位列表,只要开启状态的
|
||||
List<PostDO> list = postService.getPostList(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus()));
|
||||
List<PostDO> list = postService.getPostList(null, Collections.singleton(CommonStatusEnum.ENABLE.getStatus()), organId);
|
||||
// 排序后,返回给前端
|
||||
list.sort(Comparator.comparing(PostDO::getSort));
|
||||
return success(BeanUtils.toBean(list, PostSimpleRespVO.class));
|
||||
|
||||
+3
@@ -13,4 +13,7 @@ public class DeptListReqVO {
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
|
||||
+3
-1
@@ -22,7 +22,7 @@ public class DeptRespVO {
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "负责人的用户编号", example = "2048")
|
||||
private Long leaderUserId;
|
||||
private String leader;
|
||||
|
||||
@Schema(description = "联系电话", example = "15601691000")
|
||||
private String phone;
|
||||
@@ -36,4 +36,6 @@ public class DeptRespVO {
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "时间戳格式")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
|
||||
+7
-2
@@ -4,6 +4,7 @@ import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.validation.InEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
@@ -17,6 +18,9 @@ public class DeptSaveReqVO {
|
||||
@Schema(description = "部门编号", example = "1024")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
|
||||
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "晨丰")
|
||||
@NotBlank(message = "部门名称不能为空")
|
||||
@Size(max = 30, message = "部门名称长度不能超过 30 个字符")
|
||||
@@ -29,8 +33,9 @@ public class DeptSaveReqVO {
|
||||
@NotNull(message = "显示顺序不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "负责人的用户编号", example = "2048")
|
||||
private Long leaderUserId;
|
||||
@Schema(description = "负责人", example = "2048")
|
||||
@Length(min = 0, max = 10, message = "负责人不可太长")
|
||||
private String leader;
|
||||
|
||||
@Schema(description = "联系电话", example = "15601691000")
|
||||
@Size(max = 11, message = "联系电话长度不能超过11个字符")
|
||||
|
||||
+2
@@ -19,4 +19,6 @@ public class PostPageReqVO extends PageParam {
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
private Integer status;
|
||||
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -42,4 +42,5 @@ public class PostRespVO {
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
private Long organId;
|
||||
}
|
||||
|
||||
+23
-21
@@ -6,12 +6,10 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelElementRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelPageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.label.vo.LabelSaveReqVO;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.lable.LabelElementDO;
|
||||
import com.cf.imes.module.system.service.lable.LabelService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
@@ -39,14 +37,16 @@ public class LabelController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建标签")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:create')")
|
||||
//@PreAuthorize("@ss.hasPermission('system:label:create')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Long> createLabel(@Valid @RequestBody LabelSaveReqVO createReqVO) {
|
||||
return success(labelService.createLabel(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新标签")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:update')")
|
||||
//@PreAuthorize("@ss.hasPermission('system:label:update')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Boolean> updateLabel(@Valid @RequestBody LabelSaveReqVO updateReqVO) {
|
||||
labelService.updateLabel(updateReqVO);
|
||||
return success(true);
|
||||
@@ -55,7 +55,7 @@ public class LabelController {
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除标签")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:label:delete')")
|
||||
//@PreAuthorize("@ss.hasPermission('system:label:delete')")
|
||||
public CommonResult<Boolean> deleteLabel(@RequestParam("id") Long id) {
|
||||
labelService.deleteLabel(id);
|
||||
return success(true);
|
||||
@@ -64,29 +64,41 @@ public class LabelController {
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得标签")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
//@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<LabelRespVO> getLabel(@RequestParam("id") Long id) {
|
||||
return success(labelService.getLabel(id));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得标签分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
//@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<PageResult<LabelRespVO>> getLabelPage(@Valid LabelPageReqVO pageReqVO) {
|
||||
PageResult<LabelDO> pageResult = labelService.getLabelPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, LabelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("list")
|
||||
@Operation(summary = "获得标签列表")
|
||||
@Parameter(name = "type", description = "类型", required = false, example = "1024")
|
||||
//@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<List<LabelRespVO>> getList(@RequestParam("type") String type) {
|
||||
return success(BeanUtils.toBean(labelService.list(type), LabelRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/group-list")
|
||||
@Operation(summary = "获得分组标签列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
public CommonResult<Map<String, List<LabelRespVO>>> getGroupList() {
|
||||
return success(labelService.getGroupList());
|
||||
//@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Map<String, List<LabelRespVO>>> getGroupList(@RequestParam(value = "organId", required = false) Long organId) {
|
||||
return success(labelService.getGroupList(organId));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出标签 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:export')")
|
||||
//@PreAuthorize("@ss.hasPermission('system:label:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportLabelExcel(@Valid LabelPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
@@ -97,14 +109,4 @@ public class LabelController {
|
||||
BeanUtils.toBean(list, LabelRespVO.class));
|
||||
}
|
||||
|
||||
// ==================== 子表(标签元素) ====================
|
||||
|
||||
@GetMapping("/label-element/list-by-label-id")
|
||||
@Operation(summary = "获得标签元素列表")
|
||||
@Parameter(name = "labelId", description = "标签id")
|
||||
@PreAuthorize("@ss.hasPermission('system:label:query')")
|
||||
public CommonResult<List<LabelElementRespVO>> getLabelElementListByLabelId(@RequestParam("labelId") Long labelId) {
|
||||
return success(labelService.getLabelElementListByLabelId(labelId));
|
||||
}
|
||||
|
||||
}
|
||||
+10
-1
@@ -1,10 +1,17 @@
|
||||
package com.cf.imes.module.system.controller.admin.label.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.labelelementproperty.LabelElementPropertyDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LabelElementRespVO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
@@ -17,6 +24,8 @@ public class LabelElementRespVO {
|
||||
private String type;
|
||||
@Schema(description = "数据源id")
|
||||
private Long sourceId;
|
||||
/*@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;*/
|
||||
@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;
|
||||
private JSONObject propertyDO;
|
||||
}
|
||||
|
||||
+4
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.label.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.labelelementproperty.LabelElementPropertyDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
@@ -19,6 +20,8 @@ public class LabelElementSaveReqVO {
|
||||
private String type;
|
||||
@Schema(description = "数据源id")
|
||||
private Long sourceId;
|
||||
/*@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;*/
|
||||
@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;
|
||||
private JSONObject propertyDO;
|
||||
}
|
||||
|
||||
+5
-2
@@ -46,7 +46,10 @@ public class LabelRespVO {
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementRespVO> labelElements;
|
||||
/*@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementRespVO> labelElements;*/
|
||||
|
||||
@Schema(description = "配置")
|
||||
private String template;
|
||||
|
||||
}
|
||||
+6
-2
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.label.vo;
|
||||
|
||||
import co.elastic.clients.elasticsearch.watcher.DeactivateWatchRequest;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -34,7 +35,10 @@ public class LabelSaveReqVO {
|
||||
@NotNull(message = "高度不能为空")
|
||||
private Integer height;
|
||||
|
||||
@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementSaveReqVO> elements;
|
||||
/*@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementSaveReqVO> elements;*/
|
||||
|
||||
@Schema(description = "配置")
|
||||
private String template;
|
||||
|
||||
}
|
||||
+22
-15
@@ -1,27 +1,21 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate;
|
||||
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelElementTemplateDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
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 java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.cf.imes.module.system.controller.admin.labeltemplate.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelTemplateDO;
|
||||
import com.cf.imes.module.system.service.labeltemplate.LabelTemplateService;
|
||||
@@ -41,6 +35,7 @@ public class LabelTemplateController {
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建标签模板")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:create')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Long> createLabelTemplate(@Valid @RequestBody LabelTemplateSaveReqVO createReqVO) {
|
||||
return success(labelTemplateService.createLabelTemplate(createReqVO));
|
||||
}
|
||||
@@ -48,6 +43,7 @@ public class LabelTemplateController {
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新标签模板")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:update')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Boolean> updateLabelTemplate(@Valid @RequestBody LabelTemplateSaveReqVO updateReqVO) {
|
||||
labelTemplateService.updateLabelTemplate(updateReqVO);
|
||||
return success(true);
|
||||
@@ -66,6 +62,7 @@ public class LabelTemplateController {
|
||||
@Operation(summary = "获得标签模板")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<LabelTemplateRespVO> getLabelTemplate(@RequestParam("id") Long id) {
|
||||
return success(labelTemplateService.getLabelTemplate(id));
|
||||
}
|
||||
@@ -73,6 +70,7 @@ public class LabelTemplateController {
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得标签模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<PageResult<LabelTemplateRespVO>> getLabelTemplatePage(@Valid LabelTemplatePageReqVO pageReqVO) {
|
||||
PageResult<LabelTemplateDO> pageResult = labelTemplateService.getLabelTemplatePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, LabelTemplateRespVO.class));
|
||||
@@ -81,10 +79,28 @@ public class LabelTemplateController {
|
||||
@GetMapping("/group-list")
|
||||
@Operation(summary = "获得分组标签模板列表")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<Map<String, List<LabelTemplateRespVO>>> getGroupList() {
|
||||
return success(labelTemplateService.getGroupList());
|
||||
}
|
||||
|
||||
@GetMapping("/getDefault")
|
||||
@Operation(summary = "获得默认标签模板")
|
||||
@Parameter(name = "type", description = "标签类型", required = true, example = "1024")
|
||||
//@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
@OperateLog(enable = false)
|
||||
public CommonResult<LabelTemplateRespVO> getDefaultLabelTemplate(@RequestParam("type") String type) {
|
||||
return success(labelTemplateService.getDefaultLabelTemplate(type));
|
||||
}
|
||||
|
||||
@GetMapping("/setDefaultTemplate")
|
||||
@Operation(summary = "设置默认标签模板")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
public CommonResult<Boolean> setDefaultTemplate(@RequestParam Long id) {
|
||||
return success(labelTemplateService.setDefaultTemplate(id));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出标签模板 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:export')")
|
||||
@@ -98,14 +114,5 @@ public class LabelTemplateController {
|
||||
BeanUtils.toBean(list, LabelTemplateRespVO.class));
|
||||
}
|
||||
|
||||
// ==================== 子表(标签元素模板) ====================
|
||||
|
||||
@GetMapping("/label-element-template/list-by-label-template-id")
|
||||
@Operation(summary = "获得标签元素模板列表")
|
||||
@Parameter(name = "labelTemplateId", description = "标签模板id")
|
||||
@PreAuthorize("@ss.hasPermission('system:label-template:query')")
|
||||
public CommonResult<List<LabelElementTemplateRespVO>> getLabelElementTemplateListByLabelTemplateId(@RequestParam("labelTemplateId") Long labelTemplateId) {
|
||||
return success(labelTemplateService.getLabelElementTemplateListByLabelTemplateId(labelTemplateId));
|
||||
}
|
||||
|
||||
}
|
||||
+14
-1
@@ -1,10 +1,19 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.labelelementproperty.LabelElementPropertyDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LabelElementTemplateRespVO {
|
||||
|
||||
@Schema(description = "主键")
|
||||
@@ -17,6 +26,10 @@ public class LabelElementTemplateRespVO {
|
||||
private String type;
|
||||
@Schema(description = "数据源id")
|
||||
private Long sourceId;
|
||||
/*@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;*/
|
||||
/*@Schema(description = "标签元素属性")
|
||||
private Map<String,Object> propertyDO;*/
|
||||
@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;
|
||||
private JSONObject propertyDO;
|
||||
}
|
||||
|
||||
+9
-1
@@ -1,9 +1,12 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.labelelementproperty.LabelElementPropertyDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author there
|
||||
*/
|
||||
@@ -19,6 +22,11 @@ public class LabelElementTemplateSaveReqVO {
|
||||
private String type;
|
||||
@Schema(description = "数据源id")
|
||||
private Long sourceId;
|
||||
/*@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;*/
|
||||
/*@Schema(description = "标签元素属性")
|
||||
|
||||
private Map<String, Object> propertyDO;*/
|
||||
@Schema(description = "标签元素属性")
|
||||
private LabelElementPropertyDO propertyDO;
|
||||
private JSONObject propertyDO;
|
||||
}
|
||||
|
||||
+5
-6
@@ -1,12 +1,9 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate.vo;
|
||||
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelElementTemplateDO;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
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.*;
|
||||
|
||||
@@ -47,7 +44,9 @@ public class LabelTemplateRespVO {
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementTemplateRespVO> labelElementTemplates;
|
||||
/*@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementTemplateRespVO> labelElementTemplates;*/
|
||||
@Schema(description = "配置")
|
||||
private String template;
|
||||
|
||||
}
|
||||
+4
-4
@@ -1,11 +1,9 @@
|
||||
package com.cf.imes.module.system.controller.admin.labeltemplate.vo;
|
||||
|
||||
import com.cf.imes.module.system.dal.dataobject.labeltemplate.LabelElementTemplateDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 标签模板新增/修改 Request VO")
|
||||
@Data
|
||||
@@ -34,7 +32,9 @@ public class LabelTemplateSaveReqVO {
|
||||
@NotNull(message = "高度不能为空")
|
||||
private Integer height;
|
||||
|
||||
@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementTemplateSaveReqVO> elements;
|
||||
/*@Schema(description = "标签元素模板列表")
|
||||
private List<LabelElementTemplateSaveReqVO> elements;*/
|
||||
@Schema(description = "配置")
|
||||
private String template;
|
||||
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.MachineDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
||||
import com.cf.imes.module.system.service.machine.MachineService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@RestController
|
||||
@Tag(name = "机台授权")
|
||||
@RequestMapping("/system/machine-auth")
|
||||
public class MachineAuthController {
|
||||
|
||||
@Resource
|
||||
private MachineService machineService;
|
||||
|
||||
@PostMapping("organ-auth")
|
||||
@Operation(summary = "组织机台授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<Boolean> auth(@RequestBody MachineOrgAuthReq vo) {
|
||||
return success(machineService.auth(vo));
|
||||
}
|
||||
|
||||
@GetMapping("organ-page")
|
||||
@Operation(summary = "组织机台授权分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<PageResult<OrganMachineResp>> organTemplatePage(OrganMachinePage page) {
|
||||
return success(machineService.organMachinePage(page));
|
||||
}
|
||||
|
||||
@GetMapping("organ-by-organId")
|
||||
@Operation(summary = "根据组织id查询组织机台授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@Parameter(name = "organId", description = "组织id", required = true, example = "1")
|
||||
public CommonResult<OrganMachineResp> organTemplateByOrganId(@RequestParam Long organId ) {
|
||||
return success(machineService.organMachineByOrganId(organId));
|
||||
}
|
||||
|
||||
@GetMapping("page-machine-auth")
|
||||
@Operation(summary = "授权机台分页")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<PageResult<MachineAuthResp>> pageTemplateAuth(MachinePageReqVO pageParam) {
|
||||
PageResult<MachineDO> page = machineService.page(pageParam);
|
||||
List<MachineAuthResp> list = page.getList().stream().map(e->MachineAuthResp.builder()
|
||||
.id(e.getId())
|
||||
.machineType(e.getMachineType())
|
||||
.machineName(e.getName())
|
||||
.organId(e.getOrganId())
|
||||
.build()
|
||||
).collect(Collectors.toList());
|
||||
|
||||
return success(new PageResult<MachineAuthResp>(list, page.getTotal()));
|
||||
}
|
||||
|
||||
}
|
||||
+31
-58
@@ -1,6 +1,8 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine;
|
||||
|
||||
import com.cf.imes.framework.es.core.valid.CreateGroup;
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.MachineDO;
|
||||
import com.cf.imes.module.system.service.machine.MachineService;
|
||||
@@ -18,6 +20,7 @@ import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@@ -35,42 +38,44 @@ public class MachineController {
|
||||
private MachineTemplateService machineTemplateService;
|
||||
|
||||
@PutMapping("/create-cutting")
|
||||
@Operation(summary = "创建开料机台")
|
||||
@PreAuthorize("@ss.hasPermission('machine::create')")
|
||||
public CommonResult<Long> createCutting(@Valid @RequestBody CuttingSaveReqVO createReqVO) {
|
||||
@Operation(summary = "创建机台")
|
||||
//@PreAuthorize("@ss.hasPermission('machine::create')")
|
||||
@OperateLog(logArgs = false)
|
||||
public CommonResult<Long> createCutting(@Validated(CreateGroup.class) @RequestBody CuttingSaveReqVO createReqVO) {
|
||||
return success(machineService.createCutting(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/update-cutting")
|
||||
@Operation(summary = "更新开料机台")
|
||||
@PreAuthorize("@ss.hasPermission('machine::update')")
|
||||
public CommonResult<Boolean> update( @RequestBody @Validated(UpdateGroup.class) CuttingSaveReqVO updateReqVO) {
|
||||
@Operation(summary = "更新机台")
|
||||
//@PreAuthorize("@ss.hasPermission('machine::update')")
|
||||
@OperateLog(logArgs = false)
|
||||
public CommonResult<Boolean> update(@Validated(UpdateGroup.class) @RequestBody CuttingSaveReqVO updateReqVO) {
|
||||
machineService.updateCutting(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-cutting")
|
||||
@Operation(summary = "删除开料机台")
|
||||
@Operation(summary = "删除机台")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
//@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
public CommonResult<Boolean> delete(@RequestParam("id") Long id) {
|
||||
machineService.deleteCutting(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/batch-delete-cutting")
|
||||
@Operation(summary = "批量删除开料机台")
|
||||
@Operation(summary = "批量删除机台")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
//@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
public CommonResult<Boolean> batchDeleteCutting(@RequestParam("ids") List<Long> ids) {
|
||||
machineService.batchDeleteCutting(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-cutting")
|
||||
@Operation(summary = "获得开料机台")
|
||||
@Operation(summary = "获得机台")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
//@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<CuttingRespVO> get(@RequestParam("id") Long id) {
|
||||
CuttingRespVO respVO = machineService.getCutting(id);
|
||||
return success(respVO);
|
||||
@@ -78,25 +83,26 @@ public class MachineController {
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得机台分页")
|
||||
@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
//@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<PageResult<CuttingRespVO>> getPage(@Valid MachinePageReqVO pageReqVO) {
|
||||
PageResult<MachineDO> pageResult = machineService.getPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CuttingRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("getDefaultCutting")
|
||||
@Operation(summary = "获得默认开料机台模板")
|
||||
@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<CuttingTemplateRespVO> getDefaultCutting() {
|
||||
return success(machineTemplateService.getDefaultCutting());
|
||||
@Operation(summary = "获得默认机台模板")
|
||||
@Parameter(name = "machineType", description = "机台类型", required = true, example = "1")
|
||||
//@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<CuttingTemplateRespVO> getDefaultCutting(@RequestParam Integer machineType) {
|
||||
return success(machineTemplateService.getDefaultCutting(machineType));
|
||||
}
|
||||
|
||||
@GetMapping("getDefaultDrill")
|
||||
/* @GetMapping("getDefaultDrill")
|
||||
@Operation(summary = "获得默认钻孔机台模板")
|
||||
@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<DrillTemplateRespVO> getDefaultDrill() {
|
||||
return success(machineTemplateService.getDefaultDrill());
|
||||
}
|
||||
}*/
|
||||
|
||||
/*@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出机台 Excel")
|
||||
@@ -111,46 +117,13 @@ public class MachineController {
|
||||
BeanUtils.toBean(list, MachineRespVO.class));
|
||||
}*/
|
||||
|
||||
@PutMapping("/create-drill")
|
||||
@Operation(summary = "创建钻孔机台")
|
||||
@PreAuthorize("@ss.hasPermission('machine::create')")
|
||||
public CommonResult<Long> createDrill(@Valid @RequestBody DrillSaveReqVO createReqVO) {
|
||||
return success(machineService.createDrill(createReqVO));
|
||||
|
||||
@GetMapping("getMachineTree")
|
||||
@Operation(summary = "获得机台树")
|
||||
//@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<Map<Integer, List<MachineVO>>> getMachineTree(@RequestParam(required = false) Long organId) {
|
||||
return success(machineService.getMachineTree(organId));
|
||||
}
|
||||
|
||||
@PostMapping("/update-drill")
|
||||
@Operation(summary = "更新钻孔机台")
|
||||
@PreAuthorize("@ss.hasPermission('machine::update')")
|
||||
public CommonResult<Boolean> updateDrill( @RequestBody @Validated(UpdateGroup.class) DrillSaveReqVO updateReqVO) {
|
||||
machineService.updateDrill(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-drill")
|
||||
@Operation(summary = "删除钻孔机台")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
public CommonResult<Boolean> deleteDrill(@RequestParam("id") Long id) {
|
||||
machineService.deleteDrill(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/batch-delete-drill")
|
||||
@Operation(summary = "批量删除钻孔机台")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('machine::delete')")
|
||||
public CommonResult<Boolean> batchDeleteDrill(@RequestParam("ids") List<Long> ids) {
|
||||
machineService.batchDeleteDrill(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get-drill")
|
||||
@Operation(summary = "获得钻孔机台")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('machine::query')")
|
||||
public CommonResult<DrillRespVO> getDrill(@RequestParam("id") Long id) {
|
||||
DrillRespVO respVO = machineService.getDrill(id);
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
||||
import com.cf.imes.module.system.service.machine.MachineTemplateService;
|
||||
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.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@RestController
|
||||
@Tag(name = "机台模板授权")
|
||||
@RequestMapping("/system/machine-template-auth")
|
||||
public class MachineTemplateAuthController {
|
||||
|
||||
@Resource
|
||||
private MachineTemplateService machineTemplateService;
|
||||
|
||||
@PostMapping("organ-auth-template")
|
||||
@Operation(summary = "组织模板授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<Boolean> auth(@RequestBody MachineOrgAuthReq vo) {
|
||||
return success(machineTemplateService.auth(vo));
|
||||
}
|
||||
|
||||
@GetMapping("organ-template-page")
|
||||
@Operation(summary = "组织模板授权分页列表")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<PageResult<OrganTemplateResp>> organTemplatePage(OrganTemplatePage page) {
|
||||
return success(machineTemplateService.organTemplatePage(page));
|
||||
}
|
||||
|
||||
@GetMapping("organ-template-by-organId")
|
||||
@Operation(summary = "根据组织id查询组织模板授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@Parameter(name = "organId", description = "组织id", required = true, example = "1")
|
||||
public CommonResult<OrganTemplateResp> organTemplateByOrganId(@RequestParam Long organId ) {
|
||||
return success(machineTemplateService.organTemplateByOrganId(organId));
|
||||
}
|
||||
|
||||
@GetMapping("page-template-machine-auth")
|
||||
@Operation(summary = "授权机台模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<PageResult<TemplateAutoResp>> pageTemplateAuth(MachinePageReqVO pageParam) {
|
||||
PageResult<MachineTemplateDO> page = machineTemplateService.page(pageParam);
|
||||
List<TemplateAutoResp> list = page.getList().stream().map(e->TemplateAutoResp.builder()
|
||||
.id(e.getId())
|
||||
.machineType(e.getMachineType())
|
||||
.templateName(e.getName())
|
||||
.isDefault(e.getIsDefault())
|
||||
.build()
|
||||
).collect(Collectors.toList());
|
||||
|
||||
return success(new PageResult<TemplateAutoResp>(list, page.getTotal()));
|
||||
}
|
||||
}
|
||||
+28
-45
@@ -3,6 +3,8 @@ package com.cf.imes.module.system.controller.admin.machine;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.module.system.controller.admin.machine.vo.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.MachineTemplateDO;
|
||||
import com.cf.imes.module.system.service.machine.MachineTemplateService;
|
||||
@@ -16,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@@ -31,6 +34,21 @@ public class MachineTemplateController {
|
||||
@Resource
|
||||
private MachineTemplateService machineTemplateService;
|
||||
|
||||
@GetMapping("/setDefaultTemplate")
|
||||
@Operation(summary = "设置默认机台模板")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::create')")
|
||||
public CommonResult<Boolean> setDefaultTemplate(@RequestParam Long id) {
|
||||
return success(machineTemplateService.setDefaultTemplate(id));
|
||||
}
|
||||
|
||||
@GetMapping("getMachineTemplateTree")
|
||||
@Operation(summary = "获得机台模板树")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<Map<Integer, List<MachineTemplateDO>>> getMachineTemplateTree() {
|
||||
return success(machineTemplateService.getMachineTemplateTree());
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("page-template-machine")
|
||||
@Operation(summary = "机台模板分页")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
@@ -38,82 +56,47 @@ public class MachineTemplateController {
|
||||
return success(machineTemplateService.page(pageParam));
|
||||
}
|
||||
|
||||
@PutMapping("drill-machine")
|
||||
@Operation(summary = "新增钻孔机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::create')")
|
||||
public CommonResult<Long> createDrillTemplate(@RequestBody DrillTemplateSaveReqVO reqVO) {
|
||||
return success(machineTemplateService.createDrillTemplate(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("drill-machine")
|
||||
@Operation(summary = "修改钻孔机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::update')")
|
||||
public CommonResult<Boolean> updateDrillTemplate(@RequestBody DrillTemplateSaveReqVO reqVO) {
|
||||
return success(machineTemplateService.updateDrillTemplate(reqVO));
|
||||
}
|
||||
|
||||
@GetMapping("drill-machine")
|
||||
@Operation(summary = "获取钻孔机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<DrillTemplateRespVO> getDrillTemplateById(@RequestParam("id") Long id) {
|
||||
return success(machineTemplateService.getDirllTemplateById(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("drill-machine")
|
||||
@Operation(summary = "删除钻孔机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::delete')")
|
||||
public CommonResult<Boolean> deleteDrillTemplate(@RequestParam("id") Long id) {
|
||||
return success(machineTemplateService.deleteDrillTemplate(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("batch-delete-drill")
|
||||
@Operation(summary = "批量删除钻孔机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::delete')")
|
||||
public CommonResult<Boolean> batchDeleteDrillTemplate(@RequestParam("ids") List<Long> ids) {
|
||||
return success(machineTemplateService.batchDeleteDrillTemplate(ids));
|
||||
}
|
||||
|
||||
@PutMapping("cutting-machine")
|
||||
@Operation(summary = "新增开料机台模板配置")
|
||||
@Operation(summary = "新增机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::create')")
|
||||
@OperateLog(logArgs = false)
|
||||
public CommonResult<Long> createCuttingTemplate(@RequestBody CuttingTemplateSaveReqVO reqVO) {
|
||||
return success(machineTemplateService.createCuttingTemplate(reqVO));
|
||||
}
|
||||
|
||||
@PostMapping("cutting-machine")
|
||||
@Operation(summary = "修改开料机台模板配置")
|
||||
@Operation(summary = "修改机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::update')")
|
||||
@OperateLog(logArgs = false)
|
||||
public CommonResult<Boolean> updateCuttingTemplate(@RequestBody CuttingTemplateSaveReqVO reqVO) {
|
||||
return success(machineTemplateService.updateCuttingTemplate(reqVO));
|
||||
}
|
||||
|
||||
@GetMapping("cutting-machine")
|
||||
@Operation(summary = "获取开料机台模板配置")
|
||||
@Operation(summary = "获取机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<CuttingTemplateRespVO> getCuttingTemplateById(@RequestParam("id") String id) {
|
||||
return success(machineTemplateService.getCuttingTemplateById(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("cutting-machine")
|
||||
@Operation(summary = "删除开料机台模板配置")
|
||||
@Operation(summary = "删除机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::delete')")
|
||||
public CommonResult<Boolean> deleteCutting(@RequestParam("id") Long id) {
|
||||
return success(machineTemplateService.deleteCuttingTemplate(id));
|
||||
}
|
||||
|
||||
@DeleteMapping("batch-delete-cutting")
|
||||
@Operation(summary = "批量删除开料机台模板配置")
|
||||
@Operation(summary = "批量删除机台模板配置")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::delete')")
|
||||
public CommonResult<Boolean> batchDeleteCutting(@RequestParam("id") List<Long> ids) {
|
||||
return success(machineTemplateService.batchDeleteCuttingTemplate(ids));
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("auth-template")
|
||||
@Operation(summary = "用户模板授权")
|
||||
@PreAuthorize("@ss.hasPermission('machine-template::query')")
|
||||
public CommonResult<Boolean> auth(@RequestBody MachineAuthVO vo) {
|
||||
return success(machineTemplateService.auth(vo));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class AuthTemplatePage extends PageParam {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "用户昵称")
|
||||
private String nickname;
|
||||
@Schema(description = "机台模板名称")
|
||||
private String templateName;
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AuthTemplateResp {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "组织名称")
|
||||
private String organName;
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
@Schema(description = "用户昵称")
|
||||
private String nickname;
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date updateTime;
|
||||
@Schema(description = "机台模板列表")
|
||||
private List<AutoTemplateVO> authTemplateList;
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class AuthVO {
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter;
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class AutoTemplateVO {
|
||||
@Schema(description = "机台模板id")
|
||||
private Long templateId;
|
||||
@Schema(description = "机台模板名称")
|
||||
private String templateName;
|
||||
|
||||
@JsonIgnore
|
||||
private Long userId;
|
||||
}
|
||||
+21
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.CuttingSettingDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
@@ -10,6 +11,9 @@ import com.alibaba.excel.annotation.*;
|
||||
@Schema(description = "管理后台 - 机台 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CuttingRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14092")
|
||||
@@ -24,12 +28,28 @@ public class CuttingRespVO {
|
||||
@ExcelProperty("1机台设备 2CNC设备")
|
||||
private Integer machineType;
|
||||
|
||||
@Schema(description = "标签id")
|
||||
private Long labelId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/* @Schema(description = "机台配置")
|
||||
private CuttingSettingDO machineSettingDO;*/
|
||||
|
||||
@Schema(description = "机台配置")
|
||||
private CuttingSettingDO machineSettingDO;
|
||||
private JSONObject machineSettingDO;
|
||||
|
||||
/**
|
||||
* 机台权限相关配置
|
||||
*/
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter;
|
||||
|
||||
|
||||
}
|
||||
+13
-5
@@ -1,11 +1,11 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.framework.es.core.valid.CreateGroup;
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import com.cf.imes.module.system.dal.dataobject.machine.CuttingSettingDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@@ -16,7 +16,7 @@ import javax.validation.constraints.NotNull;
|
||||
@Data
|
||||
public class CuttingSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14092")
|
||||
@Schema(description = "主键", example = "14092")
|
||||
@NotNull(groups = UpdateGroup.class, message = "主键不能空")
|
||||
private Long id;
|
||||
|
||||
@@ -32,9 +32,17 @@ public class CuttingSaveReqVO {
|
||||
@NotNull(message = "标签id不能空")
|
||||
private Long labelId;
|
||||
|
||||
@Schema(description = "机台配置")
|
||||
@Schema(description = "机台模板id")
|
||||
@NotNull(groups = CreateGroup.class, message = "机台模板id不能空")
|
||||
private Long templateId;
|
||||
|
||||
/* @Schema(description = "机台配置")
|
||||
@Valid
|
||||
private CuttingSettingDO machineSettingDO;
|
||||
private CuttingSettingDO machineSettingDO;*/
|
||||
|
||||
@Schema(description = "机台配置")
|
||||
private JSONObject machineSettingDO;
|
||||
|
||||
|
||||
/* @Schema(description = "样式配置")
|
||||
@Valid
|
||||
|
||||
+5
-1
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.CuttingTemplateMachineDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.DrillTemplateMachineDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -35,6 +36,9 @@ public class CuttingTemplateRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/*@Schema(description = "开料机台模板配置")
|
||||
private CuttingTemplateMachineDO cuttingTemplateMachineDO;*/
|
||||
|
||||
@Schema(description = "开料机台模板配置")
|
||||
private CuttingTemplateMachineDO cuttingTemplateMachineDO;
|
||||
private JSONObject cuttingTemplateMachineDO;
|
||||
}
|
||||
|
||||
+9
-4
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import com.cf.imes.module.system.dal.dataobject.machinetemplate.CuttingTemplateMachineDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -13,7 +14,7 @@ import javax.validation.constraints.NotNull;
|
||||
*/
|
||||
@Data
|
||||
public class CuttingTemplateSaveReqVO {
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14092")
|
||||
@Schema(description = "主键", example = "14092")
|
||||
@NotNull(groups = UpdateGroup.class, message = "主键不能空")
|
||||
private Long id;
|
||||
|
||||
@@ -25,11 +26,15 @@ public class CuttingTemplateSaveReqVO {
|
||||
@NotNull(message = "1开料机台设备 2钻孔机台设备 不能为空")
|
||||
private Integer machineType;
|
||||
|
||||
@Schema(description = "标签id")
|
||||
/*@Schema(description = "标签id")
|
||||
@NotNull(message = "标签id不能空")
|
||||
private Long labelId;
|
||||
private Long labelId;*/
|
||||
|
||||
/* @Schema(description = "管理理后台 - 开料机台模板新增/修改 Request VO")
|
||||
@NotNull(message = "开料机台配置不能空")
|
||||
private CuttingTemplateMachineDO setting;*/
|
||||
|
||||
@Schema(description = "管理理后台 - 开料机台模板新增/修改 Request VO")
|
||||
@NotNull(message = "开料机台配置不能空")
|
||||
private CuttingTemplateMachineDO setting;
|
||||
private JSONObject setting;
|
||||
}
|
||||
|
||||
+3
@@ -34,6 +34,9 @@ public class DrillTemplateRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "标签id")
|
||||
private Long labelId;
|
||||
|
||||
@Schema(description = "钻孔模板配置")
|
||||
private DrillTemplateMachineDO drillTemplateMachineDO;
|
||||
}
|
||||
|
||||
+2
-2
@@ -27,9 +27,9 @@ public class DrillTemplateSaveReqVO {
|
||||
@NotNull(message = "1开料机台设备 2钻孔机台设备 不能为空")
|
||||
private Integer machineType;
|
||||
|
||||
@Schema(description = "标签id")
|
||||
/*@Schema(description = "标签id")
|
||||
@NotNull(message = "标签id不能空")
|
||||
private Long labelId;
|
||||
private Long labelId;*/
|
||||
|
||||
@Schema(description = "钻孔机台模板配置")
|
||||
@NotNull(message = "配置不能空")
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class MachineAuth {
|
||||
@Schema(description = "机台id")
|
||||
private Long machineId;
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter;
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
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 MachineAuthResp {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "机台id")
|
||||
private Long id;
|
||||
@Schema(description = "机台名称")
|
||||
private String machineName;
|
||||
@Schema(description = "机台类别")
|
||||
private Integer machineType;
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing = false;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation = false;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter = false;
|
||||
}
|
||||
-1
@@ -14,6 +14,5 @@ public class MachineAuthVO {
|
||||
@NotNull(message = "用户id不能空")
|
||||
private Long userId;
|
||||
|
||||
@NotEmpty(message = "机台配置id不能空")
|
||||
private List<Long> machinesIds;
|
||||
}
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class MachineOrgAuthReq {
|
||||
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "权限列表")
|
||||
private List<MachineAuth> machineAuthList;
|
||||
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class MachineVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14092")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "1机台设备 2CNC设备", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("1开料机 2钻孔机")
|
||||
private Integer machineType;
|
||||
|
||||
@Schema(description = "标签id")
|
||||
private Long labelId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class OrganMachinePage extends PageParam {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "机台名称")
|
||||
private String machineName;
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrganMachineResp {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "组织名称")
|
||||
private String organName;
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date updateTime;
|
||||
@Schema(description = "机台模板列表")
|
||||
private List<OrganMachineVO> authMachineList;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class OrganMachineVO {
|
||||
@Schema(description = "机台id")
|
||||
private Long machineId;
|
||||
@Schema(description = "机台名称")
|
||||
private String machineName;
|
||||
@Schema(description = "机台类型")
|
||||
private Integer machineType;
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter;
|
||||
|
||||
@JsonIgnore
|
||||
private Long organId;
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class OrganTemplatePage extends PageParam {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "机台模板名称")
|
||||
private String templateName;
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class OrganTemplateResp {
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
@Schema(description = "组织名称")
|
||||
private String organName;
|
||||
@Schema(description = "更新时间")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date updateTime;
|
||||
@Schema(description = "机台模板列表")
|
||||
private List<OrganTemplateVO> authTemplateList;
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
public class OrganTemplateVO {
|
||||
@Schema(description = "机台模板id")
|
||||
private Long templateId;
|
||||
@Schema(description = "机台模板名称")
|
||||
private String templateName;
|
||||
@Schema(description = "机台模板类型")
|
||||
private Integer machineType;
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter;
|
||||
|
||||
@JsonIgnore
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.cf.imes.module.system.controller.admin.machine.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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 TemplateAutoResp {
|
||||
@Schema(description = "机台模板id")
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@Schema(description = "机台模板名称")
|
||||
private String templateName;
|
||||
/**
|
||||
* 1机台设备 2CNC设备
|
||||
*/
|
||||
@Schema(description = "机台模板类别")
|
||||
private Integer machineType;
|
||||
/**
|
||||
* 是否默认模板
|
||||
*/
|
||||
private Boolean isDefault;
|
||||
@Schema(description ="加工模式 开料机加工模式 默认true,显示开料机工作模式(是否排钻/造型,sc)配置")
|
||||
private Boolean showPriorFacing = false;
|
||||
@Schema(description = "双工位")
|
||||
private Boolean showDualWorkstation = false;
|
||||
@Schema(description = "自动贴标")
|
||||
private Boolean showAutoNotePrinter = false;
|
||||
}
|
||||
+1
-1
@@ -12,7 +12,7 @@ import javax.validation.constraints.Size;
|
||||
public class NoticeSaveReqVO {
|
||||
|
||||
@Schema(description = "岗位公告编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@NotNull(message = "岗位公告编号不能为空")
|
||||
//@NotNull(message = "岗位公告编号不能为空")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "公告标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "小博主")
|
||||
|
||||
+15
-2
@@ -19,6 +19,10 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
@@ -56,9 +60,18 @@ public class NotifyMessageController {
|
||||
@GetMapping("/my-page")
|
||||
@Operation(summary = "获得我的站内信分页")
|
||||
public CommonResult<PageResult<NotifyMessageRespVO>> getMyMyNotifyMessagePage(@Valid NotifyMessageMyPageReqVO pageVO) {
|
||||
Long loginUserId = getLoginUserId();
|
||||
if(!Objects.isNull(pageVO.getReadStatus())) {
|
||||
return success(notifyMessageService.getPageResultByRead(pageVO));
|
||||
}
|
||||
PageResult<NotifyMessageDO> pageResult = notifyMessageService.getMyMyNotifyMessagePage(pageVO,
|
||||
getLoginUserId(), UserTypeEnum.ADMIN.getValue());
|
||||
return success(BeanUtils.toBean(pageResult, NotifyMessageRespVO.class));
|
||||
loginUserId, UserTypeEnum.ADMIN.getValue());
|
||||
PageResult<NotifyMessageRespVO> respVOPageResult = BeanUtils.toBean(pageResult, NotifyMessageRespVO.class);
|
||||
Set<String> messageRead = notifyMessageService.getMessageRead(pageResult.getList().stream().map(e -> String.valueOf(e.getId())).collect(Collectors.toSet()), loginUserId);
|
||||
respVOPageResult.getList().forEach(e->{
|
||||
e.setReadStatus(messageRead.contains(e.getId().toString()));
|
||||
});
|
||||
return success(respVOPageResult);
|
||||
}
|
||||
|
||||
@PutMapping("/update-read")
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ public class NotifyMessageRespVO {
|
||||
private Map<String, Object> templateParams;
|
||||
|
||||
@Schema(description = "是否已读", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
|
||||
private Boolean readStatus;
|
||||
private boolean readStatus;
|
||||
|
||||
@Schema(description = "阅读时间")
|
||||
private LocalDateTime readTime;
|
||||
|
||||
+4
-4
@@ -12,12 +12,12 @@ import java.util.Map;
|
||||
public class NotifyTemplateSendReqVO {
|
||||
|
||||
@Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "01")
|
||||
@NotNull(message = "用户id不能为空")
|
||||
private Long userId;
|
||||
//@NotNull(message = "用户id不能为空")
|
||||
private Long userId = 0L;
|
||||
|
||||
@Schema(description = "用户类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType;
|
||||
//@NotNull(message = "用户类型不能为空")
|
||||
private Integer userType = 2;
|
||||
|
||||
@Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "01")
|
||||
@NotEmpty(message = "模板编码不能为空")
|
||||
|
||||
+62
-8
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.organ;
|
||||
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
@@ -7,12 +8,13 @@ import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.system.controller.admin.organ.vo.organ.OrganPageReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.organ.vo.organ.OrganRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.organ.vo.organ.OrganSaveReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.organ.vo.organ.OrganSimpleRespVO;
|
||||
import com.cf.imes.module.system.api.user.dto.OrganAdminUserRespDTO;
|
||||
import com.cf.imes.module.system.controller.admin.organ.vo.organ.*;
|
||||
import com.cf.imes.module.system.dal.dataobject.organ.OrganizationDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.organ.TenantPackageDO;
|
||||
import com.cf.imes.module.system.dal.mysql.organ.TenantPackageMapper;
|
||||
import com.cf.imes.module.system.service.organ.OrganService;
|
||||
import com.cf.imes.module.system.service.user.AdminUserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -25,8 +27,13 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
import static com.cf.imes.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 组织")
|
||||
@@ -37,6 +44,12 @@ public class OrganController {
|
||||
@Resource
|
||||
private OrganService organService;
|
||||
|
||||
@Resource
|
||||
private TenantPackageMapper tenantPackageMapper;
|
||||
|
||||
@Resource
|
||||
private AdminUserService adminUserService;
|
||||
|
||||
@GetMapping("/get-id-by-name")
|
||||
@PermitAll
|
||||
@Operation(summary = "使用组织名,获得组织编号", description = "登录界面,根据用户的组织名,获得组织编号")
|
||||
@@ -85,7 +98,10 @@ public class OrganController {
|
||||
@PreAuthorize("@ss.hasPermission('system:organ:query')")
|
||||
public CommonResult<OrganRespVO> getOrgan(@RequestParam("id") Long id) {
|
||||
OrganizationDO organ = organService.getOrgan(id);
|
||||
return success(BeanUtils.toBean(organ, OrganRespVO.class));
|
||||
TenantPackageDO tenantPackageDO = tenantPackageMapper.selectById(organ.getPackageId());
|
||||
OrganRespVO bean = BeanUtils.toBean(organ, OrganRespVO.class);
|
||||
bean.setPackageName(Objects.isNull(tenantPackageDO)? "": tenantPackageDO.getName());
|
||||
return success(bean);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@@ -93,7 +109,18 @@ public class OrganController {
|
||||
@PreAuthorize("@ss.hasPermission('system:organ:query')")
|
||||
public CommonResult<PageResult<OrganRespVO>> getOrganPage(@Valid OrganPageReqVO pageVO) {
|
||||
PageResult<OrganizationDO> pageResult = organService.getOrganPage(pageVO);
|
||||
return success(BeanUtils.toBean(pageResult, OrganRespVO.class));
|
||||
PageResult<OrganRespVO> bean = BeanUtils.toBean(pageResult, OrganRespVO.class);
|
||||
Set<Long> packageIds = bean.getList().stream().map(OrganRespVO::getPackageId).collect(Collectors.toSet());
|
||||
List<TenantPackageDO> tenantPackageDOS = tenantPackageMapper.selectBatchIds(packageIds);
|
||||
bean.getList().forEach(e->{
|
||||
e.setPackageName(tenantPackageDOS.stream()
|
||||
.filter(f->Objects.equals(f.getId(), e.getPackageId()))
|
||||
.map(TenantPackageDO::getName)
|
||||
.findAny()
|
||||
.orElse("")
|
||||
);
|
||||
});
|
||||
return success(bean);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@@ -104,9 +131,36 @@ public class OrganController {
|
||||
HttpServletResponse response) throws IOException {
|
||||
exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<OrganizationDO> list = organService.getOrganPage(exportReqVO).getList();
|
||||
Set<Long> organIds = list.stream().map(OrganizationDO::getId).collect(Collectors.toSet());
|
||||
Set<Long> packageIds = list.stream().map(OrganizationDO::getPackageId).collect(Collectors.toSet());
|
||||
List<TenantPackageDO> tenantPackageDOS = tenantPackageMapper.selectBatchIds(packageIds);
|
||||
List<OrganExportRespVO> organExportRespVOS = BeanUtils.toBean(list, OrganExportRespVO.class);
|
||||
List<OrganAdminUserRespDTO> organAdminUserRespDTOS = adminUserService.getOrganAdminByOrganIds(organIds);
|
||||
|
||||
organExportRespVOS.forEach(e->{
|
||||
e.setPackageName(tenantPackageDOS.stream()
|
||||
.filter(f-> Objects.equals(e.getPackageId(),f.getId()))
|
||||
.map(TenantPackageDO::getName)
|
||||
.findAny()
|
||||
.orElse(null));
|
||||
e.setLargeStr(e.getLarge()? "是":"否");
|
||||
e.setUsernames(organAdminUserRespDTOS.stream()
|
||||
.filter(f->Objects.equals(e.getId(), f.getOrganId()))
|
||||
.map(OrganAdminUserRespDTO::getUsername)
|
||||
.reduce("", (a,b)-> a + " " + b)
|
||||
);
|
||||
});
|
||||
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "组织.xls", "数据", OrganRespVO.class,
|
||||
BeanUtils.toBean(list, OrganRespVO.class));
|
||||
ExcelUtils.write(response, "组织.xls", "数据", OrganExportRespVO.class, organExportRespVOS);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping({"/list-all-simple", "/simple-list"})
|
||||
@Operation(summary = "获取组织精简信息列表", description = "主要用于前端的下拉选项")
|
||||
@Parameter(name = "name", description = "组织名称", required = false, example = "xxx")
|
||||
public CommonResult<List<OrganSimpleRespVO>> getSimpleOrganList(@RequestParam(required = false, value = "name") String name) {
|
||||
return success(organService.getSimpleOrganList(name));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.cf.imes.module.system.controller.admin.organ.vo.organ;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.cf.imes.framework.excel.core.annotations.DictFormat;
|
||||
import com.cf.imes.framework.excel.core.convert.DictConvert;
|
||||
import com.cf.imes.module.system.enums.DictTypeConstants;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@Builder
|
||||
public class OrganExportRespVO {
|
||||
@Schema(description = "组织编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@ExcelProperty("组织编号")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "组织名", requiredMode = Schema.RequiredMode.REQUIRED, example = "晨丰")
|
||||
@ExcelProperty("组织名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "晨丰")
|
||||
@ExcelProperty("联系人")
|
||||
private String contactName;
|
||||
|
||||
@Schema(description = "联系手机", example = "15601691300")
|
||||
@ExcelProperty("联系手机")
|
||||
private String contactMobile;
|
||||
|
||||
@Schema(description = "组织状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat(DictTypeConstants.COMMON_STATUS)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "绑定域名", example = "https://www.cf.com")
|
||||
@ExcelProperty("绑定域名")
|
||||
private String website;
|
||||
|
||||
@Schema(description = "组织套餐编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long packageId;
|
||||
|
||||
@Schema(description = "组织套餐", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
@ExcelProperty("组织套餐")
|
||||
private String packageName;
|
||||
|
||||
@Schema(description = "管理员账号")
|
||||
@ExcelProperty("管理员账号")
|
||||
private String usernames;
|
||||
|
||||
@ExcelProperty("账号数量")
|
||||
private Integer accountCount;
|
||||
|
||||
@Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("过期时间")
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "地址")
|
||||
@ExcelProperty("地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "是否大型数据库")
|
||||
private Boolean large;
|
||||
|
||||
@Schema(description = "是否大型数据库")
|
||||
@ExcelProperty("是否大型数据库")
|
||||
private String largeStr;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
}
|
||||
+9
@@ -33,4 +33,13 @@ public class OrganPageReqVO extends PageParam {
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
/**
|
||||
* 拼音首字母
|
||||
*/
|
||||
private String pyFirstChar;
|
||||
/**
|
||||
* 全拼
|
||||
*/
|
||||
private String pyAll;
|
||||
|
||||
}
|
||||
|
||||
+7
@@ -42,6 +42,9 @@ public class OrganRespVO {
|
||||
@Schema(description = "组织套餐编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Long packageId;
|
||||
|
||||
@Schema(description = "组织套餐名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private String packageName;
|
||||
|
||||
@Schema(description = "过期时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
@@ -52,4 +55,8 @@ public class OrganRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -76,4 +76,8 @@ public class OrganSaveReqVO {
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Length(min = 0, max = 200, message = "备注不可太长")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
+45
-5
@@ -1,14 +1,23 @@
|
||||
package com.cf.imes.module.system.controller.admin.permission;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.security.core.LoginUser;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.system.controller.admin.permission.vo.menu.MenuListReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.permission.vo.menu.MenuRespVO;
|
||||
import com.cf.imes.module.system.controller.admin.permission.vo.menu.MenuSaveVO;
|
||||
import com.cf.imes.module.system.controller.admin.permission.vo.menu.MenuSimpleRespVO;
|
||||
import com.cf.imes.module.system.convert.auth.AuthConvert;
|
||||
import com.cf.imes.module.system.dal.dataobject.permission.MenuDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.permission.RoleDO;
|
||||
import com.cf.imes.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.cf.imes.module.system.service.permission.MenuService;
|
||||
import com.cf.imes.module.system.service.permission.PermissionService;
|
||||
import com.cf.imes.module.system.service.permission.RoleService;
|
||||
import com.cf.imes.module.system.service.user.AdminUserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -18,10 +27,12 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
import static com.cf.imes.framework.common.util.collection.CollectionUtils.convertSet;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
|
||||
|
||||
@Tag(name = "管理后台 - 菜单")
|
||||
@RestController
|
||||
@@ -32,6 +43,15 @@ public class MenuController {
|
||||
@Resource
|
||||
private MenuService menuService;
|
||||
|
||||
@Resource
|
||||
private PermissionService permissionService;
|
||||
|
||||
@Resource
|
||||
private AdminUserService userService;
|
||||
|
||||
@Resource
|
||||
private RoleService roleService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建菜单")
|
||||
@PreAuthorize("@ss.hasPermission('system:menu:create')")
|
||||
@@ -59,9 +79,29 @@ public class MenuController {
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获取菜单列表", description = "用于【菜单管理】界面")
|
||||
@PreAuthorize("@ss.hasPermission('system:menu:query')")
|
||||
//@PreAuthorize("@ss.hasPermission('system:menu:query')")
|
||||
public CommonResult<List<MenuRespVO>> getMenuList(MenuListReqVO reqVO) {
|
||||
List<MenuDO> list = menuService.getMenuList(reqVO);
|
||||
List <MenuDO> list = null;
|
||||
LoginUser loginUser = getLoginUser();
|
||||
if(loginUser.getIsSupAdmin()) {
|
||||
list = menuService.getMenuList(reqVO);
|
||||
}else {
|
||||
AdminUserDO user = userService.getUser(getLoginUserId());
|
||||
if (user == null) {
|
||||
return success(new ArrayList<>());
|
||||
}
|
||||
Set<Long> roleIds = permissionService.getUserRoleIdListByUserId(getLoginUserId());
|
||||
if (CollUtil.isEmpty(roleIds)) {
|
||||
return success(new ArrayList<>());
|
||||
}
|
||||
//List<RoleDO> roles = roleService.getRoleList(roleIds);
|
||||
List<RoleDO> roles = roleService.getRoleList1(roleIds);
|
||||
roles.removeIf(role -> !CommonStatusEnum.ENABLE.getStatus().equals(role.getStatus())); // 移除禁用的角色
|
||||
Set<Long> menuIds = permissionService.getRoleMenuListByRoleId2(convertSet(roles, RoleDO::getId));
|
||||
//List<MenuDO> menuList = menuService.getMenuList(menuIds);
|
||||
list = menuService.getMenuList1(menuIds);
|
||||
list.removeIf(menu -> !CommonStatusEnum.ENABLE.getStatus().equals(menu.getStatus())); // 移除禁用的菜单
|
||||
}
|
||||
list.sort(Comparator.comparing(MenuDO::getSort));
|
||||
return success(BeanUtils.toBean(list, MenuRespVO.class));
|
||||
}
|
||||
@@ -78,7 +118,7 @@ public class MenuController {
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获取菜单信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:menu:query')")
|
||||
//@PreAuthorize("@ss.hasPermission('system:menu:query')")
|
||||
public CommonResult<MenuRespVO> getMenu(Long id) {
|
||||
MenuDO menu = menuService.getMenu(id);
|
||||
return success(BeanUtils.toBean(menu, MenuRespVO.class));
|
||||
|
||||
+60
-4
@@ -1,7 +1,11 @@
|
||||
package com.cf.imes.module.system.controller.admin.permission;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.framework.security.core.LoginUser;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleDataScopeReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.permission.vo.permission.PermissionAssignRoleMenuReqVO;
|
||||
import com.cf.imes.module.system.controller.admin.permission.vo.permission.PermissionAssignUserRoleReqVO;
|
||||
@@ -16,9 +20,15 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.ROLE_ME_ERROR;
|
||||
import static com.cf.imes.module.system.service.organ.OrganServiceImpl.ORGAN_ADMIN_ROLE_ID;
|
||||
import static com.cf.imes.module.system.service.organ.OrganServiceImpl.ORGAN_STAFF_ROLE_ID;
|
||||
|
||||
/**
|
||||
* 权限 Controller,提供赋予用户、角色的权限的 API 接口
|
||||
@@ -47,11 +57,28 @@ public class PermissionController {
|
||||
@Operation(summary = "赋予角色菜单")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')")
|
||||
public CommonResult<Boolean> assignRoleMenu(@Validated @RequestBody PermissionAssignRoleMenuReqVO reqVO) {
|
||||
// 开启多组织的情况下,需要过滤掉未开通的菜单
|
||||
organService.handleOrganMenu(menuIds -> reqVO.getMenuIds().removeIf(menuId -> !CollUtil.contains(menuIds, menuId)));
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
if(!loginUser.getIsSupAdmin() && ( Objects.equals(reqVO.getRoleId(), ORGAN_ADMIN_ROLE_ID) || Objects.equals(reqVO.getRoleId(), ORGAN_STAFF_ROLE_ID))) {
|
||||
throw new ServiceException(11541, "内置角色无权修改菜单权限");
|
||||
}
|
||||
if(Objects.equals(reqVO.getRoleId(), 1L)) {
|
||||
throw new ServiceException(11541, "内置角色无权修改菜单权限");
|
||||
}
|
||||
Set<Long> roleIds = permissionService.getUserRoleIdListByUserId(loginUser.getId());
|
||||
if (roleIds.contains(reqVO.getRoleId())) {
|
||||
throw new ServiceException(11541, "无法修改自身的角色菜单权限");
|
||||
}
|
||||
|
||||
if(Objects.equals(reqVO.getRoleId(), ORGAN_ADMIN_ROLE_ID) || Objects.equals(reqVO.getRoleId(), ORGAN_STAFF_ROLE_ID)) {
|
||||
} else {
|
||||
// 开启多组织的情况下,需要过滤掉未开通的菜单
|
||||
organService.handleOrganMenu(menuIds -> {
|
||||
reqVO.getMenuIds().removeIf(menuId -> !CollUtil.contains(menuIds, menuId));
|
||||
});
|
||||
}
|
||||
Long organId = reqVO.getOrganId() == null? OrganContextHolder.getOrganId(): reqVO.getOrganId();
|
||||
// 执行菜单的分配
|
||||
permissionService.assignRoleMenu(reqVO.getRoleId(), reqVO.getMenuIds());
|
||||
permissionService.assignRoleMenu(reqVO.getRoleId(), reqVO.getMenuIds(), organId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@@ -75,8 +102,37 @@ public class PermissionController {
|
||||
@PostMapping("/assign-user-role")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
public CommonResult<Boolean> assignUserRole(@Validated @RequestBody PermissionAssignUserRoleReqVO reqVO) {
|
||||
permissionService.assignUserRole(reqVO.getUserId(), reqVO.getRoleIds());
|
||||
Long organId = reqVO.getOrganId() == null ? OrganContextHolder.getOrganId() : reqVO.getOrganId();
|
||||
permissionService.assignUserRole(reqVO.getUserId(), reqVO.getRoleIds(), organId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Operation(summary = "赋予多用户角色")
|
||||
@PostMapping("/bath-assign-user-role")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
public CommonResult<Boolean> bathAssignUserRole(@Validated @RequestBody List<PermissionAssignUserRoleReqVO> listReqVO) {
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
Set<Long> userIds = listReqVO.stream().map(PermissionAssignUserRoleReqVO::getUserId).collect(Collectors.toSet());
|
||||
if (userIds.contains(loginUser.getId())) {
|
||||
throw new ServiceException(ROLE_ME_ERROR);
|
||||
}
|
||||
Set<Long> roleIds = listReqVO.stream().flatMap(e -> e.getRoleIds().stream()).collect(Collectors.toSet());
|
||||
/* if(!loginUser.getIsSupAdmin()) {
|
||||
if(roleIds.contains(ORGAN_ADMIN_ROLE_ID) ) {
|
||||
throw new ServiceException(11541, "内置角色无权修改");
|
||||
}
|
||||
}*/
|
||||
permissionService.bathAssignUserRole(listReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "获得拥有角色的用户列表")
|
||||
@Parameter(name = "roleId", description = "角色id", required = true)
|
||||
@GetMapping("/list-role-users")
|
||||
@PreAuthorize("@ss.hasPermission('system:permission:assign-user-role')")
|
||||
public CommonResult<Set<Long>> listRoleUsers(@RequestParam("roleId") Long roleId, @RequestParam(value = "organId", required = false) Long organId) {
|
||||
return success(permissionService.getListRoleUsers(roleId, organId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+20
-3
@@ -1,12 +1,14 @@
|
||||
package com.cf.imes.module.system.controller.admin.permission;
|
||||
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.excel.core.util.ExcelUtils;
|
||||
import com.cf.imes.framework.operatelog.core.annotations.OperateLog;
|
||||
import com.cf.imes.framework.organ.core.context.OrganContextHolder;
|
||||
import com.cf.imes.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import com.cf.imes.module.system.controller.admin.permission.vo.role.*;
|
||||
import com.cf.imes.module.system.controller.admin.permission.vo.role.RolePageReqVO;
|
||||
@@ -29,9 +31,13 @@ import javax.validation.Valid;
|
||||
import java.io.IOException;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static com.cf.imes.module.system.service.organ.OrganServiceImpl.ORGAN_ADMIN_ROLE_ID;
|
||||
import static com.cf.imes.module.system.service.organ.OrganServiceImpl.ORGAN_STAFF_ROLE_ID;
|
||||
import static java.util.Collections.singleton;
|
||||
|
||||
@Tag(name = "管理后台 - 角色")
|
||||
@@ -47,14 +53,24 @@ public class RoleController {
|
||||
@Operation(summary = "创建角色")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:create')")
|
||||
public CommonResult<Long> createRole(@Valid @RequestBody RoleSaveReqVO createReqVO) {
|
||||
if(Objects.isNull(createReqVO.getOrganId())) {
|
||||
createReqVO.setOrganId(OrganContextHolder.getOrganId());
|
||||
}
|
||||
Long organId = SecurityFrameworkUtils.getLoginUser().getOrganId();
|
||||
return success(roleService.createRole(createReqVO, null, organId));
|
||||
return success(roleService.createRole(createReqVO, null));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "修改角色")
|
||||
@PreAuthorize("@ss.hasPermission('system:role:update')")
|
||||
public CommonResult<Boolean> updateRole(@Valid @RequestBody RoleSaveReqVO updateReqVO) {
|
||||
if(Objects.equals(updateReqVO.getId(), ORGAN_ADMIN_ROLE_ID) || Objects.equals(updateReqVO.getId(), ORGAN_STAFF_ROLE_ID)) {
|
||||
throw new ServiceException(11541, "内置角色无法修改");
|
||||
}
|
||||
|
||||
if(Objects.isNull(updateReqVO.getOrganId())) {
|
||||
updateReqVO.setOrganId(OrganContextHolder.getOrganId());
|
||||
}
|
||||
roleService.updateRole(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
@@ -94,8 +110,9 @@ public class RoleController {
|
||||
|
||||
@GetMapping({"/list-all-simple", "/simple-list"})
|
||||
@Operation(summary = "获取角色精简信息列表", description = "只包含被开启的角色,主要用于前端的下拉选项")
|
||||
public CommonResult<List<RoleSimpleRespVO>> getSimpleRoleList() {
|
||||
List<RoleDO> list = roleService.getRoleListByStatus(singleton(CommonStatusEnum.ENABLE.getStatus()));
|
||||
public CommonResult<List<RoleSimpleRespVO>> getSimpleRoleList(@RequestParam(value = "organId", required = false) Long organId) {
|
||||
List<RoleDO> list = roleService.getRoleListByStatus(singleton(CommonStatusEnum.ENABLE.getStatus()), organId);
|
||||
//List<RoleDO> roleDOS = list.stream().filter(f -> !Objects.equals(f.getId(), 1L)).sorted(Comparator.comparing(RoleDO::getSort)).toList();
|
||||
list.sort(Comparator.comparing(RoleDO::getSort));
|
||||
return success(BeanUtils.toBean(list, RoleSimpleRespVO.class));
|
||||
}
|
||||
|
||||
+3
@@ -18,4 +18,7 @@ public class PermissionAssignRoleMenuReqVO {
|
||||
@Schema(description = "菜单编号列表", example = "1,3,5")
|
||||
private Set<Long> menuIds = Collections.emptySet(); // 兜底
|
||||
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -18,4 +18,7 @@ public class PermissionAssignUserRoleReqVO {
|
||||
@Schema(description = "角色编号列表", example = "1,3,5")
|
||||
private Set<Long> roleIds = Collections.emptySet(); // 兜底
|
||||
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -28,4 +28,7 @@ public class RolePageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -31,6 +31,9 @@ public class RoleSaveReqVO {
|
||||
@Schema(description = "备注", example = "我是一个角色")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "状态 0开启1关闭" )
|
||||
private Integer status;
|
||||
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
|
||||
+26
-7
@@ -5,6 +5,7 @@ import javax.validation.Valid;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
import com.cf.imes.module.system.controller.admin.process.vo.group.ProcessGroupRespVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -44,14 +45,14 @@ public class ProcessController {
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "新建工序信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:process:create')")
|
||||
public CommonResult<Long> createProcess(@Valid @RequestBody ProcessSaveReqVO createReqVO) {
|
||||
public CommonResult<Long> createProcess(@Valid @RequestBody ProcessUserSaveReqVO createReqVO) {
|
||||
return success(processService.createProcess(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新工序信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:process:update')")
|
||||
public CommonResult<Boolean> updateProcess(@Valid @RequestBody ProcessSaveReqVO updateReqVO) {
|
||||
public CommonResult<Boolean> updateProcess(@Valid @RequestBody ProcessUserSaveReqVO updateReqVO) {
|
||||
processService.updateProcess(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
@@ -69,16 +70,34 @@ public class ProcessController {
|
||||
@Operation(summary = "获得工序信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:process:query')")
|
||||
public CommonResult<ProcessRespVO> getProcess(@RequestParam("id") Long id) {
|
||||
ProcessDO process = processService.getProcess(id);
|
||||
return success(BeanUtils.toBean(process, ProcessRespVO.class));
|
||||
public CommonResult<ProcessUserRespVO> getProcess(@RequestParam("id") Long id) {
|
||||
ProcessUserRespVO processUser = processService.getProcess(id);
|
||||
return success(BeanUtils.toBean(processUser, ProcessUserRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/allGet")
|
||||
@Operation(summary = "获得工序全部信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:process:query')")
|
||||
public CommonResult<PageResult<ProcessDO>> getProcessAll(@Valid ProcessPageReqVO pageReqVO) {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
PageResult<ProcessDO> pageResult = processService.getProcessPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProcessDO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getAll")
|
||||
@Operation(summary = "获得所有工序信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:process:query')")
|
||||
public CommonResult<List<ProcessDO>> getAllProcess() {
|
||||
List<ProcessDO> processUser = processService.getAllProcess();
|
||||
return success(BeanUtils.toBean(processUser, ProcessDO.class));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得工序信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:process:query')")
|
||||
public CommonResult<PageResult<ProcessRespVO>> getProcessPage(@Valid ProcessPageReqVO pageReqVO) {
|
||||
PageResult<ProcessDO> pageResult = processService.getProcessPage(pageReqVO);
|
||||
PageResult<ProcessRespVO> pageResult = processService.getProcessPageAll(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProcessRespVO.class));
|
||||
}
|
||||
|
||||
@@ -91,7 +110,7 @@ public class ProcessController {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProcessDO> list = processService.getProcessPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "工序信息表 process.xls", "数据", ProcessRespVO.class,
|
||||
ExcelUtils.write(response, "工序信息表.xls", "数据", ProcessRespVO.class,
|
||||
BeanUtils.toBean(list, ProcessRespVO.class));
|
||||
}
|
||||
|
||||
|
||||
+5
-15
@@ -52,26 +52,16 @@ public class ProcessGroupController {
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建工序组")
|
||||
@PreAuthorize("@ss.hasPermission('system:process-group:create')")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CommonResult<Long> createProcessGroup(@Valid @RequestBody ProcessListSaveReqVO createReqVOLists) {
|
||||
StringBuilder itemsBuilder = new StringBuilder();
|
||||
for (ProcessRespVO createReqVO : createReqVOLists.getLists()) {
|
||||
Optional.ofNullable(createReqVO.getId()).ifPresent(id -> {
|
||||
itemsBuilder.append(id).append(",");
|
||||
});
|
||||
}
|
||||
String items = itemsBuilder.length() > 0 ? itemsBuilder.substring(0, itemsBuilder.length() - 1) : null;
|
||||
|
||||
ProcessGroupSaveReqVO createReqVO = BeanUtils.toBean(createReqVOLists, ProcessGroupSaveReqVO.class);
|
||||
createReqVO.setItems(items);
|
||||
|
||||
return success(processGroupService.createProcessGroup(createReqVO));
|
||||
public CommonResult<Long> createProcessGroup(@Valid @RequestBody ProcessGroupSaveReqVO createReqVOLists) {
|
||||
return success(processGroupService.createProcessGroup(createReqVOLists));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新工序组")
|
||||
@PreAuthorize("@ss.hasPermission('system:process-group:update')")
|
||||
public CommonResult<Boolean> updateProcessGroup(@Valid @RequestBody ProcessListSaveReqVO updateReqVO) {
|
||||
public CommonResult<Boolean> updateProcessGroup(@Valid @RequestBody ProcessGroupSaveReqVO updateReqVO) {
|
||||
processGroupService.updateProcessGroup(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
@@ -103,7 +93,7 @@ public class ProcessGroupController {
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出工序组表 process_group Excel")
|
||||
@Operation(summary = "导出工序组表")
|
||||
@PreAuthorize("@ss.hasPermission('system:process-group:export')")
|
||||
@OperateLog(type = EXPORT)
|
||||
public void exportProcessGroupExcel(@Valid ProcessGroupPageReqVO pageReqVO,
|
||||
|
||||
+3
@@ -14,6 +14,9 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
@ToString(callSuper = true)
|
||||
public class ProcessGroupPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "组织id", example = "1")
|
||||
private Long organId;
|
||||
|
||||
@Schema(description = "工序组名称", example = "赵六")
|
||||
private String name;
|
||||
|
||||
|
||||
+4
@@ -26,6 +26,10 @@ public class ProcessListSaveReqVO {
|
||||
@NotNull(message = "排序优先级")
|
||||
private Short sort;
|
||||
|
||||
@Schema(description = "明细,工序 ID 逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "明细,工序 ID 逗号分隔不能为空")
|
||||
private String items;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
|
||||
@NotEmpty(message = "描述不能为空")
|
||||
private String description;
|
||||
|
||||
+6
@@ -55,4 +55,10 @@ public class ProcessPageReqVO extends PageParam {
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "用户id查询")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "组织id")
|
||||
private Long organId;
|
||||
|
||||
}
|
||||
+3
@@ -67,4 +67,7 @@ public class ProcessRespVO {
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "工序中的用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12,13")
|
||||
private String users;
|
||||
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.cf.imes.module.system.controller.admin.process.vo.process;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @projectName: cf_imes_server
|
||||
* @author: 晨丰科技
|
||||
* @date: 2024/3/7 11:39
|
||||
*/
|
||||
@Schema(description = "管理后台 - 工序信息表 process Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProcessUserRespVO {
|
||||
|
||||
@Schema(description = "工序 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20453")
|
||||
@ExcelProperty("工序 ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工序名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("工序名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "计件工资", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("计件工资")
|
||||
private Double pieceRate;
|
||||
|
||||
@Schema(description = "计件类型:1 数量 2 长度 3 平方 4 宽 5 高 6 体积 7 生产单金额百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty("计件类型:1 数量 2 长度 3 平方 4 宽 5 高 6 体积 7 生产单金额百分比")
|
||||
private Integer pieceType;
|
||||
|
||||
@Schema(description = "工序类型:0 全部加工 1 开料 2 部件加工 3 异形封边 4 分堆 5 打包 6 出库 7 组件加工 8 板材", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("工序类型:0 全部加工 1 开料 2 部件加工 3 异形封边 4 分堆 5 打包 6 出库 7 组件加工 8 板材")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "是否推送终端客户:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否推送终端客户:0 否 1 是")
|
||||
private Boolean isCustom;
|
||||
|
||||
@Schema(description = "是否推送经销商:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否推送经销商:0 否 1 是")
|
||||
private Boolean isDealer;
|
||||
|
||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("排序优先级")
|
||||
private Short sort;
|
||||
|
||||
@Schema(description = "小时产量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("小时产量")
|
||||
private Double hourCapacity;
|
||||
|
||||
@Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("单位")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "是否启用:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("是否启用:0 否 1 是")
|
||||
private Boolean isEnabled;
|
||||
|
||||
@Schema(description = "准备时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("准备时间")
|
||||
private Double prepareTime;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "随便")
|
||||
@ExcelProperty("描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12,13")
|
||||
@ExcelProperty("用户ID")
|
||||
private String Users;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.cf.imes.module.system.controller.admin.process.vo.process;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 工序信息 process新增/修改 Request VO")
|
||||
@Data
|
||||
@Valid
|
||||
public class ProcessUserSaveReqVO {
|
||||
@Schema(description = "工序 ID", example = "161")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "工序名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "工序名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "计件工资", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "计件工资不能为空")
|
||||
private Double pieceRate;
|
||||
|
||||
@Schema(description = "计件类型:1 数量 2 长度 3 平方 4 宽 5 高 6 体积 7 生产单金额百分比", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "计件类型:1 数量 2 长度 3 平方 4 宽 5 高 6 体积 7 生产单金额百分比不能为空")
|
||||
private Integer pieceType;
|
||||
|
||||
@Schema(description = "工序类型:0 全部加工 1 开料 2 部件加工 3 异形封边 4 分堆 5 打包 6 出库 7 组件加工 8 板材", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "工序类型:0 全部加工 1 开料 2 部件加工 3 异形封边 4 分堆 5 打包 6 出库 7 组件加工 8 板材不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "是否推送终端客户:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否推送终端客户:0 否 1 是不能为空")
|
||||
private Boolean isCustom;
|
||||
|
||||
@Schema(description = "是否推送经销商:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否推送经销商:0 否 1 是不能为空")
|
||||
private Boolean isDealer;
|
||||
|
||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排序优先级不能为空")
|
||||
private Short sort;
|
||||
|
||||
@Schema(description = "小时产量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "小时产量不能为空")
|
||||
private Double hourCapacity;
|
||||
|
||||
@Schema(description = "单位", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "单位不能为空")
|
||||
private String unit;
|
||||
|
||||
@Schema(description = "是否启用:0 否 1 是", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "是否启用:0 否 1 是不能为空")
|
||||
private Boolean isEnabled;
|
||||
|
||||
@Schema(description = "准备时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "准备时间不能为空")
|
||||
private Double prepareTime;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12,13")
|
||||
private String users;
|
||||
|
||||
@Schema(description = "组织Id", requiredMode = Schema.RequiredMode.REQUIRED, example = "181")
|
||||
private Long organId;
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.cf.imes.module.system.controller.admin.process.vo.processUser;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 工序用户表 process_user Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProcessAndUserRespVO {
|
||||
|
||||
@Schema(description = "工序 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9416")
|
||||
@ExcelProperty("工序 ID")
|
||||
private Long processId;
|
||||
|
||||
@Schema(description = "用户 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24517")
|
||||
@ExcelProperty("用户 ID")
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.cf.imes.module.system.controller.admin.process.vo.processUser;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 工序用户表 process_user新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProcessAndUserSaveReqVO {
|
||||
|
||||
@Schema(description = "工序 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "9416")
|
||||
@NotNull(message = "工序 ID不能为空")
|
||||
private Long processId;
|
||||
|
||||
@Schema(description = "用户 ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24517")
|
||||
@NotNull(message = "用户 ID不能为空")
|
||||
private Long userId;
|
||||
|
||||
private Long organId;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user