소스 검색

update->优化 魔法值改常量

wang-hai-cheng 5 년 전
부모
커밋
d4d2b8521a

+ 3 - 3
lift-enterprise-service/src/main/java/cn/com/ty/lift/enterprise/option/controller/MaintenanceOptionController.java

@@ -44,7 +44,7 @@ public class MaintenanceOptionController {
         IPage<MaintenanceOption> page = optionService.page(
                 new Page<>(req.getPageNum(), req.getPageSize()), new QueryWrapper<MaintenanceOption>()
                         //10086L是固定数据的公司id
-                        .in("mt_company_id", 10086L, req.getMtCompanyId())
+                        .in("mt_company_id", ApiConstants.Platform.COMPANY_ID, req.getMtCompanyId())
                         .in(req.getType() != null, "type", type(req))
                         .eq(req.getLiftCategory() != null, "lift_category", req.getLiftCategory())
                         .eq("status", 2)
@@ -113,7 +113,7 @@ public class MaintenanceOptionController {
     public RestResponse<?> modify(@RequestBody MaintenanceOption option) {
         Long mtCompanyId = optionService.getById(option.getId()).getMtCompanyId();
         //10086L是固定数据的公司id
-        if (option.getMtCompanyId().equals(mtCompanyId) || option.getMtCompanyId().equals(10086L)) {
+        if (option.getMtCompanyId().equals(mtCompanyId) || option.getMtCompanyId().equals(ApiConstants.Platform.COMPANY_ID)) {
             return RestResponse.success(optionService.updateById(option));
         }
         return RestResponse.fail("默认维保项无法编辑");
@@ -129,7 +129,7 @@ public class MaintenanceOptionController {
     public RestResponse<?> delete(@RequestBody MaintenanceOption option) {
         Long mtCompanyId = optionService.getById(option.getId()).getMtCompanyId();
         //10086L是固定数据的公司id
-        if (option.getMtCompanyId().equals(mtCompanyId) || option.getMtCompanyId().equals(10086L)) {
+        if (option.getMtCompanyId().equals(mtCompanyId) || option.getMtCompanyId().equals(ApiConstants.Platform.COMPANY_ID)) {
             return RestResponse.success(optionService.removeById(option.getId()));
         }
         return RestResponse.fail("默认维保项无法删除");