“linengliang”
2023-11-14 ea0a63b59349941d90763ef54419637cb0ea53b1
质量隐患确认,故障单
已添加6个文件
484 ■■■■■ 文件已修改
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/FaultInfoController.java 168 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/FaultInfo.java 188 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/FaultInfoMapper.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/FaultInfoMapper.xml 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IFaultInfoService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/FaultInfoServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/FaultInfoController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,168 @@
package org.jeecg.modules.eam.controller;
import java.util.Arrays;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.eam.entity.FaultInfo;
import org.jeecg.modules.eam.service.IFaultInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
 /**
 * @Description: è®¾å¤‡äº‹æ•…登记
 * @Author: jeecg-boot
 * @Date:   2023-11-08
 * @Version: V1.0
 */
@Api(tags="设备事故登记")
@RestController
@RequestMapping("/li/faultInfo")
@Slf4j
public class FaultInfoController extends JeecgController<FaultInfo, IFaultInfoService> {
    @Autowired
    private IFaultInfoService faultInfoService;
    /**
     * åˆ†é¡µåˆ—表查询
     *
     * @param faultInfo
     * @param pageNo
     * @param pageSize
     * @param req
     * @return
     */
    //@AutoLog(value = "设备事故登记-分页列表查询")
    @ApiOperation(value="设备事故登记-分页列表查询", notes="设备事故登记-分页列表查询")
    @GetMapping(value = "/list")
    public Result<IPage<FaultInfo>> queryPageList(FaultInfo faultInfo,
                                   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
                                   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
                                   HttpServletRequest req) {
        QueryWrapper<FaultInfo> queryWrapper = QueryGenerator.initQueryWrapper(faultInfo, req.getParameterMap());
        Page<FaultInfo> page = new Page<FaultInfo>(pageNo, pageSize);
        IPage<FaultInfo> pageList = faultInfoService.myPage(page, faultInfo);
        return Result.OK(pageList);
    }
    /**
     *   æ·»åŠ 
     *
     * @param faultInfo
     * @return
     */
    @AutoLog(value = "设备事故登记-添加")
    @ApiOperation(value="设备事故登记-添加", notes="设备事故登记-添加")
    //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_fault_info:add")
    @PostMapping(value = "/add")
    public Result<String> add(@RequestBody FaultInfo faultInfo) {
        faultInfoService.save(faultInfo);
        return Result.OK("添加成功!");
    }
    /**
     *  ç¼–辑
     *
     * @param faultInfo
     * @return
     */
    @AutoLog(value = "设备事故登记-编辑")
    @ApiOperation(value="设备事故登记-编辑", notes="设备事故登记-编辑")
    //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_fault_info:edit")
    @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
    public Result<String> edit(@RequestBody FaultInfo faultInfo) {
        faultInfoService.updateById(faultInfo);
        return Result.OK("编辑成功!");
    }
    /**
     *   é€šè¿‡id删除
     *
     * @param id
     * @return
     */
    @AutoLog(value = "设备事故登记-通过id删除")
    @ApiOperation(value="设备事故登记-通过id删除", notes="设备事故登记-通过id删除")
    //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_fault_info:delete")
    @DeleteMapping(value = "/delete")
    public Result<String> delete(@RequestParam(name="id",required=true) String id) {
        faultInfoService.removeById(id);
        return Result.OK("删除成功!");
    }
    /**
     *  æ‰¹é‡åˆ é™¤
     *
     * @param ids
     * @return
     */
    @AutoLog(value = "设备事故登记-批量删除")
    @ApiOperation(value="设备事故登记-批量删除", notes="设备事故登记-批量删除")
    //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_fault_info:deleteBatch")
    @DeleteMapping(value = "/deleteBatch")
    public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
        this.faultInfoService.removeByIds(Arrays.asList(ids.split(",")));
        return Result.OK("批量删除成功!");
    }
    /**
     * é€šè¿‡id查询
     *
     * @param id
     * @return
     */
    //@AutoLog(value = "设备事故登记-通过id查询")
    @ApiOperation(value="设备事故登记-通过id查询", notes="设备事故登记-通过id查询")
    @GetMapping(value = "/queryById")
    public Result<FaultInfo> queryById(@RequestParam(name="id",required=true) String id) {
        FaultInfo faultInfo = faultInfoService.getById(id);
        if(faultInfo==null) {
            return Result.error("未找到对应数据");
        }
        return Result.OK(faultInfo);
    }
    /**
    * å¯¼å‡ºexcel
    *
    * @param request
    * @param faultInfo
    */
    //@RequiresPermissions("org.jeecg.modules.mdc:mom_eam_fault_info:exportXls")
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, FaultInfo faultInfo) {
        return super.exportXls(request, faultInfo, FaultInfo.class, "设备事故登记");
    }
    /**
      * é€šè¿‡excel导入数据
    *
    * @param request
    * @param response
    * @return
    */
    //@RequiresPermissions("mom_eam_fault_info:importExcel")
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, FaultInfo.class);
    }
    @PutMapping("confirm")
    public Result<?> confirm(@RequestBody FaultInfo faultInfo){
        faultInfo.setIsConfirm("yes");
        faultInfoService.updateById(faultInfo);
        return Result.OK("确认成功");
    }
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/FaultInfo.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,188 @@
package org.jeecg.modules.eam.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
 * @Description: è®¾å¤‡äº‹æ•…登记
 * @Author: jeecg-boot
 * @Date:   2023-11-08
 * @Version: V1.0
 */
