| | |
| | | "avatar": "", |
| | | "version": "4.9.4", |
| | | "createdTime": "2025-3-10 16:38:19", |
| | | "updatedTime": "2025-7-23 11:43:01", |
| | | "updatedTime": "2025-8-22 09:21:37", |
| | | "dbConns": [], |
| | | "profile": { |
| | | "default": { |
| | |
| | | "extProps": {}, |
| | | "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", |
| | | "id": "0BACB829-115B-472B-B205-812ABA028344" |
| | | }, |
| | | { |
| | | "defKey": "second_maint_generate_flag", |
| | | "defName": "äºä¿çææ è®°", |
| | | "comment": "1 å·²çæ 0 䏿¬¡å¾
çæ", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "73FD2BAD-2358-4336-B96D-45DC897BD792", |
| | | "id": "D79339E3-28E9-4473-969D-2AE92F18168A" |
| | | } |
| | | ], |
| | | "correlations": [], |
| | |
| | | "correlations": [], |
| | | "indexes": [], |
| | | "type": "P" |
| | | }, |
| | | { |
| | | "id": "75EBAC55-1246-4201-AFB9-BB29A8600D61", |
| | | "env": { |
| | | "base": { |
| | | "nameSpace": "", |
| | | "codeRoot": "" |
| | | } |
| | | }, |
| | | "defKey": "eam_factory_second_maint_plan", |
| | | "defName": "é¦é¡µè½¦é´äºä¿è®¡å", |
| | | "comment": "", |
| | | "properties": { |
| | | "partitioned by": "(date string)", |
| | | "row format delimited": "", |
| | | "fields terminated by ','": "", |
| | | "collection items terminated by '-'": "", |
| | | "map keys terminated by ':'": "", |
| | | "store as textfile;": "" |
| | | }, |
| | | "sysProps": { |
| | | "nameTemplate": "{defKey}[{defName}]" |
| | | }, |
| | | "notes": {}, |
| | | "headers": [ |
| | | { |
| | | "refKey": "hideInGraph", |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "defKey", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "defName", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "comment", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "primaryKey", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "notNull", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "autoIncrement", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "domain", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "type", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "len", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "scale", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "refDict", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "defaultValue", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "isStandard", |
| | | "freeze": false, |
| | | "hideInGraph": false |
| | | }, |
| | | { |
| | | "refKey": "uiHint", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "extProps", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr1", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr2", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr3", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr4", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr5", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr6", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr7", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr8", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | }, |
| | | { |
| | | "refKey": "attr9", |
| | | "freeze": false, |
| | | "hideInGraph": true |
| | | } |
| | | ], |
| | | "fields": [ |
| | | { |
| | | "defKey": "id", |
| | | "defName": "主é®", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": true, |
| | | "notNull": true, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "16120F75-6AA7-4483-868D-F07F511BB081", |
| | | "id": "0C6825D7-AC55-4C2F-8DBB-B8113A789182" |
| | | }, |
| | | { |
| | | "defKey": "create_by", |
| | | "defName": "å建人", |
| | | "comment": "", |
| | | "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": "", |
| | | "uiHint": "", |
| | | "id": "EC7FDEF6-2352-415B-830F-D9A246081E32", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "create_time", |
| | | "defName": "å建æ¶é´", |
| | | "comment": "", |
| | | "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": "", |
| | | "uiHint": "", |
| | | "id": "8917CA4D-4EE8-4F77-8E9F-8CD5F160075D", |
| | | "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" |
| | | }, |
| | | { |
| | | "defKey": "update_by", |
| | | "defName": "æ´æ°äºº", |
| | | "comment": "", |
| | | "domain": "54611CCC-CA4B-42E1-9F32-4944C85B85A6", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": "", |
| | | "uiHint": "", |
| | | "id": "6B7C4AFF-3DDA-40D0-8DB7-43748798F09C", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64" |
| | | }, |
| | | { |
| | | "defKey": "update_time", |
| | | "defName": "æ´æ°æ¶é´", |
| | | "comment": "", |
| | | "domain": "7CFFA0D3-6A93-4DDC-BC10-DF21211064DC", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": true, |
| | | "refDict": "", |
| | | "uiHint": "", |
| | | "id": "1F88E4CE-F260-439B-AEA2-07867F853914", |
| | | "baseType": "89D69E81-EA34-42EE-9FA2-93B8BD27E098" |
| | | }, |
| | | { |
| | | "defKey": "del_flag", |
| | | "defName": "å 餿 è®°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "1D764C4A-6F9F-421E-B11A-6F3E23B51811", |
| | | "extProps": {}, |
| | | "domain": "6BC8F04B-6CFA-4995-98D3-318F5CDD774E", |
| | | "id": "3DD497FC-4A06-4526-BB83-76E1A9B4F422" |
| | | }, |
| | | { |
| | | "defKey": "factory_id", |
| | | "defName": "å·¥åID", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "id": "1DDDE0A7-8CF8-4865-8513-542C8B266600" |
| | | }, |
| | | { |
| | | "defKey": "factory_name", |
| | | "defName": "å·¥ååç§°", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "id": "B70016D5-1239-4AF4-9A40-6CC08F58C358" |
| | | }, |
| | | { |
| | | "defKey": "month_plan", |
| | | "defName": "计åæä»½", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "id": "9FD1A574-4E97-4D10-AC55-54931A411844" |
| | | }, |
| | | { |
| | | "defKey": "quantity", |
| | | "defName": "æ°é", |
| | | "comment": "", |
| | | "type": "", |
| | | "len": "", |
| | | "scale": "", |
| | | "primaryKey": false, |
| | | "notNull": false, |
| | | "autoIncrement": false, |
| | | "defaultValue": "", |
| | | "hideInGraph": false, |
| | | "refDict": "", |
| | | "baseType": "FC9790A7-36B8-4A48-8F9A-BC1042BCFE64", |
| | | "extProps": {}, |
| | | "domain": "9092C4E0-1A54-4859-ABBB-5B62DBC27573", |
| | | "id": "FAFC221D-0A87-4EE5-A5A6-57EC410A9F2C" |
| | | } |
| | | ], |
| | | "correlations": [], |
| | | "indexes": [], |
| | | "type": "P" |
| | | } |
| | | ], |
| | | "views": [], |
| | |
| | | "306F9BF6-990A-44D0-9585-CC5E40E639F0", |
| | | "6102925D-12F5-42D2-A721-5BBAE73F9087", |
| | | "6221E3E7-A119-4AE7-872F-1159192BD6AC", |
| | | "CB01E297-3E90-404A-883F-84A36193305F" |
| | | "CB01E297-3E90-404A-883F-84A36193305F", |
| | | "75EBAC55-1246-4201-AFB9-BB29A8600D61" |
| | | ], |
| | | "refViews": [], |
| | | "refDiagrams": [], |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.dto; |
| | | |
| | | import lombok.Data; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * @Description: EchartsDto |
| | | * @Date:2021/5/20 |
| | | * @Version:V1.0 |
| | | */ |
| | | @Data |
| | | @Accessors(chain = true) |
| | | public class EchartsDto { |
| | | |
| | | public EchartsDto() { |
| | | |
| | | } |
| | | |
| | | public EchartsDto(String code, String name, String value, String total, String percentage) { |
| | | this.code = code; |
| | | this.name = name; |
| | | this.value = value; |
| | | this.total = total; |
| | | this.percentage = percentage; |
| | | } |
| | | |
| | | /** |
| | | * code |
| | | */ |
| | | private String code; |
| | | /** |
| | | * name |
| | | */ |
| | | private String name; |
| | | /** |
| | | * å¼ |
| | | */ |
| | | private String value; |
| | | |
| | | /** |
| | | * æ»æ° |
| | | */ |
| | | private String total; |
| | | |
| | | /** |
| | | * å æ¯ |
| | | */ |
| | | private String percentage; |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | |
| | | /** |
| | | * @Description: âé¦é¡µè½¦é´äºä¿è®¡å |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-08-22 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("eam_factory_second_maint_plan") |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value="eam_factory_second_maint_plan对象", description="âé¦é¡µè½¦é´äºä¿è®¡å") |
| | | public class EamFactorySecondMaintPlan { |
| | | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | | /**å建人*/ |
| | | @Excel(name = "å建人", width = 15) |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createBy; |
| | | /**å建æ¶é´*/ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @Excel(name = "æ´æ°äºº", width = 15) |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | /**æ´æ°æ¶é´*/ |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | /**å 餿 è®°*/ |
| | | @Excel(name = "å 餿 è®°", width = 15) |
| | | @ApiModelProperty(value = "å 餿 è®°") |
| | | private Integer delFlag; |
| | | /**å·¥åID*/ |
| | | @Excel(name = "å·¥åID", width = 15) |
| | | @ApiModelProperty(value = "å·¥åID") |
| | | private String factoryId; |
| | | /**å·¥ååç§°*/ |
| | | @Excel(name = "å·¥ååç§°", width = 15) |
| | | @ApiModelProperty(value = "å·¥ååç§°") |
| | | private String factoryName; |
| | | /**计åæä»½*/ |
| | | @Excel(name = "计åæä»½", width = 15) |
| | | @ApiModelProperty(value = "计åæä»½") |
| | | private String monthPlan; |
| | | /**æ°é*/ |
| | | @Excel(name = "æ°é", width = 15) |
| | | @ApiModelProperty(value = "æ°é") |
| | | private String quantity; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | import org.jeecg.modules.eam.dto.EchartsDto; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | |
| | | import java.util.List; |
| | |
| | | */ |
| | | List<EamEquipment> selectThreeMaintenanceEquipmentList(@Param(Constants.WRAPPER) Wrapper<EamEquipment> queryWrapper); |
| | | |
| | | /** |
| | | * 设å¤ç®¡çé¦é¡µ |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | List<EchartsDto> echartsList(List<String> ids); |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.eam.entity.EamFactorySecondMaintPlan; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @Description: âé¦é¡µè½¦é´äºä¿è®¡å |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-08-22 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface EamFactorySecondMaintPlanMapper extends BaseMapper<EamFactorySecondMaintPlan> { |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | IPage<EamReportRepairDto> queryPageList(Page<EamReportRepairDto> page, @Param(Constants.WRAPPER) QueryWrapper<EamReportRepairDto> queryWrapper); |
| | | |
| | | /** |
| | | * å表æ¥è¯¢ |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | | List<EamReportRepairDto> queryList(@Param(Constants.WRAPPER) QueryWrapper<EamReportRepairDto> queryWrapper); |
| | | } |
| | |
| | | on e.id = ext.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | <select id="echartsList" resultType="org.jeecg.modules.eam.dto.EchartsDto"> |
| | | SELECT COUNT |
| | | ( t.technology_status ) AS "value", |
| | | item.item_text AS "name", |
| | | item.item_value AS "code", |
| | | ( SELECT COUNT ( a.id ) FROM eam_equipment_extend a WHERE a.technology_status IS NOT NULL |
| | | <if test="ids != null and ids != ''"> |
| | | AND a.id IN |
| | | <foreach collection="ids" item="id" index="index" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | ) AS "total", |
| | | concat ( |
| | | round( |
| | | ISNULL ( |
| | | COUNT ( t.id ) / ( SELECT COUNT ( a.id ) FROM eam_equipment_extend a WHERE a.technology_status IS NOT NULL |
| | | <if test="ids != null and ids != ''"> |
| | | AND a.id IN |
| | | <foreach collection="ids" item="id" index="index" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </if>), |
| | | 0 |
| | | ) * 100, |
| | | 2 |
| | | ), |
| | | '%' |
| | | ) AS "percentage" |
| | | FROM |
| | | sys_dict c |
| | | LEFT JOIN sys_dict_item item ON c.id = item.dict_id |
| | | LEFT JOIN eam_equipment_extend t ON t.technology_status = item.item_value |
| | | <if test="ids != null and ids != ''"> |
| | | AND t.id IN |
| | | <foreach collection="ids" item="id" index="index" open="(" close=")" separator=","> |
| | | #{id} |
| | | </foreach> |
| | | </if> |
| | | WHERE |
| | | c.dict_code = 'equipment_technology_status' |
| | | GROUP BY |
| | | item.item_text, |
| | | t.technology_status, |
| | | item.item_value |
| | | ORDER BY |
| | | item.item_value |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.EamFactorySecondMaintPlanMapper"> |
| | | |
| | | </mapper> |
| | |
| | | and aar.del_flag=0 |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | <select id="queryList" resultType="org.jeecg.modules.eam.dto.EamReportRepairDto"> |
| | | select wmo.*, e.equipment_code, e.equipment_name,e.equipment_model, e.installation_position, |
| | | aar.operation_certificate, power_off_restart, batch_first_piece, variable_factors, |
| | | variable_factors_value, execute_nc, accident_phenomenon, measure, causing_results |
| | | from eam_report_repair wmo |
| | | inner join eam_equipment e |
| | | on wmo.equipment_id = e.id |
| | | and e.del_flag=0 |
| | | left join eam_report_accidents_register aar |
| | | on wmo.id = aar.report_id |
| | | and aar.del_flag=0 |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.eam.dto.EchartsDto; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.request.EamEquipmentQuery; |
| | |
| | | * è·åå¯çæä¸ä¿å·¥åç设å¤å表 |
| | | */ |
| | | List<EamEquipment> selectThreeMaintenanceEquipmentList(); |
| | | |
| | | /** |
| | | * 设å¤ç®¡çé¦é¡µ-ææ¯ç¶æ |
| | | * @return |
| | | */ |
| | | List<EchartsDto> echartsList(); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import org.jeecg.modules.eam.entity.EamFactorySecondMaintPlan; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | /** |
| | | * @Description: âé¦é¡µè½¦é´äºä¿è®¡å |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-08-22 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IEamFactorySecondMaintPlanService extends IService<EamFactorySecondMaintPlan> { |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.dto.EamReportRepairDto; |
| | | import org.jeecg.modules.eam.dto.EchartsDto; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.request.EamReportRepairQuery; |
| | | import org.jeecg.modules.eam.request.EamReportRepairRequest; |
| | |
| | | */ |
| | | EamReportRepair reportRepairFromThirdMaintenance(String equipmentId, String reportUser, List<EamThirdMaintenanceOrderDetail> detailList); |
| | | |
| | | /** |
| | | * 设å¤ç®¡çé¦é¡µ-è®¾å¤æ¥ä¿®æ
éæ
åµ |
| | | * @return |
| | | */ |
| | | List<EchartsDto> reportRepairList(); |
| | | } |
| | |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; |
| | | import org.jeecg.modules.eam.constant.*; |
| | | import org.jeecg.modules.eam.dto.EchartsDto; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamEquipmentExtend; |
| | | import org.jeecg.modules.eam.mapper.EamEquipmentMapper; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 设å¤ç®¡çé¦é¡µ-ææ¯ç¶æ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<EchartsDto> echartsList(){ |
| | | QueryWrapper<EamEquipment> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("e.del_flag", CommonConstant.DEL_FLAG_0); |
| | | //ç¨æ·æ°æ®æé |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | return null; |
| | | } |
| | | if (StringUtils.isNotBlank(sysUser.getEamEquipmentIds())) { |
| | | //éæ©äºè®¾å¤ï¼æ ¹æ®è®¾å¤idè¿æ»¤è®¾å¤ |
| | | List<String> equipArr = Arrays.asList(sysUser.getEamEquipmentIds().split(",")); |
| | | queryWrapper.in("e.equipment_code", equipArr); |
| | | } else { |
| | | //没æéæ©è®¾å¤ï¼æ ¹æ®ä¸å¿è¿æ»¤è®¾å¤ |
| | | List<BaseFactoryUser> baseFactoryUserList=baseFactoryUserService. |
| | | list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId,sysUser.getId())); |
| | | if(!CollectionUtils.isEmpty(baseFactoryUserList)){ |
| | | Set<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toSet()); |
| | | Set<String> factoryCode= baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); |
| | | queryWrapper.in("e.factory_org_code", factoryCode); |
| | | }else { |
| | | return null; |
| | | } |
| | | } |
| | | List<String> ids=this.baseMapper.queryList(queryWrapper).stream().map(EamEquipment::getId).collect(Collectors.toList()); |
| | | return this.baseMapper.echartsList(ids); |
| | | } |
| | | |
| | | /** |
| | | * è·åææç产线idï¼å
嫿æä¸çº§ï¼ |
| | | */ |
| | | private void getAllProductionIds(List<MdcProduction> productionList, String productionId, List<String> allProductionIds) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import org.jeecg.modules.eam.entity.EamFactorySecondMaintPlan; |
| | | import org.jeecg.modules.eam.mapper.EamFactorySecondMaintPlanMapper; |
| | | import org.jeecg.modules.eam.service.IEamFactorySecondMaintPlanService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | /** |
| | | * @Description: âé¦é¡µè½¦é´äºä¿è®¡å |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-08-22 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class EamFactorySecondMaintPlanServiceImpl extends ServiceImpl<EamFactorySecondMaintPlanMapper, EamFactorySecondMaintPlan> implements IEamFactorySecondMaintPlanService { |
| | | |
| | | } |
| | |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; |
| | | import org.jeecg.modules.eam.constant.*; |
| | | import org.jeecg.modules.eam.dto.EamRepairOrderDto; |
| | | import org.jeecg.modules.eam.dto.EamReportRepairDto; |
| | | import org.jeecg.modules.eam.dto.EchartsDto; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.mapper.EamReportRepairMapper; |
| | | import org.jeecg.modules.eam.request.EamReportRepairQuery; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | eamEquipmentExtendService.updateEquipmentRepairStatus(entity.getEquipmentId(), EquipmentRepairStatus.WAIT_REPAIR.name()); |
| | | return entity; |
| | | } |
| | | |
| | | public List<EchartsDto> reportRepairList() { |
| | | List<EchartsDto> echartsDtoList = new ArrayList<>(); |
| | | |
| | | // ç¨æ·æ°æ®æéæ£æ¥ |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | return echartsDtoList; // è¿å空å表èénull |
| | | } |
| | | |
| | | QueryWrapper<EamReportRepairDto> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("wmo.del_flag", CommonConstant.DEL_FLAG_0); |
| | | |
| | | // 设å¤è¿æ»¤é»è¾ |
| | | if (StringUtils.isNotBlank(sysUser.getEamEquipmentIds())) { |
| | | List<String> equipArr = Arrays.asList(sysUser.getEamEquipmentIds().split(",")); |
| | | queryWrapper.in("e.equipment_code", equipArr); |
| | | } else { |
| | | List<BaseFactoryUser> baseFactoryUserList = baseFactoryUserService |
| | | .list(new LambdaQueryWrapper<BaseFactoryUser>() |
| | | .eq(BaseFactoryUser::getUserId, sysUser.getId())); |
| | | |
| | | if (CollectionUtils.isEmpty(baseFactoryUserList)) { |
| | | return echartsDtoList; // è¿å空å表èénull |
| | | } |
| | | |
| | | Set<String> factoryIds = baseFactoryUserList.stream() |
| | | .map(BaseFactoryUser::getFactoryId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | Set<String> factoryCodes = baseFactoryService.listByIds(factoryIds) |
| | | .stream() |
| | | .map(BaseFactory::getOrgCode) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | queryWrapper.in("e.factory_org_code", factoryCodes); |
| | | } |
| | | |
| | | // è·ååºç¡æ°æ® |
| | | List<EamReportRepairDto> baseList = this.baseMapper.queryList(queryWrapper); |
| | | int totalCount = baseList.size(); |
| | | |
| | | // è·ååæºæ°é |
| | | int shutdownCount = this.baseMapper.queryList( |
| | | queryWrapper.clone().eq("breakdown_flag", "1") |
| | | ).size(); |
| | | |
| | | // 计ç®è¿è¡æ°é |
| | | int runningCount = totalCount - shutdownCount; |
| | | |
| | | // å¤çé¶å¼æ
åµ |
| | | if (totalCount == 0) { |
| | | // æ·»å ææé¶å¼æ°æ®é¡¹ |
| | | addZeroValueData(echartsDtoList, "æ¥ä¿®æ»æ°", "bx"); |
| | | addZeroValueData(echartsDtoList, "åæºæ»æ°", "stop"); |
| | | addZeroValueData(echartsDtoList, "è¿è¡æ»æ°", "run"); |
| | | return echartsDtoList; |
| | | } |
| | | |
| | | // 计ç®ç¾åæ¯ |
| | | BigDecimal total = new BigDecimal(totalCount); |
| | | String bxPercentage = calculatePercentage(totalCount, BigDecimal.valueOf(totalCount)); |
| | | String stopPercentage = calculatePercentage(shutdownCount, BigDecimal.valueOf(totalCount)); |
| | | String runPercentage = calculatePercentage(runningCount, BigDecimal.valueOf(totalCount)); |
| | | |
| | | // æå»ºè¿åæ°æ® |
| | | echartsDtoList.add(createEchartsDto("æ¥ä¿®æ»æ°", "bx", totalCount, bxPercentage)); |
| | | echartsDtoList.add(createEchartsDto("åæºæ»æ°", "stop", shutdownCount, stopPercentage)); |
| | | echartsDtoList.add(createEchartsDto("è¿è¡æ»æ°", "run", runningCount, runPercentage)); |
| | | |
| | | return echartsDtoList; |
| | | } |
| | | |
| | | // è¾
婿¹æ³ï¼æ·»å é¶å¼æ°æ® |
| | | private void addZeroValueData(List<EchartsDto> list, String name, String code) { |
| | | EchartsDto dto = new EchartsDto(); |
| | | dto.setName(name); |
| | | dto.setCode(code); |
| | | dto.setValue("0"); |
| | | dto.setPercentage("0.00%"); |
| | | list.add(dto); |
| | | } |
| | | |
| | | // è¾
婿¹æ³ï¼è®¡ç®ç¾åæ¯ |
| | | private String calculatePercentage(int value, BigDecimal total) { |
| | | return new BigDecimal(value) |
| | | .multiply(new BigDecimal(100)) |
| | | .divide(total, 2, RoundingMode.HALF_UP) + "%"; |
| | | } |
| | | |
| | | // è¾
婿¹æ³ï¼å建EchartsDto对象 |
| | | private EchartsDto createEchartsDto(String name, String code, int value, String percentage) { |
| | | EchartsDto dto = new EchartsDto(); |
| | | dto.setName(name); |
| | | dto.setCode(code); |
| | | dto.setValue(String.valueOf(value)); |
| | | dto.setPercentage(percentage); |
| | | return dto; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | 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.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.entity.EamFactorySecondMaintPlan; |
| | | import org.jeecg.modules.eam.service.IEamFactorySecondMaintPlanService; |
| | | import java.util.Date; |
| | | 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.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.entity.ImportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import com.alibaba.fastjson.JSON; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | |
| | | /** |
| | | * @Description: âé¦é¡µè½¦é´äºä¿è®¡å |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-08-22 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags="âé¦é¡µè½¦é´äºä¿è®¡å") |
| | | @RestController |
| | | @RequestMapping("/eam/eamFactorySecondMaintPlan") |
| | | public class EamFactorySecondMaintPlanController extends JeecgController<EamFactorySecondMaintPlan, IEamFactorySecondMaintPlanService> { |
| | | @Autowired |
| | | private IEamFactorySecondMaintPlanService eamFactorySecondMaintPlanService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param eamFactorySecondMaintPlan |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "âé¦é¡µè½¦é´äºä¿è®¡å-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="âé¦é¡µè½¦é´äºä¿è®¡å-å页å表æ¥è¯¢", notes="âé¦é¡µè½¦é´äºä¿è®¡å-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> queryPageList(EamFactorySecondMaintPlan eamFactorySecondMaintPlan, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<EamFactorySecondMaintPlan> queryWrapper = QueryGenerator.initQueryWrapper(eamFactorySecondMaintPlan, req.getParameterMap()); |
| | | Page<EamFactorySecondMaintPlan> page = new Page<EamFactorySecondMaintPlan>(pageNo, pageSize); |
| | | IPage<EamFactorySecondMaintPlan> pageList = eamFactorySecondMaintPlanService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param eamFactorySecondMaintPlan |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "âé¦é¡µè½¦é´äºä¿è®¡å-æ·»å ") |
| | | @ApiOperation(value="âé¦é¡µè½¦é´äºä¿è®¡å-æ·»å ", notes="âé¦é¡µè½¦é´äºä¿è®¡å-æ·»å ") |
| | | @PostMapping(value = "/add") |
| | | public Result<?> add(@RequestBody EamFactorySecondMaintPlan eamFactorySecondMaintPlan) { |
| | | eamFactorySecondMaintPlanService.save(eamFactorySecondMaintPlan); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param eamFactorySecondMaintPlan |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "âé¦é¡µè½¦é´äºä¿è®¡å-ç¼è¾") |
| | | @ApiOperation(value="âé¦é¡µè½¦é´äºä¿è®¡å-ç¼è¾", notes="âé¦é¡µè½¦é´äºä¿è®¡å-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<?> edit(@RequestBody EamFactorySecondMaintPlan eamFactorySecondMaintPlan) { |
| | | eamFactorySecondMaintPlanService.updateById(eamFactorySecondMaintPlan); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "âé¦é¡µè½¦é´äºä¿è®¡å-éè¿idå é¤") |
| | | @ApiOperation(value="âé¦é¡µè½¦é´äºä¿è®¡å-éè¿idå é¤", notes="âé¦é¡µè½¦é´äºä¿è®¡å-éè¿idå é¤") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<?> delete(@RequestParam(name="id",required=true) String id) { |
| | | eamFactorySecondMaintPlanService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "âé¦é¡µè½¦é´äºä¿è®¡å-æ¹éå é¤") |
| | | @ApiOperation(value="âé¦é¡µè½¦é´äºä¿è®¡å-æ¹éå é¤", notes="âé¦é¡µè½¦é´äºä¿è®¡å-æ¹éå é¤") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.eamFactorySecondMaintPlanService.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<?> queryById(@RequestParam(name="id",required=true) String id) { |
| | | EamFactorySecondMaintPlan eamFactorySecondMaintPlan = eamFactorySecondMaintPlanService.getById(id); |
| | | return Result.OK(eamFactorySecondMaintPlan); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param eamFactorySecondMaintPlan |
| | | */ |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, EamFactorySecondMaintPlan eamFactorySecondMaintPlan) { |
| | | return super.exportXls(request, eamFactorySecondMaintPlan, EamFactorySecondMaintPlan.class, "âé¦é¡µè½¦é´äºä¿è®¡å"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, EamFactorySecondMaintPlan.class); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.eam.dto.EchartsDto; |
| | | import org.jeecg.modules.eam.entity.EamFactorySecondMaintPlan; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IEamFactorySecondMaintPlanService; |
| | | import org.jeecg.modules.eam.service.IEamReportRepairService; |
| | | import org.jeecg.modules.eam.service.IEamThirdMaintenanceOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author Lyh |
| | | * @Description: EAMé¦é¡µæ¥å£ |
| | | * @date 2024/3/13 14:27 |
| | | */ |
| | | @Slf4j |
| | | @Api(tags = "EAMé¦é¡µæ¥å£") |
| | | @RestController |
| | | @RequestMapping("/eam/home") |
| | | public class EamHomeController { |
| | | @Autowired |
| | | private IEamEquipmentService iEamEquipmentService; |
| | | |
| | | @Autowired |
| | | private IEamReportRepairService iEamReportRepairService; |
| | | |
| | | @Autowired |
| | | private IEamThirdMaintenanceOrderService iEamThirdMaintenanceOrderService; |
| | | |
| | | @Autowired |
| | | private IEamFactorySecondMaintPlanService iEamFactorySecondMaintPlanService; |
| | | |
| | | /** |
| | | * 设å¤ç®¡çé¦é¡µ-ææ¯ç¶æä¸è®¾å¤æ¥ä¿®æ
éæ
åµ |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "设å¤ç®¡çé¦é¡µ-ææ¯ç¶æä¸è®¾å¤æ¥ä¿®æ
éæ
åµ", notes = "设å¤ç®¡çé¦é¡µ-ææ¯ç¶æä¸è®¾å¤æ¥ä¿®æ
éæ
åµ") |
| | | @GetMapping(value = "/techornology") |
| | | public Result<?> techOrNology() { |
| | | //ææ¯ç¶æ |
| | | List<EchartsDto> echartsDtoList=iEamEquipmentService.echartsList(); |
| | | //è®¾å¤æ¥ä¿®æ
éæ
åµ |
| | | List<EchartsDto> echartsDtoList1=iEamReportRepairService.reportRepairList(); |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("jszt",echartsDtoList); |
| | | map.put("bxqk",echartsDtoList1); |
| | | return Result.ok(map); |
| | | } |
| | | |
| | | /** |
| | | * 设å¤ç®¡çé¦é¡µ-ä¸çº§ä¿å
» |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "设å¤ç®¡çé¦é¡µ-ä¸çº§ä¿å
»", notes = "设å¤ç®¡çé¦é¡µ-ä¸çº§ä¿å
»") |
| | | @GetMapping(value = "/maintenance") |
| | | public Result<?> maintenance() { |
| | | //ä¸çº§ä¿å
» |
| | | List<EchartsDto> echartsDtoList = iEamThirdMaintenanceOrderService.selectList(); |
| | | return Result.ok(echartsDtoList); |
| | | } |
| | | |
| | | /** |
| | | * 设å¤ç®¡çé¦é¡µ-äºä¿å表 |
| | | * @param |
| | | */ |
| | | @ApiOperation(value = "设å¤ç®¡çé¦é¡µ-äºä¿å表", notes = "设å¤ç®¡çé¦é¡µ-äºä¿å表") |
| | | @GetMapping(value = "/secondmaintenance") |
| | | public Result<?> secondmaintenance() { |
| | | //äºçº§ä¿å
» |
| | | List<EamFactorySecondMaintPlan> echartsDtoList = iEamFactorySecondMaintPlanService.list(); |
| | | return Result.ok(echartsDtoList); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * @Author: Lius |
| | | * @CreateTime: 2025-07-29 |
| | | * @Description: ä¸ä¿å·¥åéå® |
| | | * @Description: ä¸ä¿å·¥åçæ |
| | | */ |
| | | @Component |
| | | @Slf4j |
| | |
| | | |
| | | /** |
| | | * å表æ¥è¯¢ |
| | | */ |
| | | List<EamThirdMaintenanceOrder> queryAsList(@Param(Constants.WRAPPER) QueryWrapper<EamThirdMaintenanceOrder> queryWrapper); |
| | | |
| | | /** |
| | | * å表æ¥è¯¢ |
| | | * @param queryWrapper |
| | | * @return |
| | | */ |
| | |
| | | LEFT JOIN eam_base_factory f ON f.org_code = SUBSTRING ( e.factory_org_code , 1, 6 ) |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | <select id="queryAsList" resultType="org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder"> |
| | | select wmo.*, e.equipment_code, e.equipment_name, e.equipment_model,f.process_instance_id as 'procInstId', |
| | | f.process_definition_key, |
| | | f.process_definition_id, |
| | | f.process_instance_id |
| | | from eam_third_maintenance_order wmo |
| | | inner join eam_equipment e |
| | | on wmo.equipment_id = e.id |
| | | left join flow_my_business f on f.data_id=wmo.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.eam.dto.EamThirdMaintenanceOrderExport; |
| | | import org.jeecg.modules.eam.dto.EamThirdMaintenanceOrderExportYj; |
| | | import org.jeecg.modules.eam.dto.EchartsDto; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.jeecg.modules.eam.request.EamThirdMaintenanceQuery; |
| | |
| | | * æ¹éæå°å 工设å¤ä¸çº§ä¿å
»éªæ¶å |
| | | */ |
| | | List<EamThirdMaintenanceOrderExport> exportAcceptance(String ids); |
| | | |
| | | /** |
| | | * 设å¤ç®¡çé¦é¡µ-ä¸ä¿è®¡å |
| | | * @return |
| | | */ |
| | | List<EchartsDto> selectList(); |
| | | } |
| | |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.constant.DataBaseConstant; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.DictModel; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.StrUtils; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | |
| | | import org.jeecg.modules.eam.dto.EamThirdMaintenanceOrderExport; |
| | | import org.jeecg.modules.eam.dto.EamThirdMaintenanceOrderExport; |
| | | import org.jeecg.modules.eam.dto.EamThirdMaintenanceOrderExportYj; |
| | | import org.jeecg.modules.eam.dto.EchartsDto; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.mapper.EamThirdMaintenanceOrderMapper; |
| | | import org.jeecg.modules.eam.request.EamThirdMaintenanceBaseResponse; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDate; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 设å¤ç®¡çé¦é¡µ-ä¸ä¿è®¡å |
| | | * @return |
| | | * */ |
| | | @Override |
| | | public List<EchartsDto> selectList() { |
| | | List<EchartsDto> echartsDtos = new ArrayList<>(); |
| | | |
| | | // ç¨æ·æ°æ®æéæ£æ¥ |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | return echartsDtos; // è¿å空å表èénull |
| | | } |
| | | |
| | | QueryWrapper<EamThirdMaintenanceOrder> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | // 设å¤è¿æ»¤é»è¾ |
| | | if (StringUtils.isNotBlank(sysUser.getEamEquipmentIds())) { |
| | | List<String> equipArr = Arrays.asList(sysUser.getEamEquipmentIds().split(",")); |
| | | queryWrapper.in("e.equipment_code", equipArr); |
| | | } else { |
| | | List<BaseFactoryUser> baseFactoryUserList = baseFactoryUserService |
| | | .list(new LambdaQueryWrapper<BaseFactoryUser>() |
| | | .eq(BaseFactoryUser::getUserId, sysUser.getId())); |
| | | |
| | | if (CollectionUtils.isEmpty(baseFactoryUserList)) { |
| | | return echartsDtos; // è¿å空å表èénull |
| | | } |
| | | |
| | | Set<String> factoryIds = baseFactoryUserList.stream() |
| | | .map(BaseFactoryUser::getFactoryId) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | Set<String> factoryCodes = baseFactoryService.listByIds(factoryIds) |
| | | .stream() |
| | | .map(BaseFactory::getOrgCode) |
| | | .collect(Collectors.toSet()); |
| | | |
| | | queryWrapper.in("e.factory_org_code", factoryCodes); |
| | | } |
| | | |
| | | // è·åå½åå¹´æåä¸ä¸¤ä¸ªæçå¹´æå符串 |
| | | String currentYearMonth = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM")); |
| | | String nextMonth = LocalDate.now().plusMonths(1).format(DateTimeFormatter.ofPattern("yyyy-MM")); |
| | | String nextNextMonth = LocalDate.now().plusMonths(2).format(DateTimeFormatter.ofPattern("yyyy-MM")); |
| | | |
| | | // ä»åå
¸è¡¨è·åé
ç½®å¼ |
| | | String bysbjh = sysDictService.queryEnableDictItemsByCode("eam_home_third_number_bysbzs").get(0).getValue(); |
| | | String bywc = sysDictService.queryEnableDictItemsByCode("eam_home_third_number_bwc").get(0).getValue(); |
| | | String xysb = sysDictService.queryEnableDictItemsByCode("eam_home_third_number_xysb").get(0).getValue(); |
| | | String xxysb = sysDictService.queryEnableDictItemsByCode("eam_home_third_number_xxysb").get(0).getValue(); |
| | | |
| | | // æ¬æä¸ä¿è®¡åæ»æ° |
| | | if ("0".equals(bysbjh)) { |
| | | List<EamThirdMaintenanceOrder> currentMonthOrders = this.baseMapper.queryAsList( |
| | | queryWrapper.clone().like("maintenance_date", currentYearMonth) |
| | | ); |
| | | echartsDtos.add(new EchartsDto("bysbzs", "æ¬æä¸ä¿è®¡åæ»æ°", |
| | | String.valueOf(currentMonthOrders.size()), null, null)); |
| | | } else { |
| | | echartsDtos.add(new EchartsDto("bysbzs", "æ¬æä¸ä¿è®¡åæ»æ°", |
| | | bysbjh, null, null)); |
| | | } |
| | | |
| | | // æ¬æå®æ |
| | | if ("0".equals(bywc)) { |
| | | List<EamThirdMaintenanceOrder> currentMonthCompleted = this.baseMapper.queryAsList( |
| | | queryWrapper.clone().like("maintenance_date", currentYearMonth) |
| | | .eq("maintenance_status", ThirdMaintenanceStatusEnum.COMPLETE.name()) |
| | | ); |
| | | echartsDtos.add(new EchartsDto("bwc", "æ¬æå®æ", |
| | | String.valueOf(currentMonthCompleted.size()), null, null)); |
| | | } else { |
| | | echartsDtos.add(new EchartsDto("bwc", "æ¬æå®æ", |
| | | bywc, null, null)); |
| | | } |
| | | |
| | | // 䏿ä¸ä¿è®¡å |
| | | if ("0".equals(xysb)) { |
| | | List<EamThirdMaintenanceOrder> nextMonthOrders = this.baseMapper.queryAsList( |
| | | queryWrapper.clone().like("maintenance_date", nextMonth) |
| | | ); |
| | | echartsDtos.add(new EchartsDto("xysb", "䏿ä¸ä¿è®¡å", |
| | | String.valueOf(nextMonthOrders.size()), null, null)); |
| | | } else { |
| | | echartsDtos.add(new EchartsDto("xysb", "䏿ä¸ä¿è®¡å", |
| | | xysb, null, null)); |
| | | } |
| | | |
| | | // ä¸ä¸æä¸ä¿è®¡å |
| | | if ("0".equals(xxysb)) { |
| | | List<EamThirdMaintenanceOrder> nextNextMonthOrders = this.baseMapper.queryAsList( |
| | | queryWrapper.clone().like("maintenance_date", nextNextMonth) |
| | | ); |
| | | echartsDtos.add(new EchartsDto("xxysb", "ä¸ä¸æä¸ä¿è®¡å", |
| | | String.valueOf(nextNextMonthOrders.size()), null, null)); |
| | | } else { |
| | | echartsDtos.add(new EchartsDto("xxysb", "ä¸ä¸æä¸ä¿è®¡å", |
| | | xxysb, null, null)); |
| | | } |
| | | |
| | | return echartsDtos; |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°å·¥åç¶æ |
| | | */ |
| | | private void updateOrderStatus(Result result, EamThirdMaintenanceRequest request, EamThirdMaintenanceOrder order, LoginUser user) { |