Преглед изворни кода

后台设备页面功能处理

oyq28 пре 2 година
родитељ
комит
1e5de98ff7
12 измењених фајлова са 92 додато и 10 уклоњено
  1. 6 0
      imcs-bt-be/imcs-business-biz/src/main/java/com/github/zuihou/business/productionresource/dao/ProductionTenantResourceMapper.java
  2. 3 0
      imcs-bt-be/imcs-business-biz/src/main/java/com/github/zuihou/business/productionresource/service/ProductionTenantResourceService.java
  3. 8 0
      imcs-bt-be/imcs-business-biz/src/main/java/com/github/zuihou/business/productionresource/service/impl/ProductionTenantResourceServiceImpl.java
  4. 15 3
      imcs-bt-be/imcs-business-biz/src/main/resources/mapper_business/base/productionresource/ProductionresourceMapper.xml
  5. 17 0
      imcs-bt-be/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionresource/ProductionResourceController.java
  6. 7 0
      imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/dto/ProductionResourcePageDTO.java
  7. 25 1
      imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/entity/ProductionResource.java
  8. 2 2
      imcs-bt-be/imcs-tenant-biz/src/main/java/com/github/zuihou/tenant/service/impl/ProductionresourceServiceImpl.java
  9. 2 2
      imcs-bt-be/imcs-tenant-biz/src/main/resources/mapper_tenant/base/defaults/ProductionresourceMapper.xml
  10. 3 1
      imcs-bt-be/imcs-tenant-entity/src/main/java/com/github/zuihou/tenant/dto/ProductionresourcePageDTO.java
  11. 3 0
      imcs-bt-be/imcs-tenant-entity/src/main/java/com/github/zuihou/tenant/dto/ProductionresourceSaveDTO.java
  12. 1 1
      imcs-bt-be/imcs-tenant-entity/src/main/java/com/github/zuihou/tenant/entity/Productionresource.java

+ 6 - 0
imcs-bt-be/imcs-business-biz/src/main/java/com/github/zuihou/business/productionresource/dao/ProductionTenantResourceMapper.java

@@ -1,7 +1,12 @@
 package com.github.zuihou.business.productionresource.dao;
 
 
+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.database.mybatis.auth.DataScope;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import com.github.zuihou.business.productionresource.entity.ProductionResource;
 
@@ -17,4 +22,5 @@ import com.github.zuihou.business.productionresource.entity.ProductionResource;
 @Repository
 public interface ProductionTenantResourceMapper extends SuperMapper<ProductionResource> {
 
+    IPage<ProductionResource> pageList(IPage page, @Param(Constants.WRAPPER) LbqWrapper<ProductionResource> wrapper, DataScope dataScope);
 }

+ 3 - 0
imcs-bt-be/imcs-business-biz/src/main/java/com/github/zuihou/business/productionresource/service/ProductionTenantResourceService.java

@@ -1,7 +1,9 @@
 package com.github.zuihou.business.productionresource.service;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.service.SuperService;
 import com.github.zuihou.business.productionresource.entity.ProductionResource;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 
 /**
  * <p>
@@ -14,4 +16,5 @@ import com.github.zuihou.business.productionresource.entity.ProductionResource;
  */
 public interface ProductionTenantResourceService extends SuperService<ProductionResource> {
 
+    IPage<ProductionResource> pageList(IPage  page, LbqWrapper<ProductionResource> wrapper);
 }

+ 8 - 0
imcs-bt-be/imcs-business-biz/src/main/java/com/github/zuihou/business/productionresource/service/impl/ProductionTenantResourceServiceImpl.java

@@ -1,10 +1,14 @@
 package com.github.zuihou.business.productionresource.service.impl;
 
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.service.SuperServiceImpl;
+import com.github.zuihou.business.classSchedule.entity.AuthUser;
 import com.github.zuihou.business.productionresource.dao.ProductionTenantResourceMapper;
 import com.github.zuihou.business.productionresource.entity.ProductionResource;
 import com.github.zuihou.business.productionresource.service.ProductionTenantResourceService;
+import com.github.zuihou.database.mybatis.auth.DataScope;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 
@@ -21,4 +25,8 @@ import org.springframework.stereotype.Service;
 @Service
 
 public class ProductionTenantResourceServiceImpl extends SuperServiceImpl<ProductionTenantResourceMapper, ProductionResource> implements ProductionTenantResourceService {
+    @Override
+    public IPage<ProductionResource> pageList(IPage page, LbqWrapper<ProductionResource> wrapper) {
+        return baseMapper.pageList(page, wrapper, new DataScope());
+    }
 }

+ 15 - 3
imcs-bt-be/imcs-business-biz/src/main/resources/mapper_business/base/productionresource/ProductionresourceMapper.xml

@@ -1,6 +1,6 @@
 <?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="com.github.zuihou.business.productionresource.dao.ProductionResourceMapper">
