diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/ByglController.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/ByglController.java new file mode 100644 index 0000000..daca7c1 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/ByglController.java @@ -0,0 +1,39 @@ + +package com.lideeyunji.core.framework.controller; + +import com.lideeyunji.core.framework.service.IByglByfaService; +import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; +import com.lideeyunji.tool.framework.constants.FrameErrorCodeConstants; +import com.lideeyunji.tool.framework.yunji.model.global.BaseWebResult; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.AllArgsConstructor; +import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Map; + +@Tag(name = "保养管理-保养方案") +@RestController +@AllArgsConstructor +@RequestMapping(lideeYunJiBaseConstant.REQUEST_URL_START + "/bygl") +public class ByglController extends BaseController { + + private final IByglByfaService byglByfaService; + + @PostMapping("/changeFaState") + public BaseWebResult save(@RequestBody Map model) { + String state = lideeYunJiUtils.getMap2Str(model, "state"); + String id = lideeYunJiUtils.getMap2Str(model, "id"); + if(StringUtils.isBlank(id)){ + return BaseWebResult.error(FrameErrorCodeConstants.FRAME_OP_ERROR); + } + byglByfaService.changeFaState(id, state); + return BaseWebResult.success("成功"); + } + + +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/DbFormEnhanceController.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/DbFormEnhanceController.java index 2ac0f6f..680a6ec 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/DbFormEnhanceController.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/controller/DbFormEnhanceController.java @@ -80,6 +80,18 @@ public class DbFormEnhanceController extends BaseController { return BaseWebResult.success("成功"); } + //处理增强 + @PreAuthorize("@ss.hasPermission('lideeyunji:java')") + @PutMapping("/java/handle") + @ApiOperationSupport(order = 3) + @Operation(tags = "JAVA增强",summary = "处理操作") + public BaseWebResult javaHandle(@RequestBody EnhanceJavaEntity model) { + javaService.handleEnhanceJava(model); + return BaseWebResult.success("成功"); + } + + + @PreAuthorize("@ss.hasPermission('lideeyunji:java')") @DeleteMapping("/java/delete") @ApiOperationSupport(order = 4) diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglByfaPlugin.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglByfaPlugin.java new file mode 100644 index 0000000..58c3795 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglByfaPlugin.java @@ -0,0 +1,70 @@ + +package com.lideeyunji.core.framework.enhance.example.report.bygl; + +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.core.framework.mapper.ByglByjhMapper; +import com.lideeyunji.core.framework.utils.Func; +import com.lideeyunji.tool.framework.common.constant.ByglConstant; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * 保养管理-保养方案 + */ +@Slf4j +@Component("byglByfaPlugin") +public class ByglByfaPlugin implements AroundAdvicePlugin { + + private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + + private static final String SCHEME_ID_PREFIX = "FA"; + + @Autowired + private ByglByjhMapper byglByjhMapper; + + @Override + public void beforeExecute(EnhanceContext enhanceContext) { + Map params = enhanceContext.getParam().getParams(); + //新增方法默认状态字段(1启用) + params.put("state", ByglConstant.FA_STATE_QY); + // 获取并验证scheme_id + String scheme_id = lideeYunJiUtils.getMap2Str(params, "scheme_id"); + boolean needGenerateNewId = shouldGenerateNewSchemeId(scheme_id); + if(needGenerateNewId){ + String newSchemeId = generateSchemeId(); + params.put("scheme_id", newSchemeId); + log.info("生成新方案ID: {}", newSchemeId); + } + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + + } + + /** + * 判断是否需要生成新的方案ID + */ + private boolean shouldGenerateNewSchemeId(String scheme_id) { + if(StringUtils.isBlank(scheme_id)){ + return true; + } + Map existingScheme = byglByjhMapper.getSchemeBySchemeId(scheme_id); + return Func.isNotEmpty(existingScheme); + } + /** + * 生成方案ID + * 格式:FA + 时间戳(yyyyMMddHHmmss) + */ + private String generateSchemeId() { + return SCHEME_ID_PREFIX + LocalDateTime.now().format(DATE_TIME_FORMATTER); + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglBygdBjPlugin.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglBygdBjPlugin.java new file mode 100644 index 0000000..1f25552 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglBygdBjPlugin.java @@ -0,0 +1,176 @@ +package com.lideeyunji.core.framework.enhance.example.report.bygl; + +import cn.hutool.core.date.DateUtil; +import com.baomidou.mybatisplus.core.toolkit.IdWorker; +import com.lideeyunji.core.framework.adapter.FrameWorkAdapter; +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.core.framework.entity.ByManagementGd; +import com.lideeyunji.core.framework.entity.ByManagementJl; +import com.lideeyunji.core.framework.entity.ByManagementYs; +import com.lideeyunji.core.framework.mapper.ByManagementGdMapper; +import com.lideeyunji.core.framework.mapper.ByManagementJlMapper; +import com.lideeyunji.core.framework.mapper.ByManagementYsMapper; +import com.lideeyunji.core.framework.mapper.ByglByjhMapper; +import com.lideeyunji.tool.framework.common.constant.ByglConstant; +import com.lideeyunji.tool.framework.common.util.object.BeanUtils; +import com.lideeyunji.tool.framework.yunji.tool.spring.SpringUtils; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.util.Map; + +/** + * 保养管理-保养工单编辑 + */ +@Slf4j +@Component("byglBygdBjPlugin") +public class ByglBygdBjPlugin implements AroundAdvicePlugin { + + /** + * 操作类型常量 + */ + private static final String SUBMIT_TYPE_CL = "cl"; + private static final String SUBMIT_TYPE_YS = "ys"; + + /** + * 状态常量 + */ + private static final int NOT_DELETED = 0; + + @Autowired + private ByglByjhMapper byglByjhMapper; + + @Autowired + private ByManagementJlMapper byManagementJlMapper; + + @Autowired + private ByManagementYsMapper byManagementYsMapper; + + @Autowired + private ByManagementGdMapper byManagementGdMapper; + + @Override + public void beforeExecute(EnhanceContext enhanceContext) { + Map params = enhanceContext.getParam().getParams(); + String submit_type = lideeYunJiUtils.getMap2Str(params, "submit_type"); + log.info("开始处理工单操作,submit_type: {}", submit_type); + if(StringUtils.isBlank(submit_type)){ + log.info("submit_type为空,跳过处理"); + return; + } + String id = lideeYunJiUtils.getMap2Str(params, "id"); + validateParams(id, submit_type); + FrameWorkAdapter adapter = SpringUtils.getBean(FrameWorkAdapter.class); + + switch (submit_type) { + case SUBMIT_TYPE_CL://处理操作 + handleClOperation(id, params, adapter); + break; + case SUBMIT_TYPE_YS://验收操作 + handleYsOperation(id, params, adapter); + break; + } + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + + } + + + /** + * 验收操作 + */ + private void handleYsOperation(String id, Map params, FrameWorkAdapter adapter) { + String gdys_yj = lideeYunJiUtils.getMap2Str(params, "gdys_yj"); + String pjxj = lideeYunJiUtils.getMap2Str(params, "pjxj"); + + ByManagementJl jl = byManagementJlMapper.selectById(id); + + jl.setYsTime(DateUtil.now()); + jl.setPjxj(pjxj); + jl.setState(ByglConstant.YSZT_STATE_YYS); + jl.setGdysYj(gdys_yj); + jl.setUpdateTime(LocalDateTime.now()); + jl.setUpdateUser(adapter.getOnlineUserId()); + + byManagementJlMapper.updateById(jl); + + ByManagementYs ys = BeanUtils.toBean(jl, ByManagementYs.class); + if(ys == null){ + throw new RuntimeException("对象转换失败"); + } + byManagementYsMapper.updateById(ys); + + log.info("工单验收成功,ID: {}", id); + } + + + /** + * 处理操作 + */ + private void handleClOperation(String id, Map params, FrameWorkAdapter adapter) { + String bygd_cljg = lideeYunJiUtils.getMap2Str(params, "bygd_cljg"); + + int result = byglByjhMapper.updateClBygd(id, bygd_cljg, ByglConstant.BY_STATE_YWC); + + if (result <= 0) { + log.info("工单处理失败,ID: {}", id); + return; + } + ByManagementGd gd = byManagementGdMapper.selectById(id); + ByManagementJl jl = createByManagementJl(gd, adapter); + byManagementJlMapper.insert(jl); + syncToYsTable(jl); + + log.info("工单处理成功,ID: {}", id); + } + + /** + * 创建保养记录 + */ + private ByManagementJl createByManagementJl(ByManagementGd gd, FrameWorkAdapter adapter) { + ByManagementJl jl = new ByManagementJl(); + jl.setId(IdWorker.getId()); + jl.setOrderId(gd.getOrderId()); + jl.setOrderName(gd.getOrderName()); + jl.setEquipmentInfo(gd.getEquipmentInfo()); + jl.setUpkeepLevel(gd.getUpkeepLevel()); + jl.setUpkeepTime(gd.getUpkeepTime()); + jl.setPriority(gd.getPriority()); + jl.setState(ByglConstant.YSZT_STATE_DYS); + jl.setExecutor(gd.getExecutor()); + jl.setCreateTime(LocalDateTime.now()); + jl.setCreateUser(adapter.getOnlineUserId()); + jl.setIsDeleted(NOT_DELETED); + return jl; + } + + /** + * 同步到验收表 + */ + private void syncToYsTable(ByManagementJl jl) { + ByManagementYs ys = BeanUtils.toBean(jl, ByManagementYs.class); + if(ys == null){ + throw new RuntimeException("对象转换失败"); + } + byManagementYsMapper.insert(ys); + } + + /** + * 参数校验 + */ + private void validateParams(String id, String submit_type) { + if(StringUtils.isBlank(id)){ + throw new IllegalArgumentException("工单ID不能为空"); + } + if(!SUBMIT_TYPE_CL.equals(submit_type) && !SUBMIT_TYPE_YS.equals(submit_type)){ + throw new IllegalArgumentException("不支持的操作类型: " + submit_type); + } + } +} \ No newline at end of file diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglBygdPlugin.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglBygdPlugin.java new file mode 100644 index 0000000..4203533 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglBygdPlugin.java @@ -0,0 +1,68 @@ + +package com.lideeyunji.core.framework.enhance.example.report.bygl; + +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.core.framework.mapper.ByglByjhMapper; +import com.lideeyunji.core.framework.utils.Func; +import com.lideeyunji.tool.framework.common.constant.ByglConstant; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * 保养管理-保养工单 + */ +@Slf4j +@Component("byglBygdPlugin") +public class ByglBygdPlugin implements AroundAdvicePlugin { + + private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + + private static final String ORDER_ID_PREFIX = "GD"; + + @Autowired + private ByglByjhMapper byglByjhMapper; + + @Override + public void beforeExecute(EnhanceContext enhanceContext) { + Map params = enhanceContext.getParam().getParams(); + //新增方法默认状态字段 + params.put("order_state",ByglConstant.GD_STATE_DKS); + String order_id = lideeYunJiUtils.getMap2Str(params, "order_id"); + boolean needGenerateNewId = shouldGenerateNewOrderId(order_id); + if(needGenerateNewId){ + String newOrderId = generateOrderId(); + params.put("order_id",newOrderId); + log.info("生成新工单ID: {}", newOrderId); + } + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + + } + /** + * 判断是否需要生成新的工单ID + */ + private boolean shouldGenerateNewOrderId(String order_id) { + if(StringUtils.isBlank(order_id)){ + return true; + } + Map existingOrder = byglByjhMapper.getOrderByPlanId(order_id); + return Func.isNotEmpty(existingOrder); + } + /** + * 生成工单ID + * 格式:GD + 时间戳(yyyyMMddHHmmss) + */ + private String generateOrderId() { + return ORDER_ID_PREFIX + LocalDateTime.now().format(DATE_TIME_FORMATTER); + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglByjhLbPlugin.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglByjhLbPlugin.java new file mode 100644 index 0000000..16ea1ca --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglByjhLbPlugin.java @@ -0,0 +1,43 @@ +package com.lideeyunji.core.framework.enhance.example.report.bygl; + +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.core.framework.mapper.ByglByjhMapper; +import com.lideeyunji.core.framework.utils.Func; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; + +/** + * 保养管理-保养计划-列表 + */ +@Slf4j +@Component("byglByjlLbPlugin") +public class ByglByjhLbPlugin implements AroundAdvicePlugin { + + @Autowired + private ByglByjhMapper byglByjhMapper; + + @Override + public void beforeExecute(EnhanceContext enhanceContext) { + + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + List> records = enhanceContext.getResult().getRecords(); + if (Func.isEmpty(records)) { + return; + } + for (Map record : records) { + String plan_id = lideeYunJiUtils.getMap2Str(record, "plan_id"); + Map countByPlanId = byglByjhMapper.getCountByPlanId(plan_id); + record.put("plan_count",lideeYunJiUtils.getMap2Long(countByPlanId,"jhs")); + record.put("completed_count",lideeYunJiUtils.getMap2Long(countByPlanId,"wcs")); + } + } +} \ No newline at end of file diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglByjhPlugin.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglByjhPlugin.java new file mode 100644 index 0000000..759a7ee --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/enhance/example/report/bygl/ByglByjhPlugin.java @@ -0,0 +1,70 @@ + +package com.lideeyunji.core.framework.enhance.example.report.bygl; + +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.core.framework.mapper.ByglByjhMapper; +import com.lideeyunji.core.framework.utils.Func; +import com.lideeyunji.tool.framework.common.constant.ByglConstant; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * 保养管理-保养计划-新增 + */ +@Slf4j +@Component("byglByjhPlugin") +public class ByglByjhPlugin implements AroundAdvicePlugin { + + private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + + private static final String PLAN_ID_PREFIX = "BYJH"; + + @Autowired + private ByglByjhMapper byglByjhMapper; + + @Override + public void beforeExecute(EnhanceContext enhanceContext) { + Map params = enhanceContext.getParam().getParams(); + //新增方法默认状态字段 + params.put("plan_state", ByglConstant.JH_STATE_JXZ); + String plan_id = lideeYunJiUtils.getMap2Str(params, "plan_id"); + boolean needGenerateNewId = shouldGenerateNewPlanId(plan_id); + if(needGenerateNewId){ + String newPlanId = generatePlanId(); + params.put("plan_id",newPlanId); + log.info("生成新计划ID: {}", newPlanId); + } + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + + } + + /** + * 判断是否需要生成新的计划ID + */ + private boolean shouldGenerateNewPlanId(String plan_id) { + if(StringUtils.isBlank(plan_id)){ + return true; + } + Map existingPlan = byglByjhMapper.getPlanByPlanId(plan_id); + return Func.isNotEmpty(existingPlan); + } + /** + * 生成计划ID + * 格式:BYJH + 时间戳(yyyyMMddHHmmss) + */ + private String generatePlanId() { + return PLAN_ID_PREFIX + LocalDateTime.now().format(DATE_TIME_FORMATTER); + } + +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/ByManagementGd.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/ByManagementGd.java new file mode 100644 index 0000000..006d690 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/ByManagementGd.java @@ -0,0 +1,114 @@ + +package com.lideeyunji.core.framework.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 保养管理-保养工单 + */ +@TableName("by_management_gd") +@Data +@EqualsAndHashCode +public class ByManagementGd extends BaseTenantEntity { + /** + * ID + */ + private Long id; + + /** + * 工单编号 + */ + private String orderId; + + /** + * 工单名称 + */ + private String orderName; + + /** + * 设备类型 + */ + private String deviceTypeName; + + /** + *设备 + */ + private String equipmentInfo; + + /** + *设备编号 + */ + private String equipmentCode; + + /** + *保养级别 + */ + private String upkeepLevel; + + + /** + *优先级 + */ + private String priority; + + /** + *可能更换零件 + */ + private String possibleReplacements; + + /** + *计划保养时间 + */ + private String planUpkeepTime; + + /** + *是否申请备件 + */ + private String applyForParts; + + /** + *是否已停机 + */ + private String isStopped; + + + /** + *执行人 + */ + private String executor; + + /** + *状态 + */ + private String orderState; + + /** + * 备注 + */ + private String remark; + + /** + * 完成时间 + */ + private String upkeepTime; + + /** + * 保养方案 + */ + private String schemeId; + + /** + * 处理结果 + */ + private String bygdCljg; + + /** + * 计划id + */ + private String planId; + +} + diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/ByManagementJl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/ByManagementJl.java new file mode 100644 index 0000000..fe65454 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/ByManagementJl.java @@ -0,0 +1,77 @@ + +package com.lideeyunji.core.framework.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 保养管理-保养记录 + */ +@TableName("by_management_jl") +@Data +@EqualsAndHashCode +public class ByManagementJl extends BaseTenantEntity { + /** + * ID + */ + private Long id; + + /** + * 工单编号 + */ + private String orderId; + + /** + * 工单名称 + */ + private String orderName; + + /** + *设备 + */ + private String equipmentInfo; + + /** + *优先级 + */ + private String priority; + + /** + *保养级别 + */ + private String upkeepLevel; + + /** + *完成时间 + */ + private String upkeepTime; + + /** + *状态 + */ + private String state; + + /** + *执行人 + */ + private String executor; + + /** + *验收时间 + */ + private String ysTime; + + /** + *评价星级 + */ + private String pjxj; + + /** + *验收意见 + */ + private String gdysYj; + +} + diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/ByManagementYs.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/ByManagementYs.java new file mode 100644 index 0000000..781c88f --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/entity/ByManagementYs.java @@ -0,0 +1,68 @@ + +package com.lideeyunji.core.framework.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.lideeyunji.tool.framework.yunji.model.global.BaseTenantEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 保养管理-保养验收 + */ +@TableName("by_management_ys") +@Data +@EqualsAndHashCode +public class ByManagementYs extends BaseTenantEntity { + + /** + * ID + */ + private Long id; + + /** + * 工单编号 + */ + private String orderId; + + /** + * 工单名称 + */ + private String orderName; + + /** + *设备 + */ + private String equipmentInfo; + + /** + *优先级 + */ + private String priority; + + /** + *保养级别 + */ + private String upkeepLevel; + + /** + *完成时间 + */ + private String upkeepTime; + + /** + *状态 + */ + private String state; + + /** + *执行人 + */ + private String executor; + + /** + *验收时间 + */ + private String ysTime; + +} + diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByManagementGdMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByManagementGdMapper.java new file mode 100644 index 0000000..190c5a8 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByManagementGdMapper.java @@ -0,0 +1,13 @@ +package com.lideeyunji.core.framework.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lideeyunji.core.framework.entity.ByManagementGd; + +/** + * 保养管理-保养工单Mapper接口 + * + * @date 2026-03-20 + */ +public interface ByManagementGdMapper extends BaseMapper { + +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByManagementJlMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByManagementJlMapper.java new file mode 100644 index 0000000..36b7434 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByManagementJlMapper.java @@ -0,0 +1,13 @@ +package com.lideeyunji.core.framework.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lideeyunji.core.framework.entity.ByManagementJl; + +/** + * 保养管理-保养记录Mapper接口 + * + * @date 2026-03-20 + */ +public interface ByManagementJlMapper extends BaseMapper { + +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByManagementYsMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByManagementYsMapper.java new file mode 100644 index 0000000..2597af1 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByManagementYsMapper.java @@ -0,0 +1,13 @@ +package com.lideeyunji.core.framework.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.lideeyunji.core.framework.entity.ByManagementYs; + +/** + * 保养管理-保养验收Mapper接口 + * + * @date 2026-03-20 + */ +public interface ByManagementYsMapper extends BaseMapper { + +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByglByfaMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByglByfaMapper.java new file mode 100644 index 0000000..6f19a2e --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByglByfaMapper.java @@ -0,0 +1,13 @@ + +package com.lideeyunji.core.framework.mapper; + +import com.baomidou.dynamic.datasource.annotation.Master; + +/** + *保养管理-保养方案 + */ +@Master +public interface ByglByfaMapper { + + int changeFaState(String id, String state); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByglByjhMapper.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByglByjhMapper.java new file mode 100644 index 0000000..6661600 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/mapper/ByglByjhMapper.java @@ -0,0 +1,23 @@ + +package com.lideeyunji.core.framework.mapper; + +import com.baomidou.dynamic.datasource.annotation.Master; + +import java.util.Map; + +/** + * + */ +@Master +public interface ByglByjhMapper{ + + Map getCountByPlanId(String plan_id); + + Map getPlanByPlanId(String plan_id); + + Map getOrderByPlanId(String order_id); + + Map getSchemeBySchemeId(String scheme_id); + + int updateClBygd(String id, String bygd_cljg, String order_state); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IByglByfaService.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IByglByfaService.java new file mode 100644 index 0000000..d96685d --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IByglByfaService.java @@ -0,0 +1,10 @@ + +package com.lideeyunji.core.framework.service; + +/** + * 保养管理-保养方案 + */ +public interface IByglByfaService { + + int changeFaState(String id, String state); +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IEnhanceJavaService.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IEnhanceJavaService.java index 6f02b6c..b81f6ec 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IEnhanceJavaService.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/IEnhanceJavaService.java @@ -27,4 +27,6 @@ public interface IEnhanceJavaService extends IService { //批量删除 void removeByIds(List ids); + //处理操作 + void handleEnhanceJava(EnhanceJavaEntity model); } diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/ByglByfaServiceImpl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/ByglByfaServiceImpl.java new file mode 100644 index 0000000..e1b84e4 --- /dev/null +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/ByglByfaServiceImpl.java @@ -0,0 +1,24 @@ + +package com.lideeyunji.core.framework.service.impl; + + +import com.lideeyunji.core.framework.mapper.ByglByfaMapper; +import com.lideeyunji.core.framework.service.IByglByfaService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + *保养管理-保养方案 + */ +@Service +public class ByglByfaServiceImpl implements IByglByfaService { + + @Autowired + private ByglByfaMapper byglByfaMapper; + + @Override + public int changeFaState(String id, String state) { + int result = byglByfaMapper.changeFaState(id, state); + return result; + } +} diff --git a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/EnhanceJavaServiceImpl.java b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/EnhanceJavaServiceImpl.java index 541e2a6..618206c 100644 --- a/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/EnhanceJavaServiceImpl.java +++ b/lidee-core/src/main/java/com/lideeyunji/core/framework/service/impl/EnhanceJavaServiceImpl.java @@ -83,7 +83,12 @@ public class EnhanceJavaServiceImpl extends ServiceImpl + + + + + update by_management_fa set state = #{state} where id = #{id} + + diff --git a/lidee-core/src/main/resources/mapper/bygl/ByglByjhMapper.xml b/lidee-core/src/main/resources/mapper/bygl/ByglByjhMapper.xml new file mode 100644 index 0000000..0307378 --- /dev/null +++ b/lidee-core/src/main/resources/mapper/bygl/ByglByjhMapper.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + update by_management_gd set bygd_cljg = #{bygd_cljg}, order_state = #{order_state}, upkeep_time = DATE_FORMAT(NOW(), '%Y-%m-%d %H:%i:%s') where id = #{id} + + diff --git a/lidee-core/src/main/resources/mapper/framework/AdapterMapper.xml b/lidee-core/src/main/resources/mapper/framework/AdapterMapper.xml index 538fb31..6d4c819 100644 --- a/lidee-core/src/main/resources/mapper/framework/AdapterMapper.xml +++ b/lidee-core/src/main/resources/mapper/framework/AdapterMapper.xml @@ -77,7 +77,9 @@ FROM system_users s_user where s_user.is_deleted =0 - and s_user.tenant_id =#{tenantId} + + and s_user.tenant_id =#{tenantId} + and s_user.nickname like #{params.nickName} @@ -105,7 +107,9 @@ system_users s_user INNER JOIN (select user_id from system_user_role where is_deleted = 0 AND role_id = #{roleId} group by user_id) sur ON s_user.id = sur.user_id where s_user.is_deleted =0 - and s_user.tenant_id =#{tenantId} + + and s_user.tenant_id =#{tenantId} + and s_user.nickname like #{params.nickName} @@ -155,7 +159,9 @@ system_user_dept sud INNER JOIN system_dept sd on sud.dept_id =sd.id where sud.is_deleted=0 and sd.is_deleted=0 - and sd.tenant_id =#{tenantId} + + and sd.tenant_id =#{tenantId} + and sud.dept_id in diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/DevGzbxController.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/DevGzbxController.java new file mode 100644 index 0000000..42c93ea --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/DevGzbxController.java @@ -0,0 +1,40 @@ + +package com.lideeyunji.module.biz.controller; + +import com.lideeyunji.module.biz.entity.DevGzbxDO; +import com.lideeyunji.module.biz.service.DevGzbxService; +import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; +import com.lideeyunji.tool.framework.common.pojo.CommonResult; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.stereotype.Component; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static com.lideeyunji.tool.framework.common.pojo.CommonResult.success; + +/** + * @author DX + * @create 2026-03-3 11:59 + * @dedescription: + */ +@Tag(name = "设备故障维修") +@RestController +@Validated +@RequestMapping(lideeYunJiBaseConstant.REQUEST_URL_START +"/gzbx") +public class DevGzbxController { + + @Resource + private DevGzbxService devGzbxService; + + @PutMapping("/updateStatus") + @Operation(tags = "故障报修",summary = "故障报修状态修改") + public CommonResult updateConfig(@Valid @RequestBody DevGzbxDO devGzbxDO) { + devGzbxService.updateDevgGzbx(devGzbxDO); + return success(true); + } + +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentArchivesController.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentArchivesController.java new file mode 100644 index 0000000..29df214 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentArchivesController.java @@ -0,0 +1,50 @@ +package com.lideeyunji.module.biz.controller; + + +import com.lideeyunji.module.biz.entity.DevArchivesEntity; +import com.lideeyunji.module.biz.entity.DevGzbxDO; +import com.lideeyunji.module.biz.service.EquipmentArchivesService; +import com.lideeyunji.module.biz.vo.DevArchivesVo; +import com.lideeyunji.tool.framework.common.constant.lideeYunJiBaseConstant; +import com.lideeyunji.tool.framework.common.pojo.CommonResult; +import com.lideeyunji.tool.framework.sql.core.toolkit.CollectionUtils; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.mapstruct.ap.internal.util.Collections; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import java.util.Collection; +import java.util.List; + +import static com.lideeyunji.tool.framework.common.pojo.CommonResult.success; + +/** + * @author DX + * @create 2026-03-3 11:59 + * @dedescription: + */ +@Tag(name = "设备档案控制器") +@RestController +@Validated +@RequestMapping(lideeYunJiBaseConstant.REQUEST_URL_START +"/dev") +public class EquipmentArchivesController { + + @Resource + private EquipmentArchivesService equipmentArchivesService; + + + @GetMapping("/selectByType/{devType}") + @Operation(summary = "根据设备类型获取设备档案") + public CommonResult> getByDeviceType(@Valid @PathVariable("devType") String devType) { + List devArchives = equipmentArchivesService.selectByType(devType); + if (CollectionUtils.isEmpty(devArchives)) { + return CommonResult.error(400,"未找到对应设备类型的档案"); + } + return success(devArchives); + } + +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionCheck.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionCheck.java new file mode 100644 index 0000000..2deee63 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionCheck.java @@ -0,0 +1,48 @@ + +package com.lideeyunji.module.biz.controller; +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.module.biz.entity.*; +import com.lideeyunji.module.biz.mapper.*; +import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum; +import com.lideeyunji.tool.framework.yunji.enums.ProcessingStatusEnum; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.Map; + +/** + * 设备报修-环绕 + */ +@Component("EquipmentMalfunctionCheck") +public class EquipmentMalfunctionCheck implements AroundAdvicePlugin { + + @Resource + private DevGzbxWxgdMapper devGzbxWxgdMapper; + @Resource + private DevGzbxMapper devGzbxMapper; + + @Override + @Transactional + public void beforeExecute(EnhanceContext enhanceContext) { + + Map params = enhanceContext.getParam().getParams(); + Long id = lideeYunJiUtils.getMap2Long(params, "id"); + DevGzbxWxgdDO yorn = devGzbxWxgdMapper.selectOne("id",id); + yorn.setProcessingStatus(ProcessingStatusEnum.ACCEPTED.getType()); + yorn.setDevStatus(AcceptanceStatusEnum.COMPLETED.getType()); + yorn.setCompletionTime(new Date()); + yorn.setAcceptanceTime(new Date()); + DevGzbxDO devGzbxDO = devGzbxMapper.selectOne("id", yorn.getGzbxId()); + devGzbxDO.setProcessingStatus(AcceptanceStatusEnum.COMPLETED.getType()); + devGzbxWxgdMapper.updateById(yorn); + devGzbxMapper.updateById(devGzbxDO); + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + } +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionOrder.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionOrder.java new file mode 100644 index 0000000..85eb32b --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionOrder.java @@ -0,0 +1,77 @@ + +package com.lideeyunji.module.biz.controller; +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.module.biz.entity.DevGzbxDO; +import com.lideeyunji.module.biz.entity.DevGzbxWxfaDO; +import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO; +import com.lideeyunji.module.biz.mapper.DevGzbxMapper; +import com.lideeyunji.module.biz.mapper.DevGzbxWxfaMapper; +import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 设备报修方案-环绕 + */ +@Component("equipmentMalfunctionOrder") +public class EquipmentMalfunctionOrder implements AroundAdvicePlugin { + + @Resource + private DevGzbxWxfaMapper devGzbxWxfaMapper; + @Resource + private DevGzbxWxgdMapper devGzbxWxgdMapper; + @Resource + private DevGzbxMapper devGzbxMapper; + + @Override + @Transactional + public void beforeExecute(EnhanceContext enhanceContext) { + + Map params = enhanceContext.getParam().getParams(); + Long status = lideeYunJiUtils.getMap2Long(params, "dev_status"); + Long gzbx_id = lideeYunJiUtils.getMap2Long(params, "gzbx_id"); + Long id = lideeYunJiUtils.getMap2Long(params, "gzbx_id"); + DevGzbxWxfaDO yorn = devGzbxWxfaMapper.selectById(id); + if (status == 2) { + if (yorn == null) { + DevGzbxWxfaDO devGzbxWxfaDO = new DevGzbxWxfaDO(); + devGzbxWxfaDO.setDevStatus(2); + devGzbxWxfaDO.setGzbxId(gzbx_id); + devGzbxWxfaMapper.insertOrUpdate(devGzbxWxfaDO); + } else { + yorn.setDevStatus(2); + devGzbxWxfaMapper.insertOrUpdate(yorn); + DevGzbxWxgdDO devGzbxWxgdDO = devGzbxWxgdMapper.selectOne("gzbx_id", gzbx_id); + devGzbxWxgdDO.setDevStatus(2); + devGzbxWxgdMapper.updateBatch(devGzbxWxgdDO); + DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id); + devGzbxDO.setDevStatus(2); + devGzbxMapper.insertOrUpdate(devGzbxDO); + } + } else if (status == 0) { + if (!(yorn == null)) { + DevGzbxWxfaDO devGzbxWxfaDO = devGzbxWxfaMapper.selectOne("gzbx_id", gzbx_id); + devGzbxWxfaDO.setDevStatus(0); + devGzbxWxfaMapper.updateBatch(devGzbxWxfaDO); + DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id); + devGzbxDO.setDevStatus(0); + devGzbxMapper.insertOrUpdate(devGzbxDO); + } else { + DevGzbxDO devGzbxDO = devGzbxMapper.selectById(gzbx_id); + devGzbxDO.setDevStatus(0); + devGzbxMapper.insertOrUpdate(devGzbxDO); + } + } + + + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + } +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionRecord.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionRecord.java new file mode 100644 index 0000000..2d7a65b --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionRecord.java @@ -0,0 +1,67 @@ + +package com.lideeyunji.module.biz.controller; +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.module.biz.entity.DevGzbxWxfaDO; +import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO; +import com.lideeyunji.module.biz.mapper.DevGzbxWxfaMapper; +import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 维修方案-java增强 + */ +@Component("equipmentMalfunctionRecord") +public class EquipmentMalfunctionRecord implements AroundAdvicePlugin { + + @Resource + private DevGzbxWxfaMapper devGzbxWxfaMapper; + @Resource + private DevGzbxWxgdMapper devGzbxWxgdMapper; + + @Override + @Transactional + public void beforeExecute(EnhanceContext enhanceContext) { + + Map params = enhanceContext.getParam().getParams(); + + String submitType = lideeYunJiUtils.getMap2Str(params, "submitType"); + if (!"ys".equals(submitType)) { + return; + } + + Long id = lideeYunJiUtils.getMap2Long(params, "id"); + if (id == null) { + return; + } + + DevGzbxWxfaDO devGzbxWxfaDO = devGzbxWxfaMapper.selectOne("id", id); + if (devGzbxWxfaDO == null) { + return; + } + + devGzbxWxfaDO.setDevStatus(1); + devGzbxWxfaMapper.updateById(devGzbxWxfaDO); + + Long gzbxId = devGzbxWxfaDO.getGzbxId(); + if (gzbxId == null) { + return; + } + + DevGzbxWxgdDO devGzbxWxgdDO = devGzbxWxgdMapper.selectOne("id", gzbxId); + if (devGzbxWxgdDO != null) { + devGzbxWxgdDO.setDevStatus(2); + devGzbxWxgdMapper.updateById(devGzbxWxgdDO); + } + + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + } +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionRepair.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionRepair.java new file mode 100644 index 0000000..cad88e2 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/EquipmentMalfunctionRepair.java @@ -0,0 +1,90 @@ + +package com.lideeyunji.module.biz.controller; + +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.core.framework.mapper.AdapterMapper; +import com.lideeyunji.module.biz.entity.DevGzbxDO; +import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO; +import com.lideeyunji.module.biz.mapper.DevGzbxMapper; +import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper; +import com.lideeyunji.tool.framework.security.core.LoginUser; +import com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils; +import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum; +import com.lideeyunji.tool.framework.yunji.enums.ProcessingStatusEnum; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import jodd.util.StringUtil; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; +import java.util.Objects; + +/** + * 设备报修工单-环绕 + */ +@Component("equipmentMalfunctionRepair") +public class EquipmentMalfunctionRepair implements AroundAdvicePlugin { + + @Resource + private DevGzbxWxgdMapper devGzbxWxgdMapper; + + @Resource + private DevGzbxMapper devGzbxMapper; + + @Resource + private AdapterMapper adapterMapper; + + @Override + @Transactional + public void beforeExecute(EnhanceContext enhanceContext) { + + Map params = enhanceContext.getParam().getParams(); + + String submitType = lideeYunJiUtils.getMap2Str(params, "submitType"); + if (!"ys".equals(submitType)) { + return; + } + + Long id = lideeYunJiUtils.getMap2Long(params, "id"); + if (id == null) { + return; + } + + DevGzbxWxgdDO existingRecord = devGzbxWxgdMapper.selectOne("gzbx_id", id); + if (existingRecord != null) { + return; + } + + DevGzbxDO gzbxDO = devGzbxMapper.selectOne("id", id); + if (gzbxDO == null) { + return; + } + + DevGzbxWxgdDO newRecord = new DevGzbxWxgdDO(); + BeanUtils.copyProperties(gzbxDO, newRecord); + newRecord.setId(null); + newRecord.setGzbxId(id); + newRecord.setFaultType(gzbxDO.getType()); + newRecord.setFaultRemark(gzbxDO.getRemark()); + newRecord.setNumber(generateFaultNumber(params)); + newRecord.setCreateUserName(gzbxDO.getCreateUserName()); + devGzbxWxgdMapper.insert(newRecord); + gzbxDO.setProcessingStatus(AcceptanceStatusEnum.TREATED.getType()); + devGzbxMapper.updateById(gzbxDO); + + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + } + + private String generateFaultNumber(Map params) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + return "GD" + LocalDateTime.now().format(formatter); + } +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/AddFMaintenanceOrderFunctionRecord.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/AddFMaintenanceOrderFunctionRecord.java new file mode 100644 index 0000000..8b0664e --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/AddFMaintenanceOrderFunctionRecord.java @@ -0,0 +1,66 @@ +package com.lideeyunji.module.biz.controller.maintenance; + + +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.core.framework.mapper.AdapterMapper; +import com.lideeyunji.module.biz.entity.DevGzbxDO; +import com.lideeyunji.module.biz.mapper.DevGzbxMapper; +import com.lideeyunji.tool.framework.security.core.LoginUser; +import com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import jodd.util.StringUtil; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + +/** + * 故障报修-新增-java增强 + */ +@Component("AddFMaintenanceOrderFunctionRecord") +public class AddFMaintenanceOrderFunctionRecord implements AroundAdvicePlugin { + + @Resource + private DevGzbxMapper devGzbxMapper; + + + @Resource + private AdapterMapper adapterMapper; + + @Override + public void beforeExecute(EnhanceContext enhanceContext) { + + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + Map params = enhanceContext.getParam().getParams(); + String faultNumber = generateFaultNumber(params); + Long id = lideeYunJiUtils.getMap2Long(params, "id"); + + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + if (loginUser == null) { + return; + } + Long userId = loginUser.getId(); + + DevGzbxDO devGzbxDO = new DevGzbxDO(); + devGzbxDO.setId(id); + devGzbxDO.setFaultNumber(faultNumber); + devGzbxDO.setReporter(userId); + devGzbxDO.setCreateUserName(adapterMapper.getNickname(userId)); + devGzbxMapper.updateById(devGzbxDO); + } + + private String generateFaultNumber(Map params) { + String faultNumber = lideeYunJiUtils.getMap2Str(params, "fault_number"); + if (StringUtil.isBlank(faultNumber)) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + return "GZ" + LocalDateTime.now().format(formatter); + } + return faultNumber; + } +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/AddFaultReportingFunctionRecord.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/AddFaultReportingFunctionRecord.java new file mode 100644 index 0000000..bd70c78 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/AddFaultReportingFunctionRecord.java @@ -0,0 +1,71 @@ +package com.lideeyunji.module.biz.controller.maintenance; + + +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.core.framework.mapper.AdapterMapper; +import com.lideeyunji.module.biz.entity.DevGzbxDO; +import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO; +import com.lideeyunji.module.biz.mapper.DevGzbxMapper; +import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper; +import com.lideeyunji.tool.framework.security.core.LoginUser; +import com.lideeyunji.tool.framework.security.core.util.SecurityFrameworkUtils; +import com.lideeyunji.tool.framework.yunji.enums.ProcessingStatusEnum; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import jodd.util.StringUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; +import java.util.Objects; + +/** + * 故障报修-新增-java增强 + */ +@Component("AddFaultFeportingFunctionRecord") +public class AddFaultReportingFunctionRecord implements AroundAdvicePlugin { + + @Resource + private DevGzbxMapper devGzbxMapper; + + + @Resource + private AdapterMapper adapterMapper; + + @Override + public void beforeExecute(EnhanceContext enhanceContext) { + + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + Map params = enhanceContext.getParam().getParams(); + String faultNumber = generateFaultNumber(params); + Long id = lideeYunJiUtils.getMap2Long(params, "id"); + + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + if (loginUser == null) { + return; + } + Long userId = loginUser.getId(); + + DevGzbxDO devGzbxDO = new DevGzbxDO(); + devGzbxDO.setId(id); + devGzbxDO.setFaultNumber(faultNumber); + devGzbxDO.setReporter(userId); + devGzbxDO.setCreateUserName(adapterMapper.getNickname(userId)); + devGzbxMapper.updateById(devGzbxDO); + } + + private String generateFaultNumber(Map params) { + String faultNumber = lideeYunJiUtils.getMap2Str(params, "number"); + if (StringUtil.isBlank(faultNumber)) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + return "GZ" + LocalDateTime.now().format(formatter); + } + return faultNumber; + } +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/EquipmentArchivesFunctionRecord.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/EquipmentArchivesFunctionRecord.java new file mode 100644 index 0000000..91665fe --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/EquipmentArchivesFunctionRecord.java @@ -0,0 +1,43 @@ +package com.lideeyunji.module.biz.controller.maintenance; + +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.module.biz.mapper.EquipmentArchivesMapper; +import com.lideeyunji.tool.framework.sql.core.toolkit.StringUtils; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; +import java.util.Objects; + +/** + * 设备档案-java增强 + */ +@Component("EquipmentArchivesFunctionRecord") +public class EquipmentArchivesFunctionRecord implements AroundAdvicePlugin { + + @Resource + private EquipmentArchivesMapper equipmentArchivesMapper; + + @Override + public void beforeExecute(EnhanceContext enhanceContext) { + Map params = enhanceContext.getParam().getParams(); + String decCode = lideeYunJiUtils.getMap2Str(params, "dev_code"); + if (StringUtils.isBlank(decCode)) { + String newDevCode = generateFaultNumber(); + params.put("dev_code", newDevCode); + } + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + } + + private String generateFaultNumber() { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + return "SB" + LocalDateTime.now().format(formatter); + } +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/FaultRepairFunctionRecord.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/FaultRepairFunctionRecord.java new file mode 100644 index 0000000..e35beb3 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/controller/maintenance/FaultRepairFunctionRecord.java @@ -0,0 +1,80 @@ +package com.lideeyunji.module.biz.controller.maintenance; + +import com.lideeyunji.core.framework.config.aspect.enhance.model.EnhanceContext; +import com.lideeyunji.core.framework.config.aspect.enhance.plugin.AroundAdvicePlugin; +import com.lideeyunji.module.biz.entity.DevGzbxWxfaDO; +import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO; +import com.lideeyunji.module.biz.mapper.DevGzbxWxfaMapper; +import com.lideeyunji.module.biz.mapper.DevGzbxWxgdMapper; +import com.lideeyunji.tool.framework.yunji.enums.AcceptanceStatusEnum; +import com.lideeyunji.tool.framework.yunji.enums.ProcessingStatusEnum; +import com.lideeyunji.tool.framework.yunji.utils.lideeYunJiUtils; +import jodd.util.StringUtil; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Map; + +/** + * 设备报修工单-环绕 + */ +@Component("FaultRepairFunctionRecord") +public class FaultRepairFunctionRecord implements AroundAdvicePlugin { + @Resource + private DevGzbxWxfaMapper devGzbxWxfaMapper; + + @Resource + private DevGzbxWxgdMapper devGzbxWxgdMapper; + + // @Resource + @Override + public void beforeExecute(EnhanceContext enhanceContext) { + Map params = enhanceContext.getParam().getParams(); + + String submitType = lideeYunJiUtils.getMap2Str(params, "submitType"); + if (!"ys".equals(submitType)) { + return; + } + + Long id = lideeYunJiUtils.getMap2Long(params, "id"); + if (id == null) { + return; + } + + DevGzbxWxfaDO existingRecord = devGzbxWxfaMapper.selectOne("gzbx_id", id); + if (existingRecord != null) { + return; + } + DevGzbxWxgdDO wxgdDO = devGzbxWxgdMapper.selectOne("id", id); + if (wxgdDO == null) { + return; + } + + DevGzbxWxfaDO newRecord = new DevGzbxWxfaDO(); + BeanUtils.copyProperties(wxgdDO, newRecord); + newRecord.setId(null); + newRecord.setGzbxId(id); + newRecord.setDevStatus(0); + newRecord.setCreateTime(new Date()); + newRecord.setNumber(generateFaultNumber(params)); + devGzbxWxfaMapper.insert(newRecord); + wxgdDO.setDevStatus(AcceptanceStatusEnum.TREATED.getType()); + wxgdDO.setProcessingStatus(null); + devGzbxWxgdMapper.updateById(wxgdDO); + } + + @Override + public void afterExecute(EnhanceContext enhanceContext) { + + } + + + private String generateFaultNumber(Map params) { + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss"); + return "FA" + LocalDateTime.now().format(formatter); + } +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevArchivesEntity.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevArchivesEntity.java new file mode 100644 index 0000000..9b63af4 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevArchivesEntity.java @@ -0,0 +1,125 @@ +package com.lideeyunji.module.biz.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 设备档案-实体类 + * + * @author duanxiang + */ +@TableName(value = "sys_device", autoResultMap = true) +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DevArchivesEntity { + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + /** + * 设备编码 + */ + private String devCode; + + /** + * 设备名称 + */ + private String devName; + + /** + * 设备类型 + */ + private String devType; + + /** + * 设备型号 + */ + private String devXh; + + /** + * 设备部门 + */ + private String devDept; + + /** + * 设备所属单位 + */ + private String devZzdw; + + /** + * 设备出厂日期 + */ + private Date devCcrq; + + /** + * 设备启用日期 + */ + private Date devQyrq; + + /** + * 设备功率/管理 + */ + private String devGl; + + /** + * 设备安装位置 + */ + private String devAzwz; + + /** + * 设备固定资产编码 + */ + private String devGdzcbm; + + /** + * 设备图片 + */ + private String devTp; + + /** + * 租户ID + */ + private Long tenantId; + + /** + * 创建人 + */ + private Long createUser; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 创建部门 + */ + private Long createDept; + + /** + * 修改人 + */ + private Long updateUser; + + /** + * 修改时间 + */ + private Date updateTime; + + /** + * 逻辑删除标志(0-未删除,1-已删除) + */ + private Integer isDeleted; +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevGzbxDO.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevGzbxDO.java new file mode 100644 index 0000000..9745579 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevGzbxDO.java @@ -0,0 +1,156 @@ +package com.lideeyunji.module.biz.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.lideeyunji.tool.framework.tenant.core.db.TenantBaseDO; +import lombok.*; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 故障保修 DO + * + * @author duanxiang + */ +@TableName(value = "dev_gzbx", autoResultMap = true) +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DevGzbxDO { + + /** + * 主键ID + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 租户ID + */ + @TableField("tenant_id") + private Long tenantId; + + /** + * 故障编号 + */ + @TableField("fault_number") + private String faultNumber; + + /** + * 故障名称 + */ + @TableField("name") + private String name; + + /** + * 设备类型 + */ + @TableField("dev_type") + private Integer devType; + + /** + * 设备名称 + */ + @TableField("dev_name") + private String devName; + + /** + * 设备编号 + */ + @TableField("dev_no") + private String devNo; + + /** + * 故障类型(0-硬件故障 1-软件故障 2-网络故障 3-其他) + */ + @TableField("type") + private Integer type; + + /** + * 故障备注/描述 + */ + @TableField("remark") + private String remark; + + /** + * 故障级别(严重/高/中/低) + */ + @TableField("level") + private Integer level; + + /** + * 是否停机(0-否 1-是) + */ + @TableField("is_stop") + private Integer isStop; + + /** + * 上报人ID + */ + @TableField("reporter") + private Long reporter; + + /** + * 手机号码 + */ + @TableField("phone_number") + private String phoneNumber; + + /** + * 创建人 + */ + @TableField("create_user") + private Long createUser; + + /** + * 创建时间 + */ + @TableField("create_time") + private Date createTime; + + /** + * 创建部门ID + */ + @TableField("create_dept") + private Long createDept; + + /** + * 更新人 + */ + @TableField("update_user") + private Long updateUser; + + /** + * 更新时间 + */ + @TableField("update_time") + private Date updateTime; + + /** + * 删除标志(0-未删除 1-已删除) + */ + @TableField("is_deleted") + @TableLogic + private Integer isDeleted; + + /** + * 设备状态(0-正常 1-异常 2-维护中 3-已报废) + */ + @TableField("dev_status") + private Integer devStatus; + + /** + * 处理状态(0-待处理 1-处理中 2-已处理 3-已关闭) + */ + @TableField("processing_status") + private Integer processingStatus; + + /** + * 创建人姓名 + */ + @TableField("create_user_name") + private String createUserName; + +} + diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevGzbxWxfaDO.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevGzbxWxfaDO.java new file mode 100644 index 0000000..4070c2f --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevGzbxWxfaDO.java @@ -0,0 +1,121 @@ +package com.lideeyunji.module.biz.entity; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; +import java.util.Date; + +/** + * 维修方案 DO + * + * @author duanxiang + */ +@TableName(value = "dev_gzbx_wxfa", autoResultMap = true) +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DevGzbxWxfaDO { + /** + * 主键ID + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + /** + * 更新时间 + */ + @TableField(fill = FieldFill.UPDATE) + private Date updateTime; + + /** + * 更新人 + */ + @TableField(fill = FieldFill.UPDATE) + private Long updateUser; + + /** + * 创建部门 + */ + private Long createDept; + + /** + * 创建时间 + */ + @TableField(fill = FieldFill.INSERT) + private Date createTime; + + /** + * 创建人 + */ + @TableField(fill = FieldFill.INSERT) + private Long createUser; + + /** + * 租户ID + */ + private Long tenantId; + + /** + * 逻辑删除标志(0-正常,1-已删除) + */ + @TableLogic + @TableField(select = false) + private Integer isDeleted; + + /** + * 设备类型(0-电脑,1-打印机,2-网络设备,3-其他) + */ + private Integer devType; + + /** + * 设备名称 + */ + private String devName; + + /** + * 设备编号 + */ + private String devNo; + + /** + * 故障类型(0-硬件故障,1-软件故障,2-网络故障,3-其他) + */ + private Integer faultType; + + /** + * 故障描述 + */ + private String faultRemark; + + /** + * 设备状态(0-正常,1-故障,2-维修中,3-已报废) + */ + private Integer devStatus; + + /** + * 工单报修ID + */ + private Long gzbxId; + + /** + * 处理状态(0-待处理,1-处理中,2-已完成,3-已关闭) + */ + private Integer processingStatus; + + /** + * 姓名/联系人 + */ + private String name; + + /** + * 号码/联系电话 + */ + private String number; + +} + diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevGzbxWxgdDO.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevGzbxWxgdDO.java new file mode 100644 index 0000000..51c7d35 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/entity/DevGzbxWxgdDO.java @@ -0,0 +1,199 @@ +package com.lideeyunji.module.biz.entity; + +import com.baomidou.mybatisplus.annotation.*; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.time.LocalDateTime; +import java.util.Date; + +import static com.lideeyunji.tool.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; +import static com.lideeyunji.tool.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT; + +/** + * 维修故障 DO + * + * @author duanxiang + */ +@TableName(value = "dev_gzbx_wxgd", autoResultMap = true) +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class DevGzbxWxgdDO { + /** + * 主键ID + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 故障报修ID + */ + @TableField("gzbx_id") + private Long gzbxId; + + /** + * 删除标志(0-未删除 1-已删除) + */ + @TableField("is_deleted") + @TableLogic + private Integer isDeleted; + + /** + * 更新时间 + */ + @TableField("update_time") + private LocalDateTime updateTime; + + /** + * 更新人 + */ + @TableField("update_user") + private Long updateUser; + + /** + * 创建部门ID + */ + @TableField("create_dept") + private Long createDept; + + /** + * 创建时间 + */ + @TableField("create_time") + private Date createTime; + + /** + * 创建人 + */ + @TableField("create_user") + private Long createUser; + + /** + * 租户ID + */ + @TableField("tenant_id") + private Long tenantId; + + /** + * 处理状态(0-待处理 1-处理中 2-已处理 3-已关闭) + */ + @TableField("processing_status") + private Integer processingStatus; + + /** + * 故障名称 + */ + @TableField("name") + private String name; + + /** + * 故障类型 + */ + @TableField("fault_type") + private Integer faultType; + + /** + * 设备编号 + */ + @TableField("dev_no") + private String devNo; + + /** + * 设备名称 + */ + @TableField("dev_name") + private String devName; + + /** + * 优先级( + */ + @TableField("priority") + private String priority; + + /** + * 工单类型 + */ + @TableField("type") + private String type; + + /** + * 工单编号 + */ + @TableField("number") + private String number; + + /** + * 故障备注/描述 + */ + @TableField("fault_remark") + private String faultRemark; + + /** + * 设备类型( + */ + @TableField("dev_type") + private Integer devType; + + /** + * 维修人员ID + */ + @TableField("maintenance_person") + private Long maintenancePerson; + + /** + * 是否停机(0-否 1-是) + */ + @TableField("is_top") + private Integer isTop; + + /** + * 是否备案(0-否 1-是) + */ + @TableField("is_filing") + private Integer isFiling; + + /** + * 上报人ID + */ + @TableField("reporter") + private Long reporter; + + /** + * 手机号码 + */ + @TableField("phone_number") + private String phoneNumber; + + /** + * 设备状态 + */ + @TableField("dev_status") + private Integer devStatus; + /** + * 严重级别 + */ + private Integer level; + /** + * 完成时间 + */ + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) + private Date completionTime; + + /** + * 完成时间 + */ + @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT) + private Date acceptanceTime; + + /** + * 创建人姓名 + */ + @TableField("create_user_name") + private String createUserName; +} + diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/DevGzbxMapper.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/DevGzbxMapper.java new file mode 100644 index 0000000..c78d860 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/DevGzbxMapper.java @@ -0,0 +1,15 @@ + +package com.lideeyunji.module.biz.mapper; + + +import com.lideeyunji.module.biz.entity.DevGzbxDO; +import com.lideeyunji.tool.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * demo相关 + */ +@Mapper +public interface DevGzbxMapper extends BaseMapperX { + +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/DevGzbxWxfaMapper.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/DevGzbxWxfaMapper.java new file mode 100644 index 0000000..c3f4262 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/DevGzbxWxfaMapper.java @@ -0,0 +1,15 @@ + +package com.lideeyunji.module.biz.mapper; + + +import com.lideeyunji.module.biz.entity.DevGzbxWxfaDO; +import com.lideeyunji.tool.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * demo相关 + */ +@Mapper +public interface DevGzbxWxfaMapper extends BaseMapperX { + +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/DevGzbxWxgdMapper.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/DevGzbxWxgdMapper.java new file mode 100644 index 0000000..fc5c581 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/DevGzbxWxgdMapper.java @@ -0,0 +1,15 @@ + +package com.lideeyunji.module.biz.mapper; + + +import com.lideeyunji.module.biz.entity.DevGzbxWxgdDO; +import com.lideeyunji.tool.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; + +/** + * demo相关 + */ +@Mapper +public interface DevGzbxWxgdMapper extends BaseMapperX { + +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/EquipmentArchivesMapper.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/EquipmentArchivesMapper.java new file mode 100644 index 0000000..9bd970e --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/mapper/EquipmentArchivesMapper.java @@ -0,0 +1,17 @@ + +package com.lideeyunji.module.biz.mapper; + + +import com.lideeyunji.module.biz.entity.DevArchivesEntity; +import com.lideeyunji.tool.framework.mybatis.core.mapper.BaseMapperX; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 设备档案 + */ +@Mapper +public interface EquipmentArchivesMapper extends BaseMapperX { + + DevArchivesEntity selectByType(@Param("devType")String devType); +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/DevGzbxService.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/DevGzbxService.java new file mode 100644 index 0000000..facfcf0 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/DevGzbxService.java @@ -0,0 +1,23 @@ +package com.lideeyunji.module.biz.service; +import com.lideeyunji.module.biz.entity.DevGzbxDO; + +import javax.validation.Valid; + +/** + * 故障报修 Service 接口 + * + * @author dx + */ +public interface DevGzbxService { + + /** + * 创建故障报修 + * + * @param devGzbxDO 修改报修状态 + * @return 配置编号 + */ + void updateDevgGzbx(@Valid DevGzbxDO devGzbxDO); + + + +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/EquipmentArchivesService.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/EquipmentArchivesService.java new file mode 100644 index 0000000..26962b0 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/EquipmentArchivesService.java @@ -0,0 +1,11 @@ +package com.lideeyunji.module.biz.service; + +import com.lideeyunji.module.biz.entity.DevArchivesEntity; + +import javax.validation.Valid; +import java.util.List; + +public interface EquipmentArchivesService +{ + List selectByType(@Valid String devType); +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/impl/DevGzbxServiceImpl.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/impl/DevGzbxServiceImpl.java new file mode 100644 index 0000000..4357abc --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/impl/DevGzbxServiceImpl.java @@ -0,0 +1,30 @@ +package com.lideeyunji.module.biz.service.impl; + +import com.google.common.annotations.VisibleForTesting; +import com.lideeyunji.module.biz.entity.DevGzbxDO; +import com.lideeyunji.module.biz.mapper.DevGzbxMapper; +import com.lideeyunji.module.biz.service.DevGzbxService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +/** + * 参数配置 Service 实现类 + */ +@Service +@Slf4j +@Validated +public class DevGzbxServiceImpl implements DevGzbxService { + + @Resource + private DevGzbxMapper devGzbxMapper; + + @Override + public void updateDevgGzbx(DevGzbxDO devGzbxDO) { + devGzbxDO.setDevStatus(1); + devGzbxMapper.updateById(devGzbxDO); + } + + +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/impl/EquipmentArchivesServiceImpl.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/impl/EquipmentArchivesServiceImpl.java new file mode 100644 index 0000000..132d93f --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/service/impl/EquipmentArchivesServiceImpl.java @@ -0,0 +1,28 @@ +package com.lideeyunji.module.biz.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.lideeyunji.module.biz.entity.DevArchivesEntity; +import com.lideeyunji.module.biz.mapper.EquipmentArchivesMapper; +import com.lideeyunji.module.biz.service.EquipmentArchivesService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; +import java.util.List; + +@Service +@Slf4j +@Validated +public class EquipmentArchivesServiceImpl implements EquipmentArchivesService { + + @Resource + private EquipmentArchivesMapper equipmentArchivesMapper; + + @Override + public List selectByType(String devType) { + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(DevArchivesEntity::getDevType, devType).eq(DevArchivesEntity::getIsDeleted, 0); + return equipmentArchivesMapper.selectList(queryWrapper); + } +} diff --git a/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/vo/DevArchivesVo.java b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/vo/DevArchivesVo.java new file mode 100644 index 0000000..733a7c4 --- /dev/null +++ b/lidee-module/lidee-module-biz/src/main/java/com/lideeyunji/module/biz/vo/DevArchivesVo.java @@ -0,0 +1,112 @@ +package com.lideeyunji.module.biz.vo; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; + +import java.util.Date; + +@Data +public class DevArchivesVo { + + /** + * 主键 + */ + @TableId(type = IdType.ASSIGN_ID) + private Long id; + + /** + * 设备编码 + */ + private String devCode; + + /** + * 设备名称 + */ + private String devName; + + /** + * 设备类型 + */ + private String devType; + + /** + * 设备型号 + */ + private String devXh; + + /** + * 设备部门 + */ + private String devDept; + + /** + * 设备所属单位 + */ + private String devZzdw; + + /** + * 设备出厂日期 + */ + private Date devCcrq; + + /** + * 设备启用日期 + */ + private Date devQyrq; + + /** + * 设备功率/管理 + */ + private String devGl; + + /** + * 设备安装位置 + */ + private String devAzwz; + + /** + * 设备固定资产编码 + */ + private String devGdzcbm; + + /** + * 设备图片 + */ + private String devTp; + + /** + * 租户ID + */ + private Long tenantId; + + /** + * 创建人 + */ + private Long createUser; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 创建部门 + */ + private Long createDept; + + /** + * 修改人 + */ + private Long updateUser; + + /** + * 修改时间 + */ + private Date updateTime; + + /** + * 逻辑删除标志(0-未删除,1-已删除) + */ + private Integer isDeleted; +} diff --git a/lidee-tool/tool-common/src/main/java/com/lideeyunji/tool/framework/common/constant/ByglConstant.java b/lidee-tool/tool-common/src/main/java/com/lideeyunji/tool/framework/common/constant/ByglConstant.java new file mode 100644 index 0000000..c7d2cf1 --- /dev/null +++ b/lidee-tool/tool-common/src/main/java/com/lideeyunji/tool/framework/common/constant/ByglConstant.java @@ -0,0 +1,30 @@ + +package com.lideeyunji.tool.framework.common.constant; + +/** + * 保养管理 + */ +public interface ByglConstant { + + /**进行中*/ + String JH_STATE_JXZ = "0"; + /**已完成*/ + String JH_STATE_YWC = "1"; + + /**待开始*/ + String GD_STATE_DKS = "0"; + /**已完成*/ + String BY_STATE_YWC = "1"; + + /**方案停用*/ + String FA_STATE_TY = "0"; + /**方案启用*/ + String FA_STATE_QY = "1"; + + /**待验收*/ + String YSZT_STATE_DYS = "0"; + /**已验收*/ + String YSZT_STATE_YYS = "1"; + + +} diff --git a/lidee-tool/tool-spring-boot-starter-yunji/src/main/java/com/lideeyunji/tool/framework/yunji/enums/AcceptanceStatusEnum.java b/lidee-tool/tool-spring-boot-starter-yunji/src/main/java/com/lideeyunji/tool/framework/yunji/enums/AcceptanceStatusEnum.java new file mode 100644 index 0000000..0f6f27f --- /dev/null +++ b/lidee-tool/tool-spring-boot-starter-yunji/src/main/java/com/lideeyunji/tool/framework/yunji/enums/AcceptanceStatusEnum.java @@ -0,0 +1,31 @@ +package com.lideeyunji.tool.framework.yunji.enums; + + +/** + * 处理状态枚举 + */ +public enum AcceptanceStatusEnum { + + + UNTREATED(0, "未处理"), + TREATED(1, "已处理"), + PENDING(2, "待验收"), + COMPLETED(3, "已完成"), + ; + + private final Integer type; + private final String name; + + public Integer getType() { + return type; + } + + public String getName() { + return name; + } + + AcceptanceStatusEnum(Integer type, String name) { + this.type = type; + this.name = name; + } +} diff --git a/lidee-tool/tool-spring-boot-starter-yunji/src/main/java/com/lideeyunji/tool/framework/yunji/enums/ProcessingStatusEnum.java b/lidee-tool/tool-spring-boot-starter-yunji/src/main/java/com/lideeyunji/tool/framework/yunji/enums/ProcessingStatusEnum.java new file mode 100644 index 0000000..0d6d7ce --- /dev/null +++ b/lidee-tool/tool-spring-boot-starter-yunji/src/main/java/com/lideeyunji/tool/framework/yunji/enums/ProcessingStatusEnum.java @@ -0,0 +1,26 @@ +package com.lideeyunji.tool.framework.yunji.enums; + + +/** + * 验收状态枚举 + */ +public enum ProcessingStatusEnum { + UNACCEPTED(0, "未验收"), + ACCEPTED(1, "已验收"); + + private final Integer type; + private final String name; + + public Integer getType() { + return type; + } + + public String getName() { + return name; + } + + ProcessingStatusEnum(Integer type, String name) { + this.type = type; + this.name = name; + } +} diff --git a/sql/gzgl.sql b/sql/gzgl.sql new file mode 100644 index 0000000..bc7222d --- /dev/null +++ b/sql/gzgl.sql @@ -0,0 +1,193 @@ + +/* 给故障报修新增一个java增强 */ +INSERT INTO `yunji_dbform_enhance_java` (`tenant_id`, `create_user`, `create_time`, `create_dept`, `update_user`, `update_time`, `is_deleted`, `dbform_id`, `button_code`, `java_type`, `java_class_url`, `online_script`, `active_status`, `remark`, `list_result_handle_type`, `sort`) VALUES (NULL, 1, '2026-03-17 16:50:18', 100, NULL, NULL, 0, 2021105111153053697, 'handle', 'spring', 'faultRepairController', '', 'Y', '', '0', 1); + + +/* 给故障报修新增一个自定义按钮 */ +INSERT INTO `yunji_dbform_button` (`tenant_id`, `create_user`, `create_time`, `create_dept`, `update_user`, `update_time`, `is_deleted`, `dbform_id`, `button_name`, `button_code`, `button_icon`, `button_location`, `button_type`, `button_sort`, `button_exp`, `button_show`, `button_auth`, `button_i18n`) VALUES (NULL, 1, '2026-03-17 16:18:29', 100, 1, '2026-03-17 16:19:46', 0, 2021105111153053697, '处理', 'chuli', '', 'menu', '', 1, '', 'Y', 'Y', ''); + + +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('维修管理-严重级别', 'wxgl_yzjb', 0, '', 1, '2026-03-18 10:11:47', 1, '2026-03-18 10:11:47', 0, '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('维修管理-故障类型', 'wxgl_gzlx', 0, '', 1, '2026-03-18 10:05:47', 1, '2026-03-18 10:05:47', 0, '1970-01-01 00:00:00'); + + +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '已完成', '3', 'fault_repair_status', 0, '', '', '', 1, '2026-03-20 08:10:31', NULL, '2026-03-21 14:41:48', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (17, '其他', '17', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (16, '储运部', '16', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (15, '技术中心', '15', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (14, '化验室', '14', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (13, '动力车间', '13', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (12, '原料车间3号生产线', '12', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (11, '原料车间2号生产线', '11', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (10, '原料车间1号生产线', '10', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (9, '口服固体制剂2号生产线', '9', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (8, '口服固体制剂1号生产线', '8', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (7, '小容量注射剂2号生产线', '7', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (6, '小容量注射剂1号生产线', '6', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (5, '一般粉针生产线', '5', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (4, '头孢粉针生产线', '4', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (3, '冻干粉针3号生产线', '3', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (2, '冻干粉针2号生产线', '2', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (1, '冻干粉针1号生产线', '1', 'device_type', 0, '', '', '', 1, '2026-03-20 15:27:50', 1, '2026-03-20 15:27:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '已受理', '2', 'fault_repair_status', 0, '', '', '', 1, '2026-03-20 08:10:31', NULL, '2026-03-21 14:41:48', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '已受理', '1', 'fault_repair_status', 0, '', '', '', 1, '2026-03-20 08:10:20', 1, '2026-03-20 08:10:20', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '待处理', '0', 'fault_repair_status', 0, '', '', '', 1, '2026-03-20 08:09:58', 1, '2026-03-20 08:09:58', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '已验收', '1', 'maintenance_status', 0, '', '', '', 1, '2026-03-19 15:28:10', 1, '2026-03-19 15:28:10', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '待验收', '0', 'maintenance_status', 0, '', '', '', 1, '2026-03-19 15:28:05', 1, '2026-03-19 15:28:05', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '高', '3', 'fault_priority_type', 0, 'danger', '', '', 1, '2026-03-19 11:11:08', 1, '2026-03-19 11:11:08', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '中', '2', 'fault_priority_type', 0, 'warning', '', '', 1, '2026-03-19 11:10:56', NULL, '2026-03-19 11:11:21', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '低', '1', 'fault_priority_type', 0, 'info', '', '', 1, '2026-03-19 11:10:49', NULL, '2026-03-19 11:11:16', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '委外', '2', 'faul_order_type', 0, '', '', '', 1, '2026-03-19 11:10:10', 1, '2026-03-19 11:10:10', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '自修', '1', 'faul_order_type', 0, '', '', '', 1, '2026-03-19 11:10:06', 1, '2026-03-19 11:10:06', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '未处理', '0', 'fault_handling_status', 0, 'info', '', '', 1, '2026-03-19 11:08:18', 1, '2026-03-19 11:08:18', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '已处理', '1', 'fault_handling_status', 0, 'success', '', '', 1, '2026-03-19 11:08:00', NULL, '2026-03-19 11:08:23', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '未停机', '0', 'is_shut_down', 0, '', '', '', 1, '2026-03-18 14:48:46', 1, '2026-03-18 14:48:46', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '已停机', '1', 'is_shut_down', 0, '', '', '', 1, '2026-03-18 14:48:36', 1, '2026-03-18 14:48:36', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '否', '0', 'infra_boolean_integer', 0, '', '', '', 1, '2026-03-18 14:30:19', 1, '2026-03-18 14:30:19', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '是', '1', 'infra_boolean_integer', 0, '', '', '', 1, '2026-03-18 14:30:14', 1, '2026-03-18 14:30:14', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '严重', '3', 'wxgl_yzjb', 0, 'danger', '', '', 1, '2026-03-18 10:12:33', 1, '2026-03-18 10:12:33', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '重要', '2', 'wxgl_yzjb', 0, '', '', '', 1, '2026-03-18 10:12:19', 1, '2026-03-18 10:12:19', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '一般', '1', 'wxgl_yzjb', 0, '', '', '', 1, '2026-03-18 10:12:13', 1, '2026-03-18 10:12:13', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '其他', '4', 'wxgl_gzlx', 0, '', '', '', 1, '2026-03-18 10:06:50', 1, '2026-03-18 10:06:50', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '机械故障', '3', 'wxgl_gzlx', 0, '', '', '', 1, '2026-03-18 10:06:43', 1, '2026-03-18 10:06:43', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '电气故障', '2', 'wxgl_gzlx', 0, '', '', '', 1, '2026-03-18 10:06:32', 1, '2026-03-18 10:06:32', 0); +INSERT INTO `system_dict_data` (`sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`) VALUES (0, '系统故障', '1', 'wxgl_gzlx', 0, '', '', '', 1, '2026-03-18 10:06:19', 1, '2026-03-18 10:06:19', 0); + + + +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('维修管理-设备类型', 'device_type', 0, '', 1, '2026-03-20 15:27:21', 1, '2026-03-20 15:27:21', 0, '2026-03-20 00:00:00'); +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('故障报修状态', 'fault_repair_status', 0, '', 1, '2026-03-20 08:09:36', 1, '2026-03-20 08:09:36', 0, '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('维修工单-验收状态', 'maintenance_status', 0, '', 1, '2026-03-19 15:27:32', NULL, '2026-03-19 15:28:24', 0, '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('故障优先级', 'fault_priority_type', 0, '', 1, '2026-03-19 11:10:41', 1, '2026-03-19 11:10:41', 0, '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('故障工单类型', 'faul_order_type', 0, '', 1, '2026-03-19 11:09:45', 1, '2026-03-19 11:09:45', 0, '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('故障处理状态', 'fault_handling_status', 0, '', 1, '2026-03-19 11:07:48', 1, '2026-03-19 11:07:48', 0, '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('是否已停机', 'is_shut_down', 0, '', 1, '2026-03-18 14:48:16', 1, '2026-03-18 14:48:16', 0, '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('Integer是否类型', 'infra_boolean_integer', 0, '', 1, '2026-03-18 14:30:06', 1, '2026-03-18 14:30:06', 0, '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('维修管理-严重级别', 'wxgl_yzjb', 0, '', 1, '2026-03-18 10:11:47', 1, '2026-03-18 10:11:47', 0, '1970-01-01 00:00:00'); +INSERT INTO `system_dict_type` (`name`, `type`, `status`, `remark`, `create_user`, `create_time`, `update_user`, `update_time`, `is_deleted`, `deleted_time`) VALUES ('维修管理-故障类型', 'wxgl_gzlx', 0, '', 1, '2026-03-18 10:05:47', 1, '2026-03-18 10:05:47', 0, '1970-01-01 00:00:00'); + +DROP TABLE IF EXISTS `dev_gzbx`; +CREATE TABLE `dev_gzbx` ( + `id` bigint NOT NULL COMMENT '主键', + `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户id', + `fault_number` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '故障编号', + `name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '故障名称', + `dev_type` int NULL DEFAULT NULL COMMENT '设备类型', + `dev_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备名称', + `dev_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '设备编号', + `type` tinyint NULL DEFAULT NULL COMMENT '故障类型', + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '故障描述', + `level` tinyint NULL DEFAULT NULL COMMENT '严重级别', + `is_stop` tinyint NULL DEFAULT NULL COMMENT '是否已停机', + `reporter` bigint NULL DEFAULT NULL COMMENT '上报人', + `phone_number` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号码', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门id', + `update_user` bigint NULL DEFAULT NULL COMMENT '更新人', + `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `is_deleted` tinyint NULL DEFAULT 0 COMMENT '是否删除', + `dev_status` tinyint NULL DEFAULT 0 COMMENT '维修状态', + `processing_status` tinyint NULL DEFAULT 0 COMMENT '处理状态', + `create_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人姓名', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '设备故障报修' ROW_FORMAT = DYNAMIC; + +SET FOREIGN_KEY_CHECKS = 1; + + + + +DROP TABLE IF EXISTS `dev_gzbx_plan_step`; +CREATE TABLE `dev_gzbx_plan_step` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'id', + `plan_id` bigint NULL DEFAULT NULL COMMENT '方案id', + `step` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '步骤', + `update_time` datetime NULL DEFAULT NULL COMMENT '更新时间', + `update_user` bigint NULL DEFAULT NULL COMMENT '更新人', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门id', + `create_time` datetime NULL DEFAULT NULL COMMENT '创建时间', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户编号', + `is_deleted` int NULL DEFAULT 0 COMMENT '是否删除', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2035958249577574403 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bg_0900_ai_ci COMMENT = '故障报修-方案步骤' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of dev_gzbx_plan_step +-- ---------------------------- +INSERT INTO `dev_gzbx_plan_step` VALUES (1, 1, '1', NULL, NULL, NULL, NULL, NULL, NULL, 0); +INSERT INTO `dev_gzbx_plan_step` VALUES (2034177378348560386, 2029201620194643970, 'cs ', NULL, NULL, 100, '2026-03-18 15:57:35', 1, NULL, 0); +INSERT INTO `dev_gzbx_plan_step` VALUES (2034899364632592385, 2034899275189059585, '1', NULL, NULL, 100, '2026-03-20 15:46:30', 1, NULL, 0); +INSERT INTO `dev_gzbx_plan_step` VALUES (2034899364817141761, 2034899275189059585, '2', NULL, NULL, 100, '2026-03-20 15:46:30', 1, NULL, 0); +INSERT INTO `dev_gzbx_plan_step` VALUES (2035958248935845889, 2035958173450956801, '测试', NULL, NULL, 100, '2026-03-23 13:54:08', 1, NULL, 0); +INSERT INTO `dev_gzbx_plan_step` VALUES (2035958249258807297, 2035958173450956801, '333', NULL, NULL, 100, '2026-03-23 13:54:08', 1, NULL, 0); +INSERT INTO `dev_gzbx_plan_step` VALUES (2035958249577574402, 2035958173450956801, '444', NULL, NULL, 100, '2026-03-23 13:54:08', 1, NULL, 0); + +SET FOREIGN_KEY_CHECKS = 1; + + + +DROP TABLE IF EXISTS `dev_gzbx_wxfa`; +CREATE TABLE `dev_gzbx_wxfa` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `update_user` bigint NULL DEFAULT NULL COMMENT '更新人', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门id', + `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户编号', + `is_deleted` int NULL DEFAULT 0 COMMENT '是否删除', + `dev_type` int NULL DEFAULT NULL COMMENT '设备类型', + `dev_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '设备名称', + `dev_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '设备编号', + `fault_type` tinyint NULL DEFAULT NULL COMMENT '故障类型', + `fault_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '故障描述', + `dev_status` tinyint NULL DEFAULT NULL COMMENT '维修状态', + `gzbx_id` bigint NULL DEFAULT NULL COMMENT '关联id', + `processing_status` tinyint NULL DEFAULT 0 COMMENT '处理状态', + `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '方案名称', + `number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '方案编号', + PRIMARY KEY (`id`) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2035958173450956802 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bg_0900_ai_ci COMMENT = '维修方案' ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1; + + + +DROP TABLE IF EXISTS `dev_gzbx_wxgd`; +CREATE TABLE `dev_gzbx_wxgd` ( + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', + `gzbx_id` bigint NOT NULL COMMENT '故障报修id', + `is_deleted` tinyint NULL DEFAULT 0 COMMENT '是否删除', + `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + `update_user` bigint NULL DEFAULT NULL COMMENT '更新人', + `create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门id', + `create_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + `create_user` bigint NULL DEFAULT NULL COMMENT '创建人', + `tenant_id` bigint NULL DEFAULT NULL COMMENT '租户编号', + `processing_status` tinyint NULL DEFAULT NULL COMMENT '验收状态(1,已验收。0:待验收)', + `name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '工单名称', + `fault_type` tinyint NULL DEFAULT NULL COMMENT '故障类型', + `dev_no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '设备编号', + `dev_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '设备名称', + `priority` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT '1' COMMENT '优先级', + `type` tinyint NULL DEFAULT 1 COMMENT '类型', + `number` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '工单编号', + `fault_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '故障描述', + `dev_type` int NULL DEFAULT NULL COMMENT '设备类型', + `maintenance_person` bigint NULL DEFAULT NULL COMMENT '维修人员', + `is_top` tinyint NULL DEFAULT 0 COMMENT '是否停机', + `is_filing` tinyint NULL DEFAULT 0 COMMENT '是否备案', + `reporter` bigint NULL DEFAULT NULL COMMENT '上报人', + `phone_number` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bg_0900_ai_ci NULL DEFAULT NULL COMMENT '手机号', + `dev_status` tinyint NULL DEFAULT 0 COMMENT '处理状态(0未处理,1已生成方案,2:待验收阶段。3已完成))', + `level` tinyint NULL DEFAULT NULL COMMENT '严重级别', + `completion_time` datetime NULL DEFAULT NULL COMMENT '完成时间', + `acceptance_time` datetime NULL DEFAULT NULL COMMENT '验收时间', + `create_user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人姓名', + PRIMARY KEY (`id`) USING BTREE, + INDEX `index_gzbx_id`(`gzbx_id` ASC) USING BTREE COMMENT '故障报修id' +) ENGINE = InnoDB AUTO_INCREMENT = 2034101303270473791 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bg_0900_ai_ci COMMENT = '维修管理-维修工单' ROW_FORMAT = Dynamic; + +SET FOREIGN_KEY_CHECKS = 1;