Ver código fonte

Merge branch 'dev' of yeshijie/jw2.0 into dev

yeshijie 7 anos atrás
pai
commit
b8222e1cb2
26 arquivos alterados com 972 adições e 18 exclusões
  1. 88 0
      common/common-entity/src/main/java/com/yihu/jw/iot/label/IotDeviceLabelDO.java
  2. 78 0
      common/common-entity/src/main/java/com/yihu/jw/iot/label/IotDeviceLabelInfoDO.java
  3. 52 0
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/iot/IotRequestMapping.java
  4. 84 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceController.java
  5. 83 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceOrderController.java
  6. 84 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDevicePurchaseController.java
  7. 83 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceQualityInspectionPlanController.java
  8. 100 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/label/IotDeviceLabelController.java
  9. 100 0
      svr/svr-iot/src/main/java/com/yihu/iot/controller/label/IotDeviceLabelInfoController.java
  10. 72 2
      svr/svr-iot/src/main/java/com/yihu/iot/controller/supplier/IotSupplyDeviceDataTypeController.java
  11. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotDeviceDao.java
  12. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotDeviceOrderDao.java
  13. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotDevicePurchaseDao.java
  14. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotDeviceQualityInspectionPlanDao.java
  15. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/dao/dict/IotDeviceDictDao.java
  16. 16 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/label/IotDeviceLabelDao.java
  17. 15 0
      svr/svr-iot/src/main/java/com/yihu/iot/dao/label/IotDeviceLabelInfoDao.java
  18. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/dao/supplier/IotDeviceSupplierDao.java
  19. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/dao/supplier/IotSupplyDeviceDao.java
  20. 1 1
      svr/svr-iot/src/main/java/com/yihu/iot/dao/supplier/IotSupplyDeviceDataTypeDao.java
  21. 11 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceOrderService.java
  22. 12 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDevicePurchaseService.java
  23. 12 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceQualityInspectionPlanService.java
  24. 11 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceService.java
  25. 32 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/label/IotDeviceLabelInfoService.java
  26. 31 0
      svr/svr-iot/src/main/java/com/yihu/iot/service/label/IotDeviceLabelService.java

+ 88 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/label/IotDeviceLabelDO.java

@ -0,0 +1,88 @@
package com.yihu.jw.iot.label;
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/28.
 */
@Entity
@Table(name = "iot_device_label")
public class IotDeviceLabelDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "label_code")
    private String labelCode;//标签标识
    @Column(name = "label_name")
    private String labelName;//标签名称
    @Column(name = "label_type")
    private String labelType;//标签类型
    @Column(name = "is_system")
    private Integer isSystem;//是否系统标签(1是、0否)
    @Column(name = "supplier_code")
    private String supplierCode;//供应商code
    @Column(name = "sort")
    private Long sort;//排序
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
    public String getLabelType() {
        return labelType;
    }
    public void setLabelType(String labelType) {
        this.labelType = labelType;
    }
    public Integer getIsSystem() {
        return isSystem;
    }
    public void setIsSystem(Integer isSystem) {
        this.isSystem = isSystem;
    }
    public String getSupplierCode() {
        return supplierCode;
    }
    public void setSupplierCode(String supplierCode) {
        this.supplierCode = supplierCode;
    }
    public Long getSort() {
        return sort;
    }
    public void setSort(Long sort) {
        this.sort = sort;
    }
}

+ 78 - 0
common/common-entity/src/main/java/com/yihu/jw/iot/label/IotDeviceLabelInfoDO.java

@ -0,0 +1,78 @@
package com.yihu.jw.iot.label;
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/28.
 */
@Entity
@Table(name = "iot_device_label_info")
public class IotDeviceLabelInfoDO extends IdEntityWithOperation implements Serializable {
    @Column(name = "saas_id")
    private String saasId;
    @Column(name = "device_code")
    private String deviceCode;//设备code
    @Column(name = "device_name")
    private String deviceName;//设备名称
    @Column(name = "label_code")
    private String labelCode;//标签code
    @Column(name = "label_name")
    private String labelName;//标签名称
    @Column(name = "label_type")
    private String labelType;//标签类型
    public String getSaasId() {
        return saasId;
    }
    public void setSaasId(String saasId) {
        this.saasId = saasId;
    }
    public String getDeviceCode() {
        return deviceCode;
    }
    public void setDeviceCode(String deviceCode) {
        this.deviceCode = deviceCode;
    }
    public String getDeviceName() {
        return deviceName;
    }
    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }
    public String getLabelCode() {
        return labelCode;
    }
    public void setLabelCode(String labelCode) {
        this.labelCode = labelCode;
    }
    public String getLabelName() {
        return labelName;
    }
    public void setLabelName(String labelName) {
        this.labelName = labelName;
    }
    public String getLabelType() {
        return labelType;
    }
    public void setLabelType(String labelType) {
        this.labelType = labelType;
    }
}

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

