From 532d0b7f83815ebeb4be9aa1f7a6683ede831b6a Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期二, 10 十二月 2024 15:15:41 +0800 Subject: [PATCH] 生产调度 --- iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ToWashPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/McMzEntity.java | 51 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/WashPlanDetService.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehousePositionController.java | 69 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehouseItemEntity.java | 52 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehouseItemService.java | 26 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/DutyInfoPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/McMzPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ToWashEntity.java | 77 + iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/vo/RunTimePageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/package-info.java | 2 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/ProdAccidentEntity.java | 108 + iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ToWashDetService.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/DutyInfoServiceImpl.java | 56 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/ProdAccidentDao.java | 17 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/HourVolumeDao.java | 28 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/DispatchLogPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/HourVolumeServiceImpl.java | 56 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehouseItemServiceImpl.java | 47 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/service/impl/SaleVolumeServiceImpl.java | 56 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/dao/RunTimeDao.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehouseStockService.java | 27 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ToWashDetServiceImpl.java | 56 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/WashPlanEntity.java | 131 + iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/service/RunTimeService.java | 25 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ToWashServiceImpl.java | 56 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/WashPlanDetPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ToWashDetEntity.java | 74 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehousePositionServiceImpl.java | 55 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/DutyInfoController.java | 69 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/entity/RunTimeEntity.java | 112 + iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/WashPlanService.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/HourVolumeService.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/HourVolumeController.java | 62 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/security/config/SecurityConfiguration.java | 13 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/McMzService.java | 25 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehouseItemPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/controller/package-info.java | 2 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/ProdAccidentService.java | 24 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/WashPlanPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/ProdAccidentServiceImpl.java | 56 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/McMzDao.java | 31 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehousePositionPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ProdVolumeServiceImpl.java | 56 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ProdVolumeEntity.java | 49 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/DispatchLogServiceImpl.java | 59 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ProdVolumeService.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/TransferInController.java | 62 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/DutyInfoEntity.java | 116 + iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/TransferInEntity.java | 49 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/service/SaleVolumeService.java | 26 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehouseStockEntity.java | 198 ++ iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/McMzServiceImpl.java | 48 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/WashPlanDao.java | 28 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehouseStockServiceImpl.java | 58 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/controller/package-info.java | 2 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehouseStockController.java | 69 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ProdVolumeDao.java | 27 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/TransferInServiceImpl.java | 56 iailab-xmc-pms-biz/src/main/resources/mapper/hourVolume/HourVolumeDao.xml | 51 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/entity/SaleVolumeEntity.java | 72 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/controller/admin/SaleVolumeController.java | 58 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/TransferInDao.java | 27 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ToWashDetPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/McMzController.java | 67 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/ProdAccidentPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/package-info.java | 2 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ToWashDao.java | 27 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/TransferInPageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ToWashService.java | 23 iailab-xmc-pms-biz/src/main/resources/application.yaml | 11 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehousePositionEntity.java | 120 + iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/package-info.java | 2 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/controller/admin/RunTimeController.java | 67 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/WashPlanDetEntity.java | 99 + iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/TransferInService.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/WashPlanDetServiceImpl.java | 56 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/WashPlanDetDao.java | 28 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/DutyInfoDao.java | 18 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/dto/SalesVolumeDto.java | 37 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/HourVolumeEntity.java | 116 + iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/DispatchLogEntity.java | 81 + iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/DispatchLogController.java | 69 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ToWashDetDao.java | 28 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/dao/SaleVolumeDao.java | 22 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/ToWashController.java | 62 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/vo/SaleVolumePageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehouseItemController.java | 67 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/WashPlanController.java | 62 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ProdVolumePageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/service/impl/RunTimeServiceImpl.java | 58 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehousePositionService.java | 33 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/DispatchLogDao.java | 17 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/ProdAccidentController.java | 67 /dev/null | 7 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/DispatchLogService.java | 26 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/DutyInfoService.java | 26 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehousePositionDao.java | 28 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/HourVolumePageReqVO.java | 23 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehouseItemDao.java | 16 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehouseStockDao.java | 53 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/ProdVolumeController.java | 62 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/WashPlanServiceImpl.java | 56 iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehouseStockPageReqVO.java | 23 104 files changed, 4,588 insertions(+), 28 deletions(-) diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/OAuth2Client.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/OAuth2Client.java deleted file mode 100644 index c3ef02b..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/OAuth2Client.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.iailab.module.pms.client; - -import com.iailab.framework.common.pojo.CommonResult; -import com.iailab.module.pms.client.dto.oauth2.OAuth2AccessTokenRespDTO; -import com.iailab.module.pms.client.dto.oauth2.OAuth2CheckTokenRespDTO; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.*; -import org.springframework.stereotype.Component; -import org.springframework.util.Assert; -import org.springframework.util.Base64Utils; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestTemplate; - -import java.nio.charset.StandardCharsets; - -/** - * OAuth 2.0 客户端 - * - * 对应调用 OAuth2OpenController 接口 - */ -@Component -public class OAuth2Client { - - private static final String BASE_URL = "http://127.0.0.1:48080/admin-api/system/oauth2"; - - /** - * 租户编号 - * - * 默认使用 1;如果使用别的租户,可以调整 - */ - public static final Long TENANT_ID = 1L; - - private static final String CLIENT_ID = "pms"; - private static final String CLIENT_SECRET = "pms111111111111111"; - - -// @Resource // 可优化,注册一个 RestTemplate Bean,然后注入 - private final RestTemplate restTemplate = new RestTemplate(); - - /** - * 使用 code 授权码,获得访问令牌 - * - * @param code 授权码 - * @param redirectUri 重定向 URI - * @return 访问令牌 - */ - public CommonResult<OAuth2AccessTokenRespDTO> postAccessToken(String code, String redirectUri) { - // 1.1 构建请求头 - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - headers.set("tenant-id", TENANT_ID.toString()); - addClientHeader(headers); - // 1.2 构建请求参数 - MultiValueMap<String, Object> body = new LinkedMultiValueMap<>(); - body.add("grant_type", "authorization_code"); - body.add("code", code); - body.add("redirect_uri", redirectUri); -// body.add("state", ""); // 选填;填了会校验 - - // 2. 执行请求 - ResponseEntity<CommonResult<OAuth2AccessTokenRespDTO>> exchange = restTemplate.exchange( - BASE_URL + "/token", - HttpMethod.POST, - new HttpEntity<>(body, headers), - new ParameterizedTypeReference<CommonResult<OAuth2AccessTokenRespDTO>>() {}); // 解决 CommonResult 的泛型丢失 - Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功"); - return exchange.getBody(); - } - - /** - * 校验访问令牌,并返回它的基本信息 - * - * @param token 访问令牌 - * @return 访问令牌的基本信息 - */ - public CommonResult<OAuth2CheckTokenRespDTO> checkToken(String token) { - // 1.1 构建请求头 - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - headers.set("tenant-id", TENANT_ID.toString()); - addClientHeader(headers); - // 1.2 构建请求参数 - MultiValueMap<String, Object> body = new LinkedMultiValueMap<>(); - body.add("token", token); - - // 2. 执行请求 - ResponseEntity<CommonResult<OAuth2CheckTokenRespDTO>> exchange = restTemplate.exchange( - BASE_URL + "/check-token", - HttpMethod.POST, - new HttpEntity<>(body, headers), - new ParameterizedTypeReference<CommonResult<OAuth2CheckTokenRespDTO>>() {}); // 解决 CommonResult 的泛型丢失 - Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功"); - return exchange.getBody(); - } - - /** - * 使用刷新令牌,获得(刷新)访问令牌 - * - * @param refreshToken 刷新令牌 - * @return 访问令牌 - */ - public CommonResult<OAuth2AccessTokenRespDTO> refreshToken(String refreshToken) { - // 1.1 构建请求头 - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - headers.set("tenant-id", TENANT_ID.toString()); - addClientHeader(headers); - // 1.2 构建请求参数 - MultiValueMap<String, Object> body = new LinkedMultiValueMap<>(); - body.add("grant_type", "refresh_token"); - body.add("refresh_token", refreshToken); - - // 2. 执行请求 - ResponseEntity<CommonResult<OAuth2AccessTokenRespDTO>> exchange = restTemplate.exchange( - BASE_URL + "/token", - HttpMethod.POST, - new HttpEntity<>(body, headers), - new ParameterizedTypeReference<CommonResult<OAuth2AccessTokenRespDTO>>() {}); // 解决 CommonResult 的泛型丢失 - Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功"); - return exchange.getBody(); - } - - /** - * 删除访问令牌 - * - * @param token 访问令牌 - * @return 成功 - */ - public CommonResult<Boolean> revokeToken(String token) { - // 1.1 构建请求头 - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - headers.set("tenant-id", TENANT_ID.toString()); - addClientHeader(headers); - // 1.2 构建请求参数 - MultiValueMap<String, Object> body = new LinkedMultiValueMap<>(); - body.add("token", token); - - // 2. 执行请求 - ResponseEntity<CommonResult<Boolean>> exchange = restTemplate.exchange( - BASE_URL + "/token", - HttpMethod.DELETE, - new HttpEntity<>(body, headers), - new ParameterizedTypeReference<CommonResult<Boolean>>() {}); // 解决 CommonResult 的泛型丢失 - Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功"); - return exchange.getBody(); - } - - private static void addClientHeader(HttpHeaders headers) { - // client 拼接,需要 BASE64 编码 - String client = CLIENT_ID + ":" + CLIENT_SECRET; - client = Base64Utils.encodeToString(client.getBytes(StandardCharsets.UTF_8)); - headers.add("Authorization", "Basic " + client); - } - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/UserClient.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/UserClient.java deleted file mode 100644 index 0307c5f..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/UserClient.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.iailab.module.pms.client; - -import com.iailab.framework.common.pojo.CommonResult; -import com.iailab.framework.security.core.LoginUser; -import com.iailab.module.pms.client.dto.user.UserInfoRespDTO; -import com.iailab.module.pms.client.dto.user.UserUpdateReqDTO; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.*; -import org.springframework.stereotype.Component; -import org.springframework.util.Assert; -import org.springframework.util.LinkedMultiValueMap; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestTemplate; - -import static com.iailab.framework.security.core.util.SecurityFrameworkUtils.getLoginUser; - -/** - * 用户 User 信息的客户端 - * - * 对应调用 OAuth2UserController 接口 - */ -@Component -public class UserClient { - - private static final String BASE_URL = "http://127.0.0.1:48080/admin-api/system/oauth2/user"; - - // @Resource // 可优化,注册一个 RestTemplate Bean,然后注入 - private final RestTemplate restTemplate = new RestTemplate(); - - public CommonResult<UserInfoRespDTO> getUser() { - // 1.1 构建请求头 - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED); - headers.set("tenant-id", OAuth2Client.TENANT_ID.toString()); - addTokenHeader(headers); - // 1.2 构建请求参数 - MultiValueMap<String, Object> body = new LinkedMultiValueMap<>(); - - // 2. 执行请求 - ResponseEntity<CommonResult<UserInfoRespDTO>> exchange = restTemplate.exchange( - BASE_URL + "/get", - HttpMethod.GET, - new HttpEntity<>(body, headers), - new ParameterizedTypeReference<CommonResult<UserInfoRespDTO>>() {}); // 解决 CommonResult 的泛型丢失 - Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功"); - return exchange.getBody(); - } - - public CommonResult<Boolean> updateUser(UserUpdateReqDTO updateReqDTO) { - // 1.1 构建请求头 - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON); - headers.set("tenant-id", OAuth2Client.TENANT_ID.toString()); - addTokenHeader(headers); - // 1.2 构建请求参数 - // 使用 updateReqDTO 即可 - - // 2. 执行请求 - ResponseEntity<CommonResult<Boolean>> exchange = restTemplate.exchange( - BASE_URL + "/update", - HttpMethod.PUT, - new HttpEntity<>(updateReqDTO, headers), - new ParameterizedTypeReference<CommonResult<Boolean>>() {}); // 解决 CommonResult 的泛型丢失 - Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功"); - return exchange.getBody(); - } - - - private static void addTokenHeader(HttpHeaders headers) { - LoginUser loginUser = getLoginUser(); - Assert.notNull(loginUser, "登录用户不能为空"); - headers.add("Authorization", "Bearer " + loginUser.getAccessToken()); - } -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/oauth2/OAuth2AccessTokenRespDTO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/oauth2/OAuth2AccessTokenRespDTO.java deleted file mode 100644 index fceb4ae..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/oauth2/OAuth2AccessTokenRespDTO.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.iailab.module.pms.client.dto.oauth2; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 访问令牌 Response DTO - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class OAuth2AccessTokenRespDTO { - - /** - * 访问令牌 - */ - private String accessToken; - - /** - * 刷新令牌 - */ - private String refreshToken; - - /** - * 令牌类型 - */ - private String tokenType; - - /** - * 过期时间;单位:秒 - */ - private Long expiresTime; - - /** - * 授权范围;如果多个授权范围,使用空格分隔 - */ - private String scope; - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/oauth2/OAuth2CheckTokenRespDTO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/oauth2/OAuth2CheckTokenRespDTO.java deleted file mode 100644 index 5a24e5c..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/oauth2/OAuth2CheckTokenRespDTO.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.iailab.module.pms.client.dto.oauth2; - -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * 校验令牌 Response DTO - * - * @author 芋道源码 - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class OAuth2CheckTokenRespDTO { - - /** - * 用户编号 - */ - @JsonProperty("user_id") - private Long userId; - /** - * 用户类型 - */ - @JsonProperty("user_type") - private Integer userType; - /** - * 租户编号 - */ - @JsonProperty("tenant_id") - private Long tenantId; - - /** - * 客户端编号 - */ - @JsonProperty("client_id") - private String clientId; - /** - * 授权范围 - */ - private List<String> scopes; - - /** - * 访问令牌 - */ - @JsonProperty("access_token") - private String accessToken; - - /** - * 过期时间 - * - * 时间戳 / 1000,即单位:秒 - */ - private Long exp; - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/user/UserInfoRespDTO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/user/UserInfoRespDTO.java deleted file mode 100644 index 7ae5000..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/user/UserInfoRespDTO.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.iailab.module.pms.client.dto.user; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -/** - * 获得用户基本信息 Response dto - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class UserInfoRespDTO { - - /** - * 用户编号 - */ - private Long id; - - /** - * 用户账号 - */ - private String username; - - /** - * 用户昵称 - */ - private String nickname; - - /** - * 用户邮箱 - */ - private String email; - /** - * 手机号码 - */ - private String mobile; - - /** - * 用户性别 - */ - private Integer sex; - - /** - * 用户头像 - */ - private String avatar; - - /** - * 所在部门 - */ - private Dept dept; - - /** - * 所属岗位数组 - */ - private List<Post> posts; - - /** - * 部门 - */ - @Data - public static class Dept { - - /** - * 部门编号 - */ - private Long id; - - /** - * 部门名称 - */ - private String name; - - } - - /** - * 岗位 - */ - @Data - public static class Post { - - /** - * 岗位编号 - */ - private Long id; - - /** - * 岗位名称 - */ - private String name; - - } - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/user/UserUpdateReqDTO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/user/UserUpdateReqDTO.java deleted file mode 100644 index 042c812..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/client/dto/user/UserUpdateReqDTO.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.iailab.module.pms.client.dto.user; - -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * 更新用户基本信息 Request DTO - */ -@Data -@NoArgsConstructor -@AllArgsConstructor -public class UserUpdateReqDTO { - - /** - * 用户昵称 - */ - private String nickname; - - /** - * 用户邮箱 - */ - private String email; - - /** - * 手机号码 - */ - private String mobile; - - /** - * 用户性别 - */ - private Integer sex; - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/config/SystemDBInitConfiguration.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/config/SystemDBInitConfiguration.java deleted file mode 100644 index 0a7db0c..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/config/SystemDBInitConfiguration.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.iailab.module.pms.config;//package com.iailab.module.system.config; -// -//import com.baomidou.mybatisplus.annotation.DbType; -//import com.iailab.framework.mybatis.core.enums.SqlConstants; -//import org.springframework.context.annotation.Configuration; -// -//@Configuration -//public class SystemDBInitConfiguration { -// SqlConstants.init(DbType.MYSQL); -//} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/auth/AuthController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/auth/AuthController.java deleted file mode 100644 index f338c17..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/auth/AuthController.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.iailab.module.pms.controller.admin.auth; - -import cn.hutool.core.util.StrUtil; -import com.iailab.framework.common.pojo.CommonResult; -import com.iailab.module.pms.client.OAuth2Client; -import com.iailab.module.pms.client.dto.oauth2.OAuth2AccessTokenRespDTO; -import com.iailab.module.pms.util.SecurityUtils; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; - -import javax.annotation.Resource; -import javax.annotation.security.PermitAll; -import javax.servlet.http.HttpServletRequest; - -@RestController -@RequestMapping("/pms/auth") -public class AuthController { - - @Resource - private OAuth2Client oauth2Client; - - /** - * 使用 code 访问令牌,获得访问令牌 - * - * @param code 授权码 - * @param redirectUri 重定向 URI - * @return 访问令牌;注意,实际项目中,最好创建对应的 ResponseVO 类,只返回必要的字段 - */ - @PostMapping("/loginBycode") - @PermitAll - public CommonResult<OAuth2AccessTokenRespDTO> loginByCode(@RequestParam("code") String code, - @RequestParam("redirectUri") String redirectUri) { - return oauth2Client.postAccessToken(code, redirectUri); - } - - /** - * 使用刷新令牌,获得(刷新)访问令牌 - * - * @param refreshToken 刷新令牌 - * @return 访问令牌;注意,实际项目中,最好创建对应的 ResponseVO 类,只返回必要的字段 - */ - @PostMapping("/refresh-token") - public CommonResult<OAuth2AccessTokenRespDTO> refreshToken(@RequestParam("refreshToken") String refreshToken) { - return oauth2Client.refreshToken(refreshToken); - } - - /** - * 退出登录 - * - * @param request 请求 - * @return 成功 - */ - @PostMapping("/logout") - public CommonResult<Boolean> logout(HttpServletRequest request) { - String token = SecurityUtils.obtainAuthorization(request, "Authorization"); - if (StrUtil.isNotBlank(token)) { - return oauth2Client.revokeToken(token); - } - // 返回成功 - return new CommonResult<>(); - } - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/DemoController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/DemoController.java deleted file mode 100644 index 36bbfb8..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/DemoController.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.iailab.module.pms.controller.admin.demo; - -import com.iailab.framework.apilog.core.annotation.ApiAccessLog; -import com.iailab.framework.common.pojo.CommonResult; -import com.iailab.framework.common.pojo.PageParam; -import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.common.util.object.BeanUtils; -import com.iailab.framework.excel.core.util.ExcelUtils; -import com.iailab.module.pms.controller.admin.demo.vo.DemoPageReqVO; -import com.iailab.module.pms.controller.admin.demo.vo.DemoRespVO; -import com.iailab.module.pms.controller.admin.demo.vo.DemoSaveReqVO; -import com.iailab.module.pms.dal.dataobject.demo.DemoDO; -import com.iailab.module.pms.service.demo.DemoService; -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 javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; -import java.io.IOException; -import java.util.List; - -import static com.iailab.framework.apilog.core.enums.OperateTypeEnum.EXPORT; -import static com.iailab.framework.common.pojo.CommonResult.success; - -@Tag(name = "管理后台 - 演示管理") -@RestController -@RequestMapping("/pms/demo") -public class DemoController { - - @Resource - private DemoService demoService; - - @PostMapping("/create") - @Operation(summary = "创建演示") - @PreAuthorize("@ss.hasPermission('pms:demo:create')") - public CommonResult<Long> createDemo(@Valid @RequestBody DemoSaveReqVO createReqVO) { - return success(demoService.create(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新演示") - @PreAuthorize("@ss.hasPermission('pms:demo:update')") - public CommonResult<Boolean> updateDemo(@Valid @RequestBody DemoSaveReqVO updateReqVO) { - demoService.update(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除演示") - @Parameter(name = "id", description = "ID", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('pms:demo:delete')") - public CommonResult<Boolean> deleteDemo(@RequestParam("id") Long id) { - demoService.delete(id); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得演示") - @Parameter(name = "id", description = "ID", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('pms:demo:query')") - public CommonResult<DemoRespVO> getDemo(@RequestParam("id") Long id) { - DemoDO data = demoService.getInfo(id); - return success(BeanUtils.toBean(data, DemoRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得分页") - @PreAuthorize("@ss.hasPermission('pms:demo:query')") - public CommonResult<PageResult<DemoRespVO>> getDemoPage(@Valid DemoPageReqVO pageVO) { - PageResult<DemoDO> pageResult = demoService.getPage(pageVO); - return success(BeanUtils.toBean(pageResult, DemoRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出 Excel") - @PreAuthorize("@ss.hasPermission('system:demo:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportDemoExcel(@Valid DemoPageReqVO exportReqVO, - HttpServletResponse response) throws IOException { - exportReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List<DemoDO> list = demoService.getPage(exportReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "租户.xls", "数据", DemoRespVO.class, - BeanUtils.toBean(list, DemoRespVO.class)); - } -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/vo/DemoPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/vo/DemoPageReqVO.java deleted file mode 100644 index aa7dce9..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/vo/DemoPageReqVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.iailab.module.pms.controller.admin.demo.vo; - -import com.iailab.framework.common.pojo.PageParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; - -/** - * @author PanZhibao - * @Description - * @createTime 2024年08月17日 - */ -@Schema(description = "管理后台 - 演示分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class DemoPageReqVO extends PageParam { - - private String code; - - private String name; -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/vo/DemoRespVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/vo/DemoRespVO.java deleted file mode 100644 index 9f9abee..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/vo/DemoRespVO.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.iailab.module.pms.controller.admin.demo.vo; - -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; - -/** - * @author PanZhibao - * @Description - * @createTime 2024年08月18日 - */ -@Schema(description = "管理后台 - 演示 Response VO") -@Data -@ExcelIgnoreUnannotated -public class DemoRespVO { - - @Schema(description = "演示编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") - @ExcelProperty("演示编号") - private Long id; - - @Schema(description = "演示编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "演示编号") - @ExcelProperty("演示编号") - private String code; - - @Schema(description = "演示名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "演示名称") - @ExcelProperty("演示名称") - private String name; - - @Schema(description = "演示图标", requiredMode = Schema.RequiredMode.REQUIRED, example = "演示图标") - @ExcelProperty("演示图标") - private String icon; - - @Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED, example = "排序") - @ExcelProperty("排序") - private Integer orderNum; - - @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "状态") - @ExcelProperty("状态") - private Integer status; - - @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "备注") - @ExcelProperty("备注") - private String remark; - - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建时间") - private LocalDateTime createTime; - - @Schema(description = "演示菜单ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "演示菜单ID") - private Long appMenuId; - - /** - * 演示类型(1-系统菜单, 2-演示菜单) - */ - private Integer appType; -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/vo/DemoSaveReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/vo/DemoSaveReqVO.java deleted file mode 100644 index 6d869fa..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/demo/vo/DemoSaveReqVO.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.iailab.module.pms.controller.admin.demo.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import javax.validation.constraints.NotNull; - -/** - * @author PanZhibao - * @Description - * @createTime 2024年08月17日 - */ -@Schema(description = "管理后台 - 演示创建/修改 Request VO") -@Data -public class DemoSaveReqVO { - - @Schema(description = "ID") - private Long id; - - @Schema(description = "演示编号", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "演示编号不能为空") - private String code; - - @Schema(description = "演示名称", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "演示名称不能为空") - private String name; - - @Schema(description = "演示图标", example = "") - private String icon; - - @Schema(description = "排序", example = "") - private Integer orderNum; - - @Schema(description = "状态", example = "") - private Integer status; - - @Schema(description = "备注", example = "") - private String remark; -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/package-info.java deleted file mode 100644 index 456b21a..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/admin/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.iailab.module.pms.controller.admin; \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/app/ip/AppAreaController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/app/ip/AppAreaController.java deleted file mode 100644 index 8bef458..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/app/ip/AppAreaController.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.iailab.module.pms.controller.app.ip; - -import cn.hutool.core.lang.Assert; -import com.iailab.framework.common.pojo.CommonResult; -import com.iailab.framework.common.util.object.BeanUtils; -import com.iailab.framework.ip.core.Area; -import com.iailab.framework.ip.core.utils.AreaUtils; -import com.iailab.module.pms.controller.app.ip.vo.AppAreaNodeRespVO; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import java.util.List; - -import static com.iailab.framework.common.pojo.CommonResult.success; - -@Tag(name = "用户 App - 地区") -@RestController -@RequestMapping("/system/area") -@Validated -public class AppAreaController { - - @GetMapping("/tree") - @Operation(summary = "获得地区树") - public CommonResult<List<AppAreaNodeRespVO>> getAreaTree() { - Area area = AreaUtils.getArea(Area.ID_CHINA); - Assert.notNull(area, "获取不到中国"); - return success(BeanUtils.toBean(area.getChildren(), AppAreaNodeRespVO.class)); - } - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/app/ip/vo/AppAreaNodeRespVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/app/ip/vo/AppAreaNodeRespVO.java deleted file mode 100644 index bd224ab..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/app/ip/vo/AppAreaNodeRespVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.iailab.module.pms.controller.app.ip.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; - -import java.util.List; - -@Schema(description = "用户 App - 地区节点 Response VO") -@Data -public class AppAreaNodeRespVO { - - @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "110000") - private Integer id; - - @Schema(description = "名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "北京") - private String name; - - /** - * 子节点 - */ - private List<AppAreaNodeRespVO> children; - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/app/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/app/package-info.java deleted file mode 100644 index 0ad09cc..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/app/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 占位,避免 package 无法提交到 Git 仓库 - */ -package com.iailab.module.pms.controller.app; diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/dataobject/demo/DemoDO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/dataobject/demo/DemoDO.java deleted file mode 100644 index bfa46f6..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/dataobject/demo/DemoDO.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.iailab.module.pms.dal.dataobject.demo; - -import com.baomidou.mybatisplus.annotation.KeySequence; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.iailab.framework.tenant.core.db.TenantBaseDO; -import lombok.Data; -import lombok.EqualsAndHashCode; - -/** - * 演示表 - * - * @author Houzhongjian - * @Description - * @createTime 2024年09月05日 - */ -@TableName("demo") -@KeySequence("demo_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -public class DemoDO extends TenantBaseDO { - - public static final Long PARENT_ID_ROOT = 0L; - - /** - * ID - */ - @TableId - private Long id; - - /** - * 编号 - */ - private String code; - - /** - * 名称 - */ - private String name; - - - /** - * 图标 - */ - private String icon; - - /** - * 排序 - */ - private Integer orderNum; - - /** - * 状态 - */ - private Integer status; - - /** - * 备注 - */ - private String remark; - -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/dataobject/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/dataobject/package-info.java deleted file mode 100644 index 5c14416..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/dataobject/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.iailab.module.pms.dal.dataobject; \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/mysql/demo/DemoMapper.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/mysql/demo/DemoMapper.java deleted file mode 100644 index e83d3bb..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/mysql/demo/DemoMapper.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.iailab.module.pms.dal.mysql.demo; - -import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.mybatis.core.mapper.BaseMapperX; -import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.iailab.module.pms.controller.admin.demo.vo.DemoPageReqVO; -import com.iailab.module.pms.dal.dataobject.demo.DemoDO; -import org.apache.ibatis.annotations.Mapper; - -/** - * @author Houzhongjian - * @Description - * @createTime 2024年09月05日 - */ -@Mapper -public interface DemoMapper extends BaseMapperX<DemoDO> { - - default PageResult<DemoDO> selectPage(DemoPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX<DemoDO>() - .likeIfPresent(DemoDO::getCode, reqVO.getCode()) - .likeIfPresent(DemoDO::getName, reqVO.getName()) - .orderByDesc(DemoDO::getId)); - } -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/mysql/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/mysql/package-info.java deleted file mode 100644 index 117d32d..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/dal/mysql/package-info.java +++ /dev/null @@ -1,9 +0,0 @@ -/** - * DAL = Data Access Layer 数据访问层 - * 1. data object:数据对象 - * 2. redis:Redis 的 CRUD 操作 - * 3. mysql:MySQL 的 CRUD 操作 - * - * 其中,MySQL 的表以 system_ 作为前缀 - */ -package com.iailab.module.pms.dal.mysql; diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/captcha/config/IailabCaptchaConfiguration.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/captcha/config/IailabCaptchaConfiguration.java deleted file mode 100644 index c1f1d82..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/captcha/config/IailabCaptchaConfiguration.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.iailab.module.pms.framework.captcha.config; - -import com.iailab.module.pms.framework.captcha.core.RedisCaptchaServiceImpl; -import com.xingyuv.captcha.properties.AjCaptchaProperties; -import com.xingyuv.captcha.service.CaptchaCacheService; -import com.xingyuv.captcha.service.impl.CaptchaServiceFactory; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.data.redis.core.StringRedisTemplate; - -/** - * 验证码的配置类 - * - * @author iailab - */ -@Configuration(proxyBeanMethods = false) -public class IailabCaptchaConfiguration { - - @Bean - public CaptchaCacheService captchaCacheService(AjCaptchaProperties config, - StringRedisTemplate stringRedisTemplate) { - CaptchaCacheService captchaCacheService = CaptchaServiceFactory.getCache(config.getCacheType().name()); - if (captchaCacheService instanceof RedisCaptchaServiceImpl) { - ((RedisCaptchaServiceImpl) captchaCacheService).setStringRedisTemplate(stringRedisTemplate); - } - return captchaCacheService; - } - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/captcha/core/RedisCaptchaServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/captcha/core/RedisCaptchaServiceImpl.java deleted file mode 100644 index 35e1211..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/captcha/core/RedisCaptchaServiceImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.iailab.module.pms.framework.captcha.core; - -import com.xingyuv.captcha.service.CaptchaCacheService; -import lombok.Setter; -import org.springframework.data.redis.core.StringRedisTemplate; - -import java.util.concurrent.TimeUnit; - -/** - * 基于 Redis 实现验证码的存储 - * - * @author 星语 - */ -@Setter -public class RedisCaptchaServiceImpl implements CaptchaCacheService { - - private StringRedisTemplate stringRedisTemplate; - - @Override - public String type() { - return "redis"; - } - - @Override - public void set(String key, String value, long expiresInSeconds) { - stringRedisTemplate.opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS); - } - - @Override - public boolean exists(String key) { - return Boolean.TRUE.equals(stringRedisTemplate.hasKey(key)); - } - - @Override - public void delete(String key) { - stringRedisTemplate.delete(key); - } - - @Override - public String get(String key) { - return stringRedisTemplate.opsForValue().get(key); - } - - @Override - public Long increment(String key, long val) { - return stringRedisTemplate.opsForValue().increment(key,val); - } - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/captcha/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/captcha/package-info.java deleted file mode 100644 index 620df37..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/captcha/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * 验证码拓展 - * - * 基于 aj-captcha 实现滑块验证码,文档:https://ajcaptcha.beliefteam.cn/captcha-doc/ - * - * @author 星语 - */ -package com.iailab.module.pms.framework.captcha; \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/security/config/SecurityConfiguration.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/security/config/SecurityConfiguration.java index 3579c84..69e03df 100644 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/security/config/SecurityConfiguration.java +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/framework/security/config/SecurityConfiguration.java @@ -21,17 +21,20 @@ public void customize(AuthorizeHttpRequestsConfigurer<HttpSecurity>.AuthorizationManagerRequestMatcherRegistry registry) { // TODO iailab:这个每个项目都需要重复配置,得捉摸有没通用的方案 // Swagger 接口文档 - registry.requestMatchers("/v3/api-docs/**").permitAll() // 元数据 - .requestMatchers("/swagger-ui.html").permitAll(); // Swagger UI + registry.requestMatchers("/v3/api-docs/**").permitAll() + .requestMatchers("/webjars/**").permitAll() + .requestMatchers("/swagger-ui").permitAll() + .requestMatchers("/swagger-ui/**").permitAll(); // Druid 监控 - registry.requestMatchers("/druid/**").anonymous(); + registry.requestMatchers("/druid/**").permitAll(); // Spring Boot Actuator 的安全配置 - registry.requestMatchers("/actuator").anonymous() - .requestMatchers("/actuator/**").anonymous(); + registry.requestMatchers("/actuator").permitAll() + .requestMatchers("/actuator/**").permitAll(); // RPC 服务的安全配置 registry.requestMatchers(ApiConstants.PREFIX + "/**").permitAll(); } }; } + } diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/config/ScheduleConfig.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/config/ScheduleConfig.java deleted file mode 100644 index 362c858..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/config/ScheduleConfig.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.iailab.module.pms.job.config; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.quartz.SchedulerFactoryBean; - -import javax.sql.DataSource; -import java.util.Properties; - -/** - * 定时任务配置 - * - * @author Mark sunlightcs@gmail.com - */ -@Configuration -public class ScheduleConfig { - - @Bean - public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource) { - SchedulerFactoryBean factory = new SchedulerFactoryBean(); - factory.setDataSource(dataSource); - - //quartz参数 - Properties prop = new Properties(); - prop.put("org.quartz.scheduler.instanceName", "IailabDataScheduler"); - prop.put("org.quartz.scheduler.instanceId", "AUTO"); - //线程池配置 - prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool"); - prop.put("org.quartz.threadPool.threadCount", "20"); - prop.put("org.quartz.threadPool.threadPriority", "5"); - //JobStore配置 - prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore"); - //集群配置 - prop.put("org.quartz.jobStore.isClustered", "true"); - prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000"); - prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1"); - - prop.put("org.quartz.jobStore.misfireThreshold", "12000"); - prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_"); - prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?"); - - //PostgreSQL数据库,需要打开此注释 - //prop.put("org.quartz.jobStore.driverDelegateClass", "org.quartz.impl.jdbcjobstore.PostgreSQLDelegate"); - - factory.setQuartzProperties(prop); - - factory.setSchedulerName("IailabDataScheduler"); - //延时启动 - factory.setStartupDelay(30); - factory.setApplicationContextSchedulerContextKey("applicationContextKey"); - //可选,QuartzScheduler 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了 - factory.setOverwriteExistingJobs(true); - //设置自动启动,默认为true - factory.setAutoStartup(true); - - return factory; - } -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/controller/admin/ScheduleJobController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/controller/admin/ScheduleJobController.java deleted file mode 100644 index 577da7d..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/controller/admin/ScheduleJobController.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.iailab.module.pms.job.controller.admin; - -import com.iailab.framework.common.pojo.CommonResult; -import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.common.util.object.BeanUtils; -import com.iailab.framework.common.util.validation.ValidationUtils; -import com.iailab.framework.common.validation.group.AddGroup; -import com.iailab.framework.common.validation.group.DefaultGroup; -import com.iailab.framework.common.validation.group.UpdateGroup; -import com.iailab.framework.tenant.core.context.TenantContextHolder; -import com.iailab.module.pms.job.dto.ScheduleJobDTO; -import com.iailab.module.pms.job.entity.ScheduleJobEntity; -import com.iailab.module.pms.job.service.ScheduleJobService; -import com.iailab.module.pms.job.vo.ScheduleJobReqVO; -import io.swagger.v3.oas.annotations.Operation; -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 static com.iailab.framework.common.pojo.CommonResult.success; - -/** - * 定时任务 - * - * @author Mark sunlightcs@gmail.com - */ -@RestController -@RequestMapping("/pms/job/schedule") -@Tag(name = "定时任务") -public class ScheduleJobController { - @Resource - private ScheduleJobService scheduleJobService; - - @GetMapping("page") - @Operation(summary = "分页") - @PreAuthorize("@ss.hasPermission('pms:schedule:query')") - public CommonResult<PageResult<ScheduleJobDTO>> page(@Validated ScheduleJobReqVO reqVO){ - reqVO.setTenantId(TenantContextHolder.getTenantId()); - PageResult<ScheduleJobEntity> page = scheduleJobService.page(reqVO); - - return success(BeanUtils.toBean(page, ScheduleJobDTO.class)); - } - - @GetMapping("info") - @Operation(summary = "信息") - @PreAuthorize("@ss.hasPermission('pms:schedule:query')") - public CommonResult<ScheduleJobDTO> info(@RequestParam("id") Long id){ - ScheduleJobDTO schedule = scheduleJobService.get(id); - - return new CommonResult<ScheduleJobDTO>().setData(schedule); - } - - @PostMapping("/create") - @Operation(summary = "保存") - @PreAuthorize("@ss.hasPermission('pms:schedule:create')") - public CommonResult save(@RequestBody ScheduleJobDTO dto){ - ValidationUtils.validate(dto, AddGroup.class, DefaultGroup.class); - - scheduleJobService.save(dto); - - return new CommonResult(); - } - - @PutMapping("/update") - @Operation(summary = "修改") - @PreAuthorize("@ss.hasPermission('pms:schedule:update')") - public CommonResult update(@RequestBody ScheduleJobDTO dto){ - ValidationUtils.validate(dto, UpdateGroup.class, DefaultGroup.class); - - scheduleJobService.update(dto); - - return new CommonResult(); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除") - @PreAuthorize("@ss.hasPermission('pms:schedule:delete')") - public CommonResult delete(@RequestParam("id") Long id){ - scheduleJobService.deleteBatch(id); - - return new CommonResult(); - } - - @PutMapping("/run") - @Operation(summary = "立即执行") - public CommonResult run(@RequestParam("id") Long id){ - Long[] ids = new Long[1]; - ids[0] = id; - scheduleJobService.run(ids); - - return new CommonResult(); - } - - @PutMapping("/pause") - @Operation(summary = "暂停") - public CommonResult pause(@RequestParam("id") Long id){ - Long[] ids = new Long[1]; - ids[0] = id; - scheduleJobService.pause(ids); - - return new CommonResult(); - } - - @PutMapping("/resume") - @Operation(summary = "恢复") - public CommonResult resume(@RequestParam("id") Long id){ - Long[] ids = new Long[1]; - ids[0] = id; - scheduleJobService.resume(ids); - - return new CommonResult(); - } - -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/controller/admin/ScheduleJobLogController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/controller/admin/ScheduleJobLogController.java deleted file mode 100644 index 33394e2..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/controller/admin/ScheduleJobLogController.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.iailab.module.pms.job.controller.admin; - -import com.iailab.framework.common.constant.Constant; -import com.iailab.framework.common.page.PageData; -import com.iailab.framework.common.pojo.CommonResult; -import com.iailab.module.pms.job.dto.ScheduleJobLogDTO; -import com.iailab.module.pms.job.service.ScheduleJobLogService; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -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.Map; - -/** - * 定时任务日志 - * - * @author Mark sunlightcs@gmail.com - */ -@RestController -@RequestMapping("/sys/scheduleLog") -@Tag(name = "定时任务日志") -public class ScheduleJobLogController { - @Resource - private ScheduleJobLogService scheduleJobLogService; - - @GetMapping("page") - @Operation(summary = "分页") - @Parameters({ - @Parameter(name = Constant.PAGE, description = "当前页码,从1开始", required = true) , - @Parameter(name = Constant.LIMIT, description = "每页显示记录数", required = true) , - @Parameter(name = Constant.ORDER_FIELD, description = "排序字段") , - @Parameter(name = Constant.ORDER, description = "排序方式,可选值(asc、desc)") , - @Parameter(name = "jobId", description = "jobId") - }) - @PreAuthorize("@ss.hasPermission('sys:schedule:log')") - public CommonResult<PageData<ScheduleJobLogDTO>> page(@RequestParam Map<String, Object> params){ - PageData<ScheduleJobLogDTO> page = scheduleJobLogService.page(params); - - return new CommonResult<PageData<ScheduleJobLogDTO>>().setData(page); - } - - @GetMapping("{id}") - @Operation(summary = "信息") - @PreAuthorize("@ss.hasPermission('sys:schedule:log')") - public CommonResult<ScheduleJobLogDTO> info(@PathVariable("id") Long id){ - ScheduleJobLogDTO log = scheduleJobLogService.get(id); - - return new CommonResult<ScheduleJobLogDTO>().setData(log); - } -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/controller/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/controller/package-info.java deleted file mode 100644 index 3de054d..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/controller/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.iailab.module.pms.job.controller; \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dao/ScheduleJobDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dao/ScheduleJobDao.java deleted file mode 100644 index f5729b0..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dao/ScheduleJobDao.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.iailab.module.pms.job.dao; - -import com.baomidou.dynamic.datasource.annotation.Master; -import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.mybatis.core.mapper.BaseMapperX; -import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.iailab.module.pms.job.entity.ScheduleJobEntity; -import com.iailab.module.pms.job.vo.ScheduleJobReqVO; -import org.apache.ibatis.annotations.Mapper; - -import java.util.Map; - -/** - * 定时任务 - * - * @author Mark sunlightcs@gmail.com - */ -@Master -@Mapper -public interface ScheduleJobDao extends BaseMapperX<ScheduleJobEntity> { - - default PageResult<ScheduleJobEntity> selectPage(ScheduleJobReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX<ScheduleJobEntity>() - .likeIfPresent(ScheduleJobEntity::getBeanName, reqVO.getBeanName()) - .eqIfPresent(ScheduleJobEntity::getTenantId, reqVO.getTenantId()) - .orderByDesc(ScheduleJobEntity::getCreateDate)); - - } - - /** - * 批量更新状态 - */ - int updateBatch(Map<String, Object> map); -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dao/ScheduleJobLogDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dao/ScheduleJobLogDao.java deleted file mode 100644 index 25db157..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dao/ScheduleJobLogDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.iailab.module.pms.job.dao; - -import com.baomidou.dynamic.datasource.annotation.Master; -import com.iailab.framework.common.dao.BaseDao; -import com.iailab.module.pms.job.entity.ScheduleJobLogEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 定时任务日志 - * - * @author Mark sunlightcs@gmail.com - */ -@Master -@Mapper -public interface ScheduleJobLogDao extends BaseDao<ScheduleJobLogEntity> { - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dto/ScheduleJobDTO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dto/ScheduleJobDTO.java deleted file mode 100644 index 46f748a..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dto/ScheduleJobDTO.java +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.iailab.module.pms.job.dto; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.iailab.framework.common.validation.group.AddGroup; -import com.iailab.framework.common.validation.group.DefaultGroup; -import com.iailab.framework.common.validation.group.UpdateGroup; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.Data; - -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Null; -import java.io.Serializable; -import java.util.Date; - -/** - * 定时任务 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Data -@Tag(name = "定时任务") -public class ScheduleJobDTO implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "id") - @Null(message="{id.null}", groups = AddGroup.class) - @NotNull(message="{id.require}", groups = UpdateGroup.class) - private Long id; - - @Schema(description = "spring bean名称") - @NotBlank(message = "{schedule.bean.require}", groups = DefaultGroup.class) - private String beanName; - - @Schema(description = "参数") - private String params; - - @Schema(description = "cron表达式") - @NotBlank(message = "{schedule.cron.require}", groups = DefaultGroup.class) - private String cronExpression; - - @Schema(description = "任务状态 0:暂停 1:正常") - private Integer status; - - @Schema(description = "备注") - private String remark; - - @Schema(description = "创建时间") - @JsonProperty(access = JsonProperty.Access.READ_ONLY) - private Date createDate; - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dto/ScheduleJobLogDTO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dto/ScheduleJobLogDTO.java deleted file mode 100644 index 1680430..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/dto/ScheduleJobLogDTO.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.iailab.module.pms.job.dto; - -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; - -/** - * 定时任务日志 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Data -@Tag(name = "定时任务日志") -public class ScheduleJobLogDTO implements Serializable { - private static final long serialVersionUID = 1L; - - @Schema(description = "id") - private Long id; - - @Schema(description = "任务id") - private Long jobId; - - @Schema(description = "spring bean名称") - private String beanName; - - @Schema(description = "参数") - private String params; - - @Schema(description = "任务状态 0:失败 1:成功") - private Integer status; - - @Schema(description = "失败信息") - private String error; - - @Schema(description = "耗时(单位:毫秒)") - private Integer times; - - @Schema(description = "创建时间") - private Date createDate; - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/entity/ScheduleJobEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/entity/ScheduleJobEntity.java deleted file mode 100644 index 733a273..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/entity/ScheduleJobEntity.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.iailab.module.pms.job.entity; - -import com.baomidou.mybatisplus.annotation.FieldFill; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableName; -import com.iailab.framework.common.entity.BaseEntity; -import lombok.Data; -import lombok.EqualsAndHashCode; - -import java.util.Date; - -/** - * 定时任务 - * - * @author Mark sunlightcs@gmail.com - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("schedule_job") -public class ScheduleJobEntity extends BaseEntity { - private static final long serialVersionUID = 1L; - - /** - * spring bean名称 - */ - private String beanName; - /** - * 参数 - */ - private String params; - /** - * cron表达式 - */ - private String cronExpression; - /** - * 任务状态 0:暂停 1:正常 - */ - private Integer status; - /** - * 备注 - */ - private String remark; - /** - * 更新者 - */ - @TableField(fill = FieldFill.INSERT_UPDATE) - private Long updater; - /** - * 更新时间 - */ - @TableField(fill = FieldFill.INSERT_UPDATE) - private Date updateDate; - - /** - * 多租户编号 - */ - private Long tenantId; -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/entity/ScheduleJobLogEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/entity/ScheduleJobLogEntity.java deleted file mode 100644 index e37be60..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/entity/ScheduleJobLogEntity.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.iailab.module.pms.job.entity; - -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; - -import java.io.Serializable; -import java.util.Date; - -/** - * 定时任务日志 - * - * @author Mark sunlightcs@gmail.com - */ -@Data -@TableName("schedule_job_log") -public class ScheduleJobLogEntity implements Serializable { - private static final long serialVersionUID = 1L; - - /** - * id - */ - @TableId - private Long id; - /** - * 任务id - */ - private Long jobId; - /** - * spring bean名称 - */ - private String beanName; - /** - * 参数 - */ - private String params; - /** - * 任务状态 0:失败 1:成功 - */ - private Integer status; - /** - * 失败信息 - */ - private String error; - /** - * 耗时(单位:毫秒) - */ - private Integer times; - /** - * 创建时间 - */ - private Date createDate; - - /** - * 多租户编号 - */ - private Long tenantId; - -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/init/JobCommandLineRunner.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/init/JobCommandLineRunner.java deleted file mode 100644 index 3a795fe..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/init/JobCommandLineRunner.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.iailab.module.pms.job.init; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.iailab.module.pms.job.dao.ScheduleJobDao; -import com.iailab.module.pms.job.entity.ScheduleJobEntity; -import com.iailab.module.pms.job.utils.ScheduleUtils; -import org.quartz.CronTrigger; -import org.quartz.Scheduler; -import org.springframework.boot.CommandLineRunner; -import org.springframework.stereotype.Component; - -import javax.annotation.Resource; -import java.util.List; - -/** - * 初始化定时任务数据 - */ -@Component -public class JobCommandLineRunner implements CommandLineRunner { - @Resource - private Scheduler scheduler; - @Resource - private ScheduleJobDao scheduleJobDao; - - @Override - public void run(String... args) { - List<ScheduleJobEntity> scheduleJobList = scheduleJobDao.selectList(new QueryWrapper<>()); - for(ScheduleJobEntity scheduleJob : scheduleJobList){ - CronTrigger cronTrigger = ScheduleUtils.getCronTrigger(scheduler, scheduleJob.getId()); - //如果不存在,则创建 - if(cronTrigger == null) { - ScheduleUtils.createScheduleJob(scheduler, scheduleJob); - }else { - ScheduleUtils.updateScheduleJob(scheduler, scheduleJob); - } - } - } -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/ScheduleJobLogService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/ScheduleJobLogService.java deleted file mode 100644 index 122a80e..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/ScheduleJobLogService.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.iailab.module.pms.job.service; - -import com.iailab.framework.common.page.PageData; -import com.iailab.framework.common.service.BaseService; -import com.iailab.module.pms.job.dto.ScheduleJobLogDTO; -import com.iailab.module.pms.job.entity.ScheduleJobLogEntity; -import com.iailab.module.pms.job.dto.ScheduleJobLogDTO; - -import java.util.Map; - -/** - * 定时任务日志 - * - * @author Mark sunlightcs@gmail.com - */ -public interface ScheduleJobLogService extends BaseService<ScheduleJobLogEntity> { - - PageData<ScheduleJobLogDTO> page(Map<String, Object> params); - - ScheduleJobLogDTO get(Long id); -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/ScheduleJobService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/ScheduleJobService.java deleted file mode 100644 index 4b24067..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/ScheduleJobService.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.iailab.module.pms.job.service; - -import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.common.service.BaseService; -import com.iailab.module.pms.job.dto.ScheduleJobDTO; -import com.iailab.module.pms.job.entity.ScheduleJobEntity; -import com.iailab.module.pms.job.vo.ScheduleJobReqVO; - - -/** - * 定时任务 - * - * @author Mark sunlightcs@gmail.com - */ -public interface ScheduleJobService{ - - PageResult<ScheduleJobEntity> page(ScheduleJobReqVO reqVO); - - ScheduleJobDTO get(Long id); - - /** - * 保存定时任务 - */ - void save(ScheduleJobDTO dto); - - /** - * 更新定时任务 - */ - void update(ScheduleJobDTO dto); - - /** - * 批量删除定时任务 - */ - void deleteBatch(Long id); - - /** - * 批量更新定时任务状态 - */ - int updateBatch(Long[] ids, int status); - - /** - * 立即执行 - */ - void run(Long[] ids); - - /** - * 暂停运行 - */ - void pause(Long[] ids); - - /** - * 恢复运行 - */ - void resume(Long[] ids); -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/impl/ScheduleJobLogServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/impl/ScheduleJobLogServiceImpl.java deleted file mode 100644 index 9bac2cd..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/impl/ScheduleJobLogServiceImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.iailab.module.pms.job.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.iailab.framework.common.constant.Constant; -import com.iailab.framework.common.page.PageData; -import com.iailab.framework.common.service.impl.BaseServiceImpl; -import com.iailab.framework.common.util.object.ConvertUtils; -import com.iailab.module.pms.job.dao.ScheduleJobLogDao; -import com.iailab.module.pms.job.dto.ScheduleJobLogDTO; -import com.iailab.module.pms.job.entity.ScheduleJobLogEntity; -import com.iailab.module.pms.job.service.ScheduleJobLogService; -import org.apache.commons.lang3.StringUtils; -import org.springframework.stereotype.Service; - -import java.util.Map; - -@Service -public class ScheduleJobLogServiceImpl extends BaseServiceImpl<ScheduleJobLogDao, ScheduleJobLogEntity> implements ScheduleJobLogService { - - @Override - public PageData<ScheduleJobLogDTO> page(Map<String, Object> params) { - IPage<ScheduleJobLogEntity> page = baseDao.selectPage( - getPage(params, Constant.CREATE_DATE, false), - getWrapper(params) - ); - return getPageData(page, ScheduleJobLogDTO.class); - } - - private QueryWrapper<ScheduleJobLogEntity> getWrapper(Map<String, Object> params){ - String jobId = (String)params.get("jobId"); - - QueryWrapper<ScheduleJobLogEntity> wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(jobId), "job_id", jobId); - - return wrapper; - } - - @Override - public ScheduleJobLogDTO get(Long id) { - ScheduleJobLogEntity entity = baseDao.selectById(id); - - return ConvertUtils.sourceToTarget(entity, ScheduleJobLogDTO.class); - } - -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/impl/ScheduleJobServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/impl/ScheduleJobServiceImpl.java deleted file mode 100644 index ebb9ccd..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/service/impl/ScheduleJobServiceImpl.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.iailab.module.pms.job.service.impl; - -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.iailab.framework.common.constant.Constant; -import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.common.service.impl.BaseServiceImpl; -import com.iailab.framework.common.util.object.ConvertUtils; -import com.iailab.framework.security.core.util.SecurityFrameworkUtils; -import com.iailab.framework.tenant.core.context.TenantContextHolder; -import com.iailab.module.pms.job.dao.ScheduleJobDao; -import com.iailab.module.pms.job.dto.ScheduleJobDTO; -import com.iailab.module.pms.job.entity.ScheduleJobEntity; -import com.iailab.module.pms.job.service.ScheduleJobService; -import com.iailab.module.pms.job.utils.ScheduleUtils; -import com.iailab.module.pms.job.vo.ScheduleJobReqVO; -import org.apache.commons.lang3.StringUtils; -import org.quartz.Scheduler; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import javax.annotation.Resource; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -@Service -public class ScheduleJobServiceImpl extends ServiceImpl<ScheduleJobDao, ScheduleJobEntity> implements ScheduleJobService { - @Resource - private Scheduler scheduler; - - @Resource - private ScheduleJobDao scheduleJobDao; - - @Override - public PageResult<ScheduleJobEntity> page(ScheduleJobReqVO reqVO) { - return scheduleJobDao.selectPage(reqVO); - } - - @Override - public ScheduleJobDTO get(Long id) { - ScheduleJobEntity entity = scheduleJobDao.selectById(id); - - return ConvertUtils.sourceToTarget(entity, ScheduleJobDTO.class); - } - - private QueryWrapper<ScheduleJobEntity> getWrapper(Map<String, Object> params){ - String beanName = (String)params.get("beanName"); - - QueryWrapper<ScheduleJobEntity> wrapper = new QueryWrapper<>(); - wrapper.like(StringUtils.isNotBlank(beanName), "bean_name", beanName); - - return wrapper; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(ScheduleJobDTO dto) { - Long tenantId = TenantContextHolder.getRequiredTenantId(); - ScheduleJobEntity entity = ConvertUtils.sourceToTarget(dto, ScheduleJobEntity.class); - entity.setId(System.currentTimeMillis()); - entity.setStatus(Constant.ScheduleStatus.NORMAL.getValue()); - entity.setTenantId(tenantId); - entity.setCreator(SecurityFrameworkUtils.getLoginUser().getId()); - entity.setCreateDate(new Date()); - scheduleJobDao.insert(entity); - - ScheduleUtils.createScheduleJob(scheduler, entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(ScheduleJobDTO dto) { - Long tenantId = TenantContextHolder.getRequiredTenantId(); - ScheduleJobEntity entity = ConvertUtils.sourceToTarget(dto, ScheduleJobEntity.class); - entity.setUpdateDate(new Date()); - entity.setUpdater(SecurityFrameworkUtils.getLoginUser().getId()); - entity.setTenantId(tenantId); - ScheduleUtils.updateScheduleJob(scheduler, entity); - - this.updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void deleteBatch(Long id) { - ScheduleUtils.deleteScheduleJob(scheduler, id); - - scheduleJobDao.deleteById(id); - } - - @Override - public int updateBatch(Long[] ids, int status){ - Map<String, Object> map = new HashMap<>(2); - map.put("ids", ids); - map.put("status", status); - return scheduleJobDao.updateBatch(map); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void run(Long[] ids) { - for(Long id : ids){ - ScheduleUtils.run(scheduler, scheduleJobDao.selectById(id)); - } - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void pause(Long[] ids) { - for(Long id : ids){ - ScheduleUtils.pauseJob(scheduler, id); - } - - updateBatch(ids, Constant.ScheduleStatus.PAUSE.getValue()); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void resume(Long[] ids) { - for(Long id : ids){ - ScheduleUtils.resumeJob(scheduler, id); - } - - updateBatch(ids, Constant.ScheduleStatus.NORMAL.getValue()); - } - -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/task/ITask.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/task/ITask.java deleted file mode 100644 index bdba464..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/task/ITask.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - * - * https://www.renren.io - * - * 版权所有,侵权必究! - */ - -package com.iailab.module.pms.job.task; - -/** - * 定时任务接口,所有定时任务都要实现该接口 - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -public interface ITask { - - /** - * 执行定时任务接口 - * - * @param params 参数,多参数使用JSON数据 - */ - void run(String params); -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/task/TestTask.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/task/TestTask.java deleted file mode 100644 index 4b47225..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/task/TestTask.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.iailab.module.pms.job.task; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Component; - -/** - * 测试定时任务(演示Demo,可删除) - * - * testTask为spring bean的名称 - * - * @author Mark sunlightcs@gmail.com - */ -@Component("testTask") -public class TestTask implements ITask{ - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - public void run(String params){ - logger.debug("TestTask定时任务正在执行,参数为:{}", params); - } -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/utils/ScheduleJob.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/utils/ScheduleJob.java deleted file mode 100644 index 890d99d..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/utils/ScheduleJob.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.iailab.module.pms.job.utils; - -import com.iailab.framework.common.constant.Constant; -import com.iailab.framework.common.exception.ExceptionUtils; -import com.iailab.framework.common.util.spring.SpringContextUtils; -import com.iailab.framework.tenant.core.context.TenantContextHolder; -import com.iailab.module.pms.job.entity.ScheduleJobEntity; -import com.iailab.module.pms.job.entity.ScheduleJobLogEntity; -import com.iailab.module.pms.job.service.ScheduleJobLogService; -import org.quartz.DisallowConcurrentExecution; -import org.quartz.JobExecutionContext; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.scheduling.quartz.QuartzJobBean; - -import java.lang.reflect.Method; -import java.util.Date; - - -/** - * 定时任务 - * - * @author Mark sunlightcs@gmail.com - */ -@DisallowConcurrentExecution -public class ScheduleJob extends QuartzJobBean { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Override - protected void executeInternal(JobExecutionContext context) { - ScheduleJobEntity scheduleJob = (ScheduleJobEntity) context.getMergedJobDataMap(). - get(ScheduleUtils.JOB_PARAM_KEY); - - //设置当前租户 - TenantContextHolder.setTenantId(scheduleJob.getTenantId()); - Long tenantId = TenantContextHolder.getRequiredTenantId(); - - //数据库保存执行记录 - ScheduleJobLogEntity log = new ScheduleJobLogEntity(); - log.setId(System.currentTimeMillis()); - log.setJobId(scheduleJob.getId()); - log.setBeanName(scheduleJob.getBeanName()); - log.setParams(scheduleJob.getParams()); - log.setCreateDate(new Date()); - log.setTenantId(tenantId); - - //任务开始时间 - long startTime = System.currentTimeMillis(); - - try { - //执行任务 - logger.info("任务准备执行,任务ID:{}", scheduleJob.getId()); - Object target = SpringContextUtils.getBean(scheduleJob.getBeanName()); - Method method = target.getClass().getDeclaredMethod("run", String.class); - method.invoke(target, scheduleJob.getParams()); - - //任务执行总时长 - long times = System.currentTimeMillis() - startTime; - log.setTimes((int)times); - //任务状态 - log.setStatus(Constant.SUCCESS); - - logger.info("任务执行完毕,任务ID:{} 总共耗时:{} 毫秒", scheduleJob.getId(), times); - } catch (Exception e) { - logger.error("任务执行失败,任务ID:{}", scheduleJob.getId(), e); - - //任务执行总时长 - long times = System.currentTimeMillis() - startTime; - log.setTimes((int)times); - - //任务状态 - log.setStatus(Constant.FAIL); - log.setError(ExceptionUtils.getErrorStackTrace(e)); - }finally { - //获取spring bean - ScheduleJobLogService scheduleJobLogService = SpringContextUtils.getBean(ScheduleJobLogService.class); - scheduleJobLogService.insert(log); - } - } -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/utils/ScheduleUtils.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/utils/ScheduleUtils.java deleted file mode 100644 index 1720622..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/utils/ScheduleUtils.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.iailab.module.pms.job.utils; - -import com.iailab.framework.common.constant.Constant; -import com.iailab.framework.common.enums.ErrorCode; -import com.iailab.framework.common.exception.ServerException; -import com.iailab.module.pms.job.entity.ScheduleJobEntity; -import org.quartz.*; - -/** - * 定时任务工具类 - * - * @author Mark sunlightcs@gmail.com - */ -public class ScheduleUtils { - private final static String JOB_NAME = "TASK_"; - /** - * 任务调度参数key - */ - public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY"; - - /** - * 获取触发器key - */ - public static TriggerKey getTriggerKey(Long jobId) { - return TriggerKey.triggerKey(JOB_NAME + jobId); - } - - /** - * 获取jobKey - */ - public static JobKey getJobKey(Long jobId) { - return JobKey.jobKey(JOB_NAME + jobId); - } - - /** - * 获取表达式触发器 - */ - public static CronTrigger getCronTrigger(Scheduler scheduler, Long jobId) { - try { - return (CronTrigger) scheduler.getTrigger(getTriggerKey(jobId)); - } catch (SchedulerException e) { - throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage()); - } - } - - /** - * 创建定时任务 - */ - public static void createScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) { - try { - //构建job信息 - JobDetail jobDetail = JobBuilder.newJob(ScheduleJob.class).withIdentity(getJobKey(scheduleJob.getId())).build(); - - //表达式调度构建器 - CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression()) - .withMisfireHandlingInstructionDoNothing(); - - //按新的cronExpression表达式构建一个新的trigger - CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity(getTriggerKey(scheduleJob.getId())).withSchedule(scheduleBuilder).build(); - - //放入参数,运行时的方法可以获取 - jobDetail.getJobDataMap().put(JOB_PARAM_KEY, scheduleJob); - - scheduler.scheduleJob(jobDetail, trigger); - - //暂停任务 - if(scheduleJob.getStatus() == Constant.ScheduleStatus.PAUSE.getValue()){ - pauseJob(scheduler, scheduleJob.getId()); - } - } catch (SchedulerException e) { - throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage()); - } - } - - /** - * 更新定时任务 - */ - public static void updateScheduleJob(Scheduler scheduler, ScheduleJobEntity scheduleJob) { - try { - TriggerKey triggerKey = getTriggerKey(scheduleJob.getId()); - - //表达式调度构建器 - CronScheduleBuilder scheduleBuilder = CronScheduleBuilder.cronSchedule(scheduleJob.getCronExpression()) - .withMisfireHandlingInstructionDoNothing(); - - CronTrigger trigger = getCronTrigger(scheduler, scheduleJob.getId()); - - //按新的cronExpression表达式重新构建trigger - trigger = trigger.getTriggerBuilder().withIdentity(triggerKey).withSchedule(scheduleBuilder).build(); - - //参数 - trigger.getJobDataMap().put(JOB_PARAM_KEY, scheduleJob); - - scheduler.rescheduleJob(triggerKey, trigger); - - //暂停任务 - if(scheduleJob.getStatus() == Constant.ScheduleStatus.PAUSE.getValue()){ - pauseJob(scheduler, scheduleJob.getId()); - } - - } catch (SchedulerException e) { - throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage()); - } - } - - /** - * 立即执行任务 - */ - public static void run(Scheduler scheduler, ScheduleJobEntity scheduleJob) { - try { - //参数 - JobDataMap dataMap = new JobDataMap(); - dataMap.put(JOB_PARAM_KEY, scheduleJob); - - scheduler.triggerJob(getJobKey(scheduleJob.getId()), dataMap); - } catch (SchedulerException e) { - throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage()); - } - } - - /** - * 暂停任务 - */ - public static void pauseJob(Scheduler scheduler, Long jobId) { - try { - scheduler.pauseJob(getJobKey(jobId)); - } catch (SchedulerException e) { - throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage()); - } - } - - /** - * 恢复任务 - */ - public static void resumeJob(Scheduler scheduler, Long jobId) { - try { - scheduler.resumeJob(getJobKey(jobId)); - } catch (SchedulerException e) { - throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage()); - } - } - - /** - * 删除定时任务 - */ - public static void deleteScheduleJob(Scheduler scheduler, Long jobId) { - try { - scheduler.deleteJob(getJobKey(jobId)); - } catch (SchedulerException e) { - throw new ServerException(ErrorCode.JOB_ERROR, e.getMessage()); - } - } -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/vo/ScheduleJobReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/vo/ScheduleJobReqVO.java deleted file mode 100644 index 5774970..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/job/vo/ScheduleJobReqVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.iailab.module.pms.job.vo; - -import com.iailab.framework.common.pojo.PageParam; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.ToString; - -/** - * @author PanZhibao - * @Description - * @createTime 2024年08月23日 - */ -@Schema(description = "数据平台 - 定时任务分页 Request VO") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -public class ScheduleJobReqVO extends PageParam { - - private String beanName; - - private Long tenantId; -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/controller/admin/RunTimeController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/controller/admin/RunTimeController.java new file mode 100644 index 0000000..c693944 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/controller/admin/RunTimeController.java @@ -0,0 +1,67 @@ +package com.iailab.module.pms.production.device.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.device.entity.RunTimeEntity; +import com.iailab.module.pms.production.device.service.RunTimeService; +import com.iailab.module.pms.production.device.vo.RunTimePageReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +/** + * 运行时长统计 + * + * @author DongYukun + * @Description + * @createTime 2023年01月10日 11:15:00 + */ +@RestController +@RequestMapping("/prod/device/runTime") +public class RunTimeController { + + @Resource + private RunTimeService runTimeService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createRunTime(@Valid @RequestBody RunTimeEntity createEntity) { + return success(runTimeService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateRunTime(@Valid @RequestBody RunTimeEntity updateEntity) { + runTimeService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteRunTime(@RequestParam("id") String id) { + runTimeService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<RunTimeEntity> getRunTime(@RequestParam("id") String id) { + RunTimeEntity data = runTimeService.getInfo(id); + return success(BeanUtils.toBean(data, RunTimeEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<RunTimeEntity>> getRunTimePage(@Valid RunTimePageReqVO pageVO) { + PageResult<RunTimeEntity> pageResult = runTimeService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, RunTimeEntity.class)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/controller/package-info.java similarity index 81% copy from iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java copy to iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/controller/package-info.java index c22c215..5f7ef69 100644 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/controller/package-info.java @@ -3,4 +3,4 @@ * 1. admin 包:提供给管理后台 iailab-ui-admin 前端项目 * 2. app 包:提供给用户 APP iailab-ui-app 前端项目,它的 Controller 和 VO 都要添加 App 前缀,用于和管理后台进行区分 */ -package com.iailab.module.pms.controller; +package com.iailab.module.pms.production.device.controller; diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/dao/RunTimeDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/dao/RunTimeDao.java new file mode 100644 index 0000000..87ed80d --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/dao/RunTimeDao.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.device.dao; + + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.device.entity.RunTimeEntity; +import com.iailab.module.pms.production.device.vo.RunTimePageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author DongYukun + * @Description + * @createTime 2023年01月10日 11:15:00 + */ +@Mapper +public interface RunTimeDao extends BaseMapperX<RunTimeEntity> { + + default PageResult<RunTimeEntity> selectPage(RunTimePageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<RunTimeEntity>() + .orderByDesc(RunTimeEntity::getCjsj)); + } +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/entity/RunTimeEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/entity/RunTimeEntity.java new file mode 100644 index 0000000..2a463a3 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/entity/RunTimeEntity.java @@ -0,0 +1,112 @@ +package com.iailab.module.pms.production.device.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author DongYukun + * @Description + * @createTime 2023年02月28日 17:30:14 + */ +@Data +@TableName("t_device_run_time") +public class RunTimeEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(value = "id", type = IdType.INPUT) + private String id; + + /** + * 日期 + */ + private String rq; + + /** + * 班次 + */ + private String bc; + + /** + * 班次名称 + */ + @TableField(exist = false) + private String bcName; + + /** + * 流水号 + */ + private String lsh; + + /** + * 时长项目 + */ + private String scxm; + + /** + * 时长项目名称 + */ + @TableField(exist = false) + private String scxmName; + + /** + * 时长项目类型 + */ + private String runTimeType; + + /** + * 时长项目类型名称 + */ + @TableField(exist = false) + private String runTimeTypeName; + + /** + * 小时数 + */ + private Long xss; + + /** + * 分钟数 + */ + private Long fzs; + + /** + * 总时长(分钟) + */ + private Long zsc; + + /** + * 备注 + */ + private String bz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/service/RunTimeService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/service/RunTimeService.java new file mode 100644 index 0000000..39e83b4 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/service/RunTimeService.java @@ -0,0 +1,25 @@ +package com.iailab.module.pms.production.device.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.device.entity.RunTimeEntity; +import com.iailab.module.pms.production.device.vo.RunTimePageReqVO; + +/** + * 运行时长统计 + * + * @author DongYukun + * @Description + * @createTime 2023年01月10日 11:10:00 + */ +public interface RunTimeService{ + + String create(RunTimeEntity createEntity); + + String update(RunTimeEntity createEntity); + + void delete(String id); + + RunTimeEntity getInfo(String id); + + PageResult<RunTimeEntity> getPage(RunTimePageReqVO PageReqVO); +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/service/impl/RunTimeServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/service/impl/RunTimeServiceImpl.java new file mode 100644 index 0000000..15ad56d --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/service/impl/RunTimeServiceImpl.java @@ -0,0 +1,58 @@ +package com.iailab.module.pms.production.device.service.impl; + + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.device.dao.RunTimeDao; +import com.iailab.module.pms.production.device.entity.RunTimeEntity; +import com.iailab.module.pms.production.device.service.RunTimeService; +import com.iailab.module.pms.production.device.vo.RunTimePageReqVO; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.*; + +/** + * 运行时长统计 + * + * @author DongYukun + * @Description + * @createTime 2023年01月10日 11:11:00 + */ +@Service +public class RunTimeServiceImpl implements RunTimeService { + + @Resource + private RunTimeDao runTimeDao; + + + @Override + public String create(RunTimeEntity createEntity) { + RunTimeEntity dto = BeanUtils.toBean(createEntity, RunTimeEntity.class); + runTimeDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(RunTimeEntity createEntity) { + RunTimeEntity dto = BeanUtils.toBean(createEntity, RunTimeEntity.class); + runTimeDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + runTimeDao.deleteById(id); + } + + @Override + public RunTimeEntity getInfo(String id) { + return runTimeDao.selectById(id); + } + + @Override + public PageResult<RunTimeEntity> getPage(RunTimePageReqVO PageReqVO) { + return runTimeDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/vo/RunTimePageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/vo/RunTimePageReqVO.java new file mode 100644 index 0000000..b60e901 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/device/vo/RunTimePageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.device.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "调度日志") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class RunTimePageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/controller/admin/SaleVolumeController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/controller/admin/SaleVolumeController.java new file mode 100644 index 0000000..c9edc29 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/controller/admin/SaleVolumeController.java @@ -0,0 +1,58 @@ +package com.iailab.module.pms.production.sale.controller.admin; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.sale.dao.SaleVolumeDao; +import com.iailab.module.pms.production.sale.entity.SaleVolumeEntity; +import com.iailab.module.pms.production.sale.service.SaleVolumeService; +import com.iailab.module.pms.production.sale.vo.SaleVolumePageReqVO; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +/** + * 销售量统计 + * + * @author DongYukun + * @Description + * @createTime 2022年12月23日 14:46:00 + */ +@RestController +@RequestMapping("/prod/sale/volume") +public class SaleVolumeController implements SaleVolumeService { + + @Resource + private SaleVolumeDao saleVolumeDao; + + + @Override + public String create(SaleVolumeEntity createEntity) { + SaleVolumeEntity dto = BeanUtils.toBean(createEntity, SaleVolumeEntity.class); + saleVolumeDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(SaleVolumeEntity createEntity) { + SaleVolumeEntity dto = BeanUtils.toBean(createEntity, SaleVolumeEntity.class); + saleVolumeDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + saleVolumeDao.deleteById(id); + } + + @Override + public SaleVolumeEntity getInfo(String id) { + return saleVolumeDao.selectById(id); + } + + @Override + public PageResult<SaleVolumeEntity> getPage(SaleVolumePageReqVO PageReqVO) { + return saleVolumeDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/controller/package-info.java similarity index 81% copy from iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java copy to iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/controller/package-info.java index c22c215..8c1538c 100644 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/controller/package-info.java @@ -3,4 +3,4 @@ * 1. admin 包:提供给管理后台 iailab-ui-admin 前端项目 * 2. app 包:提供给用户 APP iailab-ui-app 前端项目,它的 Controller 和 VO 都要添加 App 前缀,用于和管理后台进行区分 */ -package com.iailab.module.pms.controller; +package com.iailab.module.pms.production.sale.controller; diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/dao/SaleVolumeDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/dao/SaleVolumeDao.java new file mode 100644 index 0000000..811b6e4 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/dao/SaleVolumeDao.java @@ -0,0 +1,22 @@ +package com.iailab.module.pms.production.sale.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.sale.entity.SaleVolumeEntity; +import com.iailab.module.pms.production.sale.vo.SaleVolumePageReqVO; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author DongYukun + * @Description + * @createTime 2022年12月23日 14:47:00 + */ +@Mapper +public interface SaleVolumeDao extends BaseMapperX<SaleVolumeEntity> { + + default PageResult<SaleVolumeEntity> selectPage(SaleVolumePageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<SaleVolumeEntity>() + .orderByDesc(SaleVolumeEntity::getCjsj)); + } +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/dto/SalesVolumeDto.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/dto/SalesVolumeDto.java new file mode 100644 index 0000000..f6ec889 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/dto/SalesVolumeDto.java @@ -0,0 +1,37 @@ +package com.iailab.module.pms.production.sale.dto; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 销售量统计 + * + * @author DongYukun + * @Description + * @createTime 2022年12月23日 14:47:00 + */ +@Data +public class SalesVolumeDto implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 产品销售煤种 + */ + private String xsmz; + + /** + * 产品销售煤种名称 + */ + private String xsmzName; + + /** + * 内报当日 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal xsl; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/entity/SaleVolumeEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/entity/SaleVolumeEntity.java new file mode 100644 index 0000000..6e6c576 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/entity/SaleVolumeEntity.java @@ -0,0 +1,72 @@ +package com.iailab.module.pms.production.sale.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author DongYukun + * @Description + * @createTime 2023年02月14日 10:58:14 + */ +@Data +@TableName("t_sale_volume") +public class SaleVolumeEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + /** + * 日期 + */ + private String rq; + + /** + * 流水号 + */ + private String lsh; + + /** + * 销售煤种 + */ + private String xsmz; + + /** + * 销售量 + */ + private String xsl; + /** + * 备注 + */ + private String bz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/service/SaleVolumeService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/service/SaleVolumeService.java new file mode 100644 index 0000000..84f08f3 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/service/SaleVolumeService.java @@ -0,0 +1,26 @@ +package com.iailab.module.pms.production.sale.service; + + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.sale.entity.SaleVolumeEntity; +import com.iailab.module.pms.production.sale.vo.SaleVolumePageReqVO; + +/** + * 销售量统计 + * + * @author DongYukun + * @Description + * @createTime 2022年12月21日 14:47:00 + */ +public interface SaleVolumeService { + + String create(SaleVolumeEntity createEntity); + + String update(SaleVolumeEntity createEntity); + + void delete(String id); + + SaleVolumeEntity getInfo(String id); + + PageResult<SaleVolumeEntity> getPage(SaleVolumePageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/service/impl/SaleVolumeServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/service/impl/SaleVolumeServiceImpl.java new file mode 100644 index 0000000..9c93498 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/service/impl/SaleVolumeServiceImpl.java @@ -0,0 +1,56 @@ +package com.iailab.module.pms.production.sale.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.sale.dao.SaleVolumeDao; +import com.iailab.module.pms.production.sale.entity.SaleVolumeEntity; +import com.iailab.module.pms.production.sale.service.SaleVolumeService; +import com.iailab.module.pms.production.sale.vo.SaleVolumePageReqVO; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 销售量统计 + * + * @author DongYukun + * @Description + * @createTime 2022年12月23日 14:50:30 + */ +@Service +public class SaleVolumeServiceImpl implements SaleVolumeService { + + @Resource + private SaleVolumeDao saleVolumeDao; + + + @Override + public String create(SaleVolumeEntity createEntity) { + SaleVolumeEntity dto = BeanUtils.toBean(createEntity, SaleVolumeEntity.class); + saleVolumeDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(SaleVolumeEntity createEntity) { + SaleVolumeEntity dto = BeanUtils.toBean(createEntity, SaleVolumeEntity.class); + saleVolumeDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + saleVolumeDao.deleteById(id); + } + + @Override + public SaleVolumeEntity getInfo(String id) { + return saleVolumeDao.selectById(id); + } + + @Override + public PageResult<SaleVolumeEntity> getPage(SaleVolumePageReqVO PageReqVO) { + return saleVolumeDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/vo/SaleVolumePageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/vo/SaleVolumePageReqVO.java new file mode 100644 index 0000000..8961642 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/sale/vo/SaleVolumePageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.sale.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "调度日志") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class SaleVolumePageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/McMzController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/McMzController.java new file mode 100644 index 0000000..43f0c1d --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/McMzController.java @@ -0,0 +1,67 @@ +package com.iailab.module.pms.production.warehouse.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.warehouse.entity.McMzEntity; +import com.iailab.module.pms.production.warehouse.service.McMzService; +import com.iailab.module.pms.production.warehouse.vo.McMzPageReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +/** + * 煤仓煤种 + * + * @author DongYukun + * @Description + * @createTime 2023年12月20日 10:22:00 + */ +@RestController +@RequestMapping("/prod/warehouse/mcmz") +public class McMzController { + + @Resource + private McMzService mcmzService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createMcMz(@Valid @RequestBody McMzEntity createEntity) { + return success(mcmzService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateMcMz(@Valid @RequestBody McMzEntity updateEntity) { + mcmzService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteMcMz(@RequestParam("id") String id) { + mcmzService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<McMzEntity> getMcMz(@RequestParam("id") String id) { + McMzEntity data = mcmzService.getInfo(id); + return success(BeanUtils.toBean(data, McMzEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<McMzEntity>> getMcMzPage(@Valid McMzPageReqVO pageVO) { + PageResult<McMzEntity> pageResult = mcmzService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, McMzEntity.class)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehouseItemController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehouseItemController.java new file mode 100644 index 0000000..8623dae --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehouseItemController.java @@ -0,0 +1,67 @@ +package com.iailab.module.pms.production.warehouse.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.warehouse.entity.WarehouseItemEntity; +import com.iailab.module.pms.production.warehouse.service.WarehouseItemService; +import com.iailab.module.pms.production.warehouse.vo.WarehouseItemPageReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +/** + * 煤仓详情 + * + * @author DongYukun + * @Description + * @createTime 2023年12月15日 17:15:00 + */ +@RestController +@RequestMapping("/prod/warehouse/item") +public class WarehouseItemController { + + @Resource + private WarehouseItemService warehouseItemService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createWarehouseItem(@Valid @RequestBody WarehouseItemEntity createEntity) { + return success(warehouseItemService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateWarehouseItem(@Valid @RequestBody WarehouseItemEntity updateEntity) { + warehouseItemService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteWarehouseItem(@RequestParam("id") String id) { + warehouseItemService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<WarehouseItemEntity> getWarehouseItem(@RequestParam("id") String id) { + WarehouseItemEntity data = warehouseItemService.getInfo(id); + return success(BeanUtils.toBean(data, WarehouseItemEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<WarehouseItemEntity>> getWarehouseItemPage(@Valid WarehouseItemPageReqVO pageVO) { + PageResult<WarehouseItemEntity> pageResult = warehouseItemService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, WarehouseItemEntity.class)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehousePositionController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehousePositionController.java new file mode 100644 index 0000000..0743b65 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehousePositionController.java @@ -0,0 +1,69 @@ +package com.iailab.module.pms.production.warehouse.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.warehouse.entity.WarehousePositionEntity; +import com.iailab.module.pms.production.warehouse.service.WarehousePositionService; +import com.iailab.module.pms.production.warehouse.vo.WarehousePositionPageReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +/** + * 仓位统计 + * + * @author DongYukun + * @Description + * @createTime 2023年01月17日 15:51:00 + */ +@RestController +@RequestMapping("/warehouse/position") +public class WarehousePositionController { + + + @Resource + private WarehousePositionService warehousePositionService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createWarehousePosition(@Valid @RequestBody WarehousePositionEntity createEntity) { + return success(warehousePositionService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateWarehousePosition(@Valid @RequestBody WarehousePositionEntity updateEntity) { + warehousePositionService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteWarehousePosition(@RequestParam("id") String id) { + warehousePositionService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<WarehousePositionEntity> getWarehousePosition(@RequestParam("id") String id) { + WarehousePositionEntity data = warehousePositionService.getInfo(id); + return success(BeanUtils.toBean(data, WarehousePositionEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<WarehousePositionEntity>> getWarehousePositionPage(@Valid WarehousePositionPageReqVO pageVO) { + PageResult<WarehousePositionEntity> pageResult = warehousePositionService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, WarehousePositionEntity.class)); + } + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehouseStockController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehouseStockController.java new file mode 100644 index 0000000..fa3d4cd --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/admin/WarehouseStockController.java @@ -0,0 +1,69 @@ +package com.iailab.module.pms.production.warehouse.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.warehouse.entity.WarehouseStockEntity; +import com.iailab.module.pms.production.warehouse.service.WarehouseStockService; +import com.iailab.module.pms.production.warehouse.vo.WarehouseStockPageReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +/** + * 产品库存 + * + * @author DongYukun + * @Description + * @createTime 2023年01月03日 15:01:00 + */ +@RestController +@RequestMapping("/warehouse/stock") +public class WarehouseStockController { + + + @Resource + private WarehouseStockService warehouseStockService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createWarehouseStock(@Valid @RequestBody WarehouseStockEntity createEntity) { + return success(warehouseStockService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateWarehouseStock(@Valid @RequestBody WarehouseStockEntity updateEntity) { + warehouseStockService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteWarehouseStock(@RequestParam("id") String id) { + warehouseStockService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<WarehouseStockEntity> getWarehouseStock(@RequestParam("id") String id) { + WarehouseStockEntity data = warehouseStockService.getInfo(id); + return success(BeanUtils.toBean(data, WarehouseStockEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<WarehouseStockEntity>> getWarehouseStockPage(@Valid WarehouseStockPageReqVO pageVO) { + PageResult<WarehouseStockEntity> pageResult = warehouseStockService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, WarehouseStockEntity.class)); + } + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/package-info.java similarity index 80% copy from iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java copy to iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/package-info.java index c22c215..33cd317 100644 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/controller/package-info.java @@ -3,4 +3,4 @@ * 1. admin 包:提供给管理后台 iailab-ui-admin 前端项目 * 2. app 包:提供给用户 APP iailab-ui-app 前端项目,它的 Controller 和 VO 都要添加 App 前缀,用于和管理后台进行区分 */ -package com.iailab.module.pms.controller; +package com.iailab.module.pms.production.warehouse.controller; diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/McMzDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/McMzDao.java new file mode 100644 index 0000000..c7c356e --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/McMzDao.java @@ -0,0 +1,31 @@ +package com.iailab.module.pms.production.warehouse.dao; + +import com.iailab.framework.common.dao.BaseDao; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.warehouse.entity.McMzEntity; +import com.iailab.module.pms.production.warehouse.vo.McMzPageReqVO; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Mapper +@Component +public interface McMzDao extends BaseMapperX<McMzEntity> { + + @Select("SELECT * , SUM(proportion) OVER () as den FROM t_mc_mz WHERE mc = #{mc}") + List<McMzEntity> selectMzList(@Param("mc") String mc); + + @Delete("DELETE FROM t_mc_mz WHERE mc = #{mc}") + void deleteByMc(@Param("mc") String mc); + + default PageResult<McMzEntity> selectPage(McMzPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<McMzEntity>() + .orderByDesc(McMzEntity::getCreateBy)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehouseItemDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehouseItemDao.java new file mode 100644 index 0000000..2d720ae --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehouseItemDao.java @@ -0,0 +1,16 @@ +package com.iailab.module.pms.production.warehouse.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.warehouse.entity.WarehouseItemEntity; +import com.iailab.module.pms.production.warehouse.vo.WarehouseItemPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface WarehouseItemDao extends BaseMapperX<WarehouseItemEntity> { + default PageResult<WarehouseItemEntity> selectPage(WarehouseItemPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<WarehouseItemEntity>() + .orderByDesc(WarehouseItemEntity::getCreateBy)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehousePositionDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehousePositionDao.java new file mode 100644 index 0000000..194a726 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehousePositionDao.java @@ -0,0 +1,28 @@ +package com.iailab.module.pms.production.warehouse.dao; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.warehouse.entity.WarehousePositionEntity; +import com.iailab.module.pms.production.warehouse.vo.WarehousePositionPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; +import java.util.Map; + +/** + * @author DongYukun + * @Description + * @createTime 2023年01月17日 15:50:00 + */ +@Mapper +public interface WarehousePositionDao extends BaseMapperX<WarehousePositionEntity> { + + List<WarehousePositionEntity> selectGroupByCp(Map<String, Object> params); + + default PageResult<WarehousePositionEntity> selectPage(WarehousePositionPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<WarehousePositionEntity>() + .orderByDesc(WarehousePositionEntity::getRq)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehouseStockDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehouseStockDao.java new file mode 100644 index 0000000..f126e7b --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/dao/WarehouseStockDao.java @@ -0,0 +1,53 @@ +package com.iailab.module.pms.production.warehouse.dao; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.warehouse.entity.WarehouseStockEntity; +import com.iailab.module.pms.production.warehouse.entity.WarehouseStockEntity; +import com.iailab.module.pms.production.warehouse.entity.WarehouseStockEntity; +import com.iailab.module.pms.production.warehouse.vo.WarehouseStockPageReqVO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @author DongYukun + * @Description + * @createTime 2023年01月04日 10:19:00 + */ +@Mapper +public interface WarehouseStockDao extends BaseMapperX<WarehouseStockEntity> { + + /** + * 分页查询 + * + * @param page 分页信息 + * @param queryWrapper 检索条件 + * @return 分页结果 + */ + IPage<WarehouseStockEntity> daySelectPage(IPage page, @Param(Constants.WRAPPER) QueryWrapper<WarehouseStockEntity> queryWrapper); + + /** + * 库存数据最新日期 + * + * @param params + * @return + */ + List<WarehouseStockEntity> getLastRq(Map<String, Object> params); + + String selectStockByName(@Param("name") String name); + + List<WarehouseStockEntity> selectListByRq(@Param("rq") String rq, @Param("before") String before); + + default PageResult<WarehouseStockEntity> selectPage(WarehouseStockPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<WarehouseStockEntity>() + .orderByDesc(WarehouseStockEntity::getRq)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/McMzEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/McMzEntity.java new file mode 100644 index 0000000..0013a40 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/McMzEntity.java @@ -0,0 +1,51 @@ +package com.iailab.module.pms.production.warehouse.entity; + + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + + +/** + * 煤仓煤种对应表 + * + * @author DongYukun + * @Description + * @createTime 2023年12月19日 10:48:00 + */ +@Data +@TableName("t_mc_mz") +public class McMzEntity { + /** + * id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + /** + * 煤仓 + */ + private String mc; + /** + * 煤种 + */ + private String mz; + /** + * 比例分母 + */ + @TableField(exist = false) + private Integer den; + /** + * 比例 + */ + private Integer proportion; + /** + * 创建人 + */ + private String createBy; + /** + * 更新人 + */ + private String updateBy; +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehouseItemEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehouseItemEntity.java new file mode 100644 index 0000000..66b2236 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehouseItemEntity.java @@ -0,0 +1,52 @@ +package com.iailab.module.pms.production.warehouse.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +/** + * 煤仓详情表 + * + * @author DongYukun + * @Description + * @createTime 2023年12月16日 8:58:00 + */ +@Data +@TableName("t_warehouse_item") +public class WarehouseItemEntity { + + /** + * id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + /** + * 煤仓类型 + */ + private String mclx; + /** + * 煤仓名 + */ + private String mcName; + /** + * 煤仓编号 + */ + private String mc; + /** + * 单位 + */ + private String unit; + /** + * 容量 + */ + private Integer capacity; + /** + * 创建人 + */ + private String createBy; + /** + * 更新人 + */ + private String updateBy; +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehousePositionEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehousePositionEntity.java new file mode 100644 index 0000000..0e4283f --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehousePositionEntity.java @@ -0,0 +1,120 @@ +package com.iailab.module.pms.production.warehouse.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 仓位表 + * + * @author DongYukun + * @Description + * @createTime 2023年02月15日 11:25:09 + */ +@Data +@TableName("t_warehouse_position") +public class WarehousePositionEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + /** + * 日期 + */ + private String rq; + + /** + * 班次 + */ + private String bc; + + /** + * 班次名称 + */ + @TableField(exist = false) + private String bcName; + + /** + * 流水号 + */ + private String lsh; + + /** + * 煤仓 + */ + private String mc; + + /** + * 煤仓类型 + */ + private String mclx; + + /** + * 煤仓名称 + */ + @TableField(exist = false) + private String mcName; + + /** + * 仓容量 + */ + private String crl; + + /** + * 产品 + */ + private String cp; + + /** + * 产品名称 + */ + @TableField(exist = false) + private String cpName; + + /** + * 内报估量 + */ + private BigDecimal nbgl; + + /** + * 外报估量 + */ + private BigDecimal wbgl; + + /** + * 备注 + */ + private String bz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehouseStockEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehouseStockEntity.java new file mode 100644 index 0000000..83b31e7 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/entity/WarehouseStockEntity.java @@ -0,0 +1,198 @@ +package com.iailab.module.pms.production.warehouse.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @author DongYukun + * @Description + * @createTime 2023年02月17日 09:41:00 + */ +@Data +@TableName("t_warehouse_stock") +public class WarehouseStockEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 日期 + */ + private String rq; + + /** + * 班次 + */ + private String bc; + + /** + * 流水号 + */ + private String lsh; + + /** + * 库存煤种 + */ + private String kcmz; + + /** + * 单价(元/t) + */ + private BigDecimal danj; + + /** + * 内报昨日库存 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal nbzrkc; + + /** + * 内报今日入库 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal nbjrrk; + + /** + * 内报今日出库 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal nbjrck; + + /** + * 内报调整量 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal nbtzl; + + /** + * 内报今日库存 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal nbjrkc; + + /** + * 外报昨日库存 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal wbzrkc; + + /** + * 外报今日入库 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal wbjrrk; + + /** + * 外报今日出库 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal wbjrck; + + /** + * 外报调整量 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal wbtzl; + + /** + * 外报今日库存 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal wbjrkc; + + /** + * 灰分Ad% + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal hf; + + /** + * 水分Mt% + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal sf; + + /** + * 硫份St,d% + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal lf; + + /** + * 挥发分Vdaf% + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal hff; + + /** + * 粘结GR.I + */ + private BigDecimal nj; + + /** + * 胶质层Y(㎜)GR.I + */ + private BigDecimal jzc; + + /** + * 发热量(cal/g) + */ + private BigDecimal frl; + + /** + * 中损 + */ + private BigDecimal zs; + + /** + * 矸损 + */ + private BigDecimal gs; + + /** + * 压滤煤泥灰分Ad% + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal ylmnHf; + + /** + * 备注 + */ + private String bz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + + /** + * 标识(原煤库存、产品库存) + */ + private String bs; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/McMzService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/McMzService.java new file mode 100644 index 0000000..661861b --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/McMzService.java @@ -0,0 +1,25 @@ +package com.iailab.module.pms.production.warehouse.service; + + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.service.BaseService; +import com.iailab.framework.common.util.object.PageUtils; +import com.iailab.module.pms.production.warehouse.entity.McMzEntity; +import com.iailab.module.pms.production.warehouse.vo.McMzPageReqVO; +import com.iailab.module.pms.production.work.vo.DutyInfoPageReqVO; + +import java.util.List; +import java.util.Map; + +public interface McMzService { + + String create(McMzEntity createEntity); + + String update(McMzEntity createEntity); + + void delete(String id); + + McMzEntity getInfo(String id); + + PageResult<McMzEntity> getPage(McMzPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehouseItemService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehouseItemService.java new file mode 100644 index 0000000..edb1612 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehouseItemService.java @@ -0,0 +1,26 @@ +package com.iailab.module.pms.production.warehouse.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.service.BaseService; +import com.iailab.framework.common.util.object.PageUtils; +import com.iailab.module.pms.production.warehouse.entity.WarehouseItemEntity; +import com.iailab.module.pms.production.warehouse.entity.WarehouseItemEntity; +import com.iailab.module.pms.production.warehouse.entity.WarehouseItemEntity; +import com.iailab.module.pms.production.warehouse.vo.WarehouseItemPageReqVO; +import com.iailab.module.pms.production.warehouse.vo.WarehouseItemPageReqVO; + +import java.util.List; +import java.util.Map; + +public interface WarehouseItemService { + + String create(WarehouseItemEntity createEntity); + + String update(WarehouseItemEntity createEntity); + + void delete(String id); + + WarehouseItemEntity getInfo(String id); + + PageResult<WarehouseItemEntity> getPage(WarehouseItemPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehousePositionService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehousePositionService.java new file mode 100644 index 0000000..790d2a5 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehousePositionService.java @@ -0,0 +1,33 @@ +package com.iailab.module.pms.production.warehouse.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.PageUtils; +import com.iailab.module.pms.production.warehouse.entity.WarehousePositionEntity; +import com.iailab.module.pms.production.warehouse.entity.WarehousePositionEntity; +import com.iailab.module.pms.production.warehouse.entity.WarehousePositionEntity; +import com.iailab.module.pms.production.warehouse.vo.WarehousePositionPageReqVO; +import com.iailab.module.pms.production.warehouse.vo.WarehousePositionPageReqVO; + +import java.util.List; +import java.util.Map; + +/** + * 仓位统计 + * + * @author DongYukun + * @Description + * @createTime 2023年01月17日 15:50:00 + */ +public interface WarehousePositionService { + + String create(WarehousePositionEntity createEntity); + + String update(WarehousePositionEntity createEntity); + + void delete(String id); + + WarehousePositionEntity getInfo(String id); + + PageResult<WarehousePositionEntity> getPage(WarehousePositionPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehouseStockService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehouseStockService.java new file mode 100644 index 0000000..d91d216 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/WarehouseStockService.java @@ -0,0 +1,27 @@ +package com.iailab.module.pms.production.warehouse.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.warehouse.entity.WarehouseStockEntity; +import com.iailab.module.pms.production.warehouse.vo.WarehouseStockPageReqVO; + + + +/** + * 产品库存 + * + * @author DongYukun + * @Description + * @createTime 2023年01月04日 10:19:00 + */ +public interface WarehouseStockService{ + + String create(WarehouseStockEntity createEntity); + + String update(WarehouseStockEntity createEntity); + + void delete(String id); + + WarehouseStockEntity getInfo(String id); + + PageResult<WarehouseStockEntity> getPage(WarehouseStockPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/McMzServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/McMzServiceImpl.java new file mode 100644 index 0000000..6ddaedb --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/McMzServiceImpl.java @@ -0,0 +1,48 @@ +package com.iailab.module.pms.production.warehouse.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.warehouse.dao.McMzDao; +import com.iailab.module.pms.production.warehouse.entity.McMzEntity; +import com.iailab.module.pms.production.warehouse.service.McMzService; +import com.iailab.module.pms.production.warehouse.vo.McMzPageReqVO; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +@Service +public class McMzServiceImpl implements McMzService { + + @Resource + private McMzDao mcMzDao; + + + @Override + public String create(McMzEntity createEntity) { + McMzEntity dto = BeanUtils.toBean(createEntity, McMzEntity.class); + mcMzDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(McMzEntity createEntity) { + McMzEntity dto = BeanUtils.toBean(createEntity, McMzEntity.class); + mcMzDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + mcMzDao.deleteById(id); + } + + @Override + public McMzEntity getInfo(String id) { + return mcMzDao.selectById(id); + } + + @Override + public PageResult<McMzEntity> getPage(McMzPageReqVO PageReqVO) { + return mcMzDao.selectPage(PageReqVO); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehouseItemServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehouseItemServiceImpl.java new file mode 100644 index 0000000..db3468e --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehouseItemServiceImpl.java @@ -0,0 +1,47 @@ +package com.iailab.module.pms.production.warehouse.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.warehouse.dao.WarehouseItemDao; +import com.iailab.module.pms.production.warehouse.entity.WarehouseItemEntity; +import com.iailab.module.pms.production.warehouse.service.WarehouseItemService; +import com.iailab.module.pms.production.warehouse.vo.WarehouseItemPageReqVO; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +@Service +public class WarehouseItemServiceImpl implements WarehouseItemService { + @Resource + private WarehouseItemDao warehouseItemDao; + + + @Override + public String create(WarehouseItemEntity createEntity) { + WarehouseItemEntity dto = BeanUtils.toBean(createEntity, WarehouseItemEntity.class); + warehouseItemDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(WarehouseItemEntity createEntity) { + WarehouseItemEntity dto = BeanUtils.toBean(createEntity, WarehouseItemEntity.class); + warehouseItemDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + warehouseItemDao.deleteById(id); + } + + @Override + public WarehouseItemEntity getInfo(String id) { + return warehouseItemDao.selectById(id); + } + + @Override + public PageResult<WarehouseItemEntity> getPage(WarehouseItemPageReqVO PageReqVO) { + return warehouseItemDao.selectPage(PageReqVO); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehousePositionServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehousePositionServiceImpl.java new file mode 100644 index 0000000..44a7b42 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehousePositionServiceImpl.java @@ -0,0 +1,55 @@ +package com.iailab.module.pms.production.warehouse.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.warehouse.dao.WarehousePositionDao; +import com.iailab.module.pms.production.warehouse.entity.WarehousePositionEntity; +import com.iailab.module.pms.production.warehouse.service.WarehousePositionService; +import com.iailab.module.pms.production.warehouse.vo.WarehousePositionPageReqVO; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 仓位统计 + * + * @author DongYukun + * @Description + * @createTime 2023年01月17日 15:49:00 + */ +@Service +public class WarehousePositionServiceImpl implements WarehousePositionService { + + @Resource + private WarehousePositionDao warehousePositionDao; + + + @Override + public String create(WarehousePositionEntity createEntity) { + WarehousePositionEntity dto = BeanUtils.toBean(createEntity, WarehousePositionEntity.class); + warehousePositionDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(WarehousePositionEntity createEntity) { + WarehousePositionEntity dto = BeanUtils.toBean(createEntity, WarehousePositionEntity.class); + warehousePositionDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + warehousePositionDao.deleteById(id); + } + + @Override + public WarehousePositionEntity getInfo(String id) { + return warehousePositionDao.selectById(id); + } + + @Override + public PageResult<WarehousePositionEntity> getPage(WarehousePositionPageReqVO PageReqVO) { + return warehousePositionDao.selectPage(PageReqVO); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehouseStockServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehouseStockServiceImpl.java new file mode 100644 index 0000000..d542f5d --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/service/impl/WarehouseStockServiceImpl.java @@ -0,0 +1,58 @@ +package com.iailab.module.pms.production.warehouse.service.impl; + + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.warehouse.dao.WarehouseStockDao; +import com.iailab.module.pms.production.warehouse.entity.WarehouseStockEntity; +import com.iailab.module.pms.production.warehouse.service.WarehouseStockService; +import com.iailab.module.pms.production.warehouse.vo.WarehouseStockPageReqVO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 产品库存 + * + * @author DongYukun + * @Description + * @createTime 2023年01月04日 10:19:30 + */ +@Slf4j +@Service +public class WarehouseStockServiceImpl implements WarehouseStockService { + + @Resource + private WarehouseStockDao warehouseStockDao; + + + @Override + public String create(WarehouseStockEntity createEntity) { + WarehouseStockEntity dto = BeanUtils.toBean(createEntity, WarehouseStockEntity.class); + warehouseStockDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(WarehouseStockEntity createEntity) { + WarehouseStockEntity dto = BeanUtils.toBean(createEntity, WarehouseStockEntity.class); + warehouseStockDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + warehouseStockDao.deleteById(id); + } + + @Override + public WarehouseStockEntity getInfo(String id) { + return warehouseStockDao.selectById(id); + } + + @Override + public PageResult<WarehouseStockEntity> getPage(WarehouseStockPageReqVO PageReqVO) { + return warehouseStockDao.selectPage(PageReqVO); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/McMzPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/McMzPageReqVO.java new file mode 100644 index 0000000..b8fcc04 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/McMzPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.warehouse.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "调度日志") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class McMzPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehouseItemPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehouseItemPageReqVO.java new file mode 100644 index 0000000..8138cb6 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehouseItemPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.warehouse.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "当班信息") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class WarehouseItemPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehousePositionPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehousePositionPageReqVO.java new file mode 100644 index 0000000..8d13944 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehousePositionPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.warehouse.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "生产事故") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class WarehousePositionPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehouseStockPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehouseStockPageReqVO.java new file mode 100644 index 0000000..2dd535f --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/warehouse/vo/WarehouseStockPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.warehouse.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "生产事故") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class WarehouseStockPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/HourVolumeController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/HourVolumeController.java new file mode 100644 index 0000000..72eb68c --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/HourVolumeController.java @@ -0,0 +1,62 @@ +package com.iailab.module.pms.production.wash.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.vo.HourVolumePageReqVO; +import com.iailab.module.pms.production.wash.entity.HourVolumeEntity; +import com.iailab.module.pms.production.wash.service.HourVolumeService; +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.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +@Tag(name = "小时量") +@RestController +@RequestMapping("/prod/wash/hourVolume") +public class HourVolumeController { + + @Resource + private HourVolumeService hourVolumeService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createHourVolume(@Valid @RequestBody HourVolumeEntity createEntity) { + return success(hourVolumeService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateHourVolume(@Valid @RequestBody HourVolumeEntity updateEntity) { + hourVolumeService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteHourVolume(@RequestParam("id") String id) { + hourVolumeService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<HourVolumeEntity> getHourVolume(@RequestParam("id") String id) { + HourVolumeEntity data = hourVolumeService.getInfo(id); + return success(BeanUtils.toBean(data, HourVolumeEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<HourVolumeEntity>> getHourVolumePage(@Valid HourVolumePageReqVO pageVO) { + PageResult<HourVolumeEntity> pageResult = hourVolumeService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, HourVolumeEntity.class)); + } +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/ProdVolumeController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/ProdVolumeController.java new file mode 100644 index 0000000..3ec43b2 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/ProdVolumeController.java @@ -0,0 +1,62 @@ +package com.iailab.module.pms.production.wash.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.vo.ProdVolumePageReqVO; +import com.iailab.module.pms.production.wash.entity.ProdVolumeEntity; +import com.iailab.module.pms.production.wash.service.ProdVolumeService; +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.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +@Tag(name = "生产量") +@RestController +@RequestMapping("/prod/wash/prodVolume") +public class ProdVolumeController { + + @Resource + private ProdVolumeService prodVolumeService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createProdVolume(@Valid @RequestBody ProdVolumeEntity createEntity) { + return success(prodVolumeService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateProdVolume(@Valid @RequestBody ProdVolumeEntity updateEntity) { + prodVolumeService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteProdVolume(@RequestParam("id") String id) { + prodVolumeService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<ProdVolumeEntity> getProdVolume(@RequestParam("id") String id) { + ProdVolumeEntity data = prodVolumeService.getInfo(id); + return success(BeanUtils.toBean(data, ProdVolumeEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<ProdVolumeEntity>> getProdVolumePage(@Valid ProdVolumePageReqVO pageVO) { + PageResult<ProdVolumeEntity> pageResult = prodVolumeService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, ProdVolumeEntity.class)); + } +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/ToWashController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/ToWashController.java new file mode 100644 index 0000000..e88d102 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/ToWashController.java @@ -0,0 +1,62 @@ +package com.iailab.module.pms.production.wash.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.vo.ToWashPageReqVO; +import com.iailab.module.pms.production.wash.entity.ToWashEntity; +import com.iailab.module.pms.production.wash.service.ToWashService; +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.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +@Tag(name = "入洗量") +@RestController +@RequestMapping("/prod/wash/toWash") +public class ToWashController { + + @Resource + private ToWashService toWashService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createToWash(@Valid @RequestBody ToWashEntity createEntity) { + return success(toWashService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateToWash(@Valid @RequestBody ToWashEntity updateEntity) { + toWashService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteToWash(@RequestParam("id") String id) { + toWashService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<ToWashEntity> getToWash(@RequestParam("id") String id) { + ToWashEntity data = toWashService.getInfo(id); + return success(BeanUtils.toBean(data, ToWashEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<ToWashEntity>> getToWashPage(@Valid ToWashPageReqVO pageVO) { + PageResult<ToWashEntity> pageResult = toWashService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, ToWashEntity.class)); + } +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/TransferInController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/TransferInController.java new file mode 100644 index 0000000..029aea1 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/TransferInController.java @@ -0,0 +1,62 @@ +package com.iailab.module.pms.production.wash.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.vo.TransferInPageReqVO; +import com.iailab.module.pms.production.wash.entity.TransferInEntity; +import com.iailab.module.pms.production.wash.service.TransferInService; +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.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +@Tag(name = "调入量") +@RestController +@RequestMapping("/prod/wash/transferIn") +public class TransferInController { + + @Resource + private TransferInService transferInService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createTransferIn(@Valid @RequestBody TransferInEntity createEntity) { + return success(transferInService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateTransferIn(@Valid @RequestBody TransferInEntity updateEntity) { + transferInService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteTransferIn(@RequestParam("id") String id) { + transferInService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<TransferInEntity> getTransferIn(@RequestParam("id") String id) { + TransferInEntity data = transferInService.getInfo(id); + return success(BeanUtils.toBean(data, TransferInEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<TransferInEntity>> getTransferInPage(@Valid TransferInPageReqVO pageVO) { + PageResult<TransferInEntity> pageResult = transferInService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, TransferInEntity.class)); + } +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/WashPlanController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/WashPlanController.java new file mode 100644 index 0000000..da911a1 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/admin/WashPlanController.java @@ -0,0 +1,62 @@ +package com.iailab.module.pms.production.wash.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.vo.WashPlanPageReqVO; +import com.iailab.module.pms.production.wash.entity.WashPlanEntity; +import com.iailab.module.pms.production.wash.service.WashPlanService; +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.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +@Tag(name = "洗选计划") +@RestController +@RequestMapping("/prod/wash/washPlan") +public class WashPlanController { + + @Resource + private WashPlanService washPlanService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createWashPlan(@Valid @RequestBody WashPlanEntity createEntity) { + return success(washPlanService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateWashPlan(@Valid @RequestBody WashPlanEntity updateEntity) { + washPlanService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteWashPlan(@RequestParam("id") String id) { + washPlanService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<WashPlanEntity> getWashPlan(@RequestParam("id") String id) { + WashPlanEntity data = washPlanService.getInfo(id); + return success(BeanUtils.toBean(data, WashPlanEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<WashPlanEntity>> getWashPlanPage(@Valid WashPlanPageReqVO pageVO) { + PageResult<WashPlanEntity> pageResult = washPlanService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, WashPlanEntity.class)); + } +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/package-info.java similarity index 81% copy from iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java copy to iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/package-info.java index c22c215..b61d574 100644 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/controller/package-info.java @@ -3,4 +3,4 @@ * 1. admin 包:提供给管理后台 iailab-ui-admin 前端项目 * 2. app 包:提供给用户 APP iailab-ui-app 前端项目,它的 Controller 和 VO 都要添加 App 前缀,用于和管理后台进行区分 */ -package com.iailab.module.pms.controller; +package com.iailab.module.pms.production.wash.controller; diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/HourVolumeDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/HourVolumeDao.java new file mode 100644 index 0000000..83f63c6 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/HourVolumeDao.java @@ -0,0 +1,28 @@ +package com.iailab.module.pms.production.wash.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.wash.vo.HourVolumePageReqVO; +import com.iailab.module.pms.production.wash.entity.HourVolumeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Mapper +public interface HourVolumeDao extends BaseMapperX<HourVolumeEntity> { + + List<String> selectListByName(@Param("startTime") Date startTime, @Param("endTime")Date endTime , @Param("name")String name ); + + default PageResult<HourVolumeEntity> selectPage(HourVolumePageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<HourVolumeEntity>() + .orderByDesc(HourVolumeEntity::getCjsj)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ProdVolumeDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ProdVolumeDao.java new file mode 100644 index 0000000..90a59c1 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ProdVolumeDao.java @@ -0,0 +1,27 @@ +package com.iailab.module.pms.production.wash.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.wash.vo.ProdVolumePageReqVO; +import com.iailab.module.pms.production.wash.entity.ProdVolumeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Mapper +public interface ProdVolumeDao extends BaseMapperX<ProdVolumeEntity> { + + List<String> selectListByName(@Param("startTime") Date startTime, @Param("endTime")Date endTime , @Param("name")String name ); + + default PageResult<ProdVolumeEntity> selectPage(ProdVolumePageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<ProdVolumeEntity>()); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ToWashDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ToWashDao.java new file mode 100644 index 0000000..cdfd40f --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ToWashDao.java @@ -0,0 +1,27 @@ +package com.iailab.module.pms.production.wash.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.wash.vo.ToWashPageReqVO; +import com.iailab.module.pms.production.wash.entity.ToWashEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Mapper +public interface ToWashDao extends BaseMapperX<ToWashEntity> { + + List<String> selectListByName(@Param("startTime") Date startTime, @Param("endTime")Date endTime , @Param("name")String name ); + + default PageResult<ToWashEntity> selectPage(ToWashPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<ToWashEntity>()); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ToWashDetDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ToWashDetDao.java new file mode 100644 index 0000000..a69ad09 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/ToWashDetDao.java @@ -0,0 +1,28 @@ +package com.iailab.module.pms.production.wash.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.wash.vo.ToWashDetPageReqVO; +import com.iailab.module.pms.production.wash.entity.ToWashDetEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Mapper +public interface ToWashDetDao extends BaseMapperX<ToWashDetEntity> { + + List<String> selectListByName(@Param("startTime") Date startTime, @Param("endTime")Date endTime , @Param("name")String name ); + + default PageResult<ToWashDetEntity> selectPage(ToWashDetPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<ToWashDetEntity>() + .orderByDesc(ToWashDetEntity::getCjsj)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/TransferInDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/TransferInDao.java new file mode 100644 index 0000000..3b9d350 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/TransferInDao.java @@ -0,0 +1,27 @@ +package com.iailab.module.pms.production.wash.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.wash.vo.TransferInPageReqVO; +import com.iailab.module.pms.production.wash.entity.TransferInEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Mapper +public interface TransferInDao extends BaseMapperX<TransferInEntity> { + + List<String> selectListByName(@Param("startTime") Date startTime, @Param("endTime")Date endTime , @Param("name")String name ); + + default PageResult<TransferInEntity> selectPage(TransferInPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<TransferInEntity>()); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/WashPlanDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/WashPlanDao.java new file mode 100644 index 0000000..e2ff94e --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/WashPlanDao.java @@ -0,0 +1,28 @@ +package com.iailab.module.pms.production.wash.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.wash.vo.WashPlanPageReqVO; +import com.iailab.module.pms.production.wash.entity.WashPlanEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Mapper +public interface WashPlanDao extends BaseMapperX<WashPlanEntity> { + + List<String> selectListByName(@Param("startTime") Date startTime, @Param("endTime")Date endTime , @Param("name")String name ); + + default PageResult<WashPlanEntity> selectPage(WashPlanPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<WashPlanEntity>() + .orderByDesc(WashPlanEntity::getCjsj)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/WashPlanDetDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/WashPlanDetDao.java new file mode 100644 index 0000000..1a378a4 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/dao/WashPlanDetDao.java @@ -0,0 +1,28 @@ +package com.iailab.module.pms.production.wash.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.wash.vo.WashPlanDetPageReqVO; +import com.iailab.module.pms.production.wash.entity.WashPlanDetEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Mapper +public interface WashPlanDetDao extends BaseMapperX<WashPlanDetEntity> { + + List<String> selectListByName(@Param("startTime") Date startTime, @Param("endTime")Date endTime , @Param("name")String name ); + + default PageResult<WashPlanDetEntity> selectPage(WashPlanDetPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<WashPlanDetEntity>() + .orderByDesc(WashPlanDetEntity::getCjsj)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/HourVolumeEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/HourVolumeEntity.java new file mode 100644 index 0000000..075e984 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/HourVolumeEntity.java @@ -0,0 +1,116 @@ +package com.iailab.module.pms.production.wash.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.iailab.framework.common.annotation.Dict; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 小时量 + * + * @author DongYukun + * @Description + * @createTime 2024年09月05日 + */ +@TableName("t_wash_hour_volume") +@Data +public class HourVolumeEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.INPUT) + private String id; + + /** + * 日期 + */ + private String rq; + + /** + * 班次 + */ + private String bc; + + /** + * 流水号 + */ + private String lsh; + + /** + * 时间 + */ + private Date sj; + + /** + * 入洗量 + */ + @JsonFormat(shape =JsonFormat.Shape.STRING) + private BigDecimal rxl; + + /** + * 精煤量 + */ + @JsonFormat(shape =JsonFormat.Shape.STRING) + private BigDecimal jml; + + /** + * 混煤量 + */ + @JsonFormat(shape =JsonFormat.Shape.STRING) + private BigDecimal hml; + + /** + * 矸石量 + */ + @JsonFormat(shape =JsonFormat.Shape.STRING) + private BigDecimal gsl; + + /** + * 水洗矸石量 + */ + @JsonFormat(shape =JsonFormat.Shape.STRING) + private BigDecimal sxgsl; + + /** + * 浮精板数 + */ + private BigDecimal fjbs; + + /** + * 煤泥板数 + */ + private BigDecimal mnbs; + + /** + * 备注 + */ + private String bz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ProdVolumeEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ProdVolumeEntity.java new file mode 100644 index 0000000..351a87b --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ProdVolumeEntity.java @@ -0,0 +1,49 @@ +package com.iailab.module.pms.production.wash.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 小时量 + * + * @author DongYukun + * @Description + * @createTime 2024年09月05日 + */ +@TableName("t_wash_prod_volume") +@Data +public class ProdVolumeEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.INPUT) + private String id; + + private String rq; + + private String bc; + + private String lsh; + + private String clmz; + + private BigDecimal nbdrl; + + private String bz; + + private String cjr; + + private Date cjsj; + + private String xgr; + + private Date xgsj; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ToWashDetEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ToWashDetEntity.java new file mode 100644 index 0000000..aded04d --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ToWashDetEntity.java @@ -0,0 +1,74 @@ +package com.iailab.module.pms.production.wash.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.iailab.framework.common.annotation.Dict; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * 入洗量详情量 + * + * @author DongYukun + * @Description + * @createTime 2024年09月05日 + */ +@TableName("t_wash_to_wash_det") +@Data +public class ToWashDetEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + /** + * 总入洗id + */ + private String washId; + + /** + * 煤种 + */ + private String mz; + + /** + * 比例 + */ + private String bl; + + /** + * 入洗量 + */ + private String rxl; + + /** + * 备注 + */ + private String bz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ToWashEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ToWashEntity.java new file mode 100644 index 0000000..f4f8def --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/ToWashEntity.java @@ -0,0 +1,77 @@ +package com.iailab.module.pms.production.wash.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.iailab.framework.common.annotation.Dict; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 原煤入洗 + * + * @author DongYukun + * @Description + * @createTime 2024年09月05日 + */ +@TableName("t_wash_to_wash") +@Data +public class ToWashEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + /** + * 日期 + */ + private String rq; + + /** + * 班次 + */ + private String bc; + + /** + * 流水号 + */ + private String lsh; + + /** + * 总入洗 + */ + private BigDecimal zrx; + + + /** + * 备注 + */ + private String bz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/TransferInEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/TransferInEntity.java new file mode 100644 index 0000000..e2430be --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/TransferInEntity.java @@ -0,0 +1,49 @@ +package com.iailab.module.pms.production.wash.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 原煤调入 + * + * @author DongYukun + * @Description + * @createTime 2024年09月05日 + */ +@TableName("t_wash_transfer_in") +@Data +public class TransferInEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.INPUT) + private String id; + + private String rq; + + private String bc; + + private String lsh; + + private String drly; + + private BigDecimal nbdrl; + + private String bz; + + private String cjr; + + private Date cjsj; + + private String xgr; + + private Date xgsj; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/WashPlanDetEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/WashPlanDetEntity.java new file mode 100644 index 0000000..82f6570 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/WashPlanDetEntity.java @@ -0,0 +1,99 @@ +package com.iailab.module.pms.production.wash.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.iailab.framework.common.annotation.Dict; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 入洗计划详情 + * + * @author DongYukun + * @Description + * @createTime 2024年09月05日 + */ +@TableName("t_wash_plan_det") +@Data +public class WashPlanDetEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + /** + * 计划id + */ + private String jhId; + + /** + * 流水号 + */ + private String lsh; + + /** + * 煤种 + */ + private String mzCode; + + /** + * 单位 + */ + private String dw; + + /** + * 产量 + */ + private BigDecimal cl; + + /** + * 灰分 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal hf; + + /** + * 硫分 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal lf; + + /** + * 水分 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING) + private BigDecimal sf; + + /** + * 目标热值 + */ + private BigDecimal mbrz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/WashPlanEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/WashPlanEntity.java new file mode 100644 index 0000000..a2410a7 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/entity/WashPlanEntity.java @@ -0,0 +1,131 @@ +package com.iailab.module.pms.production.wash.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.iailab.framework.common.annotation.BpmStatus; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * 入洗计划 + * + * @author DongYukun + * @Description + * @createTime 2024年09月05日 + */ +@TableName("t_wash_plan") +@Data +public class WashPlanEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + + /** + * 所属公司 + */ + private String unit2; + + /** + * 所属单位 + */ + private String ssdw; + + /** + * 流水号 + */ + private String lsh; + + /** + * 年月(计划时间) + */ + private String ny; + + /** + * 编制人 + */ + private String bzr; + + /** + * 编制日期 + */ + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date bzsj; + + /** + * 上报时间(具体到时分秒) + */ + private Date sbsj; + + /** + * 审核时间(具体到时分秒) + */ + private Date shsj; + + /** + * 状态 + */ + private String zt; + + /** + * 计划类别(年计划、月计划) + */ + private String jhlb; + + /** + * 所属类别(全厂、车间) + */ + private String sslb; + + /** + * 所属类别名称 + */ + @TableField(exist = false) + private String sslbName; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + + /** + * 明细列表 + */ + @TableField(exist = false) + private List<WashPlanDetEntity> detList; + + @TableField(exist = false) + @BpmStatus(businessKey = "id") + private Integer bpmStatus; + + @TableField(exist = false) + private String bpmStatusName; + + @TableField(exist = false) + private Date bpmCreateDate; + + @TableField(exist = false) + private String procInstId; +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/HourVolumeService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/HourVolumeService.java new file mode 100644 index 0000000..198b4ed --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/HourVolumeService.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.wash.vo.HourVolumePageReqVO; +import com.iailab.module.pms.production.wash.entity.HourVolumeEntity; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +public interface HourVolumeService { + + String create(HourVolumeEntity createEntity); + + String update(HourVolumeEntity createEntity); + + void delete(String id); + + HourVolumeEntity getInfo(String id); + + PageResult<HourVolumeEntity> getPage(HourVolumePageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ProdVolumeService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ProdVolumeService.java new file mode 100644 index 0000000..c305de2 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ProdVolumeService.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.wash.vo.ProdVolumePageReqVO; +import com.iailab.module.pms.production.wash.entity.ProdVolumeEntity; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +public interface ProdVolumeService { + + String create(ProdVolumeEntity createEntity); + + String update(ProdVolumeEntity createEntity); + + void delete(String id); + + ProdVolumeEntity getInfo(String id); + + PageResult<ProdVolumeEntity> getPage(ProdVolumePageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ToWashDetService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ToWashDetService.java new file mode 100644 index 0000000..1cb6f04 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ToWashDetService.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.wash.vo.ToWashDetPageReqVO; +import com.iailab.module.pms.production.wash.entity.ToWashDetEntity; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +public interface ToWashDetService { + + String create(ToWashDetEntity createEntity); + + String update(ToWashDetEntity createEntity); + + void delete(String id); + + ToWashDetEntity getInfo(String id); + + PageResult<ToWashDetEntity> getPage(ToWashDetPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ToWashService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ToWashService.java new file mode 100644 index 0000000..9e4c2e4 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/ToWashService.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.wash.vo.ToWashPageReqVO; +import com.iailab.module.pms.production.wash.entity.ToWashEntity; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +public interface ToWashService { + + String create(ToWashEntity createEntity); + + String update(ToWashEntity createEntity); + + void delete(String id); + + ToWashEntity getInfo(String id); + + PageResult<ToWashEntity> getPage(ToWashPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/TransferInService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/TransferInService.java new file mode 100644 index 0000000..c8a0a6e --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/TransferInService.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.wash.vo.TransferInPageReqVO; +import com.iailab.module.pms.production.wash.entity.TransferInEntity; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +public interface TransferInService { + + String create(TransferInEntity createEntity); + + String update(TransferInEntity createEntity); + + void delete(String id); + + TransferInEntity getInfo(String id); + + PageResult<TransferInEntity> getPage(TransferInPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/WashPlanDetService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/WashPlanDetService.java new file mode 100644 index 0000000..1e15f26 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/WashPlanDetService.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.wash.vo.WashPlanDetPageReqVO; +import com.iailab.module.pms.production.wash.entity.WashPlanDetEntity; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +public interface WashPlanDetService { + + String create(WashPlanDetEntity createEntity); + + String update(WashPlanDetEntity createEntity); + + void delete(String id); + + WashPlanDetEntity getInfo(String id); + + PageResult<WashPlanDetEntity> getPage(WashPlanDetPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/WashPlanService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/WashPlanService.java new file mode 100644 index 0000000..7fc7b4d --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/WashPlanService.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.wash.vo.WashPlanPageReqVO; +import com.iailab.module.pms.production.wash.entity.WashPlanEntity; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +public interface WashPlanService { + + String create(WashPlanEntity createEntity); + + String update(WashPlanEntity createEntity); + + void delete(String id); + + WashPlanEntity getInfo(String id); + + PageResult<WashPlanEntity> getPage(WashPlanPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/HourVolumeServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/HourVolumeServiceImpl.java new file mode 100644 index 0000000..4504608 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/HourVolumeServiceImpl.java @@ -0,0 +1,56 @@ +package com.iailab.module.pms.production.wash.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.service.HourVolumeService; +import com.iailab.module.pms.production.wash.vo.HourVolumePageReqVO; +import com.iailab.module.pms.production.wash.entity.HourVolumeEntity; +import com.iailab.module.pms.production.wash.dao.HourVolumeDao; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Service +@Slf4j +public class HourVolumeServiceImpl implements HourVolumeService { + + @Resource + private HourVolumeDao hourVolumeDao; + + + @Override + public String create(HourVolumeEntity createEntity) { + HourVolumeEntity dto = BeanUtils.toBean(createEntity, HourVolumeEntity.class); + hourVolumeDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(HourVolumeEntity createEntity) { + HourVolumeEntity dto = BeanUtils.toBean(createEntity, HourVolumeEntity.class); + hourVolumeDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + hourVolumeDao.deleteById(id); + } + + @Override + public HourVolumeEntity getInfo(String id) { + return hourVolumeDao.selectById(id); + } + + @Override + public PageResult<HourVolumeEntity> getPage(HourVolumePageReqVO PageReqVO) { + return hourVolumeDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ProdVolumeServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ProdVolumeServiceImpl.java new file mode 100644 index 0000000..1794eb6 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ProdVolumeServiceImpl.java @@ -0,0 +1,56 @@ +package com.iailab.module.pms.production.wash.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.service.ProdVolumeService; +import com.iailab.module.pms.production.wash.vo.ProdVolumePageReqVO; +import com.iailab.module.pms.production.wash.entity.ProdVolumeEntity; +import com.iailab.module.pms.production.wash.dao.ProdVolumeDao; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Service +@Slf4j +public class ProdVolumeServiceImpl implements ProdVolumeService { + + @Resource + private ProdVolumeDao prodVolumeDao; + + + @Override + public String create(ProdVolumeEntity createEntity) { + ProdVolumeEntity dto = BeanUtils.toBean(createEntity, ProdVolumeEntity.class); + prodVolumeDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(ProdVolumeEntity createEntity) { + ProdVolumeEntity dto = BeanUtils.toBean(createEntity, ProdVolumeEntity.class); + prodVolumeDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + prodVolumeDao.deleteById(id); + } + + @Override + public ProdVolumeEntity getInfo(String id) { + return prodVolumeDao.selectById(id); + } + + @Override + public PageResult<ProdVolumeEntity> getPage(ProdVolumePageReqVO PageReqVO) { + return prodVolumeDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ToWashDetServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ToWashDetServiceImpl.java new file mode 100644 index 0000000..aec6c68 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ToWashDetServiceImpl.java @@ -0,0 +1,56 @@ +package com.iailab.module.pms.production.wash.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.service.ToWashDetService; +import com.iailab.module.pms.production.wash.vo.ToWashDetPageReqVO; +import com.iailab.module.pms.production.wash.entity.ToWashDetEntity; +import com.iailab.module.pms.production.wash.dao.ToWashDetDao; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Service +@Slf4j +public class ToWashDetServiceImpl implements ToWashDetService { + + @Resource + private ToWashDetDao toWashDetDao; + + + @Override + public String create(ToWashDetEntity createEntity) { + ToWashDetEntity dto = BeanUtils.toBean(createEntity, ToWashDetEntity.class); + toWashDetDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(ToWashDetEntity createEntity) { + ToWashDetEntity dto = BeanUtils.toBean(createEntity, ToWashDetEntity.class); + toWashDetDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + toWashDetDao.deleteById(id); + } + + @Override + public ToWashDetEntity getInfo(String id) { + return toWashDetDao.selectById(id); + } + + @Override + public PageResult<ToWashDetEntity> getPage(ToWashDetPageReqVO PageReqVO) { + return toWashDetDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ToWashServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ToWashServiceImpl.java new file mode 100644 index 0000000..019a8e5 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/ToWashServiceImpl.java @@ -0,0 +1,56 @@ +package com.iailab.module.pms.production.wash.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.service.ToWashService; +import com.iailab.module.pms.production.wash.vo.ToWashPageReqVO; +import com.iailab.module.pms.production.wash.entity.ToWashEntity; +import com.iailab.module.pms.production.wash.dao.ToWashDao; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Service +@Slf4j +public class ToWashServiceImpl implements ToWashService { + + @Resource + private ToWashDao toWashDao; + + + @Override + public String create(ToWashEntity createEntity) { + ToWashEntity dto = BeanUtils.toBean(createEntity, ToWashEntity.class); + toWashDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(ToWashEntity createEntity) { + ToWashEntity dto = BeanUtils.toBean(createEntity, ToWashEntity.class); + toWashDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + toWashDao.deleteById(id); + } + + @Override + public ToWashEntity getInfo(String id) { + return toWashDao.selectById(id); + } + + @Override + public PageResult<ToWashEntity> getPage(ToWashPageReqVO PageReqVO) { + return toWashDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/TransferInServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/TransferInServiceImpl.java new file mode 100644 index 0000000..3bc92f3 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/TransferInServiceImpl.java @@ -0,0 +1,56 @@ +package com.iailab.module.pms.production.wash.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.service.TransferInService; +import com.iailab.module.pms.production.wash.vo.TransferInPageReqVO; +import com.iailab.module.pms.production.wash.entity.TransferInEntity; +import com.iailab.module.pms.production.wash.dao.TransferInDao; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Service +@Slf4j +public class TransferInServiceImpl implements TransferInService { + + @Resource + private TransferInDao transferInDao; + + + @Override + public String create(TransferInEntity createEntity) { + TransferInEntity dto = BeanUtils.toBean(createEntity, TransferInEntity.class); + transferInDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(TransferInEntity createEntity) { + TransferInEntity dto = BeanUtils.toBean(createEntity, TransferInEntity.class); + transferInDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + transferInDao.deleteById(id); + } + + @Override + public TransferInEntity getInfo(String id) { + return transferInDao.selectById(id); + } + + @Override + public PageResult<TransferInEntity> getPage(TransferInPageReqVO PageReqVO) { + return transferInDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/WashPlanDetServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/WashPlanDetServiceImpl.java new file mode 100644 index 0000000..594ac0f --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/WashPlanDetServiceImpl.java @@ -0,0 +1,56 @@ +package com.iailab.module.pms.production.wash.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.service.WashPlanDetService; +import com.iailab.module.pms.production.wash.vo.WashPlanDetPageReqVO; +import com.iailab.module.pms.production.wash.entity.WashPlanDetEntity; +import com.iailab.module.pms.production.wash.dao.WashPlanDetDao; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Service +@Slf4j +public class WashPlanDetServiceImpl implements WashPlanDetService { + + @Resource + private WashPlanDetDao washPlanDetDao; + + + @Override + public String create(WashPlanDetEntity createEntity) { + WashPlanDetEntity dto = BeanUtils.toBean(createEntity, WashPlanDetEntity.class); + washPlanDetDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(WashPlanDetEntity createEntity) { + WashPlanDetEntity dto = BeanUtils.toBean(createEntity, WashPlanDetEntity.class); + washPlanDetDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + washPlanDetDao.deleteById(id); + } + + @Override + public WashPlanDetEntity getInfo(String id) { + return washPlanDetDao.selectById(id); + } + + @Override + public PageResult<WashPlanDetEntity> getPage(WashPlanDetPageReqVO PageReqVO) { + return washPlanDetDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/WashPlanServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/WashPlanServiceImpl.java new file mode 100644 index 0000000..2e63fa0 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/service/impl/WashPlanServiceImpl.java @@ -0,0 +1,56 @@ +package com.iailab.module.pms.production.wash.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.wash.service.WashPlanService; +import com.iailab.module.pms.production.wash.vo.WashPlanPageReqVO; +import com.iailab.module.pms.production.wash.entity.WashPlanEntity; +import com.iailab.module.pms.production.wash.dao.WashPlanDao; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Service +@Slf4j +public class WashPlanServiceImpl implements WashPlanService { + + @Resource + private WashPlanDao washPlanDao; + + + @Override + public String create(WashPlanEntity createEntity) { + WashPlanEntity dto = BeanUtils.toBean(createEntity, WashPlanEntity.class); + washPlanDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(WashPlanEntity createEntity) { + WashPlanEntity dto = BeanUtils.toBean(createEntity, WashPlanEntity.class); + washPlanDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + washPlanDao.deleteById(id); + } + + @Override + public WashPlanEntity getInfo(String id) { + return washPlanDao.selectById(id); + } + + @Override + public PageResult<WashPlanEntity> getPage(WashPlanPageReqVO PageReqVO) { + return washPlanDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/HourVolumePageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/HourVolumePageReqVO.java new file mode 100644 index 0000000..39ff1a4 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/HourVolumePageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "小时量") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class HourVolumePageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ProdVolumePageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ProdVolumePageReqVO.java new file mode 100644 index 0000000..26e6997 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ProdVolumePageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "生产量") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProdVolumePageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ToWashDetPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ToWashDetPageReqVO.java new file mode 100644 index 0000000..4af565c --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ToWashDetPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "入洗详情") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ToWashDetPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ToWashPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ToWashPageReqVO.java new file mode 100644 index 0000000..dd52c6e --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/ToWashPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "入洗量") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ToWashPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/TransferInPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/TransferInPageReqVO.java new file mode 100644 index 0000000..a58a186 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/TransferInPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "调入量") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class TransferInPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/WashPlanDetPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/WashPlanDetPageReqVO.java new file mode 100644 index 0000000..444c3f4 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/WashPlanDetPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "入洗计划详情") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class WashPlanDetPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/WashPlanPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/WashPlanPageReqVO.java new file mode 100644 index 0000000..dbe14f2 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/wash/vo/WashPlanPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.wash.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "入洗计划") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class WashPlanPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/DispatchLogController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/DispatchLogController.java new file mode 100644 index 0000000..74f645d --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/DispatchLogController.java @@ -0,0 +1,69 @@ +package com.iailab.module.pms.production.work.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.work.enity.DispatchLogEntity; +import com.iailab.module.pms.production.work.service.DispatchLogService; +import com.iailab.module.pms.production.work.vo.DispatchLogPageReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +/** + * 调度日志 + * + * @author DongYuKun + * @Description + * @createTime 2023年04月27日 11:02:00 + */ +@Slf4j +@RestController +@RequestMapping("/prod/work/dispatchLog") +public class DispatchLogController { + + @Resource + private DispatchLogService dispatchLogService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createDispatchLog(@Valid @RequestBody DispatchLogEntity createEntity) { + return success(dispatchLogService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateDispatchLog(@Valid @RequestBody DispatchLogEntity updateEntity) { + dispatchLogService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteDispatchLog(@RequestParam("id") String id) { + dispatchLogService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<DispatchLogEntity> getDispatchLog(@RequestParam("id") String id) { + DispatchLogEntity data = dispatchLogService.getInfo(id); + return success(BeanUtils.toBean(data, DispatchLogEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<DispatchLogEntity>> getDispatchLogPage(@Valid DispatchLogPageReqVO pageVO) { + PageResult<DispatchLogEntity> pageResult = dispatchLogService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, DispatchLogEntity.class)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/DutyInfoController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/DutyInfoController.java new file mode 100644 index 0000000..a52c268 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/DutyInfoController.java @@ -0,0 +1,69 @@ +package com.iailab.module.pms.production.work.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.work.enity.DutyInfoEntity; +import com.iailab.module.pms.production.work.service.DutyInfoService; +import com.iailab.module.pms.production.work.vo.DutyInfoPageReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +/** + * 当班信息 + * + * @author DongYuKun + * @Description + * @createTime 2023年04月27日 14:55:00 + */ +@Slf4j +@RestController +@RequestMapping("/prod/work/onDutyInfo") +public class DutyInfoController { + + @Resource + private DutyInfoService dutyInfoService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createDutyInfo(@Valid @RequestBody DutyInfoEntity createEntity) { + return success(dutyInfoService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateDutyInfo(@Valid @RequestBody DutyInfoEntity updateEntity) { + dutyInfoService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteDutyInfo(@RequestParam("id") String id) { + dutyInfoService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<DutyInfoEntity> getDutyInfo(@RequestParam("id") String id) { + DutyInfoEntity data = dutyInfoService.getInfo(id); + return success(BeanUtils.toBean(data, DutyInfoEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<DutyInfoEntity>> getDutyInfoPage(@Valid DutyInfoPageReqVO pageVO) { + PageResult<DutyInfoEntity> pageResult = dutyInfoService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, DutyInfoEntity.class)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/ProdAccidentController.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/ProdAccidentController.java new file mode 100644 index 0000000..03dfebf --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/admin/ProdAccidentController.java @@ -0,0 +1,67 @@ +package com.iailab.module.pms.production.work.controller.admin; + +import com.iailab.framework.common.pojo.CommonResult; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.work.enity.ProdAccidentEntity; +import com.iailab.module.pms.production.work.service.ProdAccidentService; +import com.iailab.module.pms.production.work.vo.ProdAccidentPageReqVO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.iailab.framework.common.pojo.CommonResult.success; + +/** + * 生产事故 + * + * @author DongYukun + * @Description + * @createTime 2023年01月05日 15:09:00 + */ +@RestController +@RequestMapping("/prod/work/prodAccident") +public class ProdAccidentController { + + @Resource + private ProdAccidentService prodAccidentService; + + @PostMapping("/create") + @Operation(summary = "新增") + public CommonResult<String> createProdAccident(@Valid @RequestBody ProdAccidentEntity createEntity) { + return success(prodAccidentService.create(createEntity)); + } + + @PutMapping("/update") + @Operation(summary = "更新") + public CommonResult<Boolean> updateProdAccident(@Valid @RequestBody ProdAccidentEntity updateEntity) { + prodAccidentService.update(updateEntity); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<Boolean> deleteProdAccident(@RequestParam("id") String id) { + prodAccidentService.delete(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "详情") + @Parameter(name = "id", description = "ID", required = true, example = "1024") + public CommonResult<ProdAccidentEntity> getProdAccident(@RequestParam("id") String id) { + ProdAccidentEntity data = prodAccidentService.getInfo(id); + return success(BeanUtils.toBean(data, ProdAccidentEntity.class)); + } + + @GetMapping("/page") + @Operation(summary = "分页") + public CommonResult<PageResult<ProdAccidentEntity>> getProdAccidentPage(@Valid ProdAccidentPageReqVO pageVO) { + PageResult<ProdAccidentEntity> pageResult = prodAccidentService.getPage(pageVO); + return success(BeanUtils.toBean(pageResult, ProdAccidentEntity.class)); + } +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/package-info.java similarity index 81% rename from iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java rename to iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/package-info.java index c22c215..2f145e2 100644 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/controller/package-info.java +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/controller/package-info.java @@ -3,4 +3,4 @@ * 1. admin 包:提供给管理后台 iailab-ui-admin 前端项目 * 2. app 包:提供给用户 APP iailab-ui-app 前端项目,它的 Controller 和 VO 都要添加 App 前缀,用于和管理后台进行区分 */ -package com.iailab.module.pms.controller; +package com.iailab.module.pms.production.work.controller; diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/DispatchLogDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/DispatchLogDao.java new file mode 100644 index 0000000..6a2ba47 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/DispatchLogDao.java @@ -0,0 +1,17 @@ +package com.iailab.module.pms.production.work.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.work.enity.DispatchLogEntity; +import com.iailab.module.pms.production.work.vo.DispatchLogPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DispatchLogDao extends BaseMapperX<DispatchLogEntity> { + + default PageResult<DispatchLogEntity> selectPage(DispatchLogPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<DispatchLogEntity>() + .orderByDesc(DispatchLogEntity::getCjsj)); + } +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/DutyInfoDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/DutyInfoDao.java new file mode 100644 index 0000000..564ad45 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/DutyInfoDao.java @@ -0,0 +1,18 @@ +package com.iailab.module.pms.production.work.dao; + + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.work.enity.DutyInfoEntity; +import com.iailab.module.pms.production.work.vo.DutyInfoPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface DutyInfoDao extends BaseMapperX<DutyInfoEntity> { + + default PageResult<DutyInfoEntity> selectPage(DutyInfoPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<DutyInfoEntity>() + .orderByDesc(DutyInfoEntity::getCjsj)); + } +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/ProdAccidentDao.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/ProdAccidentDao.java new file mode 100644 index 0000000..2974689 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/dao/ProdAccidentDao.java @@ -0,0 +1,17 @@ +package com.iailab.module.pms.production.work.dao; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.mybatis.core.mapper.BaseMapperX; +import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; +import com.iailab.module.pms.production.work.enity.ProdAccidentEntity; +import com.iailab.module.pms.production.work.vo.ProdAccidentPageReqVO; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface ProdAccidentDao extends BaseMapperX<ProdAccidentEntity> { + + default PageResult<ProdAccidentEntity> selectPage(ProdAccidentPageReqVO Entity) { + return selectPage(Entity, new LambdaQueryWrapperX<ProdAccidentEntity>() + .orderByDesc(ProdAccidentEntity::getCjsj)); + } +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/DispatchLogEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/DispatchLogEntity.java new file mode 100644 index 0000000..a134fdc --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/DispatchLogEntity.java @@ -0,0 +1,81 @@ +package com.iailab.module.pms.production.work.enity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * @author DongYuKun + * @Description + * @createTime 2023年04月27日 09:41:58 + */ +@Data +@TableName("t_work_dispatch_log") +public class DispatchLogEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 流水号 + */ + private String lsh; + + /** + * 日期时间 + */ + private Date rqsj; + + /** + * 日志类别(生产、非生产) + */ + private String rzlb; + + /** + * 班次 + */ + private String bc; + + /** + * 日志标题 + */ + private String rzbt; + + /** + * 日志内容 + */ + private String rznr; + + /** + * 备注 + */ + private String bz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/DutyInfoEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/DutyInfoEntity.java new file mode 100644 index 0000000..a8d2c4f --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/DutyInfoEntity.java @@ -0,0 +1,116 @@ +package com.iailab.module.pms.production.work.enity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.iailab.framework.common.annotation.UserRealName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * + * @author DongYuKun + * @Description + * @createTime 2023年04月27日 + */ +@Data +@TableName("t_work_duty_info") +public class DutyInfoEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 日期 + */ + private String rq; + + /** + * 班次 + */ + private String bc; + + + /** + * 流水号 + */ + private String lsh; + + /** + * 值班领导 + */ + private String zbld; + + /** + * 值班领导姓名 + */ + @UserRealName(userid = "zbld") + @TableField(exist = false) + private String zbldName; + + /** + * 值班调度 + */ + private String zbdd; + + /** + * 值班调度姓名 + */ + @UserRealName(userid = "zbdd") + @TableField(exist = false) + private String zbddName; + + /** + * 洗选车间值班 + */ + private String xxcjzb; + + /** + * 洗选车间值班姓名 + */ + @UserRealName(userid = "xxcjzb") + @TableField(exist = false) + private String xxcjzbName; + + /** + * 机电车间值班 + */ + private String jdcjzb; + + /** + * 机电车间值班姓名 + */ + @UserRealName(userid = "jdcjzb") + @TableField(exist = false) + private String jdcjzbName; + /** + * 备注 + */ + private String bz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/ProdAccidentEntity.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/ProdAccidentEntity.java new file mode 100644 index 0000000..afbf6fb --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/enity/ProdAccidentEntity.java @@ -0,0 +1,108 @@ +package com.iailab.module.pms.production.work.enity; + +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author DongYukun + * @Description + * @createTime 2023年02月24日 16:59:20 + */ +@Data +@TableName("t_work_prod_accident") +public class ProdAccidentEntity implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 日期 + */ + private String rq; + + /** + * 班次 + */ + private String bc; + + /** + * 班次名称 + */ + @TableField(exist = false) + private String bcName; + + /** + * 流水号 + */ + private String lsh; + + /** + * 影响范围 + */ + private String yxfw; + + /** + * 事故内容 + */ + private String sgnr; + + /** + * 开始时间 + */ + private Date kssj; + + /** + * 结束时间 + */ + private Date jssj; + + /** + * 持续时间 + */ + private Long cxsj; + + /** + * 事故原因 + */ + private String sgyy; + + /** + * 事故后果 + */ + private String sghg; + + /** + * 备注 + */ + private String bz; + + /** + * 创建人 + */ + private String cjr; + + /** + * 创建时间 + */ + private Date cjsj; + + /** + * 修改人 + */ + private String xgr; + + /** + * 修改时间 + */ + private Date xgsj; + +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/DispatchLogService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/DispatchLogService.java new file mode 100644 index 0000000..a968285 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/DispatchLogService.java @@ -0,0 +1,26 @@ +package com.iailab.module.pms.production.work.service; + + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.work.enity.DispatchLogEntity; +import com.iailab.module.pms.production.work.vo.DispatchLogPageReqVO; + +/** + * 调度日志 + * + * @author DongYuKun + * @Description + * @createTime 2023年04月27日 11:03:00 + */ +public interface DispatchLogService{ + + String create(DispatchLogEntity createEntity); + + String update(DispatchLogEntity createEntity); + + void delete(String id); + + DispatchLogEntity getInfo(String id); + + PageResult<DispatchLogEntity> getPage(DispatchLogPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/DutyInfoService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/DutyInfoService.java new file mode 100644 index 0000000..7d0c202 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/DutyInfoService.java @@ -0,0 +1,26 @@ +package com.iailab.module.pms.production.work.service; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.work.enity.DutyInfoEntity; +import com.iailab.module.pms.production.work.vo.DutyInfoPageReqVO; + +/** + * 当班信息 + * + * + * @author DongYuKun + * @Description + * @createTime 2023年04月27日 14:58:00 + */ +public interface DutyInfoService { + + String create(DutyInfoEntity createEntity); + + String update(DutyInfoEntity createEntity); + + void delete(String id); + + DutyInfoEntity getInfo(String id); + + PageResult<DutyInfoEntity> getPage(DutyInfoPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/ProdAccidentService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/ProdAccidentService.java new file mode 100644 index 0000000..261ceca --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/ProdAccidentService.java @@ -0,0 +1,24 @@ +package com.iailab.module.pms.production.work.service; +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.module.pms.production.work.enity.ProdAccidentEntity; +import com.iailab.module.pms.production.work.vo.ProdAccidentPageReqVO; + +/** + * 生产事故 + * + * @author DongYukun + * @Description + * @createTime 2023年01月05日 15:13:00 + */ +public interface ProdAccidentService { + + String create(ProdAccidentEntity createEntity); + + String update(ProdAccidentEntity createEntity); + + void delete(String id); + + ProdAccidentEntity getInfo(String id); + + PageResult<ProdAccidentEntity> getPage(ProdAccidentPageReqVO PageReqVO); +} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/DispatchLogServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/DispatchLogServiceImpl.java new file mode 100644 index 0000000..cff4bb6 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/DispatchLogServiceImpl.java @@ -0,0 +1,59 @@ +package com.iailab.module.pms.production.work.service.impl; + + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.work.dao.DispatchLogDao; +import com.iailab.module.pms.production.work.enity.DispatchLogEntity; +import com.iailab.module.pms.production.work.service.DispatchLogService; +import com.iailab.module.pms.production.work.vo.DispatchLogPageReqVO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 调度日志 + * + * @author DongYukun + * @Description + * @createTime 2023年04月27日 11:03:30 + */ +@Slf4j +@Service +public class DispatchLogServiceImpl implements DispatchLogService { + + @Resource + private DispatchLogDao dispatchLogDao; + + + @Override + public String create(DispatchLogEntity createEntity) { + DispatchLogEntity dto = BeanUtils.toBean(createEntity, DispatchLogEntity.class); + dispatchLogDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(DispatchLogEntity createEntity) { + DispatchLogEntity dto = BeanUtils.toBean(createEntity, DispatchLogEntity.class); + dispatchLogDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + dispatchLogDao.deleteById(id); + } + + @Override + public DispatchLogEntity getInfo(String id) { + return dispatchLogDao.selectById(id); + } + + @Override + public PageResult<DispatchLogEntity> getPage(DispatchLogPageReqVO PageReqVO) { + return dispatchLogDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/DutyInfoServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/DutyInfoServiceImpl.java new file mode 100644 index 0000000..2afbc18 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/DutyInfoServiceImpl.java @@ -0,0 +1,56 @@ +package com.iailab.module.pms.production.work.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.work.dao.DutyInfoDao; +import com.iailab.module.pms.production.work.enity.DutyInfoEntity; +import com.iailab.module.pms.production.work.service.DutyInfoService; +import com.iailab.module.pms.production.work.vo.DutyInfoPageReqVO; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 当班信息 + * + * @author DongYukun + * @Description + * @createTime 2023年04月27日 14:59:30 + */ +@Service +public class DutyInfoServiceImpl implements DutyInfoService { + + @Resource + private DutyInfoDao dutyInfoDao; + + + @Override + public String create(DutyInfoEntity createEntity) { + DutyInfoEntity dto = BeanUtils.toBean(createEntity, DutyInfoEntity.class); + dutyInfoDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(DutyInfoEntity createEntity) { + DutyInfoEntity dto = BeanUtils.toBean(createEntity, DutyInfoEntity.class); + dutyInfoDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + dutyInfoDao.deleteById(id); + } + + @Override + public DutyInfoEntity getInfo(String id) { + return dutyInfoDao.selectById(id); + } + + @Override + public PageResult<DutyInfoEntity> getPage(DutyInfoPageReqVO PageReqVO) { + return dutyInfoDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/ProdAccidentServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/ProdAccidentServiceImpl.java new file mode 100644 index 0000000..f16d5b4 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/service/impl/ProdAccidentServiceImpl.java @@ -0,0 +1,56 @@ +package com.iailab.module.pms.production.work.service.impl; + +import com.iailab.framework.common.pojo.PageResult; +import com.iailab.framework.common.util.object.BeanUtils; +import com.iailab.module.pms.production.work.dao.ProdAccidentDao; +import com.iailab.module.pms.production.work.enity.ProdAccidentEntity; +import com.iailab.module.pms.production.work.service.ProdAccidentService; +import com.iailab.module.pms.production.work.vo.ProdAccidentPageReqVO; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * 当班信息 + * + * @author DongYukun + * @Description + * @createTime 2023年04月27日 14:59:30 + */ +@Service +public class ProdAccidentServiceImpl implements ProdAccidentService { + + @Resource + private ProdAccidentDao prodAccidentDao; + + + @Override + public String create(ProdAccidentEntity createEntity) { + ProdAccidentEntity dto = BeanUtils.toBean(createEntity, ProdAccidentEntity.class); + prodAccidentDao.insert(dto); + return dto.getId(); + } + + @Override + public String update(ProdAccidentEntity createEntity) { + ProdAccidentEntity dto = BeanUtils.toBean(createEntity, ProdAccidentEntity.class); + prodAccidentDao.updateById(dto); + return dto.getId(); + } + + @Override + public void delete(String id) { + prodAccidentDao.deleteById(id); + } + + @Override + public ProdAccidentEntity getInfo(String id) { + return prodAccidentDao.selectById(id); + } + + @Override + public PageResult<ProdAccidentEntity> getPage(ProdAccidentPageReqVO PageReqVO) { + return prodAccidentDao.selectPage(PageReqVO); + } + +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/DispatchLogPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/DispatchLogPageReqVO.java new file mode 100644 index 0000000..39bdd37 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/DispatchLogPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.work.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "调度日志") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class DispatchLogPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/DutyInfoPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/DutyInfoPageReqVO.java new file mode 100644 index 0000000..6dfa19a --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/DutyInfoPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.work.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "当班信息") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class DutyInfoPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/ProdAccidentPageReqVO.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/ProdAccidentPageReqVO.java new file mode 100644 index 0000000..5ef9582 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/production/work/vo/ProdAccidentPageReqVO.java @@ -0,0 +1,23 @@ +package com.iailab.module.pms.production.work.vo; + +import com.iailab.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** + * @author DongYukun + * @Description + * @createTime 2024年12月03日 + */ +@Schema(description = "生产事故") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class ProdAccidentPageReqVO extends PageParam { + + private String startDate; + + private String endDate; +} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/service/demo/DemoService.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/service/demo/DemoService.java deleted file mode 100644 index 98273b7..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/service/demo/DemoService.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.iailab.module.pms.service.demo; - -import com.iailab.framework.common.pojo.PageResult; -import com.iailab.module.pms.controller.admin.demo.vo.DemoPageReqVO; -import com.iailab.module.pms.controller.admin.demo.vo.DemoSaveReqVO; -import com.iailab.module.pms.dal.dataobject.demo.DemoDO; - -/** - * @author PanZhibao - * @Description - * @createTime 2024年08月17日 - */ -public interface DemoService { - - Long create(DemoSaveReqVO createReqVO); - - Long update(DemoSaveReqVO createReqVO); - - void delete(Long id); - - DemoDO getInfo(Long id); - - PageResult<DemoDO> getPage(DemoPageReqVO pageReqVO); -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/service/demo/DemoServiceImpl.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/service/demo/DemoServiceImpl.java deleted file mode 100644 index 18ab8f1..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/service/demo/DemoServiceImpl.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.iailab.module.pms.service.demo; - -import com.iailab.framework.common.pojo.PageResult; -import com.iailab.framework.common.util.object.BeanUtils; -import com.iailab.module.pms.controller.admin.demo.vo.DemoPageReqVO; -import com.iailab.module.pms.controller.admin.demo.vo.DemoSaveReqVO; -import com.iailab.module.pms.dal.dataobject.demo.DemoDO; -import com.iailab.module.pms.dal.mysql.demo.DemoMapper; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - -/** - * @author PanZhibao - * @Description - * @createTime 2024年08月17日 - */ -@Service -@Slf4j -public class DemoServiceImpl implements DemoService { - - @Resource - private DemoMapper demoMapper; - - - @Override - public Long create(DemoSaveReqVO createReqVO) { - DemoDO demo = BeanUtils.toBean(createReqVO, DemoDO.class); - demoMapper.insert(demo); - return demo.getId(); - } - - @Override - public Long update(DemoSaveReqVO createReqVO) { - DemoDO demo = BeanUtils.toBean(createReqVO, DemoDO.class); - demoMapper.updateById(demo); - return demo.getId(); - } - - @Override - public void delete(Long id) { - demoMapper.deleteById(id); - } - - @Override - public DemoDO getInfo(Long id) { - return demoMapper.selectById(id); - } - - @Override - public PageResult<DemoDO> getPage(DemoPageReqVO pageReqVO) { - return demoMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/service/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/service/package-info.java deleted file mode 100644 index 058493d..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/service/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package com.iailab.module.pms.service; \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/util/SecurityUtils.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/util/SecurityUtils.java deleted file mode 100644 index 6f05ef7..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/util/SecurityUtils.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.iailab.module.pms.util; - -import com.iailab.framework.security.core.LoginUser; -import org.springframework.lang.Nullable; -import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContext; -import org.springframework.security.core.context.SecurityContextHolder; -import org.springframework.security.web.authentication.WebAuthenticationDetailsSource; -import org.springframework.util.StringUtils; - -import javax.servlet.http.HttpServletRequest; -import java.util.Collections; - -/** - * 安全服务工具类 - * - * @author 芋道源码 - */ -public class SecurityUtils { - - public static final String AUTHORIZATION_BEARER = "Bearer"; - - private SecurityUtils() {} - - /** - * 从请求中,获得认证 Token - * - * @param request 请求 - * @param header 认证 Token 对应的 Header 名字 - * @return 认证 Token - */ - public static String obtainAuthorization(HttpServletRequest request, String header) { - String authorization = request.getHeader(header); - if (!StringUtils.hasText(authorization)) { - return null; - } - int index = authorization.indexOf(AUTHORIZATION_BEARER + " "); - if (index == -1) { // 未找到 - return null; - } - return authorization.substring(index + 7).trim(); - } - - /** - * 获得当前认证信息 - * - * @return 认证信息 - */ - public static Authentication getAuthentication() { - SecurityContext context = SecurityContextHolder.getContext(); - if (context == null) { - return null; - } - return context.getAuthentication(); - } - - /** - * 获取当前用户 - * - * @return 当前用户 - */ - @Nullable - public static LoginUser getLoginUser() { - Authentication authentication = getAuthentication(); - if (authentication == null) { - return null; - } - return authentication.getPrincipal() instanceof LoginUser ? (LoginUser) authentication.getPrincipal() : null; - } - - /** - * 获得当前用户的编号,从上下文中 - * - * @return 用户编号 - */ - @Nullable - public static Long getLoginUserId() { - LoginUser loginUser = getLoginUser(); - return loginUser != null ? loginUser.getId() : null; - } - - /** - * 设置当前用户 - * - * @param loginUser 登录用户 - * @param request 请求 - */ - public static void setLoginUser(LoginUser loginUser, HttpServletRequest request) { - // 创建 Authentication,并设置到上下文 - Authentication authentication = buildAuthentication(loginUser, request); - SecurityContextHolder.getContext().setAuthentication(authentication); - } - - private static Authentication buildAuthentication(LoginUser loginUser, HttpServletRequest request) { - // 创建 UsernamePasswordAuthenticationToken 对象 - UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken( - loginUser, null, Collections.emptyList()); - authenticationToken.setDetails(new WebAuthenticationDetailsSource().buildDetails(request)); - return authenticationToken; - } - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/util/oauth2/OAuth2Utils.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/util/oauth2/OAuth2Utils.java deleted file mode 100644 index 920add3..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/util/oauth2/OAuth2Utils.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.iailab.module.pms.util.oauth2; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.date.LocalDateTimeUtil; -import cn.hutool.core.util.StrUtil; -import com.iailab.framework.common.util.http.HttpUtils; -import com.iailab.framework.security.core.util.SecurityFrameworkUtils; - -import java.time.LocalDateTime; -import java.time.temporal.ChronoUnit; -import java.util.*; - -/** - * OAuth2 相关的工具类 - * - * @author iailab - */ -public class OAuth2Utils { - - /** - * 构建授权码模式下,重定向的 URI - * - * copy from Spring Security OAuth2 的 AuthorizationEndpoint 类的 getSuccessfulRedirect 方法 - * - * @param redirectUri 重定向 URI - * @param authorizationCode 授权码 - * @param state 状态 - * @return 授权码模式下的重定向 URI - */ - public static String buildAuthorizationCodeRedirectUri(String redirectUri, String authorizationCode, String state) { - Map<String, String> query = new LinkedHashMap<>(); - query.put("code", authorizationCode); - if (state != null) { - query.put("state", state); - } - return HttpUtils.append(redirectUri, query, null, false); - } - - /** - * 构建简化模式下,重定向的 URI - * - * copy from Spring Security OAuth2 的 AuthorizationEndpoint 类的 appendAccessToken 方法 - * - * @param redirectUri 重定向 URI - * @param accessToken 访问令牌 - * @param state 状态 - * @param expireTime 过期时间 - * @param scopes 授权范围 - * @param additionalInformation 附加信息 - * @return 简化授权模式下的重定向 URI - */ - public static String buildImplicitRedirectUri(String redirectUri, String accessToken, String state, LocalDateTime expireTime, - Collection<String> scopes, Map<String, Object> additionalInformation) { - Map<String, Object> vars = new LinkedHashMap<String, Object>(); - Map<String, String> keys = new HashMap<String, String>(); - vars.put("access_token", accessToken); - vars.put("token_type", SecurityFrameworkUtils.AUTHORIZATION_BEARER.toLowerCase()); - if (state != null) { - vars.put("state", state); - } - if (expireTime != null) { - vars.put("expires_in", getExpiresIn(expireTime)); - } - if (CollUtil.isNotEmpty(scopes)) { - vars.put("scope", buildScopeStr(scopes)); - } - if (CollUtil.isNotEmpty(additionalInformation)) { - for (String key : additionalInformation.keySet()) { - Object value = additionalInformation.get(key); - if (value != null) { - keys.put("extra_" + key, key); - vars.put("extra_" + key, value); - } - } - } - // Do not include the refresh token (even if there is one) - return HttpUtils.append(redirectUri, vars, keys, true); - } - - public static String buildUnsuccessfulRedirect(String redirectUri, String responseType, String state, - String error, String description) { - Map<String, String> query = new LinkedHashMap<String, String>(); - query.put("error", error); - query.put("error_description", description); - if (state != null) { - query.put("state", state); - } - return HttpUtils.append(redirectUri, query, null, !responseType.contains("code")); - } - - public static long getExpiresIn(LocalDateTime expireTime) { - return LocalDateTimeUtil.between(LocalDateTime.now(), expireTime, ChronoUnit.SECONDS); - } - - public static String buildScopeStr(Collection<String> scopes) { - return CollUtil.join(scopes, " "); - } - - public static List<String> buildScopes(String scope) { - return StrUtil.split(scope, ' '); - } - -} diff --git a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/util/package-info.java b/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/util/package-info.java deleted file mode 100644 index e72f1ef..0000000 --- a/iailab-xmc-pms-biz/src/main/java/com/iailab/module/pms/util/package-info.java +++ /dev/null @@ -1,4 +0,0 @@ -/** - * 每个模块的 util 包,放专属当前模块的 Utils 工具类 - */ -package com.iailab.module.pms.util; diff --git a/iailab-xmc-pms-biz/src/main/resources/application.yaml b/iailab-xmc-pms-biz/src/main/resources/application.yaml index 48e79da..531c719 100644 --- a/iailab-xmc-pms-biz/src/main/resources/application.yaml +++ b/iailab-xmc-pms-biz/src/main/resources/application.yaml @@ -152,17 +152,6 @@ - qrtz_triggers - schedule_job - schedule_job_log - - t_coal_wash_curves - - t_coal_analysis_full_det - - t_coal_analysis_full - - t_coal_wash_curves_chart - - t_coal_wash_curves_det - - t_coal_wash_curves - - t_quality_wash_target - - t_quality_detection - - t_quality_medium - - t_quality_quick_detection - - t_quality_tailing swagger: title: 选煤厂生产管理平台 description: 选煤厂生产管理平台 diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg1.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg1.png deleted file mode 100644 index c481457..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg1.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg2.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg2.png deleted file mode 100644 index bf8fb38..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg2.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg3.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg3.png deleted file mode 100644 index f871d3d..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg3.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg4.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg4.png deleted file mode 100644 index 2e3d871..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg4.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg5.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg5.png deleted file mode 100644 index fe383b7..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg5.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg6.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg6.png deleted file mode 100644 index 5024ceb..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg6.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg7.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg7.png deleted file mode 100644 index efe76f8..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg7.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg8.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg8.png deleted file mode 100644 index 2727aa3..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg8.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg9.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg9.png deleted file mode 100644 index 4463aa2..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/original/bg9.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/1.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/1.png deleted file mode 100644 index ef11324..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/1.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/10.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/10.png deleted file mode 100644 index 297e44c..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/10.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/11.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/11.png deleted file mode 100644 index d9b1da8..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/11.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/12.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/12.png deleted file mode 100644 index 07e7313..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/12.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/13.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/13.png deleted file mode 100644 index 82c3dd9..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/13.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/14.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/14.png deleted file mode 100644 index 0b9a866..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/14.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/15.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/15.png deleted file mode 100644 index 86b0d1c..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/15.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/16.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/16.png deleted file mode 100644 index e90a6e2..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/16.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/17.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/17.png deleted file mode 100644 index a82cbc7..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/17.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/18.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/18.png deleted file mode 100644 index d3f3cfd..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/18.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/19.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/19.png deleted file mode 100644 index eb2855b..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/19.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/8.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/8.png deleted file mode 100644 index 3cb5ce1..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/8.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/9.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/9.png deleted file mode 100644 index 384d354..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/11/9.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/2.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/2.png deleted file mode 100644 index baf3f06..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/2.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/3.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/3.png deleted file mode 100644 index ccaf617..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/3.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/4.png b/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/4.png deleted file mode 100644 index 7dab162..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/jigsaw/slidingBlock/4.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg1.png b/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg1.png deleted file mode 100644 index 14e7345..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg1.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg10.png b/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg10.png deleted file mode 100644 index 1ea1d6d..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg10.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg2.png b/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg2.png deleted file mode 100644 index 0edb329..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg2.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg3.png b/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg3.png deleted file mode 100644 index 9167996..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg3.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg4.png b/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg4.png deleted file mode 100644 index e8e8e6c..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg4.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg5.png b/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg5.png deleted file mode 100644 index 66a3181..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg5.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg6.png b/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg6.png deleted file mode 100644 index 9b0f5d8..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg6.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg7.png b/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg7.png deleted file mode 100644 index db41c74..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg7.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg8.png b/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg8.png deleted file mode 100644 index 3496813..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg8.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg9.png b/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg9.png deleted file mode 100644 index 4e7b477..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/images/pic-click/bg9.png +++ /dev/null Binary files differ diff --git a/iailab-xmc-pms-biz/src/main/resources/mapper/hourVolume/HourVolumeDao.xml b/iailab-xmc-pms-biz/src/main/resources/mapper/hourVolume/HourVolumeDao.xml new file mode 100644 index 0000000..9c259f7 --- /dev/null +++ b/iailab-xmc-pms-biz/src/main/resources/mapper/hourVolume/HourVolumeDao.xml @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> + +<mapper namespace="com.iailab.module.pms.production.wash.dao.HourVolumeDao"> + + <select id="selectListByName" resultType="java.lang.String"> + + SELECT + b.${name} + FROM + ( + SELECT '08' AS time, 1 AS sort_order UNION ALL + SELECT '09' AS time, 2 AS sort_order UNION ALL + SELECT '10' AS time, 3 AS sort_order UNION ALL + SELECT '11' AS time, 4 AS sort_order UNION ALL + SELECT '12' AS time, 5 AS sort_order UNION ALL + SELECT '13' AS time, 6 AS sort_order UNION ALL + SELECT '14' AS time, 7 AS sort_order UNION ALL + SELECT '15' AS time, 8 AS sort_order UNION ALL + SELECT '16' AS time, 9 AS sort_order UNION ALL + SELECT '17' AS time, 10 AS sort_order UNION ALL + SELECT '18' AS time, 11 AS sort_order UNION ALL + SELECT '19' AS time, 12 AS sort_order UNION ALL + SELECT '20' AS time, 13 AS sort_order UNION ALL + SELECT '21' AS time, 14 AS sort_order UNION ALL + SELECT '22' AS time, 15 AS sort_order UNION ALL + SELECT '23' AS time, 16 AS sort_order UNION ALL + SELECT '00' AS time, 17 AS sort_order UNION ALL + SELECT '01' AS time, 18 AS sort_order UNION ALL + SELECT '02' AS time, 19 AS sort_order UNION ALL + SELECT '03' AS time, 20 AS sort_order UNION ALL + SELECT '04' AS time, 21 AS sort_order UNION ALL + SELECT '05' AS time, 22 AS sort_order UNION ALL + SELECT '06' AS time, 23 AS sort_order UNION ALL + SELECT '07' AS time, 24 AS sort_order + ) a left join ( + SELECT + ${name} + ,sj + FROM t_wash_hour_volume + WHERE + sj >= #{startTime} + AND + sj <= #{endTime} + ) b + ON + a.time = DATE_FORMAT(b.sj,'%H') + ORDER BY + a.sort_order + </select> +</mapper> diff --git a/iailab-xmc-pms-biz/src/main/resources/mapper/job/ScheduleJobDao.xml b/iailab-xmc-pms-biz/src/main/resources/mapper/job/ScheduleJobDao.xml deleted file mode 100644 index bd0e4a6..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/mapper/job/ScheduleJobDao.xml +++ /dev/null @@ -1,14 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.iailab.module.iailab-xmc-pms.job.dao.ScheduleJobDao"> - - <!-- 批量更新状态 --> - <update id="updateBatch"> - update schedule_job set status = #{status} where id in - <foreach item="id" collection="ids" open="(" separator="," close=")"> - #{id} - </foreach> - </update> - -</mapper> \ No newline at end of file diff --git a/iailab-xmc-pms-biz/src/main/resources/mapper/job/ScheduleJobLogDao.xml b/iailab-xmc-pms-biz/src/main/resources/mapper/job/ScheduleJobLogDao.xml deleted file mode 100644 index 4db4729..0000000 --- a/iailab-xmc-pms-biz/src/main/resources/mapper/job/ScheduleJobLogDao.xml +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.iailab.module.iailab-xmc-pms.job.dao.ScheduleJobLogDao"> - - -</mapper> \ No newline at end of file -- Gitblit v1.9.3