+<mapper namespace="com.github.zuihou.business.productionresource.dao.ProductionTenantResourceMapper">
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.github.zuihou.business.productionresource.entity.ProductionResource">
@@ -34,13 +34,25 @@
         <result column="production_no" jdbcType="VARCHAR" property="productionNo"/>
         <result column="manufacturer" jdbcType="VARCHAR" property="manufacturer"/>
         <result column="program_num" jdbcType="INTEGER" property="programNum"/>
-        <result column="advUrl" jdbcType="VARCHAR" property="advUrl"/>
+        <result column="adv_url" jdbcType="VARCHAR" property="advUrl"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id,create_time,create_user,update_time,update_user,
+        id,create_time,create_user,update_time,update_user,adv_url,place_id,lineDesc,placeName,
         compnay_id, module_id, area_id, name, resources_category, code, status, online_status, remark, ip, port, GATHER_TASK_ID, income_today, exception_order_num, cache_storge_num, max_speed, capital_no, capital_name, capital_type, mode_specification, capital_price, production_date, production_no, manufacturer, program_num
     </sql>
 
+    <select id="pageList" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>, longtitude,latitude,areaIds,tenantDesc,pic, category
+        from (
+        SELECT
+        a.*,b.label as lineDesc,v.longtitude,v.latitude,v.pic,v.category,v.tenantDesc,
+        v.areaIds,v.placeName from imcs_tenant_productionresource a
+        left join c_core_org b on a.org_id = b.id
+        left join view_productionresource v on a.id = v.id
+        ) s ${ew.customSqlSegment}
+    </select>
+
 </mapper>

+ 17 - 0
imcs-bt-be/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionresource/ProductionResourceController.java

@@ -1,14 +1,21 @@
 package com.github.zuihou.business.controller.productionresource;
 
+import cn.hutool.core.bean.BeanUtil;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.controller.SuperController;
 
+import com.github.zuihou.base.request.PageParams;
+import com.github.zuihou.business.member.dto.MemberPageDTO;
+import com.github.zuihou.business.member.entity.Member;
 import com.github.zuihou.business.productionresource.dto.ProductionResourcePageDTO;
 import com.github.zuihou.business.productionresource.dto.ProductionResourceSaveDTO;
 import com.github.zuihou.business.productionresource.dto.ProductionResourceUpdateDTO;
 import com.github.zuihou.business.productionresource.entity.ProductionResource;
 import com.github.zuihou.business.productionresource.service.ProductionTenantResourceService;
+import com.github.zuihou.context.BaseContextHandler;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
 import com.github.zuihou.security.annotation.PreAuth;
 import com.github.zuihou.tenant.entity.Productionresource;
@@ -59,6 +66,16 @@ public class ProductionResourceController extends SuperController<ProductionTena
         return R.success(baseService.saveBatch(productionResourceList));
     }
 