@Data
@TableName("mom_eam_fault_info")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="mom_eam_fault_info对象", description="设备事故登记")
public class FaultInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    /**主键ID*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键ID")
    private java.lang.String id;
    /**编码*/
    @Excel(name = "编码", width = 15)
    @ApiModelProperty(value = "编码")
    private java.lang.String num;
    /**质量隐患确认单ID*/
    @Excel(name = "质量隐患确认单ID", width = 15)
    @ApiModelProperty(value = "质量隐患确认单ID")
    @Dict(dictTable = "mom_eam_quanlity_confirm",dicText = "num",dicCode = "id")
    private java.lang.String quanlityId;
    /**维修费用*/
    @Excel(name = "维修费用", width = 15)
    @ApiModelProperty(value = "维修费用")
    private java.lang.String cost;
    /**操作员是否有操作证*/
    @Excel(name = "操作员是否有操作证", width = 15)
    @ApiModelProperty(value = "操作员是否有操作证")
    private java.lang.String isCertificate;
    /**是否断电重启*/
    @Excel(name = "是否断电重启", width = 15)
    @ApiModelProperty(value = "是否断电重启")
    private java.lang.String isOutage;
    /**加工过程中的变动因素*/
    @Excel(name = "加工过程中的变动因素", width = 15)
    @ApiModelProperty(value = "加工过程中的变动因素")
    private java.lang.String factor;
    /**具体更改内容*/
    @Excel(name = "具体更改内容", width = 15)
    @ApiModelProperty(value = "具体更改内容")
    private java.lang.String modifyContent;
    /**发生事故时设备所执行的程序*/
    @Excel(name = "发生事故时设备所执行的程序", width = 15)
    @ApiModelProperty(value = "发生事故时设备所执行的程序")
    private java.lang.String equipmentProcess;
    /**发生事故时的现象*/
    @Excel(name = "发生事故时的现象", width = 15)
    @ApiModelProperty(value = "发生事故时的现象")
    private java.lang.String phenomenon;
    /**采取措施1*/
    @Excel(name = "采取措施1", width = 15)
    @ApiModelProperty(value = "采取措施1")
    private java.lang.String method1;
    /**采取措施2*/
    @Excel(name = "采取措施2", width = 15)
    @ApiModelProperty(value = "采取措施2")
    private java.lang.String method2;
    /**采取措施3*/
    @Excel(name = "采取措施3", width = 15)
    @ApiModelProperty(value = "采取措施3")
    private java.lang.String method3;
    /**事故所造成的结果*/
    @Excel(name = "事故所造成的结果", width = 15)
    @ApiModelProperty(value = "事故所造成的结果")
    private java.lang.String result;
    /**开始检查时间*/
    @Excel(name = "开始检查时间", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "开始检查时间")
    private java.util.Date startCheckTime;
    /**发生事故后设备的状态*/
    @Excel(name = "发生事故后设备的状态", width = 15)
    @ApiModelProperty(value = "发生事故后设备的状态")
    private java.lang.String equipmentStatus;
    /**维修人员对事故的分析*/
    @Excel(name = "维修人员对事故的分析", width = 15)
    @ApiModelProperty(value = "维修人员对事故的分析")
    private java.lang.String anlysis;
    /**维修人员检查结果*/
    @Excel(name = "维修人员检查结果", width = 15)
    @ApiModelProperty(value = "维修人员检查结果")
    private java.lang.String checkResult;
    /**事故原因分析过程中所采取的相关行为*/
    @Excel(name = "事故原因分析过程中所采取的相关行为", width = 15)
    @ApiModelProperty(value = "事故原因分析过程中所采取的相关行为")
    private java.lang.String active;
    /**建议采取的措施及时间节点*/
    @Excel(name = "建议采取的措施及时间节点", width = 15)
    @ApiModelProperty(value = "建议采取的措施及时间节点")
    private java.lang.String suggest;
    /**事故发生原因分析的核对*/
    @Excel(name = "事故发生原因分析的核对", width = 15)
    @ApiModelProperty(value = "事故发生原因分析的核对")
    private java.lang.String judgment;
    /**不同的意见及分析*/
    @Excel(name = "不同的意见及分析", width = 15)
    @ApiModelProperty(value = "不同的意见及分析")
    private java.lang.String differentJudgment;
    /**整改措施*/
    @Excel(name = "整改措施", width = 15)
    @ApiModelProperty(value = "整改措施")
    private java.lang.String updateMethod;
    /**事故结论*/
    @Excel(name = "事故结论", width = 15)
    @ApiModelProperty(value = "事故结论")
    private java.lang.String finalResult;
    /**操作者*/
    @Excel(name = "操作者", width = 15)
    @ApiModelProperty(value = "操作者")
    private java.lang.String operater;
    /**维修责任人*/
    @Excel(name = "维修责任人", width = 15)
    @ApiModelProperty(value = "维修责任人")
    private java.lang.String engineer;
    /**技术负责人*/
    @Excel(name = "技术负责人", width = 15)
    @ApiModelProperty(value = "技术负责人")
    private java.lang.String mechanic;
    /**工长*/
    @Excel(name = "工长", width = 15)
    @ApiModelProperty(value = "工长")
    private java.lang.String workLeader;
    /**中心主任*/
    @Excel(name = "中心主任", width = 15)
    @ApiModelProperty(value = "中心主任")
    private java.lang.String centerLeader;
    /**组长*/
    @Excel(name = "组长", width = 15)
    @ApiModelProperty(value = "组长")
    private java.lang.String teamLeader;
    /**维修站站长*/
    @Excel(name = "维修站站长", width = 15)
    @ApiModelProperty(value = "维修站站长")
    private java.lang.String repairLeader;
    /**管理室业务经理*/
    @Excel(name = "管理室业务经理", width = 15)
    @ApiModelProperty(value = "管理室业务经理")
    private java.lang.String equipLeader;
    /**运行保障部主管领导*/
    @Excel(name = "运行保障部主管领导", width = 15)
    @ApiModelProperty(value = "运行保障部主管领导")
    private java.lang.String guaranteeLeader;
    private java.lang.String equipName;
    private java.lang.String equipModel;
    private java.lang.String equipNum;
    private String area2;
    @TableField(exist = false)
    @Dict(dictTable = "sys_user",dicCode = "id",dicText = "realname")
    private String operator;
    @TableField(exist = false)
    private String faultTime;
    @TableField(exist = false)
    @Dict(dictTable = "mom_base_area",dicText = "name",dicCode = "id")
    private String area1;
    @TableField(exist = false)
    @Dict(dictTable = "sys_depart",dicCode = "id",dicText = "depart_name")
    private String departId;
    @TableField(exist = false)
    private String level;
    private String isConfirm;
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/FaultInfoMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
package org.jeecg.modules.eam.mapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.eam.entity.FaultInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/**
 * @Description: è®¾å¤‡äº‹æ•…登记
 * @Author: jeecg-boot
 * @Date:   2023-11-08
 * @Version: V1.0
 */