@ -239,4 +239,56 @@ public class IotRequestMapping {
        public static final String message_fail_saasId_is_null = "saasId is null";
    }
    /**
     * 设备标签模块常量
     */
    public static class DeviceLabel{
        public static final String api_create = "deviceLabel";
        public static final String api_delete = "deviceLabel";
        public static final String api_getById = "getDeviceLabelById";
        public static final String api_update = "deviceLabel";
        public static final String api_queryPage = "queryDeviceLabelPage";
        public static final String api_getList = "getDeviceLabelList";
        public static final String message_success_update = "deviceLabel update success";
        public static final String message_success_delete = "deviceLabel delete success";
        public static final String message_success_find = "deviceLabel find success";
        public static final String message_success_create = "deviceLabel create success";
        public static final String message_success_find_functions = "deviceLabel find success";
        public static final String message_fail_name_is_null = "name is null";
        public static final String message_fail_iotDeviceLabel_is_no_exist = "iotDeviceLabel 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";
    }
    /**
     * 设备标签信息模块常量
     */
    public static class DeviceLabelInfo{
        public static final String api_create = "deviceLabelInfo";
        public static final String api_delete = "deviceLabelInfo";
        public static final String api_getById = "getDeviceLabelInfoById";
        public static final String api_update = "deviceLabelInfo";
        public static final String api_queryPage = "queryDeviceLabelInfoPage";
        public static final String api_getList = "getDeviceLabelInfoList";
        public static final String message_success_update = "deviceLabelInfo update success";
        public static final String message_success_delete = "deviceLabelInfo delete success";
        public static final String message_success_find = "deviceLabelInfo find success";
        public static final String message_success_create = "deviceLabelInfo create success";
        public static final String message_success_find_functions = "deviceLabelInfo find success";
        public static final String message_fail_name_is_null = "name is null";
        public static final String message_fail_iotDeviceLabelInfo_is_no_exist = "iotDeviceLabelInfo 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";
    }
}

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

