ソースを参照

维修实体代码提交

huangpeng 1 年間 前
コミット
2735455a2c

+ 58 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/dao/EquMaintenanceOrderDao.java

@@ -0,0 +1,58 @@
+package com.rongwei.bscommon.sys.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwei.bsentity.domain.EquMaintenanceOrderDo;
+import com.rongwei.bsentity.domain.EquMaintenanceOrderVo;
+import com.rongwei.bsentity.dto.EquMaintenanceOrderSumDTO;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.Date;
+import java.util.List;
+
+public interface EquMaintenanceOrderDao extends BaseMapper<EquMaintenanceOrderDo> {
+    @Select("SELECT\n" +
+            "  d.PLANT,d.DEVICETYPE,d.PROBLEMLOCATION,COUNT(d.ID) 'COUNT',\n" +
+            "\tGROUP_CONCAT(d.ID  ) 'IDS' \n" +
+            "FROM\n" +
+            "\t(\n" +
+            "\tSELECT\n" +
+            "\t\ta.PLANT,a.PROBLEMLOCATION,a.ID,\n" +
+            "\tCASE\n" +
+            "\t\t\tWHEN a.MAINTENANCECLASSIFY = '1' THEN\n" +
+            "\t\t\tdict1.`NAME` ELSE c.FROCKTYPE \n" +
+            "\t\tEND 'DEVICETYPE' \n" +
+            "FROM\n" +
+            "\tequ_maintenance_order a\n" +
+            "\tLEFT JOIN asp_check_items b ON b.ID = a.EQUIPMENTID AND b.DELETED = '0'\n" +
+            "\t\tLEFT JOIN sys_dict dict1 ON dict1.DICTTYPE = 'asp_check_item_type' \tAND dict1.`VALUE` = b.CHECKITEMTYPE\n" +
+            "\tLEFT JOIN equ_frock_list c ON c.ID = a.EQUIPMENTID AND c.DELETED = '0' \n" +
+            "WHERE\n" +
+            "\t1 = 1 \n" +
+            "\tAND a.DELETED = '0' \n" +
+            "\tAND a.REPAIRSTATUS IN ( 10, 20, 30, 100, 110 ) \n" +
+            "\tAND a.MAINTENANCECLASSIFY IN ( 1, 3 ) \n" +
+            "\tand a.INCIDENTTIME BETWEEN  #{startDate} and #{endDate} \n" +
+            "\t) d \n" +
+            "GROUP BY\n" +
+            "\td.PLANT,\n" +
+            "\td.PROBLEMLOCATION,\n" +
+            "\td.DEVICETYPE \n" +
+            "HAVING\n" +
+            "\tcount( d.ID )> 1")
+    List<EquMaintenanceOrderSumDTO> selectOrderSummaryData(@Param("startDate") Date startDate, @Param("endDate") Date endDate);
+
+    @Select("SELECT a.* FROM equ_maintenance_order a\n" +
+            " WHERE 1 = 1 and FIND_IN_SET(a.ID,#{ids})" )
+    List<EquMaintenanceOrderDo> selectOrderDataByIds( @Param("ids") String ids);
+
+    @Select("SELECT su.ID\n" +
+            "FROM sys_role sr \n" +
+            "LEFT JOIN sys_user_role sur ON sr.ID = sur.ROLEID and sur.DELETED = 0 \n" +
+            "LEFT JOIN sys_user su ON sur.USERID = su.ID and su.DELETED = 0 \n" +
+            "LEFT JOIN sys_user_org suo ON suo.USERID = su.ID AND suo.DELETED = 0 \n" +
+            "LEFT JOIN sys_organization so ON suo.ORGID = so.ID AND so.DELETED = 0 \n" +
+            "WHERE sr.NAME in('设备部部长','车间维修主管','设备部维修主管') \n")
+    List<String> selectRoleList();
+
+}

+ 36 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/EquMaintenanceOrderService.java

