浏览代码

物联网 BUG修复

mengkang 5 年之前
父节点
当前提交
0bc2cc7ac3

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

@ -395,6 +395,7 @@ public class IotRequestMapping {
        public static final String delAppInterface ="delAppInterface";
        public static final String interfaceDoc ="interfaceDoc";
        public static final String addApp ="addApp";
        public static final String findCompanyShareInterface ="findCompanyShareInterface";
        public static final String message_success_add = "add success";
        public static final String message_success_edit = "edit success";

+ 6 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceAuditController.java

@ -153,6 +153,12 @@ public class IotInterfaceAuditController extends EnvelopRestEndpoint {
                                                                                    @RequestParam(value = "size", required = false) Integer size){
        try {
            if(page == null|| page < 0){
                page = 1;
            }
            if(size == null){
                size = 10;
            }
            return iotInterfaceAuditService.queryCompanyAppPage(page,size);
        } catch (Exception e) {
            e.printStackTrace();

+ 26 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/platform/IotInterfaceController.java

@ -157,6 +157,30 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
    }
    @GetMapping(value = IotRequestMapping.Platform.findCompanyShareInterface)
    @ApiOperation(value = "查询企业下的共享接口",notes = "查询企业下的共享接口")
    public MixEnvelop<IotShareInterfaceDO,IotShareInterfaceDO> findCompanyShareInterface(
                                                                                  @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;
            }
            return iotShareInterfaceService.findCompanyShareInterface(page,size);
        } catch (Exception e) {
            e.printStackTrace();
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = IotRequestMapping.Platform.findAllLog)
@ -376,4 +400,6 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
    }
}

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotInterfaceAuditService.java

@ -233,7 +233,7 @@ public class IotInterfaceAuditService  extends BaseJpaService<IotInterfaceAuditD
        IotCompanyDO account = iotCompanyDao.findByEhrUserId(userAgent.getUID());
        StringBuffer sql = new StringBuffer("SELECT DISTINCT * from iot_interface_audit ");
        sql.append("WHERE company_name = '").append(account.getName()).append("'");
        sql.append("WHERE company_id = '").append(account.getId()).append("'");
        sql.append(" order by time desc  limit ").append((page-1)*size).append(",").append(size);
        List<IotInterfaceAuditDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotInterfaceAuditDO.class));

+ 25 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/platform/IotShareInterfaceService.java

@ -4,9 +4,11 @@ import com.alibaba.fastjson.JSONObject;
import com.yihu.iot.dao.company.IotCompanyDao;
import com.yihu.iot.dao.dict.IotSystemDictDao;
import com.yihu.iot.dao.platform.IotShareInterfaceDao;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.company.IotCompanyAppDO;
import com.yihu.jw.entity.iot.company.IotCompanyDO;
import com.yihu.jw.entity.iot.dict.IotSystemDictDO;
import com.yihu.jw.entity.iot.platform.IotInterfaceAuditDO;
import com.yihu.jw.entity.iot.platform.IotShareInterfaceDO;
import com.yihu.jw.restmodel.iot.company.IotCompanyAppVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -46,6 +48,8 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
    @Autowired
    private IotSystemDictDao iotSystemDictDao;
    @Autowired
    private UserAgent userAgent;
    /**
     * 增加接口
     * @param jsonData
@ -196,4 +200,25 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
    }
    /**
     * 查询企业下的共享接口
     * @param page
     * @param size
     * @return
     */
    public MixEnvelop<IotShareInterfaceDO, IotShareInterfaceDO> findCompanyShareInterface(Integer page, Integer size) {
        IotCompanyDO account = iotCompanyDao.findByEhrUserId(userAgent.getUID());
        StringBuffer sql = new StringBuffer("SELECT DISTINCT * from iot_company_app_interface ");
        sql.append("WHERE company_id = '").append(account.getId()).append("'");
        sql.append(" order by update_time desc  limit ").append((page-1)*size).append(",").append(size);
        List<IotInterfaceAuditDO> list = jdbcTemplate.query(sql.toString(),new BeanPropertyRowMapper(IotInterfaceAuditDO.class));
        //获取总数
        long count = list.size();
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Platform.message_success_find,list,page, size,count);
    }
}