Pārlūkot izejas kodu

物联网相关

yeshijie 7 gadi atpakaļ
vecāks
revīzija
b6eda9dfa7
74 mainītis faili ar 2674 papildinājumiem un 1178 dzēšanām
  1. 93 0
      base/common-data-es/readme.MD
  2. 8 0
      common/common-entity/pom.xml
  3. 8 4
      common/common-entity/src/main/java/com/yihu/jw/IdEntityWithOperation.java
  4. 98 0
      common/common-entity/src/main/java/com/yihu/jw/iot/company/IotCompanyCertificateChangeRecordDO.java
  5. 139 0
      common/common-entity/src/main/java/com/yihu/jw/iot/company/IotCompanyCertificateDO.java
  6. 91 62
      common/common-entity/src/main/java/com/yihu/jw/iot/supplier/IotDeviceSupplierDO.java
  7. 58 0
      common/common-entity/src/main/java/com/yihu/jw/iot/company/IotCompanyTypeDO.java
  8. 67 66
      common/common-entity/src/main/java/com/yihu/jw/iot/device/IotDeviceDO.java
  9. 29 6
      common/common-entity/src/main/java/com/yihu/jw/iot/device/IotDeviceOrderDO.java
  10. 0 181
      common/common-entity/src/main/java/com/yihu/jw/iot/device/IotDevicePurchaseDO.java
  11. 39 38
      common/common-entity/src/main/java/com/yihu/jw/iot/device/IotDeviceQualityInspectionPlanDO.java
  12. 172 0
      common/common-entity/src/main/java/com/yihu/jw/iot/device/IotOrderPurchaseDO.java
  13. 128 0
      common/common-entity/src/main/java/com/yihu/jw/iot/device/IotPatientDeviceDO.java
  14. 119 0
      common/common-entity/src/main/java/com/yihu/jw/iot/device/IotQualityRecordDO.java
  15. 88 0
      common/common-entity/src/main/java/com/yihu/jw/iot/dict/IotSystemDictDO.java
  16. 78 0
      common/common-entity/src/main/java/com/yihu/jw/iot/product/IotProductAttachmentDO.java
  17. 229 0
      common/common-entity/src/main/java/com/yihu/jw/iot/product/IotProductBaseInfoDO.java
  18. 68 0
      common/common-entity/src/main/java/com/yihu/jw/iot/product/IotProductDataTransmissionDO.java
  19. 138 0
      common/common-entity/src/main/java/com/yihu/jw/iot/product/IotProductExtendInfoDO.java
  20. 88 0
      common/common-entity/src/main/java/com/yihu/jw/iot/product/IotProductMeasuredDataDO.java
  21. 0 137
      common/common-entity/src/main/java/com/yihu/jw/iot/supplier/IotSupplyDeviceDO.java
  22. 0 93
      common/common-entity/src/main/java/com/yihu/jw/iot/supplier/IotSupplyDeviceDataTypeDO.java
  23. 45 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java
  24. 4 0
      common/common-rest-model/pom.xml
  25. 42 0
      common/common-rest-model/src/main/java/com/yihu/jw/restmodel/common/Envelop.java
  26. 20 1
      svr/svr-iot/readme.MD
  27. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/common/FileUploadController.java
  28. 40 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/common/IotSystemDictController.java
  29. 125 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/company/IotCompanyController.java
  30. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceController.java
  31. 9 9
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDevicePurchaseController.java
  32. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceQualityInspectionPlanController.java
  33. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java
  34. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/label/IotDeviceLabelController.java
  35. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/controller/label/IotDeviceLabelInfoController.java
  36. 0 123
      svr/svr-iot/src/main/java/com/yihu/iot/controller/supplier/IotDeviceSupplierController.java
  37. 0 101
      svr/svr-iot/src/main/java/com/yihu/iot/controller/supplier/IotSupplyDeviceController.java
  38. 0 87
      svr/svr-iot/src/main/java/com/yihu/iot/controller/supplier/IotSupplyDeviceDataTypeController.java
  39. 13 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyCertificateChangeRecordDao.java
  40. 14 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyCertificateDao.java
  41. 18 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyDao.java
  42. 19 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyTypeDao.java
  43. 0 15
      svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotDevicePurchaseDao.java
  44. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotOrderPurchaseDao.java
  45. 14 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotPatientDeviceDao.java
  46. 14 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotQualityRecordDao.java
  47. 2 1
      svr/svr-iot/src/main/java/com/yihu/iot/dao/dict/IotDeviceDictDao.java
  48. 14 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/dict/IotSystemDictDao.java
  49. 14 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductAttachmentDao.java
  50. 14 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductBaseInfoDao.java
  51. 14 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductDataTransmissionDao.java
  52. 14 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductExtendInfoDao.java
  53. 14 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductMeasuredDataDao.java
  54. 0 15
      svr/svr-iot/src/main/java/com/yihu/iot/dao/supplier/IotDeviceSupplierDao.java
  55. 0 15
      svr/svr-iot/src/main/java/com/yihu/iot/dao/supplier/IotSupplyDeviceDao.java
  56. 0 15
      svr/svr-iot/src/main/java/com/yihu/iot/dao/supplier/IotSupplyDeviceDataTypeDao.java
  57. 4 5
      svr/svr-iot/src/main/java/com/yihu/iot/datainput/service/DataInputService.java
  58. 57 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/common/MyJdbcTemplate.java
  59. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyCertificateChangeRecordService.java
  60. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyCertificateService.java
  61. 200 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java
  62. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyTypeService.java
  63. 6 6
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDevicePurchaseService.java
  64. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java
  65. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotQualityRecordService.java
  66. 35 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotSystemDictService.java
  67. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductAttachmentService.java
  68. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductBaseInfoService.java
  69. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductDataTransmissionService.java
  70. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductExtendInfoService.java
  71. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductMeasuredDataService.java
  72. 0 140
      svr/svr-iot/src/main/java/com/yihu/iot/service/supplier/IotDeviceSupplierService.java
  73. 0 20
      svr/svr-iot/src/main/java/com/yihu/iot/service/supplier/IotSupplyDeviceDataTypeService.java
  74. 0 32
      svr/svr-iot/src/main/java/com/yihu/iot/service/supplier/IotSupplyDeviceService.java

+ 93 - 0
base/common-data-es/readme.MD

@ -0,0 +1,93 @@
ElasticSearch
    a.服务说明:
        1.该服务是对ElasticSearch搜索引擎的集成,提供了一些相对常用的操作接口
    b.配置说明:
	    2.详见application.yml文件,其中如果有多个cluster-nodes请以逗号(,)分隔
    c.调用说明:
	    1.初始化索引(相当于建立数据库表)
		    1).索引文档之前请勿必请求mapping接口进行字段映射,不然可能发生检索结果不准确的情况
		    2).参数
			    index
				    - 参数格式:"<index>"
				    - 参数说明:索引名称
			    type 
				    - 参数格式:"<type>"
				    - 参数说明:索引类型
			    source
				    - 参数格式:["<field>":{"type":"<string|byte|short|integer|long|float|double|boolean|date>","store":"<yes|or>"},"<...>":{<...>}]
				    - 参数说明:
                        因{"...":{...}}格式的字符串FeignClient请求的时候会出错,故用[]替换{}到后台的时候再进行替换处理
                        field值为字段名称,字段可选属性还有index、analyzer、search_analyzer、format
                        当字段不分词时形如:["name":{"type":"string","index":"not_analyzed"}]
                        当字段要分词时形如:["name":{"type":"string","analyzer":"ik","search_analyzer":"ik"}]
                        当字段为date类型时可指定时间格式:["createDate":{"type":"date","format":"yyyy-MM-dd HH:mm:ss"}]
                        当字段特别长的时候可选择store为yes否则默认为no
        2.索引文档(相当于插入数据)
            1).请求index接口
            2).参数
                index
                    - 同上
                type
                    - 同上
                source
                    - 参数格式:{"<field>":"<value>","<field>":<value>,"field":"<yyyy-MM-dd HH:mm:ss>"}
                    - 参数说明:filed指字段名称,value指字段值,其中时间格式为yyyy-MM-dd HH:mm:ss
        3.删除索引(相当于删除数据)
            1).请求delete接口
            2).参数
                index
                    - 同上
                type
                    - 同上
                id
                    - 参数格式:"id1,id2,..."
                    - 参数说明:多个数值以逗号(,)分隔
        4.更新索引(相当于更新数据)
            1).请求update接口
            2).参数
                index
                    - 同上
                type
                    - 同上
                id
                    - 参数格式:"<id>"
                    - 参数说明:原文档ID
                source
                    - 参数格式:同index接口
                    - 参数说明:数据中请勿包含原文档ID(_id)
        5.获取单条数据
            1).请求findById接口
            2).参数
                index
                    - 同上
                type
                    - 同上
                id
                    - 同上
        6.简单数据检索(findByFiled)
            1).请求findByField接口
            2).参数
                index
                    - 同上
                type
                    - 同上
                field
                    - 参数格式:"<field>"
                    - 参数说明:字段名称
                value
                    - 参数格式:初始化索引时,该字段对应的类型
                    - 参数说明:字段值
        7.组合数据检索(page)
            1).请求page接口,支持模糊查询,完全匹配,范围查询
            2).参数
                index
                    - 同上
                type
                    - 同上
                filter
                    - 参数格式:[{"andOr":"and|or","condition":">|=|<|>=|<=|?","field":"<filed>","value":"<value>"},<{...}>]
                    - 参数说明:andOr跟数据库的中的AND和OR相似;condition指条件匹配程度,?相当于数据库中的like;filed指检索的字段;value为检索的值
                page
                    - 参数说明:页码
                size 
                    - 参数说明:分页大小

+ 8 - 0
common/common-entity/pom.xml

@ -28,5 +28,13 @@
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>
    </dependencies>
</project>

+ 8 - 4
common/common-entity/src/main/java/com/yihu/jw/IdEntityWithOperation.java

@ -5,14 +5,16 @@
 *******************************************************************************/
package com.yihu.jw;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import javax.persistence.Column;
import javax.persistence.EntityListeners;
import javax.persistence.MappedSuperclass;
import java.util.Date;
/**
@ -28,6 +30,7 @@ public abstract class IdEntityWithOperation extends IdEntity{
	@CreatedDate
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	@Column(name = "create_time", nullable = false, length = 0,updatable = false)
	protected Date createTime;
@ -40,15 +43,16 @@ public abstract class IdEntityWithOperation extends IdEntity{
	protected String createUserName;
	@LastModifiedDate
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	@Column(name = "update_time", nullable = false, length = 0)
	protected Date updateTime;
	@LastModifiedBy
	@Column(name = "update_user", length = 100)
	@Column(name = "update_user")
	protected String updateUser;
	@LastModifiedBy
	@Column(name = "update_user_name", length = 50)
	@Column(name = "update_user_name")
	protected String updateUserName;

+ 98 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/company/IotCompanyCertificateChangeRecordDO.java

@ -0,0 +1,98 @@
package com.yihu.jw.iot.company;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 企业三证变更记录表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_company_certificate_change_record")
public class IotCompanyCertificateChangeRecordDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "company_name")
    private String companyName;//企业名称
    @Column(name = "company_id")
    private String companyId;//企业id
    @Column(name = "type")
    private String type;//类型
    @Column(name = "license_old")
    private String licenseOld;//原证书号码
    @Column(name = "certificate_old")
    private String certificateOld;//原证书扫描件
    @Column(name = "license_new")
    private String licenseNew;//新证书号码
    @Column(name = "certificate_new")
    private String certificateNew;//新证书扫描件
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getCompanyName() {
        return companyName;
    }
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    public String getCompanyId() {
        return companyId;
    }
    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getLicenseOld() {
        return licenseOld;
    }
    public void setLicenseOld(String licenseOld) {
        this.licenseOld = licenseOld;
    }
    public String getCertificateOld() {
        return certificateOld;
    }
    public void setCertificateOld(String certificateOld) {
        this.certificateOld = certificateOld;
    }
    public String getLicenseNew() {
        return licenseNew;
    }
    public void setLicenseNew(String licenseNew) {
        this.licenseNew = licenseNew;
    }
    public String getCertificateNew() {
        return certificateNew;
    }
    public void setCertificateNew(String certificateNew) {
        this.certificateNew = certificateNew;
    }
}

+ 139 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/company/IotCompanyCertificateDO.java

@ -0,0 +1,139 @@
package com.yihu.jw.iot.company;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 企业证书表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_company_certificate")
public class IotCompanyCertificateDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saas_id;//
    @Column(name = "name")
    private String name;//证书名称
    @Column(name = "manufacturer_name")
    private String manufacturerName;//生产厂家名称
    @Column(name = "manufacturer_id")
    private String manufacturerId;//生产厂家id
    @Column(name = "manufacturer_business_license")
    private String manufacturerBusinessLicense;//生产厂家营业执照号
    @Column(name = "company_name")
    private String companyName;//发起企业名称
    @Column(name = "company_id")
    private String companyId;//发起企业id
    @Column(name = "company_business_license")
    private String companyBusinessLicense;//发起企业营业执照号
    @Column(name = "start_time")
    private Date startTime;//有效期开始时间
    @Column(name = "end_time")
    private Date endTime;//有效结束时间
    @Column(name = "certificate_of_authorization_img")
    private String certificateOfAuthorizationImg;//授权书扫描件
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaas_id() {
        return saas_id;
    }
    public void setSaas_id(String saas_id) {
        this.saas_id = saas_id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getManufacturerName() {
        return manufacturerName;
    }
    public void setManufacturerName(String manufacturerName) {
        this.manufacturerName = manufacturerName;
    }
    public String getManufacturerId() {
        return manufacturerId;
    }
    public void setManufacturerId(String manufacturerId) {
        this.manufacturerId = manufacturerId;
    }
    public String getManufacturerBusinessLicense() {
        return manufacturerBusinessLicense;
    }
    public void setManufacturerBusinessLicense(String manufacturerBusinessLicense) {
        this.manufacturerBusinessLicense = manufacturerBusinessLicense;
    }
    public String getCompanyName() {
        return companyName;
    }
    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }
    public String getCompanyId() {
        return companyId;
    }
    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }
    public String getCompanyBusinessLicense() {
        return companyBusinessLicense;
    }
    public void setCompanyBusinessLicense(String companyBusinessLicense) {
        this.companyBusinessLicense = companyBusinessLicense;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public String getCertificateOfAuthorizationImg() {
        return certificateOfAuthorizationImg;
    }
    public void setCertificateOfAuthorizationImg(String certificateOfAuthorizationImg) {
        this.certificateOfAuthorizationImg = certificateOfAuthorizationImg;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 91 - 62
common/common-entity/src/main/java/com/yihu/jw/iot/supplier/IotDeviceSupplierDO.java

@ -1,69 +1,66 @@
package com.yihu.jw.iot.supplier;
package com.yihu.jw.iot.company;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * @author yeshijie on 2017/12/1.
 * 企业表
 * @author yeshijie on 2018/1/15.
 */