@@ -0,0 +1,36 @@
+package com.rongwei.bscommon.sys.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.rongwei.bsentity.domain.EquMaintenanceOrderDo;
+import com.rongwei.bsentity.dto.EquMaintenanceOrderSumDTO;
+
+import java.util.Date;
+import java.util.List;
+
+public interface EquMaintenanceOrderService extends IService<EquMaintenanceOrderDo> {
+
+    /**
+     * 根据故障发生时间自动查询每个工厂近3个月内 (以本月在往前倒推三个月至当前时间)所有 除去 无需维修、已关闭  且  维修对象分类 为 档案设备、工装 的 维修任务记录中,
+     * 然后根据所属工厂、设备类型、发生部位 分组查询对应分组类型的 数量记录 中 > 1的记录
+     * @param startDate
+     * @param endDate
+     * @return
+     */
+    List<EquMaintenanceOrderSumDTO> selectOrderSummaryData(Date startDate, Date endDate);
+
+
+    /**
+     * 通过ids 获取所有数据
+     * @param ids
+     * @return
+     */
+    List<EquMaintenanceOrderDo> selectOrderDataByIds(String ids);
+
+    /**
+     * 查询 取车间维修主管、设备部部长、设备部维修主管 角色中所有人员
+     * @return
+     */
+    List<String> selectRoleList();
+
+
+}

+ 35 - 0
cx-equipment/cx-equipment-common/src/main/java/com/rongwei/bscommon/sys/service/impl/EquMaintenanceOrderServiceImpl.java

@@ -0,0 +1,35 @@
+package com.rongwei.bscommon.sys.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.rongwei.bscommon.sys.dao.EquMaintenanceOrderDao;
+import com.rongwei.bscommon.sys.service.EquMaintenanceOrderService;
+import com.rongwei.bsentity.domain.EquMaintenanceOrderDo;
+import com.rongwei.bsentity.dto.EquMaintenanceOrderSumDTO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.List;
+
+@Service
+public class EquMaintenanceOrderServiceImpl extends ServiceImpl<EquMaintenanceOrderDao, EquMaintenanceOrderDo> implements EquMaintenanceOrderService {
+
+    @Autowired
+    EquMaintenanceOrderDao equMaintenanceOrderDao;
+
+
+    @Override
+    public List<EquMaintenanceOrderSumDTO> selectOrderSummaryData(Date startDate, Date endDate) {
+        return equMaintenanceOrderDao.selectOrderSummaryData(startDate,endDate);
+    }
+
+    @Override
+    public List<EquMaintenanceOrderDo> selectOrderDataByIds(String ids) {
+        return equMaintenanceOrderDao.selectOrderDataByIds(ids);
+    }
+
+    @Override
+    public List<String> selectRoleList() {
+        return equMaintenanceOrderDao.selectRoleList();
+    }
+}

+ 601 - 0
cx-equipment/cx-equipment-entity/src/main/java/com/rongwei/bsentity/domain/EquMaintenanceOrderDo.java

