Explorar o código

Merge remote-tracking branch 'origin/master' into master

laoyao %!s(int64=3) %!d(string=hai) anos
pai
achega
8cb2ca52f1

+ 1 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/dao/MaintenanceLogMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.github.zuihou.base.mapper.SuperMapper;
+import com.github.zuihou.business.productionResourceCenter.dto.MaintenanceLogPageDTO;
 import com.github.zuihou.business.productionResourceCenter.entity.MaintenanceLog;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;

+ 18 - 3
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionResourceCenter/MaintenceLogMapper.xml

@@ -20,14 +20,29 @@
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
         id,create_time,create_user,update_time,update_user,
-        repair_id,maintenance_time,maintenance_user,maintenance_name, status,remark
+        repair_id,maintenance_time,maintenance_user,maintenance_name, status,remark,code,resresourceName,productlineName
     </sql>
 
     <!-- 分页 -->
-    <select id="pageList" resultMap="BaseResultMap">
+    <select id="pageList" resultMap="BaseResultMap" >
         select
         <include refid="Base_Column_List"/>
-        from imcs_tenant_maintenance_log s ${ew.customSqlSegment}
+        from (
+            SELECT
+                itml.*,
+                itp.code,
+                itp.name AS resresourceName,
+                izz.name AS productlineName
+                FROM imcs_tenant_maintenance_log itml,
+                imcs_tenant_repair itr,
+                imcs_z_zone_productionresource izzp,
+                imcs_z_zone izz,
+                imcs_tenant_productionresource itp
+            WHERE itml.repair_id = itr.id
+            AND itr.productionresource_id = izzp.resource_id
+            AND izzp.zone_id = izz.id
+            AND izzp.resource_id = itp.id
+        ) s ${ew.customSqlSegment}
     </select>
 
 

+ 10 - 4
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionResourceCenter/RepairMapper.xml

@@ -50,11 +50,17 @@
         (timestampdiff( SECOND, now(), a.repair_end_time ) <![CDATA[ <= ]]> 0,1,0) AS expireFlag,
         b.CODE,
         b.NAME AS productionresourceName,
-        c.NAME AS lineDesc
+        izz.id as productionLineId,
+        izz.NAME AS lineDesc
         FROM
-        zuihou_base_yj_0000.imcs_tenant_repair a
-        LEFT JOIN zuihou_base_yj_0000.imcs_tenant_productionresource b ON a.productionresource_id = b.id
-        LEFT JOIN zuihou_base_yj_0000.imcs_tenant_productionline c ON b.productionline_id = c.id
+        zuihou_base_yj_0000.imcs_tenant_repair a,
+        imcs_z_zone_productionresource izzp,
+        imcs_z_zone izz,
+        imcs_tenant_productionresource b
+         where 1=1
+         and  a.productionresource_id = b.id
+         and  a.productionresource_id = izzp.resource_id
+         and  izzp.zone_id = izz.id
         ) s ${ew.customSqlSegment}
     </select>
 

+ 1 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/RepairController.java

@@ -50,6 +50,7 @@ public class RepairController extends SuperController<RepairService,Long, Repair
         LbqWrapper<Repair> wrapper = wrap.lambda();
         wrap.like(StringUtils.isNotEmpty(data.getCode()),"code",data.getCode());
         wrap.like(StringUtils.isNotEmpty(data.getProductionresourceName()),"productionresourceName",data.getProductionresourceName());
+        wrap.eq(null != data.getProductionLineId(),"productionLineId",data.getProductionLineId());
         Repair repair = BeanUtil.toBean(data, Repair.class);
         //Wraps.lbQ(station); 这种写法值 不能和  ${ew.customSqlSegment} 一起使用
         // ${ew.customSqlSegment} 语法一定要手动eq like 等

+ 9 - 2
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/dto/RepairPageDTO.java

@@ -80,7 +80,6 @@ public class RepairPageDTO {
      * 生产资源编号
      */
     @ApiModelProperty(value = "生产资源编号")
-    @TableField(exist=false)
     @Excel(name = "生产资源编号")
     private String code;
 
@@ -88,7 +87,15 @@ public class RepairPageDTO {
      * 生产资源
      */
     @ApiModelProperty(value = "生产资源名称")
-    @TableField(exist=false)
     @Excel(name = "生产资源")
     private String productionresourceName;
+
+    /**
+     * 产线id
+     */
+    @ApiModelProperty(value = "产线id")
+    @TableField(exist = false)
+    @Excel(name = "产线id")
+    private Long productionLineId;
+
 }

+ 21 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/MaintenanceLog.java

@@ -80,4 +80,25 @@ public class MaintenanceLog extends Entity<Long> {
     @TableField(value = "remark", condition = LIKE)
     @Excel(name = "内容")
     private String remark;
+
+    /**
+     * 设备编码
+     */
+    @TableField(exist = false)
+    @Excel(name = "设备编码")
+    private String code;
+
+    /**
+     * 设备编码
+     */
+    @TableField(exist = false)
+    @Excel(name = "设备名称")
+    private String resresourceName;
+
+    /**
+     * 设备编码
+     */
+    @TableField(exist = false)
+    @Excel(name = "产线名称")
+    private String productlineName;
 }

+ 8 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/Repair.java

@@ -116,6 +116,14 @@ public class Repair extends Entity<Long> {
     @Excel(name = "生产资源")
     private String productionresourceName;
 
+    /**
+     * 产线id
+     */
+    @ApiModelProperty(value = "产线id")
+    @TableField(exist = false)
+    @Excel(name = "产线id")
+    private Long productionLineId;
+
     @ApiModelProperty(value = "进度")
     @TableField(exist = false)
     private Double process;