Browse Source

物联网后台系统 修复编辑公司接口问题 完成接口文档说明接口

mengkang 5 years ago
parent
commit
399129d9f2

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

@ -354,10 +354,10 @@ public class IotInterfaceController extends EnvelopRestEndpoint {
    @GetMapping(value = IotRequestMapping.Platform.interfaceDoc)
    @ApiOperation(value = "接口文档说明", notes = "接口文档说明")
    public MixEnvelop interfaceDoc( @ApiParam(name = "interfaceName", value = "接口名称", defaultValue = "")
                                        @RequestParam(value = "interfaceName") String interfaceName){
    public MixEnvelop interfaceDoc( @ApiParam(name = "dictName", value = "字典名称", defaultValue = "")
                                        @RequestParam(value = "dictName") String dictName){
       String url =  iotShareInterfaceService.interfaceDoc(interfaceName);
       String url =  iotShareInterfaceService.interfaceDoc(dictName);
       return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,url);
    }

+ 25 - 11
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java

@ -515,10 +515,14 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        if(accountType.equalsIgnoreCase("1")){
            //更新类型
            List<IotCompanyTypeDO> typeList = iotCompanyTypeDao.findByCompanyId(iotCompany.getId());
           typeList.forEach(one->{
               one.setDel("1");
               iotCompanyTypeDao.save(one);
           });
            if (typeList!=null&&typeList.size()>0){
                typeList.forEach(one->{
                    one.setDel("1");
                    iotCompanyTypeDao.save(one);
                });
            }
            List<IotCompanyTypeDO> companyTypes = new ArrayList<>(10);
            iotCompany.getTypeList().forEach(one->{
@ -538,13 +542,23 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
        if(accountType.equalsIgnoreCase("0")){
            IotCompanyAppDO newApp = iotCompany.getAppList().get(0);
            IotCompanyAppDO oldApp = iotCompanyAppDao.findOne(newApp.getId());
            oldApp.setAddressIp(newApp.getAddressIp());
            oldApp.setName(newApp.getName());
            oldApp.setId(newApp.getId());
            oldApp.setCompanyId(iotCompany.getId());
            oldApp.setCompanyName(iotCompany.getName());
            oldApp.setSaasId(getCode());
            iotCompanyAppDao.save(oldApp);
            //无应用
            if (oldApp!=null){
                oldApp.setAddressIp(newApp.getAddressIp());
                oldApp.setName(newApp.getName());
                oldApp.setId(newApp.getId());
                oldApp.setCompanyId(iotCompany.getId());
                oldApp.setCompanyName(iotCompany.getName());
                oldApp.setSaasId(getCode());
                iotCompanyAppDao.save(oldApp);
            }else {
                newApp.setDel("1");
                newApp.setCompanyName(iotCompany.getName());
                newApp.setCompanyId(iotCompany.getId());
                newApp.setSaasId(getCode());
                iotCompanyAppDao.save(newApp);
            }
        }
       

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

@ -150,11 +150,11 @@ public class IotShareInterfaceService extends BaseJpaService<IotShareInterfaceDO
    /**
     * 接口文档说明
     * @param interfaceName
     * @param dictName
     * @return
     */
    public String interfaceDoc(String interfaceName) {
        IotSystemDictDO systemDictDO = iotSystemDictDao.findByDictName(interfaceName).get(0);
    public String interfaceDoc(String dictName) {
        IotSystemDictDO systemDictDO = iotSystemDictDao.findByDictName(dictName).get(0);
        return systemDictDO.getCode();
    }