瀏覽代碼

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

humingfen 5 年之前
父節點
當前提交
858685d6b7

+ 3 - 4
svr/svr-iot/src/main/java/com/yihu/iot/controller/workType/IotWorkTypeController.java

@ -32,8 +32,8 @@ public class IotWorkTypeController extends EnvelopRestEndpoint {
                                                           @RequestParam(value = "jsonData",required = true)String json){
        try {
            iotWorkTypeService.addType(json);
            return MixEnvelop.getSuccess(IotRequestMapping.WorkType.message_success_add);
            return iotWorkTypeService.addType(json);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
@ -48,8 +48,7 @@ public class IotWorkTypeController extends EnvelopRestEndpoint {
                                                            @RequestParam(value = "jsonData",required = true)String json){
        try {
            iotWorkTypeService.editType(json);
            return MixEnvelop.getSuccess(IotRequestMapping.WorkType.message_success_edit);
           return iotWorkTypeService.editType(json);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/dao/workType/IotWorkTypeDao.java

@ -18,5 +18,5 @@ public interface IotWorkTypeDao extends PagingAndSortingRepository<IotWorkTypeDO
    IotWorkTypeDO findById(String id);
    @Query("from IotWorkTypeDO w where w.name=?1 and w.del=0")
    List<IotWorkTypeDO> findByName(String name);
    IotWorkTypeDO findByName(String name);
}

+ 3 - 3
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -77,7 +77,7 @@ public class MonitorPlatformService  {
                    jsonObject.put("page",page);
                    jsonObject.put("size",size);
                    List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
                    figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                    //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
                    envelop.getDetailModelList().addAll(locationDataVOList);
                }
            }
@ -98,8 +98,8 @@ public class MonitorPlatformService  {
            jsonObject.put("page",page);
            jsonObject.put("size",size);
            List<LocationDataVO> locationDataVOList = iotPatientDeviceService.findDeviceLocationsByIdCard(jsonObject.toString());
            figureLabelSerachService.getFigureLabelByList(locationDataVOList);
            //figureLabelSerachService.getFigureLabelByList(locationDataVOList);
            envelop.getDetailModelList().addAll(locationDataVOList);
            envelop.setTotalCount(iotPatientDeviceService.getESCount(jsonObject.toString()));
            return envelop;
        }

+ 17 - 6
svr/svr-iot/src/main/java/com/yihu/iot/service/workType/IotWorkTypeService.java

@ -34,10 +34,15 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
     * 增加业务类型
     * @param json
     */
    public void addType(String json) {
    public MixEnvelop<IotWorkTypeDO,IotWorkTypeDO> addType(String json) {
        IotWorkTypeDO iotWorkTypeDO = JSONObject.parseObject(json, IotWorkTypeDO.class);
        IotWorkTypeDO workTypeDO = iotWorkTypeDao.findByName(iotWorkTypeDO.getName());
        if (workTypeDO!=null){
            return MixEnvelop.getError("该业务类型已存在");
        }
        iotWorkTypeDO.setDel("0");
        iotWorkTypeDao.save(iotWorkTypeDO);
        return MixEnvelop.getSuccess(IotRequestMapping.WorkType.message_success_add);
    }
@ -45,14 +50,18 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
     * 编辑业务类型
     * @param json
     */
    public void editType(String json) {
    public MixEnvelop<IotWorkTypeDO,IotWorkTypeDO> editType(String json) {
        IotWorkTypeDO newType = JSONObject.parseObject(json, IotWorkTypeDO.class);
        IotWorkTypeDO old = iotWorkTypeDao.findOne(newType.getId());
        IotWorkTypeDO workTypeDO = iotWorkTypeDao.findByName(newType.getName());
        if (workTypeDO!=null&&(workTypeDO.getId().equalsIgnoreCase(newType.getId())==false)){
            return MixEnvelop.getError("该业务类型已存在");
        }
        old.setName(newType.getName());
        old.setExplanation(newType.getExplanation());
        old.setDel("0");
        old.setId(old.getId());
        iotWorkTypeDao.save(old);
        return MixEnvelop.getSuccess(IotRequestMapping.WorkType.message_success_edit);
    }
    /**
@ -83,7 +92,7 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
    /**
     * 分页查询日志信息
     * 分页查询
     * @param page
     * @param size
     * @return
@ -91,9 +100,11 @@ public class IotWorkTypeService extends BaseJpaService<IotWorkTypeDO, IotWorkTyp
     */
    public MixEnvelop<IotWorkTypeDO,IotWorkTypeDO> findAll(Integer page, Integer size) throws ParseException {
        String sql = "select * from iot_work_type w where w.del=0;";
        StringBuffer sql = new StringBuffer("select * from iot_work_type w where w.del=0 ") ;
        sql.append("order by w.update_time desc limit ").append((page-1)*size).append(",").append(size);
        List<IotWorkTypeDO> list = jdbcTemplate.query(sql,new BeanPropertyRowMapper(IotWorkTypeDO.class));
        List<IotWorkTypeDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotWorkTypeDO.class));
        long count =list.size();

+ 2 - 2
svr/svr-iot/src/main/resources/application.yml

@ -194,9 +194,9 @@ spring:
    password: jkzlehr@123
  elasticsearch:
    cluster-name: jkzl #默认即为elasticsearch  集群名
    cluster-nodes: 10.90.32.2:20010,10.90.32.2:20012 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    cluster-nodes: 10.90.32.2:20011,10.90.32.2:20011 #配置es节点信息,逗号分隔,如果没有指定,则启动ClientNode
    jest:
      uris: http://10.90.32.2:20009,http://10.90.32.2:20011
      uris: http://10.90.32.2:20011,http://10.90.32.2:20012
  wlyy:
    url: http://www.xmtyw.cn/wlyytest/
    appid: 915d0345-5b1d-11e6-8344-fa163e8aee62

+ 1 - 1
svr/svr-iot/src/main/resources/bootstrap.yml

@ -95,5 +95,5 @@ spring:
  profiles: iotprod
  cloud:
    config:
      uri: ${wlyy.pring.config.uri:http://127.0.0.1:1221}
      uri: ${wlyy.pring.config.uri:http://192.168.120.216:1221}
      label: ${wlyy.spring.config.label:master}