+    @Override
+    public void query(PageParams<ProductionResourcePageDTO> params, IPage<ProductionResource> page, Long defSize) {
+        ProductionResourcePageDTO data = params.getModel();
+        ProductionResource model = BeanUtil.toBean(data, ProductionResource.class);
+        QueryWrap<ProductionResource> wrap = this.handlerWrapper(null, params);
+        LbqWrapper<ProductionResource> wrapper = wrap.lambda();
+        wrapper.like(ProductionResource::getName, model.getName()).like(ProductionResource::getStatus, model.getStatus()).eq(ProductionResource::getOnlineStatus, model.getOnlineStatus()).orderByDesc(ProductionResource::getCreateTime);
+        baseService.pageList(page, wrapper);
+    }
+
 
     @PostMapping("/updateStatus")
     public R<Integer> updateStatus(@RequestBody Map<String, Object> paramMap) {

+ 7 - 0
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/dto/ProductionResourcePageDTO.java

@@ -1,5 +1,6 @@
 package com.github.zuihou.business.productionresource.dto;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.*;
@@ -173,4 +174,10 @@ public class ProductionResourcePageDTO implements Serializable {
     @Length(max = 255, message = "设备图片长度不能超过255")
     private String imgUrl;
 
+    @ApiModelProperty(value = "场地")
+    private Long placeId;
+
+    @ApiModelProperty(value = "区域地址")
+    private String areaIds;
+
 }

+ 25 - 1
imcs-bt-be/imcs-business-entity/src/main/java/com/github/zuihou/business/productionresource/entity/ProductionResource.java

@@ -59,7 +59,7 @@ public class ProductionResource extends Entity<Long> {
      */
     @ApiModelProperty(value = "广告url")
     @Length(max = 32, message = "广告url")
-    @TableField(value = "advUrl", condition = LIKE)
+    @TableField(value = "adv_url", condition = LIKE)
     @Excel(name = "广告url")
     private String advUrl;
 
@@ -266,6 +266,13 @@ public class ProductionResource extends Entity<Long> {
     @Excel(name = "设备图片")
     private String imgUrl;
 
+    /**
+     * 运维人员
+     */
+    @ApiModelProperty(value = "场地ID")
+    @TableField(value = "place_id", condition = EQUAL)
+    @Excel(name = "场地ID")
+    private Long placeId;
 
     /**
      * 运维人员
@@ -275,8 +282,25 @@ public class ProductionResource extends Entity<Long> {
     @Excel(name = "运维人员")
     private Long opsUserId;
 
+    @ApiModelProperty(value = "区域地址")
+    @TableField(exist=false)
+    private String areaIds;
+
+    @ApiModelProperty(value = "场地名称")
+    @TableField(exist=false)
+    private String placeName;
+
+    @ApiModelProperty(value = "部门名称")
+    @TableField(exist=false)
+    private String lineDesc;
 
+    @ApiModelProperty(value = "企业名称")
+    @TableField(exist=false)
+    private String tenantDesc;
 
+    @ApiModelProperty(value = "模型图片")
+    @TableField(exist=false)
+    private String pic;
 
     @Builder
     public ProductionResource(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser,

+ 2 - 2
imcs-bt-be/imcs-tenant-biz/src/main/java/com/github/zuihou/tenant/service/impl/ProductionresourceServiceImpl.java

@@ -300,11 +300,11 @@ public class ProductionresourceServiceImpl extends SuperCacheServiceImpl<Product
 
         String sql = "INSERT INTO "+tableName+"" +
                 "(id, tenant_id, productionline_id, box_id, type,  module_id, name, code, status, " +
-                "online_status, remark, create_time, create_user, resources_type,ip,port,place_id)" +
+                "online_status, remark, create_time, create_user, resources_type,ip,port,place_id,org_id,adv_url)" +
                 "VALUES("+bean.getId()+", "+bean.getTenantId()+", "+bean.getProductionlineId()+", "+bean.getBoxId()+", '"+bean.getType().getKey()+"'," +
                 "  '"+bean.getModuleId()+"', '"+bean.getName()+"', '"+bean.getCode()+"', '"+bean.getStatus()+"', '"+1+"', " +
                 "'"+bean.getRemark()+"', '"+bean.getCreateTime()+"', "+bean.getCreateUser()+", '"+bean.getResourcesType()+"','"+ip+"'," +
-                "'"+port+"',"+ bean.getPlaceId() +")";
+                "'"+port+"',"+ bean.getPlaceId() +","+bean.getOrgId()+",'"+bean.getAdvUrl()+"')";
         baseMapper.createDynTable(sql);
     }
 

+ 2 - 2
imcs-bt-be/imcs-tenant-biz/src/main/resources/mapper_tenant/base/defaults/ProductionresourceMapper.xml

@@ -24,14 +24,14 @@
         <result column="port" jdbcType="VARCHAR" property="port"/>
         <result column="place_id" jdbcType="VARCHAR" property="placeId"/>
         <result column="org_id" jdbcType="VARCHAR" property="orgId"/>
-        <result column="advUrl" jdbcType="VARCHAR" property="advUrl"/>
+        <result column="adv_url" jdbcType="VARCHAR" property="advUrl"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
         id,create_time,create_user,update_time,update_user,
         tenant_id, productionline_id, box_id, type, category, module_id, name, code, status, remark, resources_type,resources_category,lineDesc,moduleDesc,tenantDesc,pic,
-        ip,port,place_id,org_id,advUrl
+        ip,port,place_id,org_id,adv_url
     </sql>
 
     <!-- 分页 -->

+ 3 - 1
imcs-bt-be/imcs-tenant-entity/src/main/java/com/github/zuihou/tenant/dto/ProductionresourcePageDTO.java

@@ -196,9 +196,11 @@ public class ProductionresourcePageDTO implements Serializable {
     private Long placeId;
 
     @ApiModelProperty(value = "区域地址")
-    @TableField(exist=false)
     private String areaIds;
 
+    @ApiModelProperty(value = "场地名称")
+    private String placeName;
+
     @ApiModelProperty(value = "区域经度")
     @TableField(exist=false)
     private String longtitude;

+ 3 - 0
imcs-bt-be/imcs-tenant-entity/src/main/java/com/github/zuihou/tenant/dto/ProductionresourceSaveDTO.java

@@ -112,6 +112,9 @@ public class ProductionresourceSaveDTO implements Serializable {
     @ApiModelProperty(value = "场地")
     private Long placeId;
 
+    @ApiModelProperty(value = "广告地址")
+    private String advUrl;
+
     /**
      * 资产编号
      */

+ 1 - 1
imcs-bt-be/imcs-tenant-entity/src/main/java/com/github/zuihou/tenant/entity/Productionresource.java

@@ -273,7 +273,7 @@ public class Productionresource extends Entity<Long> {
      * 广告地址
      */
     @ApiModelProperty(value = "广告地址")
-    @TableField(value = "advUrl", condition = LIKE)
+    @TableField(value = "adv_url", condition = LIKE)
     @Excel(name = "广告地址")
     private String advUrl;