@ -1,10 +1,22 @@
package com.yihu.iot.controller.device;
import com.yihu.iot.service.device.IotDeviceService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.device.IotDeviceDO;
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 org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.
@ -13,5 +25,75 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备管理相关操作", description = "设备管理相关操作")
public class IotDeviceController extends EnvelopRestController{
    @Autowired
    private IotDeviceService iotDeviceService;
    @PostMapping(value = IotRequestMapping.Device.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建设备", notes = "创建设备")
    public Envelop create(@ApiParam(name = "json_data", value = "", defaultValue = "")
                          @RequestBody String jsonData) {
        try {
            IotDeviceDO iotDevice = toEntity(jsonData, IotDeviceDO.class);
            return Envelop.getSuccess(IotRequestMapping.Device.message_success_create, iotDeviceService.create(iotDevice));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.Device.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.Device.message_success_find, iotDeviceService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value = IotRequestMapping.Device.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<IotDeviceDO> list = iotDeviceService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=iotDeviceService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<IotDeviceDO> iotDevices = convertToModels(list, new ArrayList<>(list.size()), IotDeviceDO.class, fields);
        return Envelop.getSuccessListWithPage(IotRequestMapping.Device.message_success_find_functions,iotDevices, page, size,count);
    }
    @GetMapping(value = IotRequestMapping.Device.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<IotDeviceDO> list = iotDeviceService.search(fields,filters,sorts);
        //封装返回格式
        List<IotDeviceDO> iotDevices = convertToModels(list, new ArrayList<>(list.size()), IotDeviceDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.Device.message_success_find_functions,iotDevices);
    }
}

+ 83 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotDeviceOrderController.java

@ -1,10 +1,22 @@
package com.yihu.iot.controller.device;
import com.yihu.iot.service.device.IotDeviceOrderService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.device.IotDeviceOrderDO;
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 org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.
@ -13,5 +25,74 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备订单管理相关操作", description = "设备订单管理相关操作")
public class IotDeviceOrderController extends EnvelopRestController{
    @Autowired
    private IotDeviceOrderService iotDeviceOrderService;
    @PostMapping(value = IotRequestMapping.DeviceOrder.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建设备订单", notes = "创建设备订单")
    public Envelop create(@ApiParam(name = "json_data", value = "", defaultValue = "")
                          @RequestBody String jsonData) {
        try {
            IotDeviceOrderDO iotDeviceOrder = toEntity(jsonData, IotDeviceOrderDO.class);
            return Envelop.getSuccess(IotRequestMapping.DeviceOrder.message_success_create, iotDeviceOrderService.create(iotDeviceOrder));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceOrder.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.DeviceOrder.message_success_find, iotDeviceOrderService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value = IotRequestMapping.DeviceOrder.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<IotDeviceOrderDO> list = iotDeviceOrderService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=iotDeviceOrderService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<IotDeviceOrderDO> iotDeviceOrders = convertToModels(list, new ArrayList<>(list.size()), IotDeviceOrderDO.class, fields);
        return Envelop.getSuccessListWithPage(IotRequestMapping.DeviceOrder.message_success_find_functions,iotDeviceOrders, page, size,count);
    }
    @GetMapping(value = IotRequestMapping.DeviceOrder.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<IotDeviceOrderDO> list = iotDeviceOrderService.search(fields,filters,sorts);
        //封装返回格式
        List<IotDeviceOrderDO> iotDeviceOrders = convertToModels(list, new ArrayList<>(list.size()), IotDeviceOrderDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.DeviceOrder.message_success_find_functions,iotDeviceOrders);
    }
}

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

@ -1,10 +1,22 @@
package com.yihu.iot.controller.device;
import com.yihu.iot.service.device.IotDevicePurchaseService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.device.IotDevicePurchaseDO;
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 org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.
@ -13,5 +25,75 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备采购管理相关操作", description = "设备采购管理相关操作")
public class IotDevicePurchaseController extends EnvelopRestController{
    @Autowired
    private IotDevicePurchaseService 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);
            return Envelop.getSuccess(IotRequestMapping.DevicePurchase.message_success_create, iotDevicePurchaseService.create(iotDevicePurchase));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.DevicePurchase.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.DevicePurchase.message_success_find, iotDevicePurchaseService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value = IotRequestMapping.DevicePurchase.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<IotDevicePurchaseDO> 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);
        return Envelop.getSuccessListWithPage(IotRequestMapping.DevicePurchase.message_success_find_functions,iotDevicePurchases, page, size,count);
    }
    @GetMapping(value = IotRequestMapping.DevicePurchase.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<IotDevicePurchaseDO> list = iotDevicePurchaseService.search(fields,filters,sorts);
        //封装返回格式
        List<IotDevicePurchaseDO> iotDevicePurchases = convertToModels(list, new ArrayList<>(list.size()), IotDevicePurchaseDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.DevicePurchase.message_success_find_functions,iotDevicePurchases);
    }
}

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

@ -1,10 +1,22 @@
package com.yihu.iot.controller.device;
import com.yihu.iot.service.device.IotDeviceQualityInspectionPlanService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.device.IotDeviceQualityInspectionPlanDO;
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 org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.
@ -13,5 +25,74 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备质检管理相关操作", description = "设备质检管理相关操作")
public class IotDeviceQualityInspectionPlanController extends EnvelopRestController{
    @Autowired
    private IotDeviceQualityInspectionPlanService iotDeviceQualityInspectionPlanService;
    @PostMapping(value = IotRequestMapping.DeviceQualityInspectionPlan.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建设备质检", notes = "创建设备质检")
    public Envelop create(@ApiParam(name = "json_data", value = "", defaultValue = "")
                          @RequestBody String jsonData) {
        try {
            IotDeviceQualityInspectionPlanDO iotDeviceQualityInspectionPlan = toEntity(jsonData, IotDeviceQualityInspectionPlanDO.class);
            return Envelop.getSuccess(IotRequestMapping.DeviceQualityInspectionPlan.message_success_create, iotDeviceQualityInspectionPlanService.create(iotDeviceQualityInspectionPlan));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceQualityInspectionPlan.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.DeviceQualityInspectionPlan.message_success_find, iotDeviceQualityInspectionPlanService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value = IotRequestMapping.DeviceQualityInspectionPlan.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<IotDeviceQualityInspectionPlanDO> list = iotDeviceQualityInspectionPlanService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=iotDeviceQualityInspectionPlanService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<IotDeviceQualityInspectionPlanDO> iotDeviceQualityInspectionPlans = convertToModels(list, new ArrayList<>(list.size()), IotDeviceQualityInspectionPlanDO.class, fields);
        return Envelop.getSuccessListWithPage(IotRequestMapping.DeviceQualityInspectionPlan.message_success_find_functions,iotDeviceQualityInspectionPlans, page, size,count);
    }
    @GetMapping(value = IotRequestMapping.DeviceQualityInspectionPlan.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<IotDeviceQualityInspectionPlanDO> list = iotDeviceQualityInspectionPlanService.search(fields,filters,sorts);
        //封装返回格式
        List<IotDeviceQualityInspectionPlanDO> iotDeviceQualityInspectionPlans = convertToModels(list, new ArrayList<>(list.size()), IotDeviceQualityInspectionPlanDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.DeviceQualityInspectionPlan.message_success_find_functions,iotDeviceQualityInspectionPlans);
    }
}

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

@ -0,0 +1,100 @@
package com.yihu.iot.controller.label;
import com.yihu.iot.service.label.IotDeviceLabelService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.label.IotDeviceLabelDO;
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 2018/1/4.
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备标签相关操作", description = "设备标签相关操作")
public class IotDeviceLabelController extends EnvelopRestController {
    @Autowired
    private IotDeviceLabelService iotDeviceLabelService;
    @PostMapping(value = IotRequestMapping.DeviceLabel.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建设备标签", notes = "创建设备标签")
    public Envelop create(@ApiParam(name = "json_data", value = "", defaultValue = "")
                          @RequestBody String jsonData) {
        try {
            IotDeviceLabelDO iotDevice = toEntity(jsonData, IotDeviceLabelDO.class);
            return Envelop.getSuccess(IotRequestMapping.DeviceLabel.message_success_create, iotDeviceLabelService.create(iotDevice));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceLabel.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.DeviceLabel.message_success_find, iotDeviceLabelService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value = IotRequestMapping.DeviceLabel.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取设备标签")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段(id)", 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<IotDeviceLabelDO> list = iotDeviceLabelService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=iotDeviceLabelService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<IotDeviceLabelDO> iotDevices = convertToModels(list, new ArrayList<>(list.size()), IotDeviceLabelDO.class, fields);
        return Envelop.getSuccessListWithPage(IotRequestMapping.DeviceLabel.message_success_find_functions,iotDevices, page, size,count);
    }
    @GetMapping(value = IotRequestMapping.DeviceLabel.api_getList)
    @ApiOperation(value = "获取设备标签列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段(id)", 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<IotDeviceLabelDO> list = iotDeviceLabelService.search(fields,filters,sorts);
        //封装返回格式
        List<IotDeviceLabelDO> iotDevices = convertToModels(list, new ArrayList<>(list.size()), IotDeviceLabelDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.DeviceLabel.message_success_find_functions,iotDevices);
    }
}

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

@ -0,0 +1,100 @@
package com.yihu.iot.controller.label;
import com.yihu.iot.service.label.IotDeviceLabelInfoService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.iot.label.IotDeviceLabelInfoDO;
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 2018/1/4.
 */
@RestController
@RequestMapping(IotRequestMapping.api_iot_common)
@Api(value = "设备标签信息操作", description = "设备标签信息相关操作")
public class IotDeviceLabelInfoController extends EnvelopRestController {
    @Autowired
    private IotDeviceLabelInfoService iotDeviceLabelInfoService;
    @PostMapping(value = IotRequestMapping.DeviceLabelInfo.api_create, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @ApiOperation(value = "创建设备标签信息", notes = "创建设备标签信息")
    public Envelop create(@ApiParam(name = "json_data", value = "", defaultValue = "")
                          @RequestBody String jsonData) {
        try {
            IotDeviceLabelInfoDO iotDeviceLabelInfo = toEntity(jsonData, IotDeviceLabelInfoDO.class);
            return Envelop.getSuccess(IotRequestMapping.DeviceLabelInfo.message_success_create, iotDeviceLabelInfoService.create(iotDeviceLabelInfo));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @GetMapping(value = IotRequestMapping.DeviceLabelInfo.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.DeviceLabelInfo.message_success_find, iotDeviceLabelInfoService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        }
    }
    @RequestMapping(value = IotRequestMapping.DeviceLabelInfo.api_queryPage, method = RequestMethod.GET)
    @ApiOperation(value = "分页获取设备标签信息")
    public Envelop queryPage(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段(id)", 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<IotDeviceLabelInfoDO> list = iotDeviceLabelInfoService.search(fields, filters, sorts, page, size);
        //获取总数
        long count=iotDeviceLabelInfoService.getCount(filters);
        //封装头信息
        pagedResponse(request, response, count, page, size);
        //封装返回格式
        List<IotDeviceLabelInfoDO> iotDeviceLabelInfos = convertToModels(list, new ArrayList<>(list.size()), IotDeviceLabelInfoDO.class, fields);
        return Envelop.getSuccessListWithPage(IotRequestMapping.DeviceLabelInfo.message_success_find_functions,iotDeviceLabelInfos, page, size,count);
    }
    @GetMapping(value = IotRequestMapping.DeviceLabelInfo.api_getList)
    @ApiOperation(value = "获取设备标签信息列表(不分页)")
    public Envelop getList(
            @ApiParam(name = "fields", value = "返回的字段,为空返回全部字段(id)", 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<IotDeviceLabelInfoDO> list = iotDeviceLabelInfoService.search(fields,filters,sorts);
        //封装返回格式
        List<IotDeviceLabelInfoDO> iotDeviceLabelInfos = convertToModels(list, new ArrayList<>(list.size()), IotDeviceLabelInfoDO.class, fields);
        return Envelop.getSuccessList(IotRequestMapping.DeviceLabelInfo.message_success_find_functions,iotDeviceLabelInfos);
    }
}

+ 72 - 2
svr/svr-iot/src/main/java/com/yihu/iot/controller/supplier/IotSupplyDeviceDataTypeController.java

@ -1,10 +1,21 @@
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 org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.
@ -13,5 +24,64 @@ import org.springframework.web.bind.annotation.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);
    }
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotDeviceDao.java

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

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotDeviceOrderDao.java

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

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

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

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/dao/device/IotDeviceQualityInspectionPlanDao.java

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

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

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

+ 16 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/label/IotDeviceLabelDao.java

@ -0,0 +1,16 @@
package com.yihu.iot.dao.label;
import com.yihu.jw.iot.dict.IotDeviceDictDO;
import com.yihu.jw.iot.label.IotDeviceLabelDO;
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/4.
 */
public interface IotDeviceLabelDao extends PagingAndSortingRepository<IotDeviceLabelDO,String>,JpaSpecificationExecutor<IotDeviceLabelDO> {
    @Query("from IotDeviceLabelDO w where w.id =?1")
    IotDeviceLabelDO findById(String id);
}

+ 15 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/label/IotDeviceLabelInfoDao.java

@ -0,0 +1,15 @@
package com.yihu.iot.dao.label;
import com.yihu.jw.iot.label.IotDeviceLabelInfoDO;
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/4.
 */
public interface IotDeviceLabelInfoDao extends PagingAndSortingRepository<IotDeviceLabelInfoDO,String>,JpaSpecificationExecutor<IotDeviceLabelInfoDO> {
    @Query("from IotDeviceLabelInfoDO w where w.id =?1")
    IotDeviceLabelInfoDO findById(String id);
}

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

@ -10,7 +10,7 @@ import java.util.List;
/**
 * @author yeshijie on 2017/12/5.
 */
public interface IotDeviceSupplierDao extends PagingAndSortingRepository<IotDeviceSupplierDO, Long>, JpaSpecificationExecutor<IotDeviceSupplierDO> {
public interface IotDeviceSupplierDao extends PagingAndSortingRepository<IotDeviceSupplierDO, String>, JpaSpecificationExecutor<IotDeviceSupplierDO> {
    @Query("from IotDeviceSupplierDO w where w.id =?1")
    IotDeviceSupplierDO findById(String id);

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

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

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

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

+ 11 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceOrderService.java

@ -15,6 +15,17 @@ public class IotDeviceOrderService extends BaseJpaService<IotDeviceOrderDO,IotDe
    @Autowired
    private IotDeviceOrderDao iotDeviceOrderDao;
    /**
     * 新增
     * @param iotDeviceOrder
     * @return
     */
    public IotDeviceOrderDO create(IotDeviceOrderDO iotDeviceOrder) {
        iotDeviceOrder.setSaasId(getCode());
        return iotDeviceOrderDao.save(iotDeviceOrder);
    }
    public IotDeviceOrderDO findById(String id) {
        return iotDeviceOrderDao.findById(id);
    }

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

@ -14,6 +14,18 @@ public class IotDevicePurchaseService extends BaseJpaService<IotDevicePurchaseDO
    @Autowired
    private IotDevicePurchaseDao iotDevicePurchaseDao;
    /**
     * 新增
     * @param iotDevicePurchase
     * @return
     */
    public IotDevicePurchaseDO create(IotDevicePurchaseDO iotDevicePurchase) {
        iotDevicePurchase.setSaasId(getCode());
        iotDevicePurchase.setDel(1);
        return iotDevicePurchaseDao.save(iotDevicePurchase);
    }
    public IotDevicePurchaseDO findById(String id) {
        return iotDevicePurchaseDao.findById(id);
    }

+ 12 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceQualityInspectionPlanService.java

@ -15,6 +15,18 @@ public class IotDeviceQualityInspectionPlanService extends BaseJpaService<IotDev
    @Autowired
    private IotDeviceQualityInspectionPlanDao iotDeviceQualityInspectionPlanDao;
    /**
     * 新增
     * @param iotDeviceQualityInspectionPlan
     * @return
     */
    public IotDeviceQualityInspectionPlanDO create(IotDeviceQualityInspectionPlanDO iotDeviceQualityInspectionPlan) {
        iotDeviceQualityInspectionPlan.setSaasId(getCode());
        iotDeviceQualityInspectionPlan.setDel(1);
        return iotDeviceQualityInspectionPlanDao.save(iotDeviceQualityInspectionPlan);
    }
    public IotDeviceQualityInspectionPlanDO findById(String id) {
        return iotDeviceQualityInspectionPlanDao.findById(id);
    }

+ 11 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotDeviceService.java

@ -15,6 +15,17 @@ public class IotDeviceService extends BaseJpaService<IotDeviceDO,IotDeviceDao> {
    @Autowired
    private IotDeviceDao iotDeviceDao;
    /**
     * 新增
     * @param iotDevice
     * @return
     */
    public IotDeviceDO create(IotDeviceDO iotDevice) {
        iotDevice.setSaasId(getCode());
        return iotDeviceDao.save(iotDevice);
    }
    public IotDeviceDO findById(String id) {
        return iotDeviceDao.findById(id);
    }

+ 32 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/label/IotDeviceLabelInfoService.java

@ -0,0 +1,32 @@
package com.yihu.iot.service.label;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.label.IotDeviceLabelInfoDao;
import com.yihu.jw.iot.label.IotDeviceLabelInfoDO;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * @author yeshijie on 2018/1/4.
 */
public class IotDeviceLabelInfoService extends BaseJpaService<IotDeviceLabelInfoDO,IotDeviceLabelInfoDao> {
    @Autowired
    private IotDeviceLabelInfoDao iotDeviceLabelInfoDao;
    public IotDeviceLabelInfoDO findById(String id) {
        return iotDeviceLabelInfoDao.findById(id);
    }
    /**
     * 新增
     * @param iotDeviceLabelInfo
     * @return
     */
    public IotDeviceLabelInfoDO create(IotDeviceLabelInfoDO iotDeviceLabelInfo) {
        iotDeviceLabelInfo.setSaasId(getCode());
        return iotDeviceLabelInfoDao.save(iotDeviceLabelInfo);
    }
}

+ 31 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/label/IotDeviceLabelService.java

@ -0,0 +1,31 @@
package com.yihu.iot.service.label;
import com.yihu.base.mysql.query.BaseJpaService;
import com.yihu.iot.dao.label.IotDeviceLabelDao;
import com.yihu.jw.iot.label.IotDeviceLabelDO;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * @author yeshijie on 2018/1/4.
 */
public class IotDeviceLabelService extends BaseJpaService<IotDeviceLabelDO,IotDeviceLabelDao> {
    @Autowired
    private IotDeviceLabelDao iotDeviceLabelDao;
    public IotDeviceLabelDO findById(String id) {
        return iotDeviceLabelDao.findById(id);
    }
    /**
     * 新增
     * @param iotDeviceLabel
     * @return
     */
    public IotDeviceLabelDO create(IotDeviceLabelDO iotDeviceLabel) {
        iotDeviceLabel.setSaasId(getCode());
        return iotDeviceLabelDao.save(iotDeviceLabel);
    }
}