Explorar o código

完成设备业务功能中的详细配置模块

oyq28 %!s(int64=3) %!d(string=hai) anos
pai
achega
d782dc72e8

+ 2 - 2
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/constant/BizConstant.java

@@ -46,9 +46,9 @@ public interface BizConstant {
     /**
      * 基础库
      */
-    String BASE_DATABASE = "zuihou_base";
+    String BASE_DATABASE = "zuihou_base_yj";
 
-    String DETAULTS_DATABASE = "zuihou_defaults";
+    String DETAULTS_DATABASE = "zuihou_defaults_yj";
 
 
     /**

+ 1 - 1
imcs-admin-boot/imcs-tenant-biz/src/main/java/com/github/zuihou/tenant/dao/ProductionresourceviewMapper.java

@@ -23,7 +23,7 @@ import java.util.Map;
 @Repository
 public interface ProductionresourceviewMapper extends SuperMapper<Productionresource> {
 
-    List<Map>getList(Map map);
+    List<Map> getList(Map map);
 
 
     int getCount(Map map);

+ 5 - 0
imcs-admin-boot/imcs-tenant-biz/src/main/java/com/github/zuihou/tenant/service/ProductionresourceService.java

@@ -60,6 +60,11 @@ public interface ProductionresourceService extends SuperCacheService<Productionr
      */
     Productionresource updateHardware(ProductionresourceUpdateDTO data);
 
+    /**
+     * 修改
+     */
+    Productionresource updateConf(Productionresource data);
+
     /**
      * 根据编码获取
      *

+ 20 - 2
imcs-admin-boot/imcs-tenant-biz/src/main/java/com/github/zuihou/tenant/service/impl/ProductionresourceServiceImpl.java

@@ -1,7 +1,6 @@
 package com.github.zuihou.tenant.service.impl;
 
 import cn.hutool.core.collection.CollectionUtil;
-import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONObject;
@@ -20,7 +19,10 @@ import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.properties.DatabaseProperties;
 import com.github.zuihou.injection.annonation.InjectionResult;
 import com.github.zuihou.model.RemoteData;
-import com.github.zuihou.tenant.dao.*;
+import com.github.zuihou.tenant.dao.ModuleFieldMapper;
+import com.github.zuihou.tenant.dao.ProductionlineMapper;
+import com.github.zuihou.tenant.dao.ProductionresourceMapper;
+import com.github.zuihou.tenant.dao.ProductionresourceviewMapper;
 import com.github.zuihou.tenant.dto.AArmSaveDTO;
 import com.github.zuihou.tenant.dto.ProductionresourceSaveDTO;
 import com.github.zuihou.tenant.dto.ProductionresourceUpdateDTO;
@@ -843,6 +845,22 @@ public class ProductionresourceServiceImpl extends SuperCacheServiceImpl<Product
         return productionresource;
     }
 
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public Productionresource updateConf(Productionresource productionresource) {
+        updateById(productionresource);
+        String tenantCode = "0000";
+        String tableName = BizConstant.BASE_DATABASE+"_"+tenantCode+"."+"imcs_tenant_productionresource";
+        String sql = "UPDATE "+tableName+" " +
+                "SET capital_no="+productionresource.getCapitalNo()+", capital_name="+productionresource.getCapitalName()+"," +
+                " capital_type="+productionresource.getCapitalType()+", capital_price="+productionresource.getCapitalPrice()+"," +
+                "  mode_specification="+productionresource.getModeSpecification()+", production_no="+productionresource.getProductionNo()+"," +
+                "  production_date="+productionresource.getProductionDate()+", manufacturer="+productionresource.getManufacturer()+
+                " WHERE id= "+productionresource.getId();
+        baseMapper.createDynTable(sql);
+        return productionresource;
+    }
+
     @Override
     @InjectionResult
     public List<Productionresource> getProductionresourceList(Productionresource bean){

+ 9 - 0
imcs-admin-boot/imcs-tenant-biz/src/main/resources/mapper_tenant/base/defaults/ProductionresourceviewMapper.xml

@@ -13,6 +13,15 @@
             v.ip,
             v.port,
             v.module_id moduleId,
+            v.tenant_id tenantId,
+            v.capital_no capitalNo,
+            v.capital_name capitalName,
+            v.capital_type capitalType,
+            v.mode_specification modeSpecification,
+            v.capital_price capitalPrice,
+            v.production_date productionDate,
+            v.production_no  productionNo,
+            v.manufacturer,
             pic,
             name,
             code,

+ 9 - 0
imcs-admin-boot/imcs-tenant-controller/src/main/java/com/github/zuihou/tenant/controller/ProductionresourceController.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.controller.SuperCacheController;
 import com.github.zuihou.base.request.PageParams;
+import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
@@ -106,6 +107,14 @@ public class ProductionresourceController extends SuperCacheController<Productio
         return success(productionresource);
     }
 
+    @ApiOperation(value = "修改详情配置", notes = "修改边缘盒子/生产资源")
+    @PostMapping("/updateConf")
+    public R<Productionresource> updateConf (@RequestBody Productionresource model) {
+        BaseContextHandler.setTenant("0000");
+        Productionresource productionresource = baseService.updateConf(model);
+        return success(productionresource);
+    }
+
     @ApiOperation(value = "修改边缘盒子/生产资源", notes = "修改边缘盒子/生产资源")
     @PostMapping("/updateHardware")
     public R<Productionresource> updateHardware(@RequestBody ProductionresourceUpdateDTO model) {

+ 61 - 0
imcs-admin-boot/imcs-tenant-entity/src/main/java/com/github/zuihou/tenant/dto/ProductionresourcePageDTO.java

@@ -1,6 +1,8 @@
 package com.github.zuihou.tenant.dto;
 
 import java.time.LocalDateTime;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -23,6 +25,8 @@ import lombok.experimental.Accessors;
 import com.github.zuihou.common.constant.DictionaryType;
 import java.io.Serializable;
 
+import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
+
 /**
  * <p>
  * 实体类
@@ -101,6 +105,63 @@ public class ProductionresourcePageDTO implements Serializable {
     @ApiModelProperty(value = "状态(1-启用0-停用)")
     @Length(max = 4, message = "状态(1-启用0-停用)长度不能超过4")
     private String status;
+
+    /**
+     * 资产编号
+     */
+    @ApiModelProperty(value = "资产编号")
+    @Length(max = 32, message = "资产编号长度不能超过32")
+    private String capitalNo;
+
+    /**
+     * 资产名称
+     */
+    @ApiModelProperty(value = "资产名称")
+    @Length(max = 256, message = "资产名称长度不能超过256")
+    private String capitalName;
+
+    /**
+     * 资产类别
+     */
+    @ApiModelProperty(value = "资产类别")
+    @Length(max = 10, message = "资产类别长度不能超过10")
+    private String capitalType;
+
+    /**
+     * 型号规格
+     */
+    @ApiModelProperty(value = "型号规格")
+    @Length(max = 256, message = "型号规格长度不能超过256")
+    private String modeSpecification;
+
+    /**
+     * 资产原值
+     */
+    @ApiModelProperty(value = "资产原值")
+    @Length(max = 256, message = "资产原值长度不能超过256")
+    private String capitalPrice;
+
+    /**
+     * 出厂年月
+     */
+    @ApiModelProperty(value = "出厂年月")
+    @Length(max = 256, message = "出厂年月长度不能超过256")
+    private String productionDate;
+
+    /**
+     * 出厂编号
+     */
+    @ApiModelProperty(value = "出厂编号")
+    @Length(max = 256, message = "出厂编号长度不能超过256")
+    private String productionNo;
+
+    /**
+     * 制造厂家
+     */
+    @ApiModelProperty(value = "制造厂家")
+    @Length(max = 256, message = "出厂编号长度不能超过256")
+    private String manufacturer;
+
     /**
      * 备注
      */

+ 57 - 0
imcs-admin-boot/imcs-tenant-entity/src/main/java/com/github/zuihou/tenant/dto/ProductionresourceSaveDTO.java

@@ -100,6 +100,63 @@ public class ProductionresourceSaveDTO implements Serializable {
     @ApiModelProperty(value = "状态(1-启用0-停用)")
     @Length(max = 4, message = "状态(1-启用0-停用)长度不能超过4")
     private String status;
+
+    /**
+     * 资产编号
+     */
+    @ApiModelProperty(value = "资产编号")
+    @Length(max = 32, message = "资产编号长度不能超过32")
+    private String capitalNo;
+
+    /**
+     * 资产名称
+     */
+    @ApiModelProperty(value = "资产名称")
+    @Length(max = 256, message = "资产名称长度不能超过256")
+    private String capitalName;
+
+    /**
+     * 资产类别
+     */
+    @ApiModelProperty(value = "资产类别")
+    @Length(max = 10, message = "资产类别长度不能超过10")
+    private String capitalType;
+
+    /**
+     * 型号规格
+     */
+    @ApiModelProperty(value = "型号规格")
+    @Length(max = 256, message = "型号规格长度不能超过256")
+    private String modeSpecification;
+
+    /**
+     * 资产原值
+     */
+    @ApiModelProperty(value = "资产原值")
+    @Length(max = 256, message = "资产原值长度不能超过256")
+    private String capitalPrice;
+
+    /**
+     * 出厂年月
+     */
+    @ApiModelProperty(value = "出厂年月")
+    @Length(max = 256, message = "出厂年月长度不能超过256")
+    private String productionDate;
+
+    /**
+     * 出厂编号
+     */
+    @ApiModelProperty(value = "出厂编号")
+    @Length(max = 256, message = "出厂编号长度不能超过256")
+    private String productionNo;
+
+    /**
+     * 制造厂家
+     */
+    @ApiModelProperty(value = "制造厂家")
+    @Length(max = 256, message = "出厂编号长度不能超过256")
+    private String manufacturer;
+
     /**
      * 备注
      */

+ 57 - 0
imcs-admin-boot/imcs-tenant-entity/src/main/java/com/github/zuihou/tenant/dto/ProductionresourceUpdateDTO.java

@@ -106,6 +106,63 @@ public class ProductionresourceUpdateDTO implements Serializable {
     @ApiModelProperty(value = "在线状态(0-离线1-在线2-未激活)")
     @Length(max = 4, message = "在线状态(0-离线1-在线2-未激活)长度不能超过4")
     private String status;
+
+    /**
+     * 资产编号
+     */
+    @ApiModelProperty(value = "资产编号")
+    @Length(max = 32, message = "资产编号长度不能超过32")
+    private String capitalNo;
+
+    /**
+     * 资产名称
+     */
+    @ApiModelProperty(value = "资产名称")
+    @Length(max = 256, message = "资产名称长度不能超过256")
+    private String capitalName;
+
+    /**
+     * 资产类别
+     */
+    @ApiModelProperty(value = "资产类别")
+    @Length(max = 10, message = "资产类别长度不能超过10")
+    private String capitalType;
+
+    /**
+     * 型号规格
+     */
+    @ApiModelProperty(value = "型号规格")
+    @Length(max = 256, message = "型号规格长度不能超过256")
+    private String modeSpecification;
+
+    /**
+     * 资产原值
+     */
+    @ApiModelProperty(value = "资产原值")
+    @Length(max = 256, message = "资产原值长度不能超过256")
+    private String capitalPrice;
+
+    /**
+     * 出厂年月
+     */
+    @ApiModelProperty(value = "出厂年月")
+    @Length(max = 256, message = "出厂年月长度不能超过256")
+    private String productionDate;
+
+    /**
+     * 出厂编号
+     */
+    @ApiModelProperty(value = "出厂编号")
+    @Length(max = 256, message = "出厂编号长度不能超过256")
+    private String productionNo;
+
+    /**
+     * 制造厂家
+     */
+    @ApiModelProperty(value = "制造厂家")
+    @Length(max = 256, message = "出厂编号长度不能超过256")
+    private String manufacturer;
+
     /**
      * 备注
      */

+ 72 - 0
imcs-admin-boot/imcs-tenant-entity/src/main/java/com/github/zuihou/tenant/entity/Productionresource.java

@@ -146,6 +146,78 @@ public class Productionresource extends Entity<Long> {
     @Excel(name = "状态(1-启用0-停用)")
     private String status;
 
+    /**
+     * 资产编号
+     */
+    @ApiModelProperty(value = "资产编号")
+    @Length(max = 32, message = "资产编号长度不能超过32")
+    @TableField(value = "capital_no", condition = LIKE)
+    @Excel(name = "资产编号")
+    private String capitalNo;
+
+    /**
+     * 资产名称
+     */
+    @ApiModelProperty(value = "资产名称")
+    @Length(max = 256, message = "资产名称长度不能超过256")
+    @TableField(value = "capital_name", condition = LIKE)
+    @Excel(name = "资产名称")
+    private String capitalName;
+
+    /**
+     * 资产类别
+     */
+    @ApiModelProperty(value = "资产类别")
+    @Length(max = 10, message = "资产类别长度不能超过10")
+    @TableField(value = "capital_type", condition = LIKE)
+    @Excel(name = "资产名称")
+    private String capitalType;
+
+    /**
+     * 型号规格
+     */
+    @ApiModelProperty(value = "型号规格")
+    @Length(max = 256, message = "型号规格长度不能超过256")
+    @TableField(value = "mode_specification", condition = LIKE)
+    @Excel(name = "型号规格")
+    private String modeSpecification;
+
+    /**
+     * 资产原值
+     */
+    @ApiModelProperty(value = "资产原值")
+    @Length(max = 256, message = "资产原值长度不能超过256")
+    @TableField(value = "capital_price", condition = LIKE)
+    @Excel(name = "资产原值")
+    private String capitalPrice;
+
+    /**
+     * 出厂年月
+     */
+    @ApiModelProperty(value = "出厂年月")
+    @Length(max = 256, message = "出厂年月长度不能超过256")
+    @TableField(value = "production_date", condition = LIKE)
+    @Excel(name = "出厂年月")
+    private String productionDate;
+
+    /**
+     * 出厂编号
+     */
+    @ApiModelProperty(value = "出厂编号")
+    @Length(max = 256, message = "出厂编号长度不能超过256")
+    @TableField(value = "production_no", condition = LIKE)
+    @Excel(name = "出厂编号")
+    private String productionNo;
+
+    /**
+     * 制造厂家
+     */
+    @ApiModelProperty(value = "制造厂家")
+    @Length(max = 256, message = "出厂编号长度不能超过256")
+    @TableField(value = "manufacturer", condition = LIKE)
+    @Excel(name = "制造厂家")
+    private String manufacturer;
+
     /**
      * 备注
      */