ソースを参照

Merge branch 'dev' of humingfen/wlyy2.0 into dev

humingfen 5 年 前
コミット
e23e264c07

+ 40 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/iot/device/IotPatientDeviceDO.java

@ -52,7 +52,14 @@ public class IotPatientDeviceDO extends UuidIdentityEntityWithOperator implement
    private String hospitalName;//归属社区名称
    @Column(name = "imgs")
    private String imgs;//领用协议,多个用逗号隔开
    @Column(name = "status")
    private Integer status;//维修状态(1待维护 2已报修 3厂家接收 4厂家寄回 5待更换 6已更换)
    @Column(name = "damage_description")
    private String damageDescription;//损坏说明
    @Column(name = "damage_images")
    private String damageImages;//申请维修附件图片,多个用逗号隔开
    @Column(name = "repair_description")
    private String repairDescription;//维修说明
    public String getSaasId() {
        return saasId;
@ -197,4 +204,36 @@ public class IotPatientDeviceDO extends UuidIdentityEntityWithOperator implement
    public void setImgs(String imgs) {
        this.imgs = imgs;
    }
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    public String getDamageDescription() {
        return damageDescription;
    }
    public void setDamageDescription(String damageDescription) {
        this.damageDescription = damageDescription;
    }
    public String getDamageImages() {
        return damageImages;
    }
    public void setDamageImages(String damageImages) {
        this.damageImages = damageImages;
    }
    public String getRepairDescription() {
        return repairDescription;
    }
    public void setRepairDescription(String repairDescription) {
        this.repairDescription = repairDescription;
    }
}

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

@ -144,6 +144,10 @@ public class IotRequestMapping {
        public static final String updateLocation= "updateLocation";
        public static final String createPatientDevice = "createPatientDevice";
        //设备维修
        public static final String createRepairDevice = "createRepairDevice";
        public static final String getRepairDeviceList = "getRepairDeviceList";
    }

+ 1 - 1
svr/svr-iot/pom.xml

@ -13,7 +13,7 @@
    <groupId>com.yihu.iot</groupId>
    <artifactId>svr-iot</artifactId>
    <version>${parent.version}</version>
    <packaging>war</packaging>
    <packaging>jar</packaging>
    <dependencies>
        <!-- 支持Tomcat启动 -->

+ 20 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/device/IotPatientDeviceController.java

@ -304,4 +304,24 @@ public class IotPatientDeviceController extends EnvelopRestEndpoint {
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = IotRequestMapping.PatientDevice.createRepairDevice)
    @ApiOperation(value = "新增设备维修记录", notes = "新增设备维修记录")
    public MixEnvelop<IotPatientDeviceVO, IotPatientDeviceVO> createRepairDevice(@ApiParam(name = "deviceSn", value = "设备sn码")
                                                                                     @RequestParam(value = "deviceSn", required = true) String deviceSn,
                                                                                 @ApiParam(name = "status", value = "维修状态(1待维护 2已报修 3厂家接收 4厂家寄回 5待更换 6已更换)")
                                                                                 @RequestParam(value = "status", required = false) Integer status,
                                                                                 @ApiParam(name = "damageDescription", value = "损坏说明")
                                                                                     @RequestParam(value = "damageDescription", required = false) String damageDescription,
                                                                                 @ApiParam(name = "damageImages", value = "申请维修附件图片,多个用逗号隔开")
                                                                                     @RequestParam(value = "damageImages", required = false) String damageImages) {
        try {
            //设备绑定
            List<IotPatientDeviceVO> patientDeviceDOList = iotPatientDeviceService.createRepairDevice(deviceSn, status, damageDescription, damageImages);
            return MixEnvelop.getSuccessList(IotRequestMapping.Device.message_success_create, patientDeviceDOList);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
}

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

@ -274,4 +274,17 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
        count = result.getTotal();
        return count;
    }
    public List<IotPatientDeviceVO> createRepairDevice(String deviceSn, Integer status, String damageDescription, String damageImages) {
        List<IotPatientDeviceDO> patientDeviceDOList = iotPatientDeviceDao.findByDeviceSn(deviceSn);
        for(IotPatientDeviceDO patientDeviceDO : patientDeviceDOList){
            patientDeviceDO.setStatus(status);
            patientDeviceDO.setDamageDescription(damageDescription);
            patientDeviceDO.setDamageImages(damageImages);
            patientDeviceDO.setUpdateTime(new Date());
        }
        iotPatientDeviceDao.save(patientDeviceDOList);
        List<IotPatientDeviceVO> patientDeviceVOS = new ArrayList<>();
        return convertToModels(patientDeviceDOList, patientDeviceVOS, IotPatientDeviceVO.class);
    }
}

+ 19 - 0
svr/svr-iot/src/main/resources/application.yml

@ -115,6 +115,25 @@ fast-dfs:
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
---
spring:
  profiles: iottest
  datasource:
    url: jdbc:mysql://172.26.0.104/xmiot?useUnicode=true&amp;characterEncoding=utf-8&amp;autoReconnect=true
    username: ssgg
    password: ssgg@jkzl2019
  elasticsearch:
    cluster-name: jkzl #默认即为elasticsearch  集群名
    cluster-nodes: 172.19.103.45:9300,172.19.103.68:9300 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    jest:
      uris: http://172.19.103.45:9200,http://172.19.103.68:9200
  wlyy:
    url: http://ehr.yihu.com/wlyy/
fast-dfs:
  tracker-server: 172.19.103.54:22122 #服务器地址
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
---
spring:
  profiles: jwprod

+ 9 - 0
svr/svr-iot/src/main/resources/bootstrap.yml

@ -22,6 +22,15 @@ spring:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.107:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: iottest
  cloud:
    config:
      uri: ${wlyy.spring.config.uri:http://172.26.0.109:1221}
      label: ${wlyy.spring.config.label:jwdev}
---
spring:
  profiles: qytest