ソースを参照

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

huangwenjie 7 年 前
コミット
6434eb3b97

+ 8 - 6
svr/svr-iot/src/main/java/com/yihu/iot/controller/label/FigureLabelSearchController.java

@ -1,7 +1,6 @@
package com.yihu.iot.controller.label;
package com.yihu.iot.controller.label;
import com.yihu.iot.service.label.FigureLabelSerachService;
import com.yihu.iot.service.label.FigureLabelSerachService;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.Envelop;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.restmodel.common.EnvelopRestController;
import com.yihu.jw.restmodel.iot.device.FigureLabelDataModelVO;
import com.yihu.jw.restmodel.iot.device.FigureLabelDataModelVO;
@ -11,7 +10,10 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.List;
@ -32,8 +34,8 @@ public class FigureLabelSearchController extends EnvelopRestController {
    public Envelop<List<FigureLabelDataModelVO>> findByIdcard(@ApiParam(name = "jsonData", value = "", defaultValue = "") @RequestBody String jsonData) {
    public Envelop<List<FigureLabelDataModelVO>> findByIdcard(@ApiParam(name = "jsonData", value = "", defaultValue = "") @RequestBody String jsonData) {
        try {
        try {
            return Envelop.getSuccess(IotRequestMapping.FigureLabelInfo.message_success_find, figureLabelSerachService.getFigureLabelByIdcard(jsonData));
            return Envelop.getSuccess(IotRequestMapping.FigureLabelInfo.message_success_find, figureLabelSerachService.getFigureLabelByIdcard(jsonData));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
        }
    }
    }
@ -43,8 +45,8 @@ public class FigureLabelSearchController extends EnvelopRestController {
    public Envelop<List<FigureLabelDataModelVO>> findByTypeAndCode(@ApiParam(name = "jsonData", value = "", defaultValue = "") @RequestBody String jsonData) {
    public Envelop<List<FigureLabelDataModelVO>> findByTypeAndCode(@ApiParam(name = "jsonData", value = "", defaultValue = "") @RequestBody String jsonData) {
        try {
        try {
            return Envelop.getSuccess(IotRequestMapping.FigureLabelInfo.message_success_find, figureLabelSerachService.getFigureLabelByLabel(jsonData));
            return Envelop.getSuccess(IotRequestMapping.FigureLabelInfo.message_success_find, figureLabelSerachService.getFigureLabelByLabel(jsonData));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
        }
    }
    }

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

@ -36,8 +36,8 @@ public class IotDeviceLabelController extends EnvelopRestController {
        try {
        try {
            IotDeviceLabelDO iotDevice = toEntity(jsonData, IotDeviceLabelDO.class);
            IotDeviceLabelDO iotDevice = toEntity(jsonData, IotDeviceLabelDO.class);
            return Envelop.getSuccess(IotRequestMapping.DeviceLabel.message_success_create, iotDeviceLabelService.create(iotDevice));
            return Envelop.getSuccess(IotRequestMapping.DeviceLabel.message_success_create, iotDeviceLabelService.create(iotDevice));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
        }
    }
    }
@ -49,8 +49,8 @@ public class IotDeviceLabelController extends EnvelopRestController {
    ) {
    ) {
        try {
        try {
            return Envelop.getSuccess(IotRequestMapping.DeviceLabel.message_success_find, iotDeviceLabelService.findById(id));
            return Envelop.getSuccess(IotRequestMapping.DeviceLabel.message_success_find, iotDeviceLabelService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
        }
    }
    }

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

@ -36,8 +36,8 @@ public class IotDeviceLabelInfoController extends EnvelopRestController {
        try {
        try {
            IotDeviceLabelInfoDO iotDeviceLabelInfo = toEntity(jsonData, IotDeviceLabelInfoDO.class);
            IotDeviceLabelInfoDO iotDeviceLabelInfo = toEntity(jsonData, IotDeviceLabelInfoDO.class);
            return Envelop.getSuccess(IotRequestMapping.DeviceLabelInfo.message_success_create, iotDeviceLabelInfoService.create(iotDeviceLabelInfo));
            return Envelop.getSuccess(IotRequestMapping.DeviceLabelInfo.message_success_create, iotDeviceLabelInfoService.create(iotDeviceLabelInfo));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
        }
    }
    }
@ -49,8 +49,8 @@ public class IotDeviceLabelInfoController extends EnvelopRestController {
    ) {
    ) {
        try {
        try {
            return Envelop.getSuccess(IotRequestMapping.DeviceLabelInfo.message_success_find, iotDeviceLabelInfoService.findById(id));
            return Envelop.getSuccess(IotRequestMapping.DeviceLabelInfo.message_success_find, iotDeviceLabelInfoService.findById(id));
        } catch (ApiException e) {
            return Envelop.getError(e.getMessage(), e.getErrorCode());
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
        }
    }
    }

+ 39 - 49
svr/svr-wlyy-health-bank/pom.xml

@ -51,34 +51,22 @@
        <dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>tomcat-servlet-api</artifactId>
            <version>8.5.28</version>
            <scope>provided</scope>
            <!--tomcat 启动时 打开注释 end-->
        </dependency>
        <!--tomcat 启动时 注释下列配置 start-->
        <dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        </dependency>
        <!--tomcat 启动时 注释下列配置 end-->
        <dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>
        <dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
@ -91,32 +79,6 @@
            <groupId>org.springframework.boot</groupId>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-logging</artifactId>
            <artifactId>spring-boot-starter-logging</artifactId>
        </dependency>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <!--zipkin支持分布式追踪系统-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-sleuth</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-sleuth-zipkin</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <artifactId>jackson-annotations</artifactId>
@ -129,10 +91,6 @@
            <groupId>com.fasterxml.jackson.core</groupId>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-jpa</artifactId>
            <artifactId>spring-data-jpa</artifactId>
@ -141,5 +99,37 @@
            <groupId>org.springframework.data</groupId>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
            <artifactId>spring-data-commons</artifactId>
        </dependency>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.jna</groupId>
            <artifactId>jna</artifactId>
            <version>3.0.9</version>
        </dependency>
    </dependencies>
    </dependencies>
    <build>
        <finalName>svr-wlyy-health-bank</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>com.yihu.jw.SvrWlyyHealthBankApplication</mainClass>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
</project>

+ 13 - 0
svr/svr-wlyy-health-bank/src/main/java/com/yihu/jw/config/WarConfig.java

@ -0,0 +1,13 @@
package com.yihu.jw.config;
import com.yihu.jw.SvrWlyyHealthBankApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
public class WarConfig extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(SvrWlyyHealthBankApplication.class);
    }
}