public interface FaultInfoMapper extends BaseMapper<FaultInfo> {
    /**
     * page
     *
     * @param page
     * @param num
     * @param isConfirm
     * @return
     */
   List<FaultInfo> myPage(Page<FaultInfo> page,@Param("num") String num,@Param("isConfirm")String isConfirm);
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/mapper/xml/FaultInfoMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.eam.mapper.FaultInfoMapper">
    <select id="myPage" resultType="org.jeecg.modules.eam.entity.FaultInfo">
        select
            t1.id,
            t1.num,
            t1.quanlity_id quanlityId,
            t1.cost,
            t1.is_certificate isCertificate,
            t1.is_outage isOutage,
            t1.factor,
            t1.modify_content modifyContent,
            t1.equipment_process equipmentProcess,
            t1.phenomenon,
            t1.method1,
            t1.method2,
            t1.method3,
            t1.result,
            t1.start_check_time startCheckTime,
            t1.equipment_status equipmentStatus,
            t1.anlysis,
            t1.check_result checkResult,
            t1.active,
            t1.suggest,
            t1.judgment,
            t1.different_judgment differentJudgment,
            t1.update_method updateMethod,
            t1.final_result finalResult,
            t1.operater,
            t1.engineer,
            t1.mechanic,
            t1.work_leader workLeader,
            t1.center_leader centerLeader,
            t1.team_leader teamLeader,
            t1.repair_leader repairLeader,
            t1.equip_leader equipLeader,
            t1.guarantee_leader guaranteeLeader,
            t1.equip_name equipName,
            t1.equip_model equipModel,
            t1.equip_num equipNum,
            t1.is_confirm isConfirm,
            t1.area2,
            t2.operator,
            t3.fault_time faultTime,
            t4.factory_model_id area1,
            t4.use_id departId,
            t5.technical_level level
            from mom_eam_fault_info t1
            left join mom_eam_quanlity_confirm t2 on t2.id = t1.quanlity_id
            left join mom_eam_equipment_report_repair t3 on t3.id = t2.report_id
            left join mom_eam_equipment t4 on t4.id = t3.equipment_id
            left join mom_eam_operation_certificate t5 on t5.id = t2.operator
            where 1=1
            <if test="num != null and num != ''">
                and t1.num like concat('%',#{num},'%')
            </if>
            <if test="isConfirm != null and isConfirm != ''">
                and t1.is_confirm = #{isConfirm}
            </if>
    </select>
</mapper>
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IFaultInfoService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package org.jeecg.modules.eam.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.eam.entity.FaultInfo;
import com.baomidou.mybatisplus.extension.service.IService;
/**
 * @Description: è®¾å¤‡äº‹æ•…登记
 * @Author: jeecg-boot
 * @Date:   2023-11-08
 * @Version: V1.0
 */
public interface IFaultInfoService extends IService<FaultInfo> {
    Page<FaultInfo>myPage(Page<FaultInfo> page,FaultInfo faultInfo);
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/FaultInfoServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,23 @@
package org.jeecg.modules.eam.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.eam.entity.FaultInfo;
import org.jeecg.modules.eam.mapper.FaultInfoMapper;
import org.jeecg.modules.eam.service.IFaultInfoService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
 * @Description: è®¾å¤‡äº‹æ•…登记
 * @Author: jeecg-boot
 * @Date:   2023-11-08
 * @Version: V1.0
 */
@Service
public class FaultInfoServiceImpl extends ServiceImpl<FaultInfoMapper, FaultInfo> implements IFaultInfoService {
    @Override
    public Page<FaultInfo> myPage(Page<FaultInfo> page, FaultInfo faultInfo) {
        return page.setRecords(baseMapper.myPage(page,faultInfo.getNum(),faultInfo.getIsConfirm()));
    }
}