@@ -0,0 +1,601 @@
+package com.rongwei.bsentity.domain;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.NoArgsConstructor;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import java.util.Date;
+
+/**
+ * @author  cyn 
+ * @create 2024-01-19 14:52 
+ */
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@TableName("equ_maintenance_order")
+public class EquMaintenanceOrderDo {
+
+	/**
+	 * table name:ID
+	 * table type:varchar(36)
+	 * table comment:主键
+	 */
+	private String id;
+
+	/**
+	 * table name:TENANTID
+	 * table type:text
+	 * table comment:null
+	 */
+	private String tenantid;
+
+	/**
+	 * table name:ROPTION
+	 * table type:longtext
+	 * table comment:扩展json格式配置
+	 */
+	private String roption;
+
+	/**
+	 * table name:DELETED
+	 * table type:char(1)
+	 * table comment:是否删除
+	 */
+	private String deleted;
+
+	/**
+	 * table name:REMARK
+	 * table type:mediumtext
+	 * table comment:备注
+	 */
+	private String remark;
+
+	/**
+	 * table name:CREATEDATE
+	 * table type:datetime
+	 * table comment:创建时间
+	 */
+	private String  createdate;
+
+	/**
+	 * table name:CREATEUSERID
+	 * table type:varchar(36)
+	 * table comment:创建用户ID
+	 */
+	private String createuserid;
+
+	/**
+	 * table name:MODIFYDATE
+	 * table type:datetime
+	 * table comment:修改日期
+	 */
+	private Date modifydate;
+
+	/**
+	 * table name:MODIFYUSERID
+	 * table type:varchar(36)
+	 * table comment:修改用户ID
+	 */
+	private String modifyuserid;
+
+	/**
+	 * table name:CREATEUSERNAME
+	 * table type:varchar(50)
+	 * table comment:创建人名称
+	 */
+	private String createusername;
+
+	/**
+	 * table name:MODIFYUSERNAME
+	 * table type:varchar(50)
+	 * table comment:修改人名称
+	 */
+	private String modifyusername;
+
+	/**
+	 * table name:JOBNUMBER
+	 * table type:varchar(50)
+	 * table comment:工单号
+	 */
+	private String jobnumber;
+
+	/**
+	 * table name:FAULTSOURCE
+	 * table type:varchar(20)
+	 * table comment:故障来源
+	 */
+	private String faultsource;
+
+	/**
+	 * table name:FAULTCLASSIFY
+	 * table type:varchar(20)
+	 * table comment:故障分类
+	 */
+	private String faultclassify;
+
+	/**
+	 * table name:MAINTENANCECLASSIFY
+	 * table type:varchar(20)
+	 * table comment:维修对象分类
+	 */
+	private String maintenanceclassify;
+
+	/**
+	 * table name:EQUIPMENTNAME
+	 * table type:varchar(500)
+	 * table comment:设备/工装名称
+	 */
+	private String equipmentname;
+
+	/**
+	 * table name:EQUIPMENTID
+	 * table type:varchar(500)
+	 * table comment:设备/工装名称ID
+	 */
+	private String equipmentid;
+
+	/**
+	 * table name:EQUIPMENTNUMBER
+	 * table type:varchar(36)
+	 * table comment:设备编号
+	 */
+	private String equipmentnumber;
+
+	/**
+	 * table name:SPECIFICATION
+	 * table type:varchar(50)
+	 * table comment:规格型号
+	 */
+	private String specification;
+
+	/**
+	 * table name:AREA
+	 * table type:text
+	 * table comment:区域
+	 */
+	private String area;
+
+	/**
+	 * table name:PROBLEMLOCATION
+	 * table type:text
+	 * table comment:问题发生部位
+	 */
+	private String problemlocation;
+
+	/**
+	 * table name:INCIDENTTIME
+	 * table type:datetime
+	 * table comment:问题发生时间
+	 */
+	private Date incidenttime;
+
+	/**
+	 * table name:PLANT
+	 * table type:varchar(35)
+	 * table comment:所属工厂
+	 */
+	private String plant;
+
+	/**
+	 * table name:WORKSHOPID
+	 * table type:varchar(150)
+	 * table comment:使用车间ID
+	 */
+	private String workshopid;
+
+	/**
+	 * table name:WORKSHOP
+	 * table type:varchar(100)
+	 * table comment:使用车间
+	 */
+	private String workshop;
+
+	/**
+	 * table name:USERID
+	 * table type:varchar(500)
+	 * table comment:设备使用人ID
+	 */
+	private String userid;
+
+	/**
+	 * table name:USER
+	 * table type:varchar(2000)
+	 * table comment:设备使用人
+	 */
+	private String user;
+
+	/**
+	 * table name:SERVICEPERSIONID
+	 * table type:varchar(2000)
+	 * table comment:设备维修人ID
+	 */
+	private String servicepersionid;
+
+	/**
+	 * table name:SERVICEPERSON
+	 * table type:varchar(500)
+	 * table comment:设备维修人
+	 */
+	private String serviceperson;
+
+	/**
+	 * table name:FAULTCONDITION
+	 * table type:text
+	 * table comment:设备故障情况
+	 */
+	private String faultcondition;
+
+	/**
+	 * table name:EQUIPMENTFAULT
+	 * table type:text
+	 * table comment:故障图
+	 */
+	private String equipmentfault;
+
+	/**
+	 * table name:ISHALT
+	 * table type:varchar(10)
+	 * table comment:是否停机
+	 */
+	private String ishalt;
+
+	/**
+	 * table name:HALTTIME
+	 * table type:datetime
+	 * table comment:停机时间
+	 */
+	private Date halttime;
+
+	/**
+	 * table name:APPLICATIONDEPT
+	 * table type:varchar(50)
+	 * table comment:申请部门
+	 */
+	private String applicationdept;
+
+	/**
+	 * table name:APPLICATIONDEPTID
+	 * table type:varchar(36)
+	 * table comment:申请部门ID
+	 */
+	private String applicationdeptid;
+
+	/**
+	 * table name:CAUSEFAILURE
+	 * table type:text
+	 * table comment:故障发生原因
+	 */
+	private String causefailure;
+
+	/**
+	 * table name:REPAIR
+	 * table type:text
+	 * table comment:设备维修情况
+	 */
+	private String repair;
+
+	/**
+	 * table name:RESULT
+	 * table type:text
+	 * table comment:维修结果
+	 */
+	private String result;
+
+	/**
+	 * table name:MAINTENANCENOTE
+	 * table type:text
+	 * table comment:维修备注
+	 */
+	private String maintenancenote;
+
+	/**
+	 * table name:REPAIRSTARTTIME
+	 * table type:datetime
+	 * table comment:维修开始时间
+	 */
+	private Date repairstarttime;
+
+	/**
+	 * table name:REPAIRENDTIME
+	 * table type:datetime
+	 * table comment:维修结束时间
+	 */
+	private Date repairendtime;
+
+	/**
+	 * table name:REPAIRSTATUS
+	 * table type:varchar(20)
+	 * table comment:维修状态
+	 */
+	private String repairstatus;
+
+	/**
+	 * table name:GRAPHICALRESULT
+	 * table type:text
+	 * table comment:设备维修结果图
+	 */
+	private String graphicalresult;
+
+	/**
+	 * table name:FAILURELEVEL
+	 * table type:varchar(20)
+	 * table comment:故障等级
+	 */
+	private String failurelevel;
+
+	/**
+	 * table name:ACCEPTOR
+	 * table type:varchar(500)
+	 * table comment:验收确认人
+	 */
+	private String acceptor;
+
+	/**
+	 * table name:ACCEPTORID
+	 * table type:varchar(2000)
+	 * table comment:验收确认人ID
+	 */
+	private String acceptorid;
+
+	/**
+	 * table name:CONFIRMRESULT
+	 * table type:varchar(20)
+	 * table comment:确认结果
+	 */
+	private String confirmresult;
+
+	/**
+	 * table name:AFFIRMSTATE
+	 * table type:text
+	 * table comment:确认说明
+	 */
+	private String affirmstate;
+
+	/**
+	 * table name:CLOSECLASSIFY
+	 * table type:varchar(20)
+	 * table comment:工单关闭分类
+	 */
+	private String closeclassify;
+
+	/**
+	 * table name:CLOSECAUSE
+	 * table type:text
+	 * table comment:工单关闭原因
+	 */
+	private String closecause;
+
+	/**
+	 * table name:HANGERID
+	 * table type:varchar(36)
+	 * table comment:挂起人ID
+	 */
+	private String hangerid;
+
+	/**
+	 * table name:HANGER
+	 * table type:varchar(20)
+	 * table comment:挂起人
+	 */
+	private String hanger;
+
+	/**
+	 * table name:SUSPENSIONTIME
+	 * table type:datetime
+	 * table comment:挂起时间
+	 */
+	private Date suspensiontime;
+
+	/**
+	 * table name:SCHEDULEDSTARTTIME
+	 * table type:datetime
+	 * table comment:预计重新开始维修时间
+	 */
+	private Date scheduledstarttime;
+
+	/**
+	 * table name:SUPENSIONREASON
+	 * table type:text
+	 * table comment:工单挂起原因
+	 */
+	private String supensionreason;
+
+	/**
+	 * table name:SUSPENDEDREMAKS
+	 * table type:text
+	 * table comment:挂起备注
+	 */
+	private String suspendedremaks;
+
+	/**
+	 * table name:MAINTENANCETIME
+	 * table type:datetime
+	 * table comment:保修时间
+	 */
+	private Date maintenancetime;
+
+	/**
+	 * table name:WHETHEROUTSOURCEMAINTENANCE
+	 * table type:varchar(36)
+	 * table comment:是否委外维修
+	 */
+	private String whetheroutsourcemaintenance;
+
+	/**
+	 * table name:WORKORDERCLOSESORT
+	 * table type:varchar(36)
+	 * table comment:工单关闭分类
+	 */
+	private String workorderclosesort;
+
+	/**
+	 * table name:WORKORDERSHUTDOWNREASON
+	 * table type:text
+	 * table comment:工单关闭原因详情
+	 */
+	private String workordershutdownreason;
+
+	/**
+	 * table name:ACCEPTANCETIME
+	 * table type:datetime
+	 * table comment:确认验收时间
+	 */
+	private Date acceptancetime;
+
+	/**
+	 * table name:ACCEPTANCEMODIFIER
+	 * table type:varchar(36)
+	 * table comment:验收修改人
+	 */
+	private String acceptancemodifier;
+
+	/**
+	 * table name:ACCEPTANCEMODIFIERID
+	 * table type:varchar(36)
+	 * table comment:验收修改人ID
+	 */
+	private String acceptancemodifierid;
+
+	/**
+	 * table name:ACCEPTANCEMODIFICATIONTIME
+	 * table type:datetime
+	 * table comment:验收修改时间
+	 */
+	private Date acceptancemodificationtime;
+
+	/**
+	 * table name:PLANPROPOSERID
+	 * table type:varchar(36)
+	 * table comment:委外维修申请人ID
+	 */
+	private String planproposerid;
+
+	/**
+	 * table name:PLANPROPOSER
+	 * table type:varchar(20)
+	 * table comment:委外维修申请人
+	 */
+	private String planproposer;
+
+	/**
+	 * table name:PLANAPPLYTIME
+	 * table type:datetime
+	 * table comment:委外申请时间
+	 */
+	private Date planapplytime;
+
+	/**
+	 * table name:OUTSOURCINNGCAUSE
+	 * table type:text
+	 * table comment:委外维修原因
+	 */
+	private String outsourcinngcause;
+
+	/**
+	 * table name:OUTSOURCINNGUNIT
+	 * table type:varchar(100)
+	 * table comment:委外维修单位
+	 */
+	private String outsourcinngunit;
+
+	/**
+	 * table name:MAINTENANCESITE
+	 * table type:varchar(20)
+	 * table comment:维修地点
+	 */
+	private String maintenancesite;
+
+	/**
+	 * table name:BAFO
+	 * table type:double
+	 * table comment:维修最终报价
+	 */
+	private Double bafo;
+
+	/**
+	 * table name:SCORINGMETHOD
+	 * table type:text
+	 * table comment:计划维修方式和说明
+	 */
+	private String scoringmethod;
+
+	/**
+	 * table name:GIST
+	 * table type:text
+	 * table comment:委外维修依据
+	 */
+	private String gist;
+
+	/**
+	 * table name:OUTSOURCEREMARKS
+	 * table type:text
+	 * table comment:委外备注
+	 */
+	private String outsourceremarks;
+
+	/**
+	 * table name:PLANSTARTTIME
+	 * table type:datetime
+	 * table comment:计划开始维修时间
+	 */
+	private Date planstarttime;
+
+	/**
+	 * table name:PLANENDTIME
+	 * table type:datetime
+	 * table comment:计划完成维修时间
+	 */
+	private Date planendtime;
+
+	/**
+	 * table name:REPAIRTIME
+	 * table type:datetime
+	 * table comment:报修时间
+	 */
+	private Date repairtime;
+
+	/**
+	 * table name:MAINTENANCEARRIVALTIME
+	 * table type:datetime
+	 * table comment:维修人员到达时间
+	 */
+	private Date maintenancearrivaltime;
+
+	/**
+	 * table name:MAINTENANCEPROCESSTIME
+	 * table type:decimal(18)
+	 * table comment:维修过程耗时-分钟
+	 */
+	private Double maintenanceprocesstime;
+
+	/**
+	 * table name:MAINTENANCEWAITINGTIME
+	 * table type:decimal(18)
+	 * table comment:维修等待耗时-分钟
+	 */
+	private Double maintenancewaitingtime;
+
+	/**
+	 * table name:MAINTENANCEDIAGNOSTICTIME
+	 * table type:decimal(18)
+	 * table comment:诊断耗时-分钟
+	 */
+	private Double maintenancediagnostictime;
+
+	/**
+	 * table name:POWERONDATE
+	 * table type:datetime
+	 * table comment:开机时间
+	 */
+	private Date powerondate;
+
+	/**
+	 * table name:POWERONNEEDTIME
+	 * table type:decimal(18)
+	 * table comment:开机准备耗时-分钟
+	 */
+	private Double poweronneedtime;
+
+}