@Entity
@Table(name = "iot_device_supplier")
public class IotDeviceSupplierDO extends IdEntityWithOperation implements Serializable{
    private static final long serialVersionUID = 41357656279822210L;
@Table(name = "iot_company")
public class IotCompanyDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "supplier_name")
    private String supplierName;//供应商名称
    @Column(name = "organization_code")
    private String organizationCode;//组织机构代码/统一社会信用代码
    @Column(name = "juridical_person_name")
    private String juridicalPersonName;//法定代表人/负责人姓名
    private String saasId;//
    @Column(name = "status")
    private String status;//审核状态(预留字段)
    @Column(name = "name")
    private String name;//企业名称
    @Column(name = "is_three_in_one")
    private Integer isThreeInOne;//是否三证合一(1是,0否)
    @Column(name = "business_license")
    private String businessLicense;//统一社会信用代码/营业执照
    @Column(name = "business_start_time")
    private Date businessStartTime;//营业开始时间
    @Column(name = "business_end_time")
    private Date businessEndTime;//营业结束时间
    @Column(name = "organization_address")
    private String organizationAddress;//机构地址
    @Column(name = "office_phone")
    private String officePhone;//办公电话
    @Column(name = "contacts_name")
    private String contactsName;//联系人姓名
    @Column(name = "contacts_mobile")
    private String contactsMobile;//联系人手机号码
    @Column(name = "contacts_phone")
    private String contactsPhone;//联系人座机
    @Column(name = "contacts_idcard")
    private String contactsIdcard;//联系人身份证号
    @Column(name = "contacts_email")
    private String contactsEmail;//联系人邮件
    @Column(name = "type")
    private String type;//类型 1、供应商,2、厂商
    @Column(name = "business_license_img")
    private String businessLicenseImg;//统一社会信用代码证照片
    @Column(name = "organization_code_img")
    private String organizationCodeImg;//组织机构代码证照片
    @Column(name = "tax_registration_img")
    private String taxRegistrationImg;//税务登记证照片
    @Column(name = "contacts_idcard_img")
    private String contactsIdcardImg;//联系人身份证照片
    @Column(name = "data_transmission_mode")
    private String dataTransmissionMode;//数据传输方式
    @Column(name = "account")
    private String account;//账号
    @Column(name = "del")
    private Integer del;//删除标志(1有效,0删除)
    @Transient
    private List<JSONObject> typeList;//类型
    public String getSaasId() {
        return saasId;
    }
@ -72,28 +69,52 @@ public class IotDeviceSupplierDO extends IdEntityWithOperation implements Serial
        this.saasId = saasId;
    }
    public String getSupplierName() {
        return supplierName;
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getName() {
        return name;
    }
    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    public void setName(String name) {
        this.name = name;
    }
    public String getOrganizationCode() {
        return organizationCode;
    public Integer getIsThreeInOne() {
        return isThreeInOne;
    }
    public void setOrganizationCode(String organizationCode) {
        this.organizationCode = organizationCode;
    public void setIsThreeInOne(Integer isThreeInOne) {
        this.isThreeInOne = isThreeInOne;
    }
    public String getJuridicalPersonName() {
        return juridicalPersonName;
    public String getBusinessLicense() {
        return businessLicense;
    }
    public void setJuridicalPersonName(String juridicalPersonName) {
        this.juridicalPersonName = juridicalPersonName;
    public void setBusinessLicense(String businessLicense) {
        this.businessLicense = businessLicense;
    }
    public Date getBusinessStartTime() {
        return businessStartTime;
    }
    public void setBusinessStartTime(Date businessStartTime) {
        this.businessStartTime = businessStartTime;
    }
    public Date getBusinessEndTime() {
        return businessEndTime;
    }
    public void setBusinessEndTime(Date businessEndTime) {
        this.businessEndTime = businessEndTime;
    }
    public String getOrganizationAddress() {
@ -128,14 +149,6 @@ public class IotDeviceSupplierDO extends IdEntityWithOperation implements Serial
        this.contactsMobile = contactsMobile;
    }
    public String getContactsPhone() {
        return contactsPhone;
    }
    public void setContactsPhone(String contactsPhone) {
        this.contactsPhone = contactsPhone;
    }
    public String getContactsIdcard() {
        return contactsIdcard;
    }
@ -152,12 +165,12 @@ public class IotDeviceSupplierDO extends IdEntityWithOperation implements Serial
        this.contactsEmail = contactsEmail;
    }
    public String getType() {
        return type;
    public String getBusinessLicenseImg() {
        return businessLicenseImg;
    }
    public void setType(String type) {
        this.type = type;
    public void setBusinessLicenseImg(String businessLicenseImg) {
        this.businessLicenseImg = businessLicenseImg;
    }
    public String getOrganizationCodeImg() {
@ -168,6 +181,14 @@ public class IotDeviceSupplierDO extends IdEntityWithOperation implements Serial
        this.organizationCodeImg = organizationCodeImg;
    }
    public String getTaxRegistrationImg() {
        return taxRegistrationImg;
    }
    public void setTaxRegistrationImg(String taxRegistrationImg) {
        this.taxRegistrationImg = taxRegistrationImg;
    }
    public String getContactsIdcardImg() {
        return contactsIdcardImg;
    }
@ -176,12 +197,12 @@ public class IotDeviceSupplierDO extends IdEntityWithOperation implements Serial
        this.contactsIdcardImg = contactsIdcardImg;
    }
    public String getDataTransmissionMode() {
        return dataTransmissionMode;
    public String getAccount() {
        return account;
    }
    public void setDataTransmissionMode(String dataTransmissionMode) {
        this.dataTransmissionMode = dataTransmissionMode;
    public void setAccount(String account) {
        this.account = account;
    }
    public Integer getDel() {
@ -191,4 +212,12 @@ public class IotDeviceSupplierDO extends IdEntityWithOperation implements Serial
    public void setDel(Integer del) {
        this.del = del;
    }
    public List<JSONObject> getTypeList() {
        return typeList;
    }
    public void setTypeList(List<JSONObject> typeList) {
        this.typeList = typeList;
    }
}

+ 58 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/company/IotCompanyTypeDO.java

@ -0,0 +1,58 @@
package com.yihu.jw.iot.company;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 企业类型表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_company_type")
public class IotCompanyTypeDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "company_id")
    private String companyId;//企业id
    @Column(name = "type")
    private String type;//企业类型code
    @Column(name = "type_name")
    private String typeName;//企业类型名称
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getCompanyId() {
        return companyId;
    }
    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
}

+ 67 - 66
common/common-entity/src/main/java/com/yihu/jw/iot/device/IotDeviceDO.java

@ -9,6 +9,7 @@ import java.io.Serializable;
import java.util.Date;
/**
 * 设备表
 * @author yeshijie on 2017/12/1.
 */
@Entity
@ -18,11 +19,14 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "product_id")
    private String productId;//产品id
    @Column(name = "name")
    private String name;//设备名称
    @Column(name = "device_model")
    private String deviceModel;//设备型号
//    @Column(name = "device_model")
//    private String deviceModel;//设备型号
    @Column(name = "device_sn")
    private String deviceSn;//设备sn码
@ -33,29 +37,32 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "is_platform")
    private Integer isPlatform;//是否平台型(1是,0否)
    @Column(name = "device_type")
    private String deviceType;//设备种类
//    @Column(name = "device_type")
//    private String deviceType;//设备种类
    @Column(name = "device_source")
    private String deviceSource;//设备来源(1采购订单关联,2居民绑定,3管理员新增)
    @Column(name = "supplier_code")
    private String supplierCode;//供应商code
    @Column(name = "supplier_id")
    private String supplierId;//供应商code
    @Column(name = "supplier_name")
    private String supplierName;//供应商名称
    @Column(name = "manufacturer_code")
    private String manufacturerCode;//厂商code
    @Column(name = "manufacturer_id")
    private String manufacturerId;//厂商code
    @Column(name = "manufacturer_name")
    private String manufacturerName;//厂商名称
    @Column(name = "manufacture_tel")
    private String manufactureTel;//厂商名称
    @Column(name = "hospital")
    private String hospital;//归属社区
    @Column(name = "hospital_name")
    private String hospital_name;//归属社区名称
    @Column(name = "order_code")
    private String orderCode;//订单code
    @Column(name = "order_id")
    private String orderId;//订单code
    @Column(name = "order_no")
    private String orderNo;//订单编号
@ -66,8 +73,8 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "next_quality_time")
    private Date nextQualityTime;//下次质检时间
    @Column(name = "purchase_code")
    private String purchaseCode;//采购code
    @Column(name = "purchase_id")
    private String purchaseId;//采购code
    @Column(name = "sim_no")
    private String simNo;//sim卡号
@ -75,12 +82,6 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "del")
    private Integer del;//删除标志(1有效,0删除)
    @Column(name = "sale_org_code")
    private String saleOrgCode; //经销商单位代码
    @Column(name = "sale_org_name")
    private String saleOrgName; //经销商单位名称
    public String getSaasId() {
        return saasId;
    }
@ -97,13 +98,13 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
        this.name = name;
    }
    public String getDeviceModel() {
        return deviceModel;
    }
    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }
//    public String getDeviceModel() {
//        return deviceModel;
//    }
//
//    public void setDeviceModel(String deviceModel) {
//        this.deviceModel = deviceModel;
//    }
    public String getDeviceSn() {
        return deviceSn;
@ -129,13 +130,13 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
        this.isPlatform = isPlatform;
    }
    public String getDeviceType() {
        return deviceType;
    }
    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }
//    public String getDeviceType() {
//        return deviceType;
//    }
//
//    public void setDeviceType(String deviceType) {
//        this.deviceType = deviceType;
//    }
    public String getDeviceSource() {
        return deviceSource;
@ -145,12 +146,12 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
        this.deviceSource = deviceSource;
    }
    public String getSupplierCode() {
        return supplierCode;
    public String getSupplierId() {
        return supplierId;
    }
    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    public void setSupplierId(String supplierId) {
        this.supplierId = supplierId;
    }
    public String getSupplierName() {
@ -161,12 +162,12 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
        this.supplierName = supplierName;
    }
    public String getManufacturerCode() {
        return manufacturerCode;
    public String getManufacturerId() {
        return manufacturerId;
    }
    public void setManufacturerCode(String manufacturerCode) {
        this.manufacturerCode = manufacturerCode;
    public void setManufacturerId(String manufacturerId) {
        this.manufacturerId = manufacturerId;
    }
    public String getManufacturerName() {
@ -177,20 +178,12 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
        this.manufacturerName = manufacturerName;
    }
    public String getManufactureTel() {
        return manufactureTel;
    }
    public void setManufactureTel(String manufactureTel) {
        this.manufactureTel = manufactureTel;
    }
    public String getOrderCode() {
        return orderCode;
    public String getOrderId() {
        return orderId;
    }
    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    public String getOrderNo() {
@ -217,12 +210,12 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
        this.nextQualityTime = nextQualityTime;
    }
    public String getPurchaseCode() {
        return purchaseCode;
    public String getPurchaseId() {
        return purchaseId;
    }
    public void setPurchaseCode(String purchaseCode) {
        this.purchaseCode = purchaseCode;
    public void setPurchaseId(String purchaseId) {
        this.purchaseId = purchaseId;
    }
    public String getSimNo() {
@ -241,19 +234,27 @@ public class IotDeviceDO extends IdEntityWithOperation implements Serializable {
        this.del = del;
    }
    public String getSaleOrgCode() {
        return saleOrgCode;
    public String getProductId() {
        return productId;
    }
    public void setProductId(String productId) {
        this.productId = productId;
    }
    public String getHospital() {
        return hospital;
    }
    public void setSaleOrgCode(String saleOrgCode) {
        this.saleOrgCode = saleOrgCode;
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    public String getSaleOrgName() {
        return saleOrgName;
    public String getHospital_name() {
        return hospital_name;
    }
    public void setSaleOrgName(String saleOrgName) {
        this.saleOrgName = saleOrgName;
    public void setHospital_name(String hospital_name) {
        this.hospital_name = hospital_name;
    }
}

+ 29 - 6
common/common-entity/src/main/java/com/yihu/jw/iot/device/IotDeviceOrderDO.java

@ -9,6 +9,7 @@ import java.io.Serializable;
import java.util.Date;
/**
 * 设备订单表
 * @author yeshijie on 2017/12/1.
 */
@Entity
@ -45,8 +46,8 @@ public class IotDeviceOrderDO extends IdEntityWithOperation implements Serializa
    @Column(name = "purchaser_phone")
    private String purchaserPhone;//采购负责人联系方式
    @Column(name = "supplier_code")
    private String supplierCode;//供应商code
    @Column(name = "supplier_id")
    private String supplierId;//供应商code
    @Column(name = "supplier_name")
    private String supplierName;//供应商名称
@ -60,6 +61,12 @@ public class IotDeviceOrderDO extends IdEntityWithOperation implements Serializa
    @Column(name = "supplier_leader_phone")
    private String supplierLeaderPhone;//供应商负责人联系方式
    @Column(name = "instruction")
    private String instruction;//订单说明
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaasId() {
        return saasId;
    }
@ -140,12 +147,12 @@ public class IotDeviceOrderDO extends IdEntityWithOperation implements Serializa
        this.purchaserPhone = purchaserPhone;
    }
    public String getSupplierCode() {
        return supplierCode;
    public String getSupplierId() {
        return supplierId;
    }
    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    public void setSupplierId(String supplierId) {
        this.supplierId = supplierId;
    }
    public String getSupplierName() {
@ -179,4 +186,20 @@ public class IotDeviceOrderDO extends IdEntityWithOperation implements Serializa
    public void setSupplierLeaderPhone(String supplierLeaderPhone) {
        this.supplierLeaderPhone = supplierLeaderPhone;
    }
    public String getInstruction() {
        return instruction;
    }
    public void setInstruction(String instruction) {
        this.instruction = instruction;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 0 - 181
common/common-entity/src/main/java/com/yihu/jw/iot/device/IotDevicePurchaseDO.java

@ -1,181 +0,0 @@
package com.yihu.jw.iot.device;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * @author yeshijie on 2017/12/1.
 */
@Entity
@Table(name = "iot_device_purchase")
public class IotDevicePurchaseDO extends IdEntityWithOperation implements Serializable{
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "order_code")
    private String orderCode;//订单code
    @Column(name = "order_no")
    private String orderNo;//订单编号
    @Column(name = "supplier_code")
    private String supplierCode;//供应商code
    @Column(name = "supplier_name")
    private String supplierName;//供应商名称
    @Column(name = "device_name")
    private String deviceName;//采购设备名称
    @Column(name = "device_model")
    private String deviceModel;//采购设备型号
    @Column(name = "device_type")
    private String deviceType;//设备种类
    @Column(name = "manufacturer_code")
    private String manufacturerCode;//厂商code
    @Column(name = "manufacturer_name")
    private String manufacturerName;//厂商名称
    @Column(name = "purchase_num")
    private Long purchaseNum;//采购数量
    @Column(name = "quality_cycle")
    private String qualityCycle;//质检周期
    @Column(name = "associated_num")
    private Long associatedNum;//已关联设备数量
    @Column(name = "unassociated_num")
    private Long unassociatedNum;//未关联设备数量
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getOrderCode() {
        return orderCode;
    }
    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }
    public String getOrderNo() {
        return orderNo;
    }
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
    public String getSupplierCode() {
        return supplierCode;
    }
    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    }
    public String getSupplierName() {
        return supplierName;
    }
    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }
    public String getDeviceName() {
        return deviceName;
    }
    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }
    public String getDeviceModel() {
        return deviceModel;
    }
    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }
    public String getDeviceType() {
        return deviceType;
    }
    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }
    public String getManufacturerCode() {
        return manufacturerCode;
    }
    public void setManufacturerCode(String manufacturerCode) {
        this.manufacturerCode = manufacturerCode;
    }
    public String getManufacturerName() {
        return manufacturerName;
    }
    public void setManufacturerName(String manufacturerName) {
        this.manufacturerName = manufacturerName;
    }
    public Long getPurchaseNum() {
        return purchaseNum;
    }
    public void setPurchaseNum(Long purchaseNum) {
        this.purchaseNum = purchaseNum;
    }
    public String getQualityCycle() {
        return qualityCycle;
    }
    public void setQualityCycle(String qualityCycle) {
        this.qualityCycle = qualityCycle;
    }
    public Long getAssociatedNum() {
        return associatedNum;
    }
    public void setAssociatedNum(Long associatedNum) {
        this.associatedNum = associatedNum;
    }
    public Long getUnassociatedNum() {
        return unassociatedNum;
    }
    public void setUnassociatedNum(Long unassociatedNum) {
        this.unassociatedNum = unassociatedNum;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 39 - 38
common/common-entity/src/main/java/com/yihu/jw/iot/device/IotDeviceQualityInspectionPlanDO.java

@ -9,6 +9,7 @@ import java.io.Serializable;
import java.util.Date;
/**
 * 设备质检计划表
 * @author yeshijie on 2017/12/1.
 */
@Entity
@ -18,26 +19,26 @@ public class IotDeviceQualityInspectionPlanDO extends IdEntityWithOperation impl
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "purchase_code")
    private String purchaseCode;//采购code
    @Column(name = "purchase_id")
    private String purchaseId;//采购code
    @Column(name = "order_code")
    private String orderCode;//订单code
    @Column(name = "order_id")
    private String orderId;//订单code
    @Column(name = "order_no")
    private String orderNo;//订单编号
    @Column(name = "device_code")
    private String deviceCode;//设备code
    @Column(name = "device_id")
    private String deviceId;//设备code
    @Column(name = "device_name")
    private String deviceName;//设备名称
    @Column(name = "device_model")
    private String deviceModel;//设备型号
    @Column(name = "device_type")
    private String deviceType;//设备种类
//    @Column(name = "device_model")
//    private String deviceModel;//设备型号
//
//    @Column(name = "device_type")
//    private String deviceType;//设备种类
    @Column(name = "purchase_num")
    private Long purchaseNum;//采购数量
@ -68,20 +69,20 @@ public class IotDeviceQualityInspectionPlanDO extends IdEntityWithOperation impl
        this.saasId = saasId;
    }
    public String getPurchaseCode() {
        return purchaseCode;
    public String getPurchaseId() {
        return purchaseId;
    }
    public void setPurchaseCode(String purchaseCode) {
        this.purchaseCode = purchaseCode;
    public void setPurchaseId(String purchaseId) {
        this.purchaseId = purchaseId;
    }
    public String getOrderCode() {
        return orderCode;
    public String getOrderId() {
        return orderId;
    }
    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    public String getOrderNo() {
@ -92,12 +93,12 @@ public class IotDeviceQualityInspectionPlanDO extends IdEntityWithOperation impl
        this.orderNo = orderNo;
    }
    public String getDeviceCode() {
        return deviceCode;
    public String getDeviceId() {
        return deviceId;
    }
    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
    public String getDeviceName() {
@ -108,21 +109,21 @@ public class IotDeviceQualityInspectionPlanDO extends IdEntityWithOperation impl
        this.deviceName = deviceName;
    }
    public String getDeviceModel() {
        return deviceModel;
    }
    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }
    public String getDeviceType() {
        return deviceType;
    }
    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }
//    public String getDeviceModel() {
//        return deviceModel;
//    }
//
//    public void setDeviceModel(String deviceModel) {
//        this.deviceModel = deviceModel;
//    }
//
//    public String getDeviceType() {
//        return deviceType;
//    }
//
//    public void setDeviceType(String deviceType) {
//        this.deviceType = deviceType;
//    }
    public Long getPurchaseNum() {
        return purchaseNum;

+ 172 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/device/IotOrderPurchaseDO.java

@ -0,0 +1,172 @@
package com.yihu.jw.iot.device;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 采购清单表
 * @author yeshijie on 2017/12/1.
 */
@Entity
@Table(name = "iot_order_purchase")
public class IotOrderPurchaseDO extends IdEntityWithOperation implements Serializable{
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "order_id")
    private String orderId;//订单code
    @Column(name = "order_no")
    private String orderNo;//订单编号
    @Column(name = "supplier_id")
    private String supplierId;//供应商code
    @Column(name = "supplier_name")
    private String supplierName;//供应商名称
    @Column(name = "device_name")
    private String deviceName;//采购设备名称
//    @Column(name = "device_model")
//    private String deviceModel;//采购设备型号
//
//    @Column(name = "device_type")
//    private String deviceType;//设备种类
    @Column(name = "manufacturer_id")
    private String manufacturerId;//厂商code
    @Column(name = "manufacturer_name")
    private String manufacturerName;//厂商名称
    @Column(name = "purchase_num")
    private Long purchaseNum;//采购数量
    @Column(name = "next_quality_time")
    private Date nextQualityTime;//'下次质检时间'
    @Column(name = "quality_status")
    private String qualityStatus;//'质检状态'
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    public String getOrderNo() {
        return orderNo;
    }
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
    public String getSupplierId() {
        return supplierId;
    }
    public void setSupplierId(String supplierId) {
        this.supplierId = supplierId;
    }
    public String getSupplierName() {
        return supplierName;
    }
    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }
    public String getDeviceName() {
        return deviceName;
    }
    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }
//    public String getDeviceModel() {
//        return deviceModel;
//    }
//
//    public void setDeviceModel(String deviceModel) {
//        this.deviceModel = deviceModel;
//    }
//
//    public String getDeviceType() {
//        return deviceType;
//    }
//
//    public void setDeviceType(String deviceType) {
//        this.deviceType = deviceType;
//    }
    public String getManufacturerId() {
        return manufacturerId;
    }
    public void setManufacturerId(String manufacturerId) {
        this.manufacturerId = manufacturerId;
    }
    public String getManufacturerName() {
        return manufacturerName;
    }
    public void setManufacturerName(String manufacturerName) {
        this.manufacturerName = manufacturerName;
    }
    public Long getPurchaseNum() {
        return purchaseNum;
    }
    public void setPurchaseNum(Long purchaseNum) {
        this.purchaseNum = purchaseNum;
    }
    public Date getNextQualityTime() {
        return nextQualityTime;
    }
    public void setNextQualityTime(Date nextQualityTime) {
        this.nextQualityTime = nextQualityTime;
    }
    public String getQualityStatus() {
        return qualityStatus;
    }
    public void setQualityStatus(String qualityStatus) {
        this.qualityStatus = qualityStatus;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 128 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/device/IotPatientDeviceDO.java

@ -0,0 +1,128 @@
package com.yihu.jw.iot.device;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 居民设备绑定表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_patient_device")
public class IotPatientDeviceDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "patient")
    private String patient;//居民code
    @Column(name = "patient_name")
    private String patientName;//居民姓名
    @Column(name = "idcard")
    private String idcard;//居民身份证
    @Column(name = "device_id")
    private String deviceId;//设备id
    @Column(name = "device_name")
    private String deviceName;//设备名称
    @Column(name = "device_sn")
    private String deviceSn;//设备sn码
    @Column(name = "doctor")
    private String doctor;//质检负责人
    @Column(name = "agent")
    private String agent;//质检负责人联系方式
    @Column(name = "user_type")
    private String userType;//质检状态
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }
    public String getIdcard() {
        return idcard;
    }
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
    public String getDeviceId() {
        return deviceId;
    }
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
    public String getDeviceName() {
        return deviceName;
    }
    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }
    public String getDeviceSn() {
        return deviceSn;
    }
    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    public String getAgent() {
        return agent;
    }
    public void setAgent(String agent) {
        this.agent = agent;
    }
    public String getUserType() {
        return userType;
    }
    public void setUserType(String userType) {
        this.userType = userType;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 119 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/device/IotQualityRecordDO.java

@ -0,0 +1,119 @@
package com.yihu.jw.iot.device;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 质检记录表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_quality_record")
public class IotQualityRecordDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "device_id")
    private String deviceId;//设备id
    @Column(name = "device_name")
    private String deviceName;//设备名称
    @Column(name = "purchase_num")
    private Long purchaseNum;//采购数量
    @Column(name = "quality_leader")
    private String qualityLeader;//质检负责人
    @Column(name = "quality_leader_phone")
    private String qualityLeaderPhone;//质检负责人联系方式
    @Column(name = "plan_time")
    private Date planTime;//计划质检时间
    @Column(name = "actual_time")
    private Date actualTime;//实际质检时间
    @Column(name = "status")
    private String status;//质检状态
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getDeviceId() {
        return deviceId;
    }
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
    public String getDeviceName() {
        return deviceName;
    }
    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }
    public Long getPurchaseNum() {
        return purchaseNum;
    }
    public void setPurchaseNum(Long purchaseNum) {
        this.purchaseNum = purchaseNum;
    }
    public String getQualityLeader() {
        return qualityLeader;
    }
    public void setQualityLeader(String qualityLeader) {
        this.qualityLeader = qualityLeader;
    }
    public String getQualityLeaderPhone() {
        return qualityLeaderPhone;
    }
    public void setQualityLeaderPhone(String qualityLeaderPhone) {
        this.qualityLeaderPhone = qualityLeaderPhone;
    }
    public Date getPlanTime() {
        return planTime;
    }
    public void setPlanTime(Date planTime) {
        this.planTime = planTime;
    }
    public Date getActualTime() {
        return actualTime;
    }
    public void setActualTime(Date actualTime) {
        this.actualTime = actualTime;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 88 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/dict/IotSystemDictDO.java

@ -0,0 +1,88 @@
package com.yihu.jw.iot.dict;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 系统字典表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_system_dict")
public class IotSystemDictDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "dict_name")
    private String dictName;//所属字典
    @Column(name = "code")
    private String code;//字典项代码
    @Column(name = "value")
    private String value;//字典项值
    @Column(name = "py_code")
    private String pyCode;//拼音码
    @Column(name = "sort")
    private Long sort;//排序
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getDictName() {
        return dictName;
    }
    public void setDictName(String dictName) {
        this.dictName = dictName;
    }
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
    public String getPyCode() {
        return pyCode;
    }
    public void setPyCode(String pyCode) {
        this.pyCode = pyCode;
    }
    public Long getSort() {
        return sort;
    }
    public void setSort(Long sort) {
        this.sort = sort;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 78 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/product/IotProductAttachmentDO.java

@ -0,0 +1,78 @@
package com.yihu.jw.iot.product;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 产品附件表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_product_attachment")
public class IotProductAttachmentDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "product_id")
    private String productId;//产品ID
    @Column(name = "product_extend_id")
    private String productExtendId;//产品扩展信息ID
    @Column(name = "type")
    private String type;//附件类型(1产品说明书,2其他附件)
    @Column(name = "attachment")
    private String attachment;//附件
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getProductId() {
        return productId;
    }
    public void setProductId(String productId) {
        this.productId = productId;
    }
    public String getProductExtendId() {
        return productExtendId;
    }
    public void setProductExtendId(String productExtendId) {
        this.productExtendId = productExtendId;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getAttachment() {
        return attachment;
    }
    public void setAttachment(String attachment) {
        this.attachment = attachment;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 229 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/product/IotProductBaseInfoDO.java

@ -0,0 +1,229 @@
package com.yihu.jw.iot.product;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * 产品基本信息表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_product_base_info")
public class IotProductBaseInfoDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "parent_id")
    private String parentId;//父类ID
    @Column(name = "product_classify")
    private String productClassify;//产品分类
    @Column(name = "supplier_name")
    private String supplierName;//厂商名称
    @Column(name = "supplier_id")
    private String supplierId;//厂商id
    @Column(name = "agent_name")
    private String agentName;//代理商名称
    @Column(name = "agent_id")
    private String agentId;//代理商id
    @Column(name = "type")
    private String type;//产品类型
    @Column(name = "product_subclass")
    private String productSubclass;//产品小类
    @Column(name = "instrument_classify")
    private String instrumentClassify;//68分类/器械分类
    @Column(name = "register_certificate")
    private String registerCertificate;//注册证号
    @Column(name = "register_certificate_img")
    private String registerCertificateImg;//注册证扫描件
    @Column(name = "start_time")
    private Date startTime;//有效期开始时间
    @Column(name = "end_time")
    private Date endTime;//有效期结束时间
    @Column(name = "name")
    private String name;//产品名称
    @Column(name = "alias")
    private String alias;//别名
    @Column(name = "brand_name")
    private String brandName;//品牌名称
    @Column(name = "origin_place")
    private String originPlace;//产地
    @Column(name = "origin_type")
    private Integer originType;//产地类型
    @Column(name = "is_cold_chain")
    private Integer isColdChain;//是否需要冷链
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getParentId() {
        return parentId;
    }
    public void setParentId(String parentId) {
        this.parentId = parentId;
    }
    public String getProductClassify() {
        return productClassify;
    }
    public void setProductClassify(String productClassify) {
        this.productClassify = productClassify;
    }
    public String getSupplierName() {
        return supplierName;
    }
    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }
    public String getSupplierId() {
        return supplierId;
    }
    public void setSupplierId(String supplierId) {
        this.supplierId = supplierId;
    }
    public String getAgentName() {
        return agentName;
    }
    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }
    public String getAgentId() {
        return agentId;
    }
    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getProductSubclass() {
        return productSubclass;
    }
    public void setProductSubclass(String productSubclass) {
        this.productSubclass = productSubclass;
    }
    public String getInstrumentClassify() {
        return instrumentClassify;
    }
    public void setInstrumentClassify(String instrumentClassify) {
        this.instrumentClassify = instrumentClassify;
    }
    public String getRegisterCertificate() {
        return registerCertificate;
    }
    public void setRegisterCertificate(String registerCertificate) {
        this.registerCertificate = registerCertificate;
    }
    public String getRegisterCertificateImg() {
        return registerCertificateImg;
    }
    public void setRegisterCertificateImg(String registerCertificateImg) {
        this.registerCertificateImg = registerCertificateImg;
    }
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getAlias() {
        return alias;
    }
    public void setAlias(String alias) {
        this.alias = alias;
    }
    public String getBrandName() {
        return brandName;
    }
    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }
    public String getOriginPlace() {
        return originPlace;
    }
    public void setOriginPlace(String originPlace) {
        this.originPlace = originPlace;
    }
    public Integer getOriginType() {
        return originType;
    }
    public void setOriginType(Integer originType) {
        this.originType = originType;
    }
    public Integer getIsColdChain() {
        return isColdChain;
    }
    public void setIsColdChain(Integer isColdChain) {
        this.isColdChain = isColdChain;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 68 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/product/IotProductDataTransmissionDO.java

@ -0,0 +1,68 @@
package com.yihu.jw.iot.product;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 设备数据传输方式表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_product_data_transmission")
public class IotProductDataTransmissionDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "product_id")
    private String productId;//产品ID
    @Column(name = "type")
    private String type;//传输协议类型
    @Column(name = "type_name")
    private String typeName;//传输协议类型名称
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getProductId() {
        return productId;
    }
    public void setProductId(String productId) {
        this.productId = productId;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 138 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/product/IotProductExtendInfoDO.java

@ -0,0 +1,138 @@
package com.yihu.jw.iot.product;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 产品扩展信息表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_product_extend_info")
public class IotProductExtendInfoDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;//
    @Column(name = "product_id")
    private String productId;//产品ID
    @Column(name = "product_img")
    private String productImg;//产品图片
    @Column(name = "description")
    private String description;//产品说明
    @Column(name = "use_range")
    private String useRange;//适用范围
    @Column(name = "version")
    private String version;//版本
    @Column(name = "standard")
    private String standard;//产品标准
    @Column(name = "contraindication")
    private String contraindication;//禁忌症
    @Column(name = "specification")
    private String specification;//产品说明书
    @Column(name = "certificate_id")
    private String certificateId;//授权id
    @Column(name = "certificate_name")
    private String certificateName;//授权书名称
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getProductId() {
        return productId;
    }
    public void setProductId(String productId) {
        this.productId = productId;
    }
    public String getProductImg() {
        return productImg;
    }
    public void setProductImg(String productImg) {
        this.productImg = productImg;
    }
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    public String getUseRange() {
        return useRange;
    }
    public void setUseRange(String useRange) {
        this.useRange = useRange;
    }
    public String getVersion() {
        return version;
    }
    public void setVersion(String version) {
        this.version = version;
    }
    public String getStandard() {
        return standard;
    }
    public void setStandard(String standard) {
        this.standard = standard;
    }
    public String getContraindication() {
        return contraindication;
    }
    public void setContraindication(String contraindication) {
        this.contraindication = contraindication;
    }
    public String getSpecification() {
        return specification;
    }
    public void setSpecification(String specification) {
        this.specification = specification;
    }
    public String getCertificateId() {
        return certificateId;
    }
    public void setCertificateId(String certificateId) {
        this.certificateId = certificateId;
    }
    public String getCertificateName() {
        return certificateName;
    }
    public void setCertificateName(String certificateName) {
        this.certificateName = certificateName;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 88 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/product/IotProductMeasuredDataDO.java

@ -0,0 +1,88 @@
package com.yihu.jw.iot.product;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * 设备测量数据表
 * @author yeshijie on 2018/1/16.
 */
@Entity
@Table(name = "iot_product_measured_data")
public class IotProductMeasuredDataDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saas_id;//
    @Column(name = "product_id")
    private String product_id;//产品ID
    @Column(name = "company_id")
    private String company_id;//企业id
    @Column(name = "data_code")
    private String data_code;//编码
    @Column(name = "type")
    private String type;//类型
    @Column(name = "instruction")
    private String instruction;//说明
    @Column(name = "del")
    private Integer del;//删除标志
    public String getSaas_id() {
        return saas_id;
    }
    public void setSaas_id(String saas_id) {
        this.saas_id = saas_id;
    }
    public String getProduct_id() {
        return product_id;
    }
    public void setProduct_id(String product_id) {
        this.product_id = product_id;
    }
    public String getCompany_id() {
        return company_id;
    }
    public void setCompany_id(String company_id) {
        this.company_id = company_id;
    }
    public String getData_code() {
        return data_code;
    }
    public void setData_code(String data_code) {
        this.data_code = data_code;
    }
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
    public String getInstruction() {
        return instruction;
    }
    public void setInstruction(String instruction) {
        this.instruction = instruction;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 0 - 137
common/common-entity/src/main/java/com/yihu/jw/iot/supplier/IotSupplyDeviceDO.java

@ -1,137 +0,0 @@
package com.yihu.jw.iot.supplier;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * @author yeshijie on 2017/12/1.
 */
@Entity
@Table(name = "iot_supply_device")
public class IotSupplyDeviceDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "name")
    private String name;//'设备名称
    @Column(name = "device_model")
    private String deviceModel;//型号
    @Column(name = "devie_type")
    private String deviceType;//设备种类 1血压计、2血糖仪
    @Column(name = "is_composite")
    private Integer isComposite;//是否复合型
    @Column(name = "is_platform")
    private Integer isPlatform;//是否平台型
    @Column(name = "device_sn")
    private String deviceSn;//设备编码
    @Column(name = "supplier_type")
    private String supplierType;//供应商类型
    @Column(name = "supplier_code")
    private String supplierCode;//供应商code
    @Column(name = "supplier_name")
    private String supplierName;//供应商名称
    @Column(name = "del")
    private Integer del;//删除标志(1有效,0删除)
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getDeviceModel() {
        return deviceModel;
    }
    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }
    public String getDeviceType() {
        return deviceType;
    }
    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }
    public Integer getIsComposite() {
        return isComposite;
    }
    public void setIsComposite(Integer isComposite) {
        this.isComposite = isComposite;
    }
    public Integer getIsPlatform() {
        return isPlatform;
    }
    public void setIsPlatform(Integer isPlatform) {
        this.isPlatform = isPlatform;
    }
    public String getDeviceSn() {
        return deviceSn;
    }
    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }
    public String getSupplierType() {
        return supplierType;
    }
    public void setSupplierType(String supplierType) {
        this.supplierType = supplierType;
    }
    public String getSupplierCode() {
        return supplierCode;
    }
    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    }
    public String getSupplierName() {
        return supplierName;
    }
    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 0 - 93
common/common-entity/src/main/java/com/yihu/jw/iot/supplier/IotSupplyDeviceDataTypeDO.java

@ -1,93 +0,0 @@
package com.yihu.jw.iot.supplier;
import com.yihu.jw.IdEntityWithOperation;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
 * @author yeshijie on 2017/12/1.
 */
@Entity
@Table(name = "iot_supply_device_data_type")
public class IotSupplyDeviceDataTypeDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "supplier_device_code")
    private String supplierDeviceCode;//供应商设备code',
    @Column(name = "device_model")
    private String deviceModel;//设备型号',
    @Column(name = "device_type")
    private String deviceType;//设备种类',
    @Column(name = "data_type")
    private String dataType;//测量数据种类',
    @Column(name = "data_type_name")
    private String dataTypeName;//测量数据种类名称',
    @Column(name = "del")
    private Integer del;//
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getSupplierDeviceCode() {
        return supplierDeviceCode;
    }
    public void setSupplierDeviceCode(String supplierDeviceCode) {
        this.supplierDeviceCode = supplierDeviceCode;
    }
    public String getDeviceModel() {
        return deviceModel;
    }
    public void setDeviceModel(String deviceModel) {
        this.deviceModel = deviceModel;
    }
    public String getDeviceType() {
        return deviceType;
    }
    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }
    public String getDataType() {
        return dataType;
    }
    public void setDataType(String dataType) {
        this.dataType = dataType;
    }
    public String getDataTypeName() {
        return dataTypeName;
    }
    public void setDataTypeName(String dataTypeName) {
        this.dataTypeName = dataTypeName;
    }
    public Integer getDel() {
        return del;
    }
    public void setDel(Integer del) {
        this.del = del;
    }
}

+ 45 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java

@ -8,6 +8,18 @@ public class IotRequestMapping {
    public static final String api_iot_common = "svr-iot";
    public static final Integer api_iot_fail = -1;
    /**
     * 公共模块
     */
    public static class Common{
        public static final String company = api_iot_common + "/company";
        public static final String system_dict = api_iot_common + "/systemDict";
        public static final String file_upload = api_iot_common + "/fileUpload";
    }
    public static class System{
        public static final String findDictByCode = "findDictByCode";
    }
    /**
     * 文件上传模块常量
@ -21,6 +33,39 @@ public class IotRequestMapping {
        public static final String message_fail_jsonData_is_null = "jsonData is null";
    }
    /**
     * 企业模块
     */
    public static class Company{
        public static final String findCompanyPage = "findCompanyPage";
        public static final String addCompany = "addCompany";
        public static final String findCompanyById = "findCompanyById";
        public static final String updCompany = "updCompany";
        public static final String delCompany = "delCompany";
        public static final String api_create = "company";
        public static final String api_delete = "company";
        public static final String api_getById = "getById";
        public static final String api_update = "company";
        public static final String api_queryPage = "queryPage";
        public static final String api_getList = "getList";
        public static final String message_success_update = "update success";
        public static final String message_success_delete = "delete success";
        public static final String message_success_find = "find success";
        public static final String message_success_create = "create success";
        public static final String message_success_find_functions = "find success";
        public static final String message_fail_name_is_null = "name is null";
        public static final String message_fail_is_no_exist = "is no exist";
        public static final String message_fail_id_no_exist = "id no exist";
        public static final String message_fail_status_is_null = "status is null";
        public static final String message_fail_id_is_null = "id is null";
        public static final String message_fail_id_exist = "id exist";
        public static final String message_fail_saasId_is_null = "saasId is null";
    }
    /**
     * 供应商模块常量
     */

+ 4 - 0
common/common-rest-model/pom.xml

@ -43,5 +43,9 @@
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
        </dependency>
    </dependencies>
</project>

+ 42 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/common/Envelop.java

@ -1,5 +1,6 @@
package com.yihu.jw.restmodel.common;
import com.alibaba.fastjson.JSONArray;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
@ -31,8 +32,12 @@ public class Envelop implements Serializable {
    private int totalCount;
    private int status;//状态 成功200,错误-1
    private List detailModelList;
    private JSONArray detailJsonArray;
    private Object obj;
    private String errorMsg;
@ -109,15 +114,33 @@ public class Envelop implements Serializable {
        this.successMsg = successMsg;
    }
    public int getStatus() {
        return status;
    }
    public void setStatus(int status) {
        this.status = status;
    }
    public JSONArray getDetailJsonArray() {
        return detailJsonArray;
    }
    public void setDetailJsonArray(JSONArray detailJsonArray) {
        this.detailJsonArray = detailJsonArray;
    }
    public static Envelop getSuccess(String message) {
        Envelop envelop = new Envelop();
        envelop.setSuccessMsg(message);
        envelop.setStatus(200);
        return envelop;
    }
    public static Envelop getSuccess(String message, Object obj) {
        Envelop envelop = new Envelop();
        envelop.setSuccessMsg(message);
        envelop.setStatus(200);
        envelop.setObj(obj);
        return envelop;
    }
@ -126,22 +149,41 @@ public class Envelop implements Serializable {
        Envelop envelop = new Envelop();
        envelop.setSuccessMsg(message);
        envelop.setPageSize(size);
        envelop.setStatus(200);
        envelop.setDetailModelList(detailModelList);
        envelop.setCurrPage(page);
        envelop.setTotalCount(count.intValue());
        return envelop;
    }
    public static Envelop getError(String message) {
        Envelop envelop = new Envelop();
        envelop.setErrorMsg(message);
        envelop.setStatus(-1);
        return envelop;
    }
    public static Envelop getError(String message, int errorCode) {
        Envelop envelop = new Envelop();
        envelop.setErrorMsg(message);
        envelop.setStatus(errorCode);
        return envelop;
    }
    public static Envelop getSuccessList(String message, List objList) {
        Envelop envelop = new Envelop();
        envelop.setSuccessMsg(message);
        envelop.setStatus(200);
        envelop.setDetailModelList(objList);
        return envelop;
    }
    public static Envelop getSuccessJsonArray(String message, JSONArray jsonArray) {
        Envelop envelop = new Envelop();
        envelop.setSuccessMsg(message);
        envelop.setStatus(200);
        envelop.setDetailJsonArray(jsonArray);
        return envelop;
    }
}

+ 20 - 1
svr/svr-iot/readme.MD

@ -1 +1,20 @@
Internet of things  物联网平台
Internet of things  物联网平台
filters 字符串拼接规则
         * like:使用"?"来表示,如:name?'%医'
         * in:使用"="来表示并用","逗号对值进行分隔,如:status=2,3,4,5
         * not in:使用"<>"来表示并用","逗号对值进行分隔,如:status=2,3,4,5
         * =:使用"="来表示,如:status=2
         * >=:使用大于号和大于等于语法,如:createDate>2012
         * <=:使用小于号和小于等于语法,如:createDate<=2015
         * 分组:在条件后面加上空格,并设置分组号,如:createDate>2012 g1,具有相同组名的条件将使用or连接 GB/T 2261.2-2003
         * 多条件组合:使用";"来分隔
         * <p/>
         * 生成 where 条件。
sort
     * +code 以code字段进行升序排序
     * -code 以code字段进行降序排序
     * 生成排序字段。

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/common/FileUploadController.java

@ -26,7 +26,7 @@ import java.util.Base64;
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "文件上传相关操作", description = "文件上传相关操作")
@Api(tags = "文件上传相关操作", description = "文件上传相关操作")
public class FileUploadController extends EnvelopRestController{
    @Autowired

+ 40 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/common/IotSystemDictController.java

@ -0,0 +1,40 @@
package com.yihu.iot.controller.common;
import com.yihu.iot.service.dict.IotSystemDictService;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * @author yeshijie on 2018/1/16.
 */
@RestController
@RequestMapping(IotRequestMapping.Common.system_dict)
@Api(tags = "系统字典相关操作", description = "系统字典相关操作")
public class IotSystemDictController extends EnvelopRestController {
    @Autowired
    private IotSystemDictService iotSystemDictService;
    @GetMapping(value = IotRequestMapping.System.findDictByCode)
    @ApiOperation(value = "获取字典列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "dictName", value = "字典名称", defaultValue = "COMPANY_TYPE")
            @RequestParam(value = "dictName", required = true) String dictName) throws Exception {
        try {
            return Envelop.getSuccessList(IotRequestMapping.Company.message_success_find_functions,iotSystemDictService.findByDictName(dictName));
        }catch (Exception e){
            e.printStackTrace();
            return Envelop.getError("查询失败");
        }
    }
}

+ 125 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/company/IotCompanyController.java

@ -0,0 +1,125 @@
package com.yihu.iot.controller.company;
import com.yihu.iot.service.company.IotCompanyService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.company.IotCompanyDO;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
/**
 * @author yeshijie on 2018/1/16.
 */
@RestController
@RequestMapping(IotRequestMapping.Common.company)
@Api(tags = "企业管理相关操作", description = "企业管理相关操作")
public class IotCompanyController extends EnvelopRestController {
    @Autowired
    private IotCompanyService iotCompanyService;
    @GetMapping(value = IotRequestMapping.Company.findCompanyPage)
    @ApiOperation(value = "分页查找企业", notes = "分页查找企业")
    public Envelop findCompanyPage(@ApiParam(name = "name", value = "供应商名称或联系人姓名", defaultValue = "")
                                       @RequestParam(value = "name", required = false) String name,
                                   @ApiParam(name = "status", value = "审核状态", defaultValue = "")
                                       @RequestParam(value = "status", required = false) String status,
                                   @ApiParam(name = "type", value = "企业类型", defaultValue = "")
                                       @RequestParam(value = "type", required = false) String type,
                                   @ApiParam(name = "page", value = "第几页", defaultValue = "")
                                       @RequestParam(value = "page", required = false) Integer page,
                                   @ApiParam(name = "size", value = "每页记录数", defaultValue = "")
                                       @RequestParam(value = "size", required = false) Integer size){
        try {
            if(page == null|| page < 0){
                page = 1;
            }
            if(size == null){
                size = 10;
            }
            if(StringUtils.isBlank(type)){
                return iotCompanyService.queryPage(page,size,status,name);
            }else {
                return iotCompanyService.queryPage(page,size,status,name,type);
            }
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.Company.addCompany)
    @ApiOperation(value = "创建企业", notes = "创建企业")
    public Envelop addCompany(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
                                  @RequestParam(value = "jsonData", required = false)String jsonData) {
        try {
            IotCompanyDO iotCompany = toEntity(jsonData, IotCompanyDO.class);
            return Envelop.getSuccess(IotRequestMapping.Company.message_success_create, iotCompanyService.create(iotCompany));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.Company.findCompanyById)
    @ApiOperation(value = "根据id查找企业", notes = "根据id查找企业")
    public Envelop findByCode(@ApiParam(name = "id", value = "id")
                              @RequestParam(value = "id", required = true) String id) {
        try {
            return Envelop.getSuccess(IotRequestMapping.Company.message_success_find, iotCompanyService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @PostMapping(value = IotRequestMapping.Company.delCompany)
    @ApiOperation(value = "删除企业", notes = "删除企业")
    public Envelop delCompany(@ApiParam(name = "id", value = "id")
                              @RequestParam(value = "id", required = true) String id) {
        try {
            iotCompanyService.delCompany(id);
            return Envelop.getSuccess(IotRequestMapping.Company.message_success_find);
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @PostMapping(value = IotRequestMapping.Company.updCompany)
    @ApiOperation(value = "修改企业信息", notes = "修改企业信息")
    public Envelop updCompany(@ApiParam(name = "jsonData", value = "json", defaultValue = "")
                                  @RequestParam(value = "jsonData", required = false)String jsonData) {
        try {
            IotCompanyDO iotCompany = toEntity(jsonData, IotCompanyDO.class);
            iotCompanyService.updCompany(iotCompany);
            return Envelop.getSuccess(IotRequestMapping.Company.message_success_find);
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.Company.api_getList)
    @ApiOperation(value = "获取企业列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段(id,supplierName,type,contactsName,contactsMobile)", defaultValue = "")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "-createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<IotCompanyDO> list = iotCompanyService.search(fields,filters,sorts);
        //封装返回格式
        List<IotCompanyDO> iotCompanys = convertToModels(list, new ArrayList<>(list.size()), IotCompanyDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.Company.message_success_find_functions,iotCompanys);
    }
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceController.java

@ -23,7 +23,7 @@ import java.util.List;
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备管理相关操作", description = "设备管理相关操作")
@Api(tags = "设备管理相关操作", description = "设备管理相关操作")
public class IotDeviceController extends EnvelopRestController{
    @Autowired
    private IotDeviceService iotDeviceService;

+ 9 - 9
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDevicePurchaseController.java

@ -1,8 +1,8 @@
package com.yihu.iot.controller.device;
import com.yihu.iot.service.device.IotDevicePurchaseService;
import com.yihu.iot.service.device.IotOrderPurchaseService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.device.IotDevicePurchaseDO;
import com.yihu.jw.iot.device.IotOrderPurchaseDO;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.rm.iot.IotRequestMapping;
@ -23,17 +23,17 @@ import java.util.List;
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备采购管理相关操作", description = "设备采购管理相关操作")
@Api(tags = "设备采购管理相关操作", description = "设备采购管理相关操作")
public class IotDevicePurchaseController extends EnvelopRestController{
    @Autowired
    private IotDevicePurchaseService iotDevicePurchaseService;
    private IotOrderPurchaseService iotDevicePurchaseService;
    @PostMapping(value = IotRequestMapping.DevicePurchase.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建设备采购", notes = "创建设备采购")
    public Envelop create(@ApiParam(name = "json_data", value = "", defaultValue = "")
                          @RequestBody String jsonData) {
        try {
            IotDevicePurchaseDO iotDevicePurchase = toEntity(jsonData, IotDevicePurchaseDO.class);
            IotOrderPurchaseDO iotDevicePurchase = toEntity(jsonData, IotOrderPurchaseDO.class);
            return Envelop.getSuccess(IotRequestMapping.DevicePurchase.message_success_create, iotDevicePurchaseService.create(iotDevicePurchase));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
@ -69,13 +69,13 @@ public class IotDevicePurchaseController extends EnvelopRestController{
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        //得到list数据
        List<IotDevicePurchaseDO> list = iotDevicePurchaseService.search(fields, filters, sorts, page, size);
        List<IotOrderPurchaseDO> list = iotDevicePurchaseService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=iotDevicePurchaseService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<IotDevicePurchaseDO> iotDevicePurchases = convertToModels(list, new ArrayList<>(list.size()), IotDevicePurchaseDO.class, fields);
        List<IotOrderPurchaseDO> iotDevicePurchases = convertToModels(list, new ArrayList<>(list.size()), IotOrderPurchaseDO.class, fields);
        return Envelop.getSuccessListWithPage(IotRequestMapping.DevicePurchase.message_success_find_functions,iotDevicePurchases, page, size,count);
    }
@ -91,9 +91,9 @@ public class IotDevicePurchaseController extends EnvelopRestController{
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "-createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<IotDevicePurchaseDO> list = iotDevicePurchaseService.search(fields,filters,sorts);
        List<IotOrderPurchaseDO> list = iotDevicePurchaseService.search(fields,filters,sorts);
        //封装返回格式
        List<IotDevicePurchaseDO> iotDevicePurchases = convertToModels(list, new ArrayList<>(list.size()), IotDevicePurchaseDO.class, fields);
        List<IotOrderPurchaseDO> iotDevicePurchases = convertToModels(list, new ArrayList<>(list.size()), IotOrderPurchaseDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.DevicePurchase.message_success_find_functions,iotDevicePurchases);
    }
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceQualityInspectionPlanController.java

@ -23,7 +23,7 @@ import java.util.List;
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备质检管理相关操作", description = "设备质检管理相关操作")
@Api(tags = "设备质检管理相关操作", description = "设备质检管理相关操作")
public class IotDeviceQualityInspectionPlanController extends EnvelopRestController{
    @Autowired
    private IotDeviceQualityInspectionPlanService iotDeviceQualityInspectionPlanService;

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/dict/IotDeviceDictController.java

@ -22,7 +22,7 @@ import java.util.List;
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备字典管理相关操作", description = "设备字典管理相关操作")
@Api(tags = "设备字典管理相关操作", description = "设备字典管理相关操作")
public class IotDeviceDictController extends EnvelopRestController{
    @Autowired

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/label/IotDeviceLabelController.java

@ -23,7 +23,7 @@ import java.util.List;
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备标签相关操作", description = "设备标签相关操作")
@Api(tags = "设备标签相关操作", description = "设备标签相关操作")
public class IotDeviceLabelController extends EnvelopRestController {
    @Autowired

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/controller/label/IotDeviceLabelInfoController.java

@ -23,7 +23,7 @@ import java.util.List;
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备标签信息操作", description = "设备标签信息相关操作")
@Api(tags = "设备标签信息操作", description = "设备标签信息相关操作")
public class IotDeviceLabelInfoController extends EnvelopRestController {
    @Autowired

+ 0 - 123
svr/svr-iot/src/main/java/com/yihu/iot/controller/supplier/IotDeviceSupplierController.java

@ -1,123 +0,0 @@
package com.yihu.iot.controller.supplier;
import com.yihu.iot.service.supplier.IotDeviceSupplierService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.supplier.IotDeviceSupplierDO;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
 * @author yeshijie on 2017/12/5.
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "供应商管理相关操作", description = "供应商管理相关操作")
public class IotDeviceSupplierController extends EnvelopRestController {
    @Autowired
    private IotDeviceSupplierService iotDeviceSupplierService;
    @PostMapping(value = IotRequestMapping.DeviceSupplier.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建供应商", notes = "创建供应商")
    public Envelop create(@ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        try {
            IotDeviceSupplierDO iotDeviceSupplier = toEntity(jsonData, IotDeviceSupplierDO.class);
            return Envelop.getSuccess(IotRequestMapping.DeviceSupplier.message_success_create, iotDeviceSupplierService.create(iotDeviceSupplier));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @PutMapping(value = IotRequestMapping.DeviceSupplier.api_update, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "更新供应商", notes = "更新供应商")
    public Envelop update(@ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData){
        try {
            IotDeviceSupplierDO iotDeviceSupplier = toEntity(jsonData, IotDeviceSupplierDO.class);
            return Envelop.getSuccess(IotRequestMapping.DeviceSupplier.message_success_update, iotDeviceSupplierService.update(iotDeviceSupplier));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @DeleteMapping(value = IotRequestMapping.DeviceSupplier.api_delete)
    @ApiOperation(value = "删除供应商", notes = "删除供应商")
    public Envelop delete(@ApiParam(name = "id", value = "id")
                              @RequestParam(value = "id", required = true) String id){
        try {
            iotDeviceSupplierService.deleteById(id);
            return Envelop.getSuccess(IotRequestMapping.DeviceSupplier.message_success_delete, null);
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceSupplier.api_getById)
    @ApiOperation(value = "根据code查找供应商", notes = "根据code查找供应商")
    public Envelop findByCode(@ApiParam(name = "id", value = "id")
            @RequestParam(value = "id", required = true) String id
    ) {
        try {
            return Envelop.getSuccess(IotRequestMapping.DeviceSupplier.message_success_find, iotDeviceSupplierService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value = IotRequestMapping.DeviceSupplier.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取供应商")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段(id,supplierName,type,contactsName,contactsMobile)", defaultValue = "")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件(supplierName?中 g1;contactsName?中 g1)")
            @RequestParam(value = "filters", required = false,defaultValue = "") String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "-createTime")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "size", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "size", required = false) Integer size,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) Integer page,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        //得到list数据
        List<IotDeviceSupplierDO> list = iotDeviceSupplierService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=iotDeviceSupplierService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<IotDeviceSupplierDO> iotDeviceSuppliers = convertToModels(list, new ArrayList<>(list.size()), IotDeviceSupplierDO.class, fields);
        return Envelop.getSuccessListWithPage(IotRequestMapping.DeviceSupplier.message_success_find_functions,iotDeviceSuppliers, page, size,count);
    }
    @GetMapping(value = IotRequestMapping.DeviceSupplier.api_getList)
    @ApiOperation(value = "获取供应商列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段(id,supplierName,type,contactsName,contactsMobile)", defaultValue = "")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "-createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<IotDeviceSupplierDO> list = iotDeviceSupplierService.search(fields,filters,sorts);
        //封装返回格式
        List<IotDeviceSupplierDO> iotDeviceSuppliers = convertToModels(list, new ArrayList<>(list.size()), IotDeviceSupplierDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.DeviceSupplier.message_success_find_functions,iotDeviceSuppliers);
    }
}

+ 0 - 101
svr/svr-iot/src/main/java/com/yihu/iot/controller/supplier/IotSupplyDeviceController.java

@ -1,101 +0,0 @@
package com.yihu.iot.controller.supplier;
import com.yihu.iot.service.supplier.IotSupplyDeviceService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.supplier.IotSupplyDeviceDO;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
 * @author yeshijie on 2017/12/8.
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "供应设备-供应设备管理相关操作", description = "供应设备-供应设备管理相关操作")
public class IotSupplyDeviceController extends EnvelopRestController{
    @Autowired
    private IotSupplyDeviceService iotSupplyDeviceService;
    @PostMapping(value = IotRequestMapping.SupplyDevice.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建供应设备", notes = "创建供应设备")
    public Envelop create(
            @ApiParam(name = "json_data", value = "", defaultValue = "")
            @RequestBody String jsonData) {
        try {
            IotSupplyDeviceDO iotSupplyDevice = toEntity(jsonData, IotSupplyDeviceDO.class);
            return Envelop.getSuccess(IotRequestMapping.SupplyDevice.message_success_create, iotSupplyDeviceService.create(iotSupplyDevice));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.SupplyDevice.api_getById)
    @ApiOperation(value = "根据code查找供应设备", notes = "根据code查找供应设备")
    public Envelop findByCode(
            @ApiParam(name = "id", value = "id")
            @RequestParam(value = "id", required = true) String id
    ) {
        try {
            return Envelop.getSuccess(IotRequestMapping.SupplyDevice.message_success_find, iotSupplyDeviceService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value = IotRequestMapping.SupplyDevice.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取供应设备")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,supplierName,type,contactsName,contactsMobile")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false,defaultValue = "name?中 g1;deviceModel?中 g1") String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+createTime")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "size", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "size", required = false) int size,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) int page,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        //得到list数据
        List<IotSupplyDeviceDO> list = iotSupplyDeviceService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=iotSupplyDeviceService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<IotSupplyDeviceDO> iotSupplyDevices = convertToModels(list, new ArrayList<>(list.size()), IotSupplyDeviceDO.class, fields);
        return Envelop.getSuccessListWithPage(IotRequestMapping.SupplyDevice.message_success_find_functions,iotSupplyDevices, page, size,count);
    }
    @GetMapping(value = IotRequestMapping.SupplyDevice.api_getList)
    @ApiOperation(value = "获取供应设备列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段", defaultValue = "id,supplierName,type,contactsName,contactsMobile")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "+createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<IotSupplyDeviceDO> list = iotSupplyDeviceService.search(fields,filters,sorts);
        //封装返回格式
        List<IotSupplyDeviceDO> iotSupplyDevices = convertToModels(list, new ArrayList<>(list.size()), IotSupplyDeviceDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.SupplyDevice.message_success_find_functions,iotSupplyDevices);
    }
}

+ 0 - 87
svr/svr-iot/src/main/java/com/yihu/iot/controller/supplier/IotSupplyDeviceDataTypeController.java

@ -1,87 +0,0 @@
package com.yihu.iot.controller.supplier;
import com.yihu.iot.service.supplier.IotSupplyDeviceDataTypeService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.supplier.IotSupplyDeviceDataTypeDO;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.rm.iot.IotRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
 * @author yeshijie on 2017/12/8.
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "供应设备数据类型管理相关操作", description = "供应设备数据类型管理相关操作")
public class IotSupplyDeviceDataTypeController extends EnvelopRestController{
    
    @Autowired
    private IotSupplyDeviceDataTypeService iotSupplyDeviceDataTypeService;
    @GetMapping(value = IotRequestMapping.SupplyDeviceDataType.api_getById)
    @ApiOperation(value = "根据code查找供应设备数据类型", notes = "根据code查找供应设备数据类型")
    public Envelop findByCode(@ApiParam(name = "id", value = "id")
                              @RequestParam(value = "id", required = true) String id
    ) {
        try {
            return Envelop.getSuccess(IotRequestMapping.SupplyDeviceDataType.message_success_find, iotSupplyDeviceDataTypeService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value = IotRequestMapping.SupplyDeviceDataType.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取供应设备数据类型")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段(id,supplierName,type,contactsName,contactsMobile)", defaultValue = "")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件(supplierName?中 g1;contactsName?中 g1)")
            @RequestParam(value = "filters", required = false,defaultValue = "") String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "-createTime")
            @RequestParam(value = "sorts", required = false) String sorts,
            @ApiParam(name = "size", value = "分页大小", defaultValue = "15")
            @RequestParam(value = "size", required = false) Integer size,
            @ApiParam(name = "page", value = "页码", defaultValue = "1")
            @RequestParam(value = "page", required = false) Integer page,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
        //得到list数据
        List<IotSupplyDeviceDataTypeDO> list = iotSupplyDeviceDataTypeService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=iotSupplyDeviceDataTypeService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<IotSupplyDeviceDataTypeDO> iotSupplyDeviceDataTypes = convertToModels(list, new ArrayList<>(list.size()), IotSupplyDeviceDataTypeDO.class, fields);
        return Envelop.getSuccessListWithPage(IotRequestMapping.SupplyDeviceDataType.message_success_find_functions,iotSupplyDeviceDataTypes, page, size,count);
    }
    @GetMapping(value = IotRequestMapping.SupplyDeviceDataType.api_getList)
    @ApiOperation(value = "获取供应设备数据类型列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段(id,supplierName,type,contactsName,contactsMobile)", defaultValue = "")
            @RequestParam(value = "fields", required = false) String fields,
            @ApiParam(name = "filters", value = "过滤器,为空检索所有条件")
            @RequestParam(value = "filters", required = false) String filters,
            @ApiParam(name = "sorts", value = "排序,规则参见说明文档", defaultValue = "-createTime")
            @RequestParam(value = "sorts", required = false) String sorts) throws Exception {
        //得到list数据
        List<IotSupplyDeviceDataTypeDO> list = iotSupplyDeviceDataTypeService.search(fields,filters,sorts);
        //封装返回格式
        List<IotSupplyDeviceDataTypeDO> iotSupplyDeviceDataTypes = convertToModels(list, new ArrayList<>(list.size()), IotSupplyDeviceDataTypeDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.SupplyDeviceDataType.message_success_find_functions,iotSupplyDeviceDataTypes);
    }
}

+ 13 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyCertificateChangeRecordDao.java

@ -0,0 +1,13 @@
package com.yihu.iot.dao.company;
import com.yihu.jw.iot.company.IotCompanyCertificateChangeRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/16.
 */
public interface IotCompanyCertificateChangeRecordDao extends PagingAndSortingRepository<IotCompanyCertificateChangeRecordDO, String>,
        JpaSpecificationExecutor<IotCompanyCertificateChangeRecordDO> {
}

+ 14 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyCertificateDao.java

@ -0,0 +1,14 @@
package com.yihu.iot.dao.company;
import com.yihu.jw.iot.company.IotCompanyCertificateDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/16.
 */
public interface IotCompanyCertificateDao extends PagingAndSortingRepository<IotCompanyCertificateDO, String>,
        JpaSpecificationExecutor<IotCompanyCertificateDO>{
}

+ 18 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyDao.java

@ -0,0 +1,18 @@
package com.yihu.iot.dao.company;
import com.yihu.jw.iot.company.IotCompanyDO;
import com.yihu.jw.iot.device.IotOrderPurchaseDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 企业表
 * @author yeshijie on 2018/1/15.
 */
public interface IotCompanyDao extends PagingAndSortingRepository<IotCompanyDO, String>,
        JpaSpecificationExecutor<IotCompanyDO> {
    @Query("from IotCompanyDO w where w.id =?1")
    IotCompanyDO findById(String id);
}

+ 19 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/company/IotCompanyTypeDao.java

@ -0,0 +1,19 @@
package com.yihu.iot.dao.company;
import com.yihu.jw.iot.company.IotCompanyTypeDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * 企业类型表
 * @author yeshijie on 2018/1/16.
 */
public interface IotCompanyTypeDao extends PagingAndSortingRepository<IotCompanyTypeDO, String>,
        JpaSpecificationExecutor<IotCompanyTypeDO> {
    @Query("select s from IotCompanyTypeDO s where s.companyId = ?1 ")
    List<IotCompanyTypeDO> findByCompanyId(String companyId);
}

+ 0 - 15
svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotDevicePurchaseDao.java

@ -1,15 +0,0 @@
package com.yihu.iot.dao.device;
import com.yihu.jw.iot.device.IotDevicePurchaseDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2017/12/1.
 */
public interface IotDevicePurchaseDao extends PagingAndSortingRepository<IotDevicePurchaseDO,String>,JpaSpecificationExecutor<IotDevicePurchaseDO> {
    @Query("from IotDevicePurchaseDO w where w.id =?1")
    IotDevicePurchaseDO findById(String id);
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotOrderPurchaseDao.java

@ -0,0 +1,15 @@
package com.yihu.iot.dao.device;
import com.yihu.jw.iot.device.IotOrderPurchaseDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2017/12/1.
 */
public interface IotOrderPurchaseDao extends PagingAndSortingRepository<IotOrderPurchaseDO,String>,JpaSpecificationExecutor<IotOrderPurchaseDO> {
    @Query("from IotOrderPurchaseDO w where w.id =?1")
    IotOrderPurchaseDO findById(String id);
}

+ 14 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotPatientDeviceDao.java

@ -0,0 +1,14 @@
package com.yihu.iot.dao.device;
import com.yihu.jw.iot.device.IotQualityRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/16.
 */
public interface IotPatientDeviceDao extends PagingAndSortingRepository<IotQualityRecordDO, String>,
        JpaSpecificationExecutor<IotQualityRecordDO> {
}

+ 14 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotQualityRecordDao.java

@ -0,0 +1,14 @@
package com.yihu.iot.dao.device;
import com.yihu.jw.iot.device.IotQualityRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/16.
 */
public interface IotQualityRecordDao extends PagingAndSortingRepository<IotQualityRecordDO, String>,
        JpaSpecificationExecutor<IotQualityRecordDO> {
}

+ 2 - 1
svr/svr-iot/src/main/java/com/yihu/iot/dao/dict/IotDeviceDictDao.java

@ -8,7 +8,8 @@ import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2017/12/1.
 */
public interface IotDeviceDictDao extends PagingAndSortingRepository<IotDeviceDictDO,String>,JpaSpecificationExecutor<IotDeviceDictDO> {
public interface IotDeviceDictDao extends PagingAndSortingRepository<IotDeviceDictDO,String>,
        JpaSpecificationExecutor<IotDeviceDictDO> {
    @Query("from IotDeviceDictDO w where w.id =?1")
    IotDeviceDictDO findById(String id);

+ 14 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/dict/IotSystemDictDao.java

@ -0,0 +1,14 @@
package com.yihu.iot.dao.dict;
import com.yihu.jw.iot.dict.IotSystemDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/16.
 */
public interface IotSystemDictDao extends PagingAndSortingRepository<IotSystemDictDO,String>,
        JpaSpecificationExecutor<IotSystemDictDO> {
    
}

+ 14 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductAttachmentDao.java

@ -0,0 +1,14 @@
package com.yihu.iot.dao.product;
import com.yihu.jw.iot.product.IotProductAttachmentDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/16.
 */
public interface IotProductAttachmentDao extends PagingAndSortingRepository<IotProductAttachmentDO,String>,
        JpaSpecificationExecutor<IotProductAttachmentDO> {
}

+ 14 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductBaseInfoDao.java

@ -0,0 +1,14 @@
package com.yihu.iot.dao.product;
import com.yihu.jw.iot.product.IotProductBaseInfoDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/16.
 */
public interface IotProductBaseInfoDao extends PagingAndSortingRepository<IotProductBaseInfoDO,String>,
        JpaSpecificationExecutor<IotProductBaseInfoDO> {
}

+ 14 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductDataTransmissionDao.java

@ -0,0 +1,14 @@
package com.yihu.iot.dao.product;
import com.yihu.jw.iot.product.IotProductDataTransmissionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/16.
 */
public interface IotProductDataTransmissionDao extends PagingAndSortingRepository<IotProductDataTransmissionDO,String>,
        JpaSpecificationExecutor<IotProductDataTransmissionDO> {
}

+ 14 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductExtendInfoDao.java

@ -0,0 +1,14 @@
package com.yihu.iot.dao.product;
import com.yihu.jw.iot.product.IotProductExtendInfoDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/16.
 */
public interface IotProductExtendInfoDao extends PagingAndSortingRepository<IotProductExtendInfoDO,String>,
        JpaSpecificationExecutor<IotProductExtendInfoDO> {
}

+ 14 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/product/IotProductMeasuredDataDao.java

@ -0,0 +1,14 @@
package com.yihu.iot.dao.product;
import com.yihu.jw.iot.product.IotProductMeasuredDataDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2018/1/16.
 */
public interface IotProductMeasuredDataDao extends PagingAndSortingRepository<IotProductMeasuredDataDO,String>,
        JpaSpecificationExecutor<IotProductMeasuredDataDO> {
}

+ 0 - 15
svr/svr-iot/src/main/java/com/yihu/iot/dao/supplier/IotDeviceSupplierDao.java

@ -1,15 +0,0 @@
package com.yihu.iot.dao.supplier;
import com.yihu.jw.iot.supplier.IotDeviceSupplierDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2017/12/5.
 */
public interface IotDeviceSupplierDao extends PagingAndSortingRepository<IotDeviceSupplierDO, String>, JpaSpecificationExecutor<IotDeviceSupplierDO> {
    @Query("from IotDeviceSupplierDO w where w.id =?1")
    IotDeviceSupplierDO findById(String id);
}

+ 0 - 15
svr/svr-iot/src/main/java/com/yihu/iot/dao/supplier/IotSupplyDeviceDao.java

@ -1,15 +0,0 @@
package com.yihu.iot.dao.supplier;
import com.yihu.jw.iot.supplier.IotSupplyDeviceDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2017/12/5.
 */
public interface IotSupplyDeviceDao extends PagingAndSortingRepository<IotSupplyDeviceDO, String>, JpaSpecificationExecutor<IotSupplyDeviceDO> {
    @Query("from IotSupplyDeviceDO w where w.id =?1")
    IotSupplyDeviceDO findById(String id);
}

+ 0 - 15
svr/svr-iot/src/main/java/com/yihu/iot/dao/supplier/IotSupplyDeviceDataTypeDao.java

@ -1,15 +0,0 @@
package com.yihu.iot.dao.supplier;
import com.yihu.jw.iot.supplier.IotSupplyDeviceDataTypeDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author yeshijie on 2017/12/5.
 */
public interface IotSupplyDeviceDataTypeDao extends PagingAndSortingRepository<IotSupplyDeviceDataTypeDO, String>, JpaSpecificationExecutor<IotSupplyDeviceDataTypeDO> {
    @Query("from IotSupplyDeviceDataTypeDO w where w.id =?1")
    IotSupplyDeviceDataTypeDO findById(String id);
}

+ 4 - 5
svr/svr-iot/src/main/java/com/yihu/iot/datainput/service/DataInputService.java

@ -3,7 +3,6 @@ package com.yihu.iot.datainput.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.base.es.config.ElastricSearchHelper;
import com.yihu.base.es.config.model.SaveModel;
import com.yihu.base.hbase.HBaseAdmin;
import com.yihu.base.hbase.HBaseHelper;
import com.yihu.iot.datainput.enums.DataOperationTypeEnum;
@ -67,7 +66,7 @@ public class DataInputService {
                    iotDeviceDO.setDeviceSn(sn);
//                    iotDeviceDO.setCode(dataJson.getString("ext_code"));
                    iotDeviceDO.setName(dataJson.getString("device_name"));
                    iotDeviceDO.setDeviceModel(dataJson.getString("device_model"));
//                    iotDeviceDO.setDeviceModel(dataJson.getString("device_model"));
                    iotDeviceDO.setDeviceSource("2"); //设备来源为居民绑定
                    iotDeviceDO.setCreateUser(dataJson.getString("idcard")); //居民绑定的,暂定创建人和修改人均为居民
@ -75,10 +74,10 @@ public class DataInputService {
                    iotDeviceDO.setUpdateUser(dataJson.getString("idcard"));
                    iotDeviceDO.setUpdateUserName(dataJson.getString("username"));
                    iotDeviceDO.setManufacturerCode(dataJson.getString("manufacture_code"));
//                    iotDeviceDO.setManufacturerCode(dataJson.getString("manufacture_code"));
                    iotDeviceDO.setManufacturerName(dataJson.getString("manufacture_name"));
                    iotDeviceDO.setManufactureTel(dataJson.getString("manufacture_tel"));
                    iotDeviceDO.setSupplierCode(dataJson.getString("owner_org_code"));
//                    iotDeviceDO.setManufactureTel(dataJson.getString("manufacture_tel"));
//                    iotDeviceDO.setSupplierCode(dataJson.getString("owner_org_code"));
                    iotDeviceDO.setSupplierName(dataJson.getString("owner_org_name"));
                    iotDeviceDO.setName(dataJson.getString("sale_org_code"));
                    iotDeviceDO.setName(dataJson.getString("sale_org_name"));

+ 57 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/common/MyJdbcTemplate.java

@ -0,0 +1,57 @@
package com.yihu.iot.service.common;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.ResultSetExtractor;
import org.springframework.stereotype.Component;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
/**
 * @author yeshijie on 2018/1/16.
 */
@Component
public class MyJdbcTemplate{
    @Autowired
    private JdbcTemplate jdbcTemplate;
    /**
     * jdbc查询返回json
     * @param sql
     * @param args
     * @return
     * @throws DataAccessException
     */
    public List<JSONObject> queryJson(String sql, Object[] args) throws DataAccessException {
        return jdbcTemplate.query(sql, args, new ResultSetExtractor<List<JSONObject>>() {
            @Override
            public List<JSONObject> extractData(ResultSet resultSet) throws SQLException, DataAccessException {
                ResultSetMetaData rsd = resultSet.getMetaData();
                int clength = rsd.getColumnCount();
                List<JSONObject> li = new ArrayList<JSONObject>();
                String columnName;
                try {
                    while (resultSet.next()) {
                        JSONObject jo = new JSONObject();
                        for (int i = 0; i < clength; i++) {
                            columnName = rsd.getColumnLabel(i + 1);
                            jo.put(columnName, resultSet.getObject(i + 1));
                        }
                        li.add(jo);
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                return li;
            }
        });
    }
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyCertificateChangeRecordService.java

@ -0,0 +1,15 @@
package com.yihu.iot.service.company;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.company.IotCompanyCertificateChangeRecordDao;
import com.yihu.jw.iot.company.IotCompanyCertificateChangeRecordDO;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotCompanyCertificateChangeRecordService extends BaseJpaService<IotCompanyCertificateChangeRecordDO,IotCompanyCertificateChangeRecordDao> {
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyCertificateService.java

@ -0,0 +1,15 @@
package com.yihu.iot.service.company;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.company.IotCompanyCertificateDao;
import com.yihu.jw.iot.company.IotCompanyCertificateDO;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotCompanyCertificateService extends BaseJpaService<IotCompanyCertificateDO,IotCompanyCertificateDao> {
}

+ 200 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java

@ -0,0 +1,200 @@
package com.yihu.iot.service.company;
import com.alibaba.fastjson.JSONObject;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.company.IotCompanyDao;
import com.yihu.iot.dao.company.IotCompanyTypeDao;
import com.yihu.jw.iot.company.IotCompanyDO;
import com.yihu.jw.iot.company.IotCompanyTypeDO;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
 * @author yeshijie on 2018/1/15.
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao> {
    @Autowired
    private IotCompanyDao iotCompanyDao;
    @Autowired
    private IotCompanyTypeDao iotCompanyTypeDao;
    @Autowired
    private JdbcTemplate jdbcTempalte;
    /**
     * 分页查找
     * @param page
     * @param size
     * @param status
     * @param name
     * @return
     * @throws ParseException
     */
    public Envelop queryPage(Integer page,Integer size,String status,String name) throws ParseException {
        String filters = "";
        String semicolon = "";
        if(StringUtils.isNotBlank(name)){
            filters = "name?"+name+" g1;contactsName?"+name+" g1";
            semicolon = ";";
        }
        if(StringUtils.isNotBlank(status)){
            filters += semicolon +"status="+status;
            semicolon = ";";
        }
        if(StringUtils.isBlank(filters)){
            filters+= semicolon + "del=1";
        }
        String sorts = "-updateTime";
        //得到list数据
        List<IotCompanyDO> list = search(null, filters, sorts, page, size);
        list.forEach(one->{
            findType(one);
        });
        //获取总数
        long count = getCount(filters);
        return Envelop.getSuccessListWithPage(IotRequestMapping.Company.message_success_find_functions,list, page, size,count);
    }
    /**
     * 按类型分页查找
     * @param page
     * @param size
     * @param status
     * @param name
     * @param type
     * @return
     */
    public Envelop queryPage(Integer page,Integer size,String status,String name,String type){
        StringBuffer sql = new StringBuffer("SELECT DISTINCT c.* from iot_company c ,iot_company_type t WHERE del=1 ");
        StringBuffer sqlCount = new StringBuffer("SELECT COUNT(DISTINCT c.id) count from iot_company c ,iot_company_type t WHERE del=1 ");
        List<Object> args = new ArrayList<>();
        if(StringUtils.isNotBlank(status)){
            sql.append(" and c.status=? ");
            sqlCount.append(" and c.status='").append(status).append("' ");
            args.add(status);
        }
        if(StringUtils.isNotBlank(name)){
            sql.append(" and (c.name like ? or c.contactsName like ?)");
            sqlCount.append(" and (c.name like '").append(name).append("' or c.contactsName like '").append(name).append("')");
            args.add(name);
            args.add(name);
        }
        if(StringUtils.isNotBlank(type)){
            sql.append(" and t.type=? ");
            sqlCount.append(" and t.type='").append(type).append("' ");
            args.add(type);
        }
        sql.append("order by c.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotCompanyDO> list = jdbcTempalte.query(sql.toString(),args.toArray(),new BeanPropertyRowMapper(IotCompanyDO.class));
        list.forEach(one->{
            findType(one);
        });
        List<Map<String,Object>> countList = jdbcTempalte.queryForList(sqlCount.toString());
        long count = Long.valueOf(countList.get(0).get("count").toString());
        return Envelop.getSuccessListWithPage(IotRequestMapping.Company.message_success_find_functions,list, page, size,count);
    }
    /**
     * 新增
     * @param iotCompany
     * @return
     */
    public IotCompanyDO create(IotCompanyDO iotCompany) {
        iotCompany.setSaasId(getCode());
        iotCompany.setDel(1);
        List<JSONObject> list = iotCompany.getTypeList();
        iotCompany = iotCompanyDao.save(iotCompany);
        //新增类型
        List<IotCompanyTypeDO> companyTypes = new ArrayList<>(10);
        for (JSONObject json:list) {
            IotCompanyTypeDO companyType = new IotCompanyTypeDO();
            companyType.setSaasId(getCode());
            companyType.setCompanyId(iotCompany.getId());
            companyType.setType(json.getString("type"));
            companyType.setTypeName(json.getString("typeName"));
            companyTypes.add(companyType);
        }
        iotCompanyTypeDao.save(companyTypes);
        return iotCompany;
    }
    /**
     * 按id查找
     * @param id
     * @return
     */
    public IotCompanyDO findById(String id) {
        IotCompanyDO company = iotCompanyDao.findById(id);
        findType(company);
        return company;
    }
    /**
     * 添加类型
     * @param company
     */
    public void findType(IotCompanyDO company){
        //查找类型
        List<IotCompanyTypeDO> companyTypes = iotCompanyTypeDao.findByCompanyId(company.getId());
        List<JSONObject> list = new ArrayList<>(8);
        if(companyTypes.size()>0){
            companyTypes.forEach(one->{
                JSONObject json = new JSONObject();
                json.put("type",one.getType());
                json.put("typeName",one.getTypeName());
                list.add(json);
            });
        }
        company.setTypeList(list);
    }
    /**
     * 删除
     * @param id
     */
    public void delCompany(String id){
        IotCompanyDO company = iotCompanyDao.findById(id);
        company.setDel(0);
        iotCompanyDao.save(company);
    }
    /**
     * 修改
     * @param iotCompany
     */
    public void updCompany(IotCompanyDO iotCompany){
        //更新类型
        List<IotCompanyTypeDO> typeList = iotCompanyTypeDao.findByCompanyId(iotCompany.getId());
        iotCompanyTypeDao.delete(typeList);
        List<IotCompanyTypeDO> companyTypes = new ArrayList<>(10);
        for (JSONObject json:iotCompany.getTypeList()) {
            IotCompanyTypeDO companyType = new IotCompanyTypeDO();
            companyType.setSaasId(getCode());
            companyType.setCompanyId(iotCompany.getId());
            companyType.setType(json.getString("type"));
            companyType.setTypeName(json.getString("typeName"));
            companyTypes.add(companyType);
        }
        iotCompanyTypeDao.save(companyTypes);
        iotCompanyDao.save(iotCompany);
    }
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyTypeService.java

@ -0,0 +1,15 @@
package com.yihu.iot.service.company;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.company.IotCompanyTypeDao;
import com.yihu.jw.iot.company.IotCompanyTypeDO;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotCompanyTypeService extends BaseJpaService<IotCompanyTypeDO,IotCompanyTypeDao> {
}

+ 6 - 6
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDevicePurchaseService.java

@ -1,8 +1,8 @@
package com.yihu.iot.service.device;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.device.IotDevicePurchaseDao;
import com.yihu.jw.iot.device.IotDevicePurchaseDO;
import com.yihu.iot.dao.device.IotOrderPurchaseDao;
import com.yihu.jw.iot.device.IotOrderPurchaseDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -10,23 +10,23 @@ import org.springframework.stereotype.Service;
 * @author yeshijie on 2017/12/8.
 */
@Service
public class IotDevicePurchaseService extends BaseJpaService<IotDevicePurchaseDO,IotDevicePurchaseDao> {
public class IotOrderPurchaseService extends BaseJpaService<IotOrderPurchaseDO,IotOrderPurchaseDao> {
    @Autowired
    private IotDevicePurchaseDao iotDevicePurchaseDao;
    private IotOrderPurchaseDao iotDevicePurchaseDao;
    /**
     * 新增
     * @param iotDevicePurchase
     * @return
     */
    public IotDevicePurchaseDO create(IotDevicePurchaseDO iotDevicePurchase) {
    public IotOrderPurchaseDO create(IotOrderPurchaseDO iotDevicePurchase) {
        iotDevicePurchase.setSaasId(getCode());
        iotDevicePurchase.setDel(1);
        return iotDevicePurchaseDao.save(iotDevicePurchase);
    }
    public IotDevicePurchaseDO findById(String id) {
    public IotOrderPurchaseDO findById(String id) {
        return iotDevicePurchaseDao.findById(id);
    }
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -0,0 +1,15 @@
package com.yihu.iot.service.device;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.device.IotPatientDeviceDao;
import com.yihu.jw.iot.device.IotPatientDeviceDO;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,IotPatientDeviceDao> {
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotQualityRecordService.java

@ -0,0 +1,15 @@
package com.yihu.iot.service.device;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.device.IotQualityRecordDao;
import com.yihu.jw.iot.device.IotQualityRecordDO;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotQualityRecordService extends BaseJpaService<IotQualityRecordDO,IotQualityRecordDao> {
}

+ 35 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/dict/IotSystemDictService.java

@ -0,0 +1,35 @@
package com.yihu.iot.service.dict;
import com.alibaba.fastjson.JSONObject;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.dict.IotSystemDictDao;
import com.yihu.iot.service.common.MyJdbcTemplate;
import com.yihu.jw.iot.dict.IotSystemDictDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotSystemDictService extends BaseJpaService<IotSystemDictDO,IotSystemDictDao> {
    @Autowired
    private IotSystemDictDao iotSystemDictDao;
    @Autowired
    private MyJdbcTemplate myJdbcTemplate;
    /**
     * 查询字典
     * @param dictName
     * @return
     */
    public List<JSONObject> findByDictName(String dictName){
        String sql = "SELECT code,value from iot_system_dict WHERE dict_name = ? and del = 1 ORDER BY sort";
        return myJdbcTemplate.queryJson(sql,new Object[]{dictName});
    }
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductAttachmentService.java

@ -0,0 +1,15 @@
package com.yihu.iot.service.product;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.product.IotProductAttachmentDao;
import com.yihu.jw.iot.product.IotProductAttachmentDO;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotProductAttachmentService extends BaseJpaService<IotProductAttachmentDO,IotProductAttachmentDao> {
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductBaseInfoService.java

@ -0,0 +1,15 @@
package com.yihu.iot.service.product;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.product.IotProductBaseInfoDao;
import com.yihu.jw.iot.product.IotProductBaseInfoDO;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotProductBaseInfoService extends BaseJpaService<IotProductBaseInfoDO,IotProductBaseInfoDao> {
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductDataTransmissionService.java

@ -0,0 +1,15 @@
package com.yihu.iot.service.product;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.product.IotProductDataTransmissionDao;
import com.yihu.jw.iot.product.IotProductDataTransmissionDO;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotProductDataTransmissionService extends BaseJpaService<IotProductDataTransmissionDO,IotProductDataTransmissionDao> {
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductExtendInfoService.java

@ -0,0 +1,15 @@
package com.yihu.iot.service.product;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.product.IotProductExtendInfoDao;
import com.yihu.jw.iot.product.IotProductExtendInfoDO;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotProductExtendInfoService extends BaseJpaService<IotProductExtendInfoDO,IotProductExtendInfoDao> {
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/product/IotProductMeasuredDataService.java

@ -0,0 +1,15 @@
package com.yihu.iot.service.product;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.dict.IotDeviceDictDao;
import com.yihu.jw.iot.dict.IotDeviceDictDO;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2018/1/16.
 */
@Service
public class IotProductMeasuredDataService extends BaseJpaService<IotDeviceDictDO,IotDeviceDictDao> {
}

+ 0 - 140
svr/svr-iot/src/main/java/com/yihu/iot/service/supplier/IotDeviceSupplierService.java

@ -1,140 +0,0 @@
package com.yihu.iot.service.supplier;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.supplier.IotDeviceSupplierDao;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.exception.code.ExceptionCode;
import com.yihu.jw.iot.supplier.IotDeviceSupplierDO;
import com.yihu.jw.rm.iot.IotRequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
/**
 * @author yeshijie on 2017/12/5.
 */
@Service
public class IotDeviceSupplierService extends BaseJpaService<IotDeviceSupplierDO,IotDeviceSupplierDao>{
    @Autowired
    private IotDeviceSupplierDao iotDeviceSupplierDao;
    /**
     * 新增
     * @param iotDeviceSupplier
     * @return
     */
    public IotDeviceSupplierDO create(IotDeviceSupplierDO iotDeviceSupplier) {
        if (StringUtils.isEmpty(iotDeviceSupplier.getSupplierName())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_supplierName_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getOrganizationCode())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_organizationCode_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getContactsName())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_contactsName_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getContactsMobile())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_contactsMobile_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getContactsPhone())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_contactsPhone_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getContactsIdcard())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_contactsIdcard_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getType())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_type_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getOrganizationCodeImg())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_organizationCodeImg_is_null, ExceptionCode.common_error_params_code);
        }
        if(StringUtils.isEmpty(iotDeviceSupplier.getContactsIdcardImg())){
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_contactsIdcardImg_is_null,ExceptionCode.common_error_params_code);
        }
        iotDeviceSupplier.setSaasId(getCode());
        iotDeviceSupplier.setDel(1);
        return iotDeviceSupplierDao.save(iotDeviceSupplier);
    }
    /**
     * 修改
     * @param iotDeviceSupplier
     * @return
     */
    public IotDeviceSupplierDO update(IotDeviceSupplierDO iotDeviceSupplier){
        if(StringUtils.isEmpty(iotDeviceSupplier.getId())){
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_id_is_null,ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getSupplierName())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_supplierName_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getOrganizationCode())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_organizationCode_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getContactsName())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_contactsName_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getContactsMobile())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_contactsMobile_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getContactsPhone())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_contactsPhone_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getContactsIdcard())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_contactsIdcard_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getType())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_type_is_null, ExceptionCode.common_error_params_code);
        }
        if (StringUtils.isEmpty(iotDeviceSupplier.getOrganizationCodeImg())) {
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_organizationCodeImg_is_null, ExceptionCode.common_error_params_code);
        }
        if(StringUtils.isEmpty(iotDeviceSupplier.getContactsIdcardImg())){
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_contactsIdcardImg_is_null,ExceptionCode.common_error_params_code);
        }
        IotDeviceSupplierDO deviceSupplier = findById(iotDeviceSupplier.getId());
        if(deviceSupplier == null){
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_iotDeviceSupplier_is_no_exist,ExceptionCode.common_error_params_code);
        }
        deviceSupplier.setSupplierName(iotDeviceSupplier.getSupplierName());
        deviceSupplier.setOrganizationCode(iotDeviceSupplier.getOrganizationCode());
        deviceSupplier.setJuridicalPersonName(iotDeviceSupplier.getJuridicalPersonName());
        deviceSupplier.setOrganizationAddress(iotDeviceSupplier.getOrganizationAddress());
        deviceSupplier.setOfficePhone(iotDeviceSupplier.getOfficePhone());
        deviceSupplier.setContactsName(iotDeviceSupplier.getContactsName());
        deviceSupplier.setContactsMobile(iotDeviceSupplier.getContactsMobile());
        deviceSupplier.setContactsPhone(iotDeviceSupplier.getContactsPhone());
        deviceSupplier.setContactsIdcard(iotDeviceSupplier.getContactsIdcard());
        deviceSupplier.setType(iotDeviceSupplier.getType());
        deviceSupplier.setOrganizationCodeImg(iotDeviceSupplier.getOrganizationCodeImg());
        deviceSupplier.setContactsIdcardImg(iotDeviceSupplier.getContactsIdcardImg());
        return iotDeviceSupplierDao.save(deviceSupplier);
    }
    public IotDeviceSupplierDO findById(String id) {
        return iotDeviceSupplierDao.findById(id);
    }
    /**
     * 删除厂商,伪删除
     * @param id
     */
    public void deleteById(String id){
        if(StringUtils.isEmpty(id)){
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_id_is_null,ExceptionCode.common_error_params_code);
        }
        IotDeviceSupplierDO deviceSupplier = findById(id);
        if(deviceSupplier == null){
            throw new ApiException(IotRequestMapping.DeviceSupplier.message_fail_iotDeviceSupplier_is_no_exist,ExceptionCode.common_error_params_code);
        }
        deviceSupplier.setDel(0);
        iotDeviceSupplierDao.save(deviceSupplier);
    }
}

+ 0 - 20
svr/svr-iot/src/main/java/com/yihu/iot/service/supplier/IotSupplyDeviceDataTypeService.java

@ -1,20 +0,0 @@
package com.yihu.iot.service.supplier;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.supplier.IotSupplyDeviceDataTypeDao;
import com.yihu.jw.iot.supplier.IotSupplyDeviceDataTypeDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * @author yeshijie on 2017/12/8.
 */
@Service
public class IotSupplyDeviceDataTypeService extends BaseJpaService<IotSupplyDeviceDataTypeDO,IotSupplyDeviceDataTypeDao> {
    @Autowired
    private IotSupplyDeviceDataTypeDao iotSupplyDeviceDataTypeDao;
    public IotSupplyDeviceDataTypeDO findById(String id) {
        return iotSupplyDeviceDataTypeDao.findById(id);
    }
}

+ 0 - 32
svr/svr-iot/src/main/java/com/yihu/iot/service/supplier/IotSupplyDeviceService.java

@ -1,32 +0,0 @@
package com.yihu.iot.service.supplier;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.supplier.IotSupplyDeviceDao;
import com.yihu.jw.iot.supplier.IotSupplyDeviceDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.persistence.Transient;
/**
 * @author yeshijie on 2017/12/8.
 */
@Service
public class IotSupplyDeviceService extends BaseJpaService<IotSupplyDeviceDO,IotSupplyDeviceDao> {
    @Autowired
    private IotSupplyDeviceDao iotSupplyDeviceDao;
    public IotSupplyDeviceDO findById(String id) {
        return iotSupplyDeviceDao.findById(id);
    }
    @Transient
    public IotSupplyDeviceDO create(IotSupplyDeviceDO iotSupplyDeviceDO) {
        iotSupplyDeviceDO.setSaasId(getCode());
        iotSupplyDeviceDO.setDel(1);
        return iotSupplyDeviceDao.save(iotSupplyDeviceDO);
    }
}