Commit 4acbca30 by 杨林龙

完成基本开发

1 parent b6ba5223
Showing 47 changed files with 1058 additions and 143 deletions
...@@ -7,6 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -7,6 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/** /**
* @author deployer name * @author deployer name
...@@ -19,6 +20,7 @@ import org.springframework.scheduling.annotation.EnableAsync; ...@@ -19,6 +20,7 @@ import org.springframework.scheduling.annotation.EnableAsync;
@EnableAsync @EnableAsync
@SpringBootApplication @SpringBootApplication
@ServletComponentScan @ServletComponentScan
@EnableSwagger2
public class Main extends AbsOreBootStarter { public class Main extends AbsOreBootStarter {
@Override @Override
......
package com.glsx.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.basePackage("com.glsx.controller"))
.paths(PathSelectors.any())
.build()
.apiInfo(apiEndPointsInfo())
.useDefaultResponseMessages(false);
}
private ApiInfo apiEndPointsInfo() {
return new ApiInfoBuilder().title("Sys REST API")
.description("接口描述")
.contact(new Contact("Zhangln", "https://code.aliyun.com/yidingv3/kwafoo", "zhangln@zhidianfan.com"))
.license("edingyi")
.licenseUrl("http://www.edingyi.com")
.version("V1")
.build();
}
}
package com.glsx.controller; package com.glsx.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformAd;
import com.glsx.model.PlatformApiCall;
import com.glsx.service.AdMgrService; import com.glsx.service.AdMgrService;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity; import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity; import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -11,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -11,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api
@RestController @RestController
@RequestMapping(value = "/admgr") @RequestMapping(value = "/admgr")
public class AdMgrController { public class AdMgrController {
...@@ -22,11 +32,45 @@ public class AdMgrController { ...@@ -22,11 +32,45 @@ public class AdMgrController {
@Autowired @Autowired
private AdMgrService adMgrService; private AdMgrService adMgrService;
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/getAdMgrList", method = RequestMethod.GET)
@ResponseBody
public R getAdMgrList(Pagination pagination) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformAd> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformAd> adMgrList = adMgrService.getAdMgrList();
return R.ok().putPageData(page, adMgrList);
}
@RequestMapping(value = "/insertAd", method = RequestMethod.POST)
@ResponseBody
public R insertAd(PlatformAd ad) {
int num = adMgrService.insertAd(ad);
if (num == 0) {
return R.error("新增广告失败");
}
return R.ok("新增广告成功");
}
@RequestMapping(value = "/updateAd", method = RequestMethod.POST)
@ResponseBody
public R updateAd(PlatformAd ad) {
int num = adMgrService.updateAd(ad);
if (num == 0) {
return R.error("编辑广告失败");
}
return R.ok("编辑广告成功");
}
@RequestMapping(value = "/startandstop", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<Object> getAdMgrList() { public R startandstop(int id, int status) {
LOGGER.info("获取金融产品类型和货款期限的下拉选项 start"); int num = adMgrService.startandstop(id, status);
ResponseEntity<Object> responseEntity = new ResponseEntity<>(); if (num == 0) {
return responseEntity; return R.error("修改广告投放状态失败");
}
return R.ok("修改广告投放状态成功");
} }
} }
package com.glsx.controller; package com.glsx.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformApi;
import com.glsx.model.PlatformApiCall;
import com.glsx.service.ApiCallMgrService; import com.glsx.service.ApiCallMgrService;
import com.glsx.vo.ApiCallVo;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity; import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity; import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -11,6 +19,9 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -11,6 +19,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api
@RestController @RestController
@RequestMapping(value = "/apicallmgr") @RequestMapping(value = "/apicallmgr")
public class ApiCallMgrController { public class ApiCallMgrController {
...@@ -22,11 +33,14 @@ public class ApiCallMgrController { ...@@ -22,11 +33,14 @@ public class ApiCallMgrController {
@Autowired @Autowired
private ApiCallMgrService apiCallMgrService; private ApiCallMgrService apiCallMgrService;
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/getApiCallMgrList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<Object> getApiCallMgrList() { public R getApiCallMgrList(Pagination pagination, ApiCallVo apiCallVo) {
LOGGER.info("获取金融产品类型和货款期限的下拉选项 start"); //PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
ResponseEntity<Object> responseEntity = new ResponseEntity<>(); Page<PlatformApiCall> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
return responseEntity;
List<PlatformApiCall> apiMgrList = apiCallMgrService.getApiCallMgrList(apiCallVo);
return R.ok().putPageData(page, apiMgrList);
} }
} }
package com.glsx.controller; package com.glsx.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformApi;
import com.glsx.model.PlatformCustomer;
import com.glsx.service.ApiMgrService; import com.glsx.service.ApiMgrService;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity; import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity; import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -11,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -11,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api
@RestController @RestController
@RequestMapping(value = "/apimgr") @RequestMapping(value = "/apimgr")
public class ApiMgrController { public class ApiMgrController {
...@@ -22,11 +32,24 @@ public class ApiMgrController { ...@@ -22,11 +32,24 @@ public class ApiMgrController {
@Autowired @Autowired
private ApiMgrService apiMgrService; private ApiMgrService apiMgrService;
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/getApiMgrList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<Object> getApiMgrList() { public R getApiMgrList(Pagination pagination) {
LOGGER.info("获取金融产品类型和货款期限的下拉选项 start"); //PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
ResponseEntity<Object> responseEntity = new ResponseEntity<>(); Page<PlatformApi> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
return responseEntity;
List<PlatformApi> apiMgrList = apiMgrService.getApiMgrList();
return R.ok().putPageData(page, apiMgrList);
}
@RequestMapping(value = "/startandstop", method = RequestMethod.GET)
@ResponseBody
public R startAndStop(int id, int status) {
int num = apiMgrService.startAndStop(id, status);
if (num == 0) {
return R.error("API使用状态修改失败");
}
return R.ok("API使用状态修改成功");
} }
} }
package com.glsx.controller; package com.glsx.controller;
import com.glsx.service.AppDownloadMgrService; import com.glsx.service.AppDownloadMgrService;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.ResponseEntity; import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity; import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -11,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -11,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@Api
@RestController @RestController
@RequestMapping(value = "/appdownloadmgr") @RequestMapping(value = "/appdownloadmgr")
public class AppDownloadMgrController { public class AppDownloadMgrController {
...@@ -24,9 +27,7 @@ public class AppDownloadMgrController { ...@@ -24,9 +27,7 @@ public class AppDownloadMgrController {
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<Object> getAppDownloadMgrList() { public R getAppDownloadMgrList() {
LOGGER.info("获取金融产品类型和货款期限的下拉选项 start"); return R.ok();
ResponseEntity<Object> responseEntity = new ResponseEntity<>();
return responseEntity;
} }
} }
package com.glsx.controller; package com.glsx.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformCustomer;
import com.glsx.model.PlatformUser;
import com.glsx.service.CustomerMgrService; import com.glsx.service.CustomerMgrService;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity; import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity; import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -11,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -11,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api
@RestController @RestController
@RequestMapping(value = "/customermgr") @RequestMapping(value = "/customermgr")
public class CustomerMgrController { public class CustomerMgrController {
...@@ -22,12 +32,34 @@ public class CustomerMgrController { ...@@ -22,12 +32,34 @@ public class CustomerMgrController {
@Autowired @Autowired
private CustomerMgrService customerMgrService; private CustomerMgrService customerMgrService;
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/getCustomerMgrList", method = RequestMethod.GET)
@ResponseBody
public R getCustomerMgrList(Pagination pagination) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformCustomer> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformCustomer> customerMgrList = customerMgrService.getCustomerMgrList();
return R.ok().putPageData(page, customerMgrList);
}
@RequestMapping(value = "/reset", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<Object> getCustomerMgrList() { public R reset(int id) {
LOGGER.info("获取金融产品类型和货款期限的下拉选项 start"); int num = customerMgrService.reset(id);
ResponseEntity<Object> responseEntity = new ResponseEntity<>(); if (num == 0) {
return R.error("重置密码失败");
}
return R.ok("重置的密码成功");
}
return responseEntity; @RequestMapping(value = "/startandstop", method = RequestMethod.GET)
@ResponseBody
public R startAndStop(int id, int status) {
int num = customerMgrService.startAndStop(id, status);
if (num == 0) {
return R.error("账号状态修改失败");
}
return R.ok("账号状态修改成功");
} }
} }
package com.glsx.controller; package com.glsx.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformCustomer;
import com.glsx.model.PlatformDevice;
import com.glsx.service.DeviceMgrService; import com.glsx.service.DeviceMgrService;
import com.glsx.vo.DeviceVo;
import com.glsx.vo.R;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity; import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity; import org.oreframework.web.ui.ResultEntity;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -11,6 +19,10 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -11,6 +19,10 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List;
@Api
@RestController @RestController
@RequestMapping(value = "/devicemgr") @RequestMapping(value = "/devicemgr")
public class DeviceMgrController { public class DeviceMgrController {
...@@ -22,11 +34,27 @@ public class DeviceMgrController { ...@@ -22,11 +34,27 @@ public class DeviceMgrController {
@Autowired @Autowired
private DeviceMgrService deviceMgrService; private DeviceMgrService deviceMgrService;
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/getDeviceMgrList", method = RequestMethod.GET)
@ResponseBody
public R getDeviceMgrList(Pagination pagination, DeviceVo deviceVo) {
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
Page<PlatformDevice> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformDevice> deviceMgrList = deviceMgrService.getDeviceMgrList(deviceVo);
return R.ok().putPageData(page, deviceMgrList);
}
@RequestMapping(value = "/getDropDownOptions", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<Object> getDeviceMgrList() { public R getDropDownOptions() {
LOGGER.info("获取金融产品类型和货款期限的下拉选项 start"); HashMap<String, List<String>> hashMap = new HashMap<>();
ResponseEntity<Object> responseEntity = new ResponseEntity<>(); List<String> customerNameList = deviceMgrService.getCustomerNameList();
return responseEntity;
List<String> deviceTypeList = deviceMgrService.getDeviceTypeList();
hashMap.put("customerNameList", customerNameList);
hashMap.put("deviceTypeList", deviceTypeList);
return R.ok().data(hashMap);
} }
} }
package com.glsx.controller; package com.glsx.controller;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformUser;
import com.glsx.service.*;
import com.glsx.vo.R;
import com.glsx.vo.UserVo;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RestController;
import com.glsx.config.SystemProperty;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* @author deployer name * @author deployer name
...@@ -15,21 +28,99 @@ import com.glsx.config.SystemProperty; ...@@ -15,21 +28,99 @@ import com.glsx.config.SystemProperty;
* @Company: Didihu.com.cn * @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017 * @Copyright Copyright (c) 2017
*/ */
@Controller @Api
@RestController
@RequestMapping(value = "/index")
public class IndexController { public class IndexController {
/**
* 日志
*/
private final static Logger LOGGER = LoggerFactory.getLogger(IndexController.class);
@Autowired
private CustomerMgrService customerMgrService;
@Autowired
private DeviceMgrService deviceMgrService;
@Autowired
private UserMgrService userMgrService;
@Autowired
private ApiCallMgrService apiCallMgrService;
@Autowired @Autowired
private SystemProperty systemProperty; private AppDownloadMgrService appDownloadMgrService;
@RequestMapping(value = "/getStatisticData", method = RequestMethod.GET)
@ResponseBody @ResponseBody
@RequestMapping("home") public R getStatisticData() {
public String home() { Map<String, Integer> hashMap = new HashMap<>();
return "hello, welcome to home!" + systemProperty.getName(); int customerCount = customerMgrService.getCustomerCount();
int deviceCount = deviceMgrService.getDeviceCount();
int userCount = userMgrService.getUserCount();
int apiCallCount = apiCallMgrService.getApiCallCount();
hashMap.put("customerCount", customerCount);
hashMap.put("deviceCount", deviceCount);
hashMap.put("userCount", userCount);
hashMap.put("apiCallCount", apiCallCount);
return R.ok().data(hashMap);
} }
@RequestMapping("index")
public String index(ModelMap map) { @RequestMapping(value = "/getGraphData", method = RequestMethod.GET)
map.addAttribute("name", systemProperty.getName()); @ResponseBody
return "index"; public R getGraphData() {
Map<String, Map<String, Integer>> hashMap = new HashMap<>();
Map<String, Integer> deviceGraphData = deviceMgrService.getDeviceGraphData();
Map<String, Integer> apiCallGraphData = apiCallMgrService.getApiCallGraphData();
hashMap.put("deviceGraphData", deviceGraphData);
hashMap.put("apiCallGraphData", apiCallGraphData);
return R.ok().data(hashMap);
}
@RequestMapping(value = "/getPolylineData", method = RequestMethod.GET)
@ResponseBody
public R getPolylineData() {
HashMap<String, Integer> hashMap = new HashMap<>();
int customerCount = customerMgrService.getCustomerCount();
int deviceCount = deviceMgrService.getDeviceCount();
int userCount = userMgrService.getUserCount();
int apiCallCount = apiCallMgrService.getApiCallCount();
hashMap.put("customerCount", customerCount);
hashMap.put("deviceCount", deviceCount);
hashMap.put("userCount", userCount);
hashMap.put("apiCallCount", apiCallCount);
return R.ok().data(hashMap);
}
@RequestMapping(value = "/getStatisticDataForUserConsole", method = RequestMethod.GET)
@ResponseBody
public R getStatisticDataForUserConsole(String customerName) {
Map<String, Integer> hashMap = new HashMap<>();
int deviceCountAuth = deviceMgrService.getDeviceCountAuth(customerName);
int userCountAuth = userMgrService.getUserCountAuth(customerName);
int apiCallCountAuth = appDownloadMgrService.getApiCallCountAuth(customerName);
hashMap.put("deviceCount", deviceCountAuth);
hashMap.put("userCount", userCountAuth);
hashMap.put("apiCallCount", apiCallCountAuth);
return R.ok().data(hashMap);
} }
} }
...@@ -4,6 +4,9 @@ import com.github.pagehelper.Page; ...@@ -4,6 +4,9 @@ import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glsx.model.PlatformUser; import com.glsx.model.PlatformUser;
import com.glsx.service.UserMgrService; import com.glsx.service.UserMgrService;
import com.glsx.vo.R;
import com.glsx.vo.UserVo;
import io.swagger.annotations.Api;
import org.oreframework.web.ui.Pagination; import org.oreframework.web.ui.Pagination;
import org.oreframework.web.ui.ResponseEntity; import org.oreframework.web.ui.ResponseEntity;
import org.oreframework.web.ui.ResultEntity; import org.oreframework.web.ui.ResultEntity;
...@@ -17,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -17,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@Api
@RestController @RestController
@RequestMapping(value = "/usermgr") @RequestMapping(value = "/usermgr")
public class UserMgrController { public class UserMgrController {
...@@ -30,35 +34,19 @@ public class UserMgrController { ...@@ -30,35 +34,19 @@ public class UserMgrController {
@RequestMapping(value = "/getUserMgrList", method = RequestMethod.GET) @RequestMapping(value = "/getUserMgrList", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<PlatformUser> getUserMgrList(Pagination pagination) { public R getUserMgrList(Pagination pagination, UserVo userVo) {
ResponseEntity<PlatformUser> responseEntity = new ResponseEntity<>();
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面 //PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面
PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true); Page<PlatformUser> page = PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformUser> datasyncAnjVerifyAccountsList = userMgrService.getUserMgrList(); List<PlatformUser> userMgrList = userMgrService.getUserMgrList(userVo);
long total = ((Page<PlatformUser>) datasyncAnjVerifyAccountsList).getTotal(); return R.ok().putPageData(page, userMgrList);
responseEntity.setData(datasyncAnjVerifyAccountsList);
responseEntity.setRecordsTotal(total);
responseEntity.setRecordsFiltered(total);
return responseEntity;
} }
@RequestMapping(value = "/reset", method = RequestMethod.GET) @RequestMapping(value = "/getDropDownOptions", method = RequestMethod.GET)
@ResponseBody @ResponseBody
public ResponseEntity<PlatformUser> reset(Pagination pagination) { public R getDropDownOptions() {
ResponseEntity<PlatformUser> responseEntity = new ResponseEntity<>(); List<String> customerNameList = userMgrService.getCustomerNameList();
//PageHelper注入分页和要分页的查询之前不能有其它查询,不然分页到第一个查询上面 return R.ok().data(customerNameList);
PageHelper.startPage(pagination.getCurrentPage(), pagination.getPageSize(), true);
List<PlatformUser> datasyncAnjVerifyAccountsList = userMgrService.getUserMgrList();
long total = ((Page<PlatformUser>) datasyncAnjVerifyAccountsList).getTotal();
responseEntity.setData(datasyncAnjVerifyAccountsList);
responseEntity.setRecordsTotal(total);
responseEntity.setRecordsFiltered(total);
return responseEntity;
} }
} }
...@@ -34,4 +34,6 @@ public interface PlatformAdMapper { ...@@ -34,4 +34,6 @@ public interface PlatformAdMapper {
int updateBatch(List<PlatformAd> list); int updateBatch(List<PlatformAd> list);
int updateBatchSelective(List<PlatformAd> list); int updateBatchSelective(List<PlatformAd> list);
List<PlatformAd> getAdMgrList();
} }
\ No newline at end of file \ No newline at end of file
...@@ -29,6 +29,13 @@ ...@@ -29,6 +29,13 @@
from t_platform_ad from t_platform_ad
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="getAdMgrList" resultType="com.glsx.model.PlatformAd">
select
<include refid="Base_Column_List" />
from t_platform_ad
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from t_platform_ad delete from t_platform_ad
......
...@@ -2,9 +2,11 @@ package com.glsx.mapper; ...@@ -2,9 +2,11 @@ package com.glsx.mapper;
import com.glsx.model.PlatformApiCall; import com.glsx.model.PlatformApiCall;
import com.glsx.vo.ApiCallVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p>Description: * <p>Description:
...@@ -34,4 +36,10 @@ public interface PlatformApiCallMapper { ...@@ -34,4 +36,10 @@ public interface PlatformApiCallMapper {
int updateBatch(List<PlatformApiCall> list); int updateBatch(List<PlatformApiCall> list);
int updateBatchSelective(List<PlatformApiCall> list); int updateBatchSelective(List<PlatformApiCall> list);
List<PlatformApiCall> getApiCallMgrList(ApiCallVo apiCallVo);
int getApiCallCount();
Map<String, Integer> getApiCallGraphData();
} }
\ No newline at end of file \ No newline at end of file
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
<!--@Table t_platform_api_call--> <!--@Table t_platform_api_call-->
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="customer_id" jdbcType="INTEGER" property="customerId" /> <result column="customer_id" jdbcType="INTEGER" property="customerId" />
<result column="customer_name" jdbcType="INTEGER" property="customerName" />
<result column="api_id" jdbcType="INTEGER" property="apiId" /> <result column="api_id" jdbcType="INTEGER" property="apiId" />
<result column="api_name" jdbcType="INTEGER" property="apiName" />
<result column="call_result" jdbcType="TINYINT" property="callResult" /> <result column="call_result" jdbcType="TINYINT" property="callResult" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="create_by" jdbcType="INTEGER" property="createBy" /> <result column="create_by" jdbcType="INTEGER" property="createBy" />
...@@ -23,6 +25,43 @@ ...@@ -23,6 +25,43 @@
from t_platform_api_call from t_platform_api_call
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="getApiCallMgrList" resultMap="BaseResultMap">
select
a.id,
b.customer_name,
c.api_name,
a.call_result,
a.create_time,
a.create_by,
a.remark
from t_platform_api_call a
left join t_platform_customer b
on a.customer_id = b.id
left join t_platform_api c
on a.api_id = c.id
where 1=1
<if test="apiCallVo.accessStartTime != null ">
and create_time &gt;= apiCallVo.accessStartTime
</if>
<if test="apiCallVo.accessEndTime != null ">
and create_time &lt;= apiCallVo.accessEndTime
</if>
</select>
<select id="getApiCallCount" resultType="java.lang.Integer">
select count(1)
from t_platform_api_call
</select>
<select id="getApiCallGraphData" resultType="java.util.Map">
select b.api_classification ,count(a.id)
from t_platform_api_call a
left join t_platform_api b
on a.api_id = b.id
group by b.api_classification
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from t_platform_api_call delete from t_platform_api_call
......
...@@ -33,4 +33,6 @@ public interface PlatformApiMapper { ...@@ -33,4 +33,6 @@ public interface PlatformApiMapper {
int updateBatch(List<PlatformApi> list); int updateBatch(List<PlatformApi> list);
int updateBatchSelective(List<PlatformApi> list); int updateBatchSelective(List<PlatformApi> list);
List<PlatformApi> getApiMgrList();
} }
\ No newline at end of file \ No newline at end of file
...@@ -29,6 +29,13 @@ ...@@ -29,6 +29,13 @@
from t_platform_api from t_platform_api
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="getApiMgrList" resultType="com.glsx.model.PlatformApi">
select
<include refid="Base_Column_List" />
from t_platform_api
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from t_platform_api delete from t_platform_api
......
...@@ -33,4 +33,6 @@ public interface PlatformAppDownloadMapper { ...@@ -33,4 +33,6 @@ public interface PlatformAppDownloadMapper {
int updateBatch(List<PlatformAppDownload> list); int updateBatch(List<PlatformAppDownload> list);
int updateBatchSelective(List<PlatformAppDownload> list); int updateBatchSelective(List<PlatformAppDownload> list);
int getApiCallCountAuth(String customerName);
} }
\ No newline at end of file \ No newline at end of file
...@@ -21,6 +21,15 @@ ...@@ -21,6 +21,15 @@
from t_platform_app_download from t_platform_app_download
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="getApiCallCountAuth" resultType="java.lang.Integer">
select count(1)
from t_platform_app_download a
left join t_platform_customer b
on a.customer_id = b.id
where b.customer_name = #{customerName,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from t_platform_app_download delete from t_platform_app_download
......
...@@ -33,4 +33,10 @@ public interface PlatformCustomerMapper { ...@@ -33,4 +33,10 @@ public interface PlatformCustomerMapper {
int updateBatch(List<PlatformCustomer> list); int updateBatch(List<PlatformCustomer> list);
int updateBatchSelective(List<PlatformCustomer> list); int updateBatchSelective(List<PlatformCustomer> list);
List<PlatformCustomer> getCustomerMgrList();
List<String> getCustomerNameList();
int getCustomerCount();
} }
\ No newline at end of file \ No newline at end of file
...@@ -36,6 +36,24 @@ ...@@ -36,6 +36,24 @@
from t_platform_customer from t_platform_customer
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="getCustomerMgrList" resultType="com.glsx.model.PlatformCustomer">
select
<include refid="Base_Column_List" />
from t_platform_customer
</select>
<select id="getCustomerNameList" resultType="java.lang.String">
select distinct
customer_name
from t_platform_customer
</select>
<select id="getCustomerCount" resultType="java.lang.Integer">
select count(1)
from t_platform_customer
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from t_platform_customer delete from t_platform_customer
......
package com.glsx.mapper; package com.glsx.mapper;
import com.glsx.model.PlatformDevice; import com.glsx.model.PlatformDevice;
import com.glsx.vo.DeviceVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* <p>Description: * <p>Description:
...@@ -33,4 +36,14 @@ public interface PlatformDeviceMapper { ...@@ -33,4 +36,14 @@ public interface PlatformDeviceMapper {
int updateBatch(List<PlatformDevice> list); int updateBatch(List<PlatformDevice> list);
int updateBatchSelective(List<PlatformDevice> list); int updateBatchSelective(List<PlatformDevice> list);
List<PlatformDevice> getDeviceMgrList(DeviceVo deviceVo);
List<String> getDeviceTypeList();
int getDeviceCount();
Map<String, Integer> getDeviceGraphData();
int getDeviceCountAuth(@Param("customerName") String customerName);
} }
\ No newline at end of file \ No newline at end of file
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<result column="device_sn" jdbcType="VARCHAR" property="deviceSn" /> <result column="device_sn" jdbcType="VARCHAR" property="deviceSn" />
<result column="device_type" jdbcType="VARCHAR" property="deviceType" /> <result column="device_type" jdbcType="VARCHAR" property="deviceType" />
<result column="customer_id" jdbcType="INTEGER" property="customerId" /> <result column="customer_id" jdbcType="INTEGER" property="customerId" />
<result column="customer_name" jdbcType="INTEGER" property="customerName" />
<result column="activat_time" jdbcType="TIMESTAMP" property="activatTime" /> <result column="activat_time" jdbcType="TIMESTAMP" property="activatTime" />
<result column="status" jdbcType="TINYINT" property="status" /> <result column="status" jdbcType="TINYINT" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
...@@ -28,6 +29,65 @@ ...@@ -28,6 +29,65 @@
from t_platform_device from t_platform_device
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="getDeviceMgrList" resultMap="BaseResultMap">
select
a.id,
a.device_sn,
a.device_type,
b.customer_name,
a.activat_time,
a.`status`,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
from t_platform_device a
left join t_platform_customer b
on a.customer_id = b.id
where 1 = 1
<if test="deviceVo.customerName != null and deviceVo.customerName != '' ">
and b.customer_name = #{deviceVo.customerName,jdbcType=VARCHAR}
</if>
<if test="deviceVo.deviceType != null and deviceVo.deviceType != '' ">
and a.device_type = #{deviceVo.deviceType,jdbcType=VARCHAR}
</if>
<if test="deviceVo.activatStartTime != null and deviceVo.activatStartTime != '' ">
and a.create_time &gt;= apiCallVo.accessStartTime
</if>
<if test="deviceVo.activatEndTime != null and deviceVo.activatEndTime != '' ">
and a.create_time &lt;= apiCallVo.accessEndTime
</if>
</select>
<select id="getDeviceTypeList" resultType="java.lang.String">
select distinct
device_type
from t_platform_device
</select>
<select id="getDeviceCount" resultType="java.lang.Integer">
select count(1)
from t_platform_device
</select>
<select id="getDeviceGraphData" resultType="java.util.Map">
select
device_type,
count(id)
from t_platform_device
group by device_type
</select>
<select id="getDeviceCountAuth" resultType="java.lang.Integer">
select count(1)
from t_platform_device a
left join t_platform_customer b
on a.customer_id = b.id
where b.customer_name = #{customerName,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from t_platform_device delete from t_platform_device
......
package com.glsx.mapper; package com.glsx.mapper;
import com.glsx.model.PlatformUser; import com.glsx.model.PlatformUser;
import com.glsx.vo.UserVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
...@@ -34,5 +36,9 @@ public interface PlatformUserMapper { ...@@ -34,5 +36,9 @@ public interface PlatformUserMapper {
int updateBatchSelective(List<PlatformUser> list); int updateBatchSelective(List<PlatformUser> list);
List<PlatformUser> getUserMgrList(); List<PlatformUser> getUserMgrList(UserVo userVo);
int getUserCount();
int getUserCountAuth(@Param("customerName") String customerName);
} }
\ No newline at end of file \ No newline at end of file
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<result column="province" jdbcType="INTEGER" property="province" /> <result column="province" jdbcType="INTEGER" property="province" />
<result column="city" jdbcType="INTEGER" property="city" /> <result column="city" jdbcType="INTEGER" property="city" />
<result column="customer_id" jdbcType="INTEGER" property="customerId" /> <result column="customer_id" jdbcType="INTEGER" property="customerId" />
<result column="customer_name" jdbcType="INTEGER" property="customerName" />
<result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" /> <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime" />
<result column="app_account_id" jdbcType="INTEGER" property="appAccountId" /> <result column="app_account_id" jdbcType="INTEGER" property="appAccountId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
...@@ -32,12 +33,50 @@ ...@@ -32,12 +33,50 @@
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</select> </select>
<select id="getUserMgrList" resultType="com.glsx.model.PlatformUser"> <select id="getUserMgrList" resultMap="BaseResultMap">
select select
<include refid="Base_Column_List" /> a.id,
a.nickname,
a.contact_number,
a.wechat_id,
a.province,
a.city,
b.customer_name,
a.last_login_time,
a.app_account_id,
a.create_time,
a.update_time,
a.create_by,
a.update_by,
a.remark
from t_platform_user a
left join t_platform_customer b
on a.customer_id = b.id
where 1 = 1
<if test="userVo.customerName != null and userVo.customerName != '' ">
and b.customer_name = #{userVo.customerName,jdbcType=VARCHAR}
</if>
<if test="userVo.registerStartTime != null and userVo.registerStartTime != '' ">
and a.create_time &gt;= userVo.registerStartTime
</if>
<if test="userVo.registerEndTime != null and userVo.registerEndTime != '' ">
and a.create_time &lt;= userVo.registerEndTime
</if>
</select>
<select id="getUserCount" resultType="java.lang.Integer">
select count(1)
from t_platform_user from t_platform_user
</select> </select>
<select id="getUserCountAuth" resultType="java.lang.Integer">
select count(1)
from t_platform_user a
left join t_platform_customer b
on a.customer_id = b.id
where b.customer_name = #{customerName,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated--> <!--@mbg.generated-->
delete from t_platform_user delete from t_platform_user
......
...@@ -48,7 +48,7 @@ public class PlatformAd implements Serializable { ...@@ -48,7 +48,7 @@ public class PlatformAd implements Serializable {
/** /**
* 是否上架 0 下架 1 上架 * 是否上架 0 下架 1 上架
*/ */
private Byte status; private Integer status;
/** /**
* 创建时间 添加时间 * 创建时间 添加时间
...@@ -123,11 +123,11 @@ public class PlatformAd implements Serializable { ...@@ -123,11 +123,11 @@ public class PlatformAd implements Serializable {
this.interfaceUrl = interfaceUrl; this.interfaceUrl = interfaceUrl;
} }
public Byte getStatus() { public Integer getStatus() {
return status; return status;
} }
public void setStatus(Byte status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
} }
......
...@@ -23,7 +23,7 @@ public class PlatformApi implements Serializable { ...@@ -23,7 +23,7 @@ public class PlatformApi implements Serializable {
/** /**
* API分类 1 授权管理 2 设备管理 3 数据服务 * API分类 1 授权管理 2 设备管理 3 数据服务
*/ */
private Byte apiClassification; private Integer apiClassification;
/** /**
* API名称 * API名称
...@@ -33,7 +33,7 @@ public class PlatformApi implements Serializable { ...@@ -33,7 +33,7 @@ public class PlatformApi implements Serializable {
/** /**
* 请求方式 1 GET 2 POST * 请求方式 1 GET 2 POST
*/ */
private Byte requestMethod; private Integer requestMethod;
/** /**
* API接口 * API接口
...@@ -48,7 +48,7 @@ public class PlatformApi implements Serializable { ...@@ -48,7 +48,7 @@ public class PlatformApi implements Serializable {
/** /**
* 状态 0 停用 1 可用 * 状态 0 停用 1 可用
*/ */
private Byte status; private Integer status;
/** /**
* 创建时间 * 创建时间
...@@ -83,11 +83,11 @@ public class PlatformApi implements Serializable { ...@@ -83,11 +83,11 @@ public class PlatformApi implements Serializable {
this.id = id; this.id = id;
} }
public Byte getApiClassification() { public Integer getApiClassification() {
return apiClassification; return apiClassification;
} }
public void setApiClassification(Byte apiClassification) { public void setApiClassification(Integer apiClassification) {
this.apiClassification = apiClassification; this.apiClassification = apiClassification;
} }
...@@ -99,11 +99,11 @@ public class PlatformApi implements Serializable { ...@@ -99,11 +99,11 @@ public class PlatformApi implements Serializable {
this.apiName = apiName; this.apiName = apiName;
} }
public Byte getRequestMethod() { public Integer getRequestMethod() {
return requestMethod; return requestMethod;
} }
public void setRequestMethod(Byte requestMethod) { public void setRequestMethod(Integer requestMethod) {
this.requestMethod = requestMethod; this.requestMethod = requestMethod;
} }
...@@ -123,11 +123,11 @@ public class PlatformApi implements Serializable { ...@@ -123,11 +123,11 @@ public class PlatformApi implements Serializable {
this.description = description; this.description = description;
} }
public Byte getStatus() { public Integer getStatus() {
return status; return status;
} }
public void setStatus(Byte status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
} }
......
...@@ -26,14 +26,24 @@ public class PlatformApiCall implements Serializable { ...@@ -26,14 +26,24 @@ public class PlatformApiCall implements Serializable {
private Integer customerId; private Integer customerId;
/** /**
* 客户名称
*/
private String customerName;
/**
* 调用API id t_platform_api 的id * 调用API id t_platform_api 的id
*/ */
private Integer apiId; private Integer apiId;
/** /**
* API名称
*/
private String apiName;
/**
* 调用结果 0 失败 1 成功 * 调用结果 0 失败 1 成功
*/ */
private Byte callResult; private Integer callResult;
/** /**
* 创建时间 访问时间 * 创建时间 访问时间
...@@ -74,11 +84,11 @@ public class PlatformApiCall implements Serializable { ...@@ -74,11 +84,11 @@ public class PlatformApiCall implements Serializable {
this.apiId = apiId; this.apiId = apiId;
} }
public Byte getCallResult() { public Integer getCallResult() {
return callResult; return callResult;
} }
public void setCallResult(Byte callResult) { public void setCallResult(Integer callResult) {
this.callResult = callResult; this.callResult = callResult;
} }
...@@ -106,20 +116,34 @@ public class PlatformApiCall implements Serializable { ...@@ -106,20 +116,34 @@ public class PlatformApiCall implements Serializable {
this.remark = remark; this.remark = remark;
} }
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getApiName() {
return apiName;
}
public void setApiName(String apiName) {
this.apiName = apiName;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); return "PlatformApiCall{" +
sb.append(getClass().getSimpleName()); "id=" + id +
sb.append(" ["); ", customerId=" + customerId +
sb.append("Hash = ").append(hashCode()); ", customerName='" + customerName + '\'' +
sb.append(", id=").append(id); ", apiId=" + apiId +
sb.append(", customerId=").append(customerId); ", apiName='" + apiName + '\'' +
sb.append(", apiId=").append(apiId); ", callResult=" + callResult +
sb.append(", callResult=").append(callResult); ", createTime=" + createTime +
sb.append(", createTime=").append(createTime); ", createBy=" + createBy +
sb.append(", createBy=").append(createBy); ", remark='" + remark + '\'' +
sb.append(", remark=").append(remark); '}';
sb.append("]");
return sb.toString();
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -63,7 +63,7 @@ public class PlatformCustomer implements Serializable { ...@@ -63,7 +63,7 @@ public class PlatformCustomer implements Serializable {
/** /**
* 账号状态 0 停用 1 正常 2 待审核 3 审核未通过 * 账号状态 0 停用 1 正常 2 待审核 3 审核未通过
*/ */
private Byte status; private Integer status;
/** /**
* 公钥 * 公钥
...@@ -177,11 +177,11 @@ public class PlatformCustomer implements Serializable { ...@@ -177,11 +177,11 @@ public class PlatformCustomer implements Serializable {
this.address = address; this.address = address;
} }
public Byte getStatus() { public Integer getStatus() {
return status; return status;
} }
public void setStatus(Byte status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
} }
......
...@@ -36,6 +36,11 @@ public class PlatformDevice implements Serializable { ...@@ -36,6 +36,11 @@ public class PlatformDevice implements Serializable {
private Integer customerId; private Integer customerId;
/** /**
* 客户名称
*/
private String customerName;
/**
* 激活时间 * 激活时间
*/ */
private Date activatTime; private Date activatTime;
...@@ -43,7 +48,7 @@ public class PlatformDevice implements Serializable { ...@@ -43,7 +48,7 @@ public class PlatformDevice implements Serializable {
/** /**
* 设备状态 0 异常 1 正常 * 设备状态 0 异常 1 正常
*/ */
private Byte status; private Integer status;
/** /**
* 创建时间 * 创建时间
...@@ -110,11 +115,11 @@ public class PlatformDevice implements Serializable { ...@@ -110,11 +115,11 @@ public class PlatformDevice implements Serializable {
this.activatTime = activatTime; this.activatTime = activatTime;
} }
public Byte getStatus() { public Integer getStatus() {
return status; return status;
} }
public void setStatus(Byte status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
} }
...@@ -158,24 +163,29 @@ public class PlatformDevice implements Serializable { ...@@ -158,24 +163,29 @@ public class PlatformDevice implements Serializable {
this.remark = remark; this.remark = remark;
} }
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); return "PlatformDevice{" +
sb.append(getClass().getSimpleName()); "id=" + id +
sb.append(" ["); ", deviceSn='" + deviceSn + '\'' +
sb.append("Hash = ").append(hashCode()); ", deviceType='" + deviceType + '\'' +
sb.append(", id=").append(id); ", customerId=" + customerId +
sb.append(", deviceSn=").append(deviceSn); ", customerName='" + customerName + '\'' +
sb.append(", deviceType=").append(deviceType); ", activatTime=" + activatTime +
sb.append(", customerId=").append(customerId); ", status=" + status +
sb.append(", activatTime=").append(activatTime); ", createTime=" + createTime +
sb.append(", status=").append(status); ", updateTime=" + updateTime +
sb.append(", createTime=").append(createTime); ", createBy=" + createBy +
sb.append(", updateTime=").append(updateTime); ", updateBy=" + updateBy +
sb.append(", createBy=").append(createBy); ", remark='" + remark + '\'' +
sb.append(", updateBy=").append(updateBy); '}';
sb.append(", remark=").append(remark);
sb.append("]");
return sb.toString();
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -51,6 +51,11 @@ public class PlatformUser implements Serializable { ...@@ -51,6 +51,11 @@ public class PlatformUser implements Serializable {
private Integer customerId; private Integer customerId;
/** /**
* 客户名称
*/
private String customerName;
/**
* 最后登录时间 * 最后登录时间
*/ */
private Date lastLoginTime; private Date lastLoginTime;
...@@ -197,27 +202,32 @@ public class PlatformUser implements Serializable { ...@@ -197,27 +202,32 @@ public class PlatformUser implements Serializable {
this.remark = remark; this.remark = remark;
} }
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); return "PlatformUser{" +
sb.append(getClass().getSimpleName()); "id=" + id +
sb.append(" ["); ", nickname='" + nickname + '\'' +
sb.append("Hash = ").append(hashCode()); ", contactNumber='" + contactNumber + '\'' +
sb.append(", id=").append(id); ", wechatId='" + wechatId + '\'' +
sb.append(", nickname=").append(nickname); ", province=" + province +
sb.append(", contactNumber=").append(contactNumber); ", city=" + city +
sb.append(", wechatId=").append(wechatId); ", customerId=" + customerId +
sb.append(", province=").append(province); ", customerName='" + customerName + '\'' +
sb.append(", city=").append(city); ", lastLoginTime=" + lastLoginTime +
sb.append(", customerId=").append(customerId); ", appAccountId=" + appAccountId +
sb.append(", lastLoginTime=").append(lastLoginTime); ", createTime=" + createTime +
sb.append(", appAccountId=").append(appAccountId); ", updateTime=" + updateTime +
sb.append(", createTime=").append(createTime); ", createBy=" + createBy +
sb.append(", updateTime=").append(updateTime); ", updateBy=" + updateBy +
sb.append(", createBy=").append(createBy); ", remark='" + remark + '\'' +
sb.append(", updateBy=").append(updateBy); '}';
sb.append(", remark=").append(remark);
sb.append("]");
return sb.toString();
} }
} }
\ No newline at end of file \ No newline at end of file
package com.glsx.service; package com.glsx.service;
import com.glsx.model.PlatformAd;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
@Service @Service
public interface AdMgrService { public interface AdMgrService {
List<PlatformAd> getAdMgrList();
int insertAd(PlatformAd ad);
int updateAd(PlatformAd ad);
int startandstop(int id, int status);
} }
package com.glsx.service; package com.glsx.service;
import com.glsx.model.PlatformApiCall;
import com.glsx.vo.ApiCallVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service @Service
public interface ApiCallMgrService { public interface ApiCallMgrService {
List<PlatformApiCall> getApiCallMgrList(ApiCallVo apiCallVo);
int getApiCallCount();
Map<String, Integer> getApiCallGraphData();
} }
package com.glsx.service; package com.glsx.service;
import com.glsx.model.PlatformApi;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
@Service @Service
public interface ApiMgrService { public interface ApiMgrService {
List<PlatformApi> getApiMgrList();
int startAndStop(int id, int status);
} }
...@@ -4,4 +4,5 @@ import org.springframework.stereotype.Service; ...@@ -4,4 +4,5 @@ import org.springframework.stereotype.Service;
@Service @Service
public interface AppDownloadMgrService { public interface AppDownloadMgrService {
int getApiCallCountAuth(String customerName);
} }
package com.glsx.service; package com.glsx.service;
import com.glsx.model.PlatformCustomer;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
@Service @Service
public interface CustomerMgrService { public interface CustomerMgrService {
List<PlatformCustomer> getCustomerMgrList();
int reset(int id);
int startAndStop(int id, int status);
int getCustomerCount();
} }
package com.glsx.service; package com.glsx.service;
import com.glsx.model.PlatformDevice;
import com.glsx.vo.DeviceVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
@Service @Service
public interface DeviceMgrService { public interface DeviceMgrService {
List<PlatformDevice> getDeviceMgrList(DeviceVo deviceVo);
List<String> getCustomerNameList();
List<String> getDeviceTypeList();
int getDeviceCount();
Map<String, Integer> getDeviceGraphData();
int getDeviceCountAuth(String customerName);
} }
package com.glsx.service; package com.glsx.service;
import com.glsx.model.PlatformUser; import com.glsx.model.PlatformUser;
import com.glsx.vo.UserVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
...@@ -8,5 +9,13 @@ import java.util.List; ...@@ -8,5 +9,13 @@ import java.util.List;
@Service @Service
public interface UserMgrService { public interface UserMgrService {
List<PlatformUser> getUserMgrList(); List<PlatformUser> getUserMgrList(UserVo userVo);
List<String> getCustomerNameList();
int getUserCount();
int getUserCountAuth(String customerName);
} }
package com.glsx.service.impl; package com.glsx.service.impl;
import com.glsx.mapper.PlatformAdMapper; import com.glsx.mapper.PlatformAdMapper;
import com.glsx.model.PlatformAd;
import com.glsx.service.AdMgrService; import com.glsx.service.AdMgrService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
public class AdMgrServiceImpl implements AdMgrService { public class AdMgrServiceImpl implements AdMgrService {
/** /**
...@@ -15,4 +17,27 @@ public class AdMgrServiceImpl implements AdMgrService { ...@@ -15,4 +17,27 @@ public class AdMgrServiceImpl implements AdMgrService {
@Resource @Resource
private PlatformAdMapper adMapper; private PlatformAdMapper adMapper;
@Override
public List<PlatformAd> getAdMgrList() {
return adMapper.getAdMgrList();
}
@Override
public int insertAd(PlatformAd ad) {
return adMapper.insert(ad);
}
@Override
public int updateAd(PlatformAd ad) {
return adMapper.updateByPrimaryKeySelective(ad);
}
@Override
public int startandstop(int id, int status) {
PlatformAd ad = new PlatformAd();
ad.setId(id);
ad.setStatus(status);
return adMapper.updateByPrimaryKeySelective(ad);
}
} }
...@@ -2,11 +2,15 @@ package com.glsx.service.impl; ...@@ -2,11 +2,15 @@ package com.glsx.service.impl;
import com.glsx.mapper.PlatformApiCallMapper; import com.glsx.mapper.PlatformApiCallMapper;
import com.glsx.mapper.PlatformApiMapper; import com.glsx.mapper.PlatformApiMapper;
import com.glsx.model.PlatformApiCall;
import com.glsx.service.ApiCallMgrService; import com.glsx.service.ApiCallMgrService;
import com.glsx.vo.ApiCallVo;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
public class ApiCallMgrServiceImpl implements ApiCallMgrService { public class ApiCallMgrServiceImpl implements ApiCallMgrService {
/** /**
...@@ -16,4 +20,19 @@ public class ApiCallMgrServiceImpl implements ApiCallMgrService { ...@@ -16,4 +20,19 @@ public class ApiCallMgrServiceImpl implements ApiCallMgrService {
@Resource @Resource
private PlatformApiCallMapper apiCallMapper; private PlatformApiCallMapper apiCallMapper;
@Override
public List<PlatformApiCall> getApiCallMgrList(ApiCallVo apiCallVo) {
return apiCallMapper.getApiCallMgrList(apiCallVo);
}
@Override
public int getApiCallCount() {
return apiCallMapper.getApiCallCount();
}
@Override
public Map<String, Integer> getApiCallGraphData() {
return apiCallMapper.getApiCallGraphData();
}
} }
...@@ -2,11 +2,14 @@ package com.glsx.service.impl; ...@@ -2,11 +2,14 @@ package com.glsx.service.impl;
import com.glsx.mapper.PlatformApiMapper; import com.glsx.mapper.PlatformApiMapper;
import com.glsx.mapper.PlatformAppDownloadMapper; import com.glsx.mapper.PlatformAppDownloadMapper;
import com.glsx.model.PlatformApi;
import com.glsx.model.PlatformCustomer;
import com.glsx.service.ApiMgrService; import com.glsx.service.ApiMgrService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
public class ApiMgrServiceImpl implements ApiMgrService { public class ApiMgrServiceImpl implements ApiMgrService {
/** /**
...@@ -16,4 +19,17 @@ public class ApiMgrServiceImpl implements ApiMgrService { ...@@ -16,4 +19,17 @@ public class ApiMgrServiceImpl implements ApiMgrService {
@Resource @Resource
private PlatformApiMapper apiMapper; private PlatformApiMapper apiMapper;
@Override
public List<PlatformApi> getApiMgrList() {
return apiMapper.getApiMgrList();
}
@Override
public int startAndStop(int id, int status) {
PlatformApi api = new PlatformApi();
api.setId(id);
api.setStatus(status);
return apiMapper.updateByPrimaryKeySelective(api);
}
} }
...@@ -16,4 +16,9 @@ public class AppDownloadMgrServiceImpl implements AppDownloadMgrService { ...@@ -16,4 +16,9 @@ public class AppDownloadMgrServiceImpl implements AppDownloadMgrService {
@Resource @Resource
private PlatformAppDownloadMapper appDownloadMapper; private PlatformAppDownloadMapper appDownloadMapper;
@Override
public int getApiCallCountAuth(String customerName) {
return appDownloadMapper.getApiCallCountAuth(customerName);
}
} }
...@@ -2,11 +2,13 @@ package com.glsx.service.impl; ...@@ -2,11 +2,13 @@ package com.glsx.service.impl;
import com.glsx.mapper.PlatformCustomerMapper; import com.glsx.mapper.PlatformCustomerMapper;
import com.glsx.mapper.PlatformDeviceMapper; import com.glsx.mapper.PlatformDeviceMapper;
import com.glsx.model.PlatformCustomer;
import com.glsx.service.CustomerMgrService; import com.glsx.service.CustomerMgrService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
public class CustomerMgrServiceImpl implements CustomerMgrService { public class CustomerMgrServiceImpl implements CustomerMgrService {
/** /**
...@@ -16,4 +18,30 @@ public class CustomerMgrServiceImpl implements CustomerMgrService { ...@@ -16,4 +18,30 @@ public class CustomerMgrServiceImpl implements CustomerMgrService {
@Resource @Resource
private PlatformCustomerMapper customerMapper; private PlatformCustomerMapper customerMapper;
@Override
public List<PlatformCustomer> getCustomerMgrList() {
return customerMapper.getCustomerMgrList();
}
@Override
public int reset(int id) {
PlatformCustomer customer = new PlatformCustomer();
customer.setId(id);
customer.setPassword("12345678");
return customerMapper.updateByPrimaryKeySelective(customer);
}
@Override
public int startAndStop(int id, int status) {
PlatformCustomer customer = new PlatformCustomer();
customer.setId(id);
customer.setStatus(status);
return customerMapper.updateByPrimaryKeySelective(customer);
}
@Override
public int getCustomerCount() {
return customerMapper.getCustomerCount();
}
} }
package com.glsx.service.impl; package com.glsx.service.impl;
import com.glsx.mapper.PlatformCustomerMapper;
import com.glsx.mapper.PlatformDeviceMapper; import com.glsx.mapper.PlatformDeviceMapper;
import com.glsx.mapper.PlatformUserMapper; import com.glsx.model.PlatformDevice;
import com.glsx.service.DeviceMgrService; import com.glsx.service.DeviceMgrService;
import com.glsx.vo.DeviceVo;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
public class DeviceMgrServiceImpl implements DeviceMgrService { public class DeviceMgrServiceImpl implements DeviceMgrService {
/** /**
...@@ -16,4 +20,37 @@ public class DeviceMgrServiceImpl implements DeviceMgrService { ...@@ -16,4 +20,37 @@ public class DeviceMgrServiceImpl implements DeviceMgrService {
@Resource @Resource
private PlatformDeviceMapper deviceMapper; private PlatformDeviceMapper deviceMapper;
@Resource
private PlatformCustomerMapper customerMapper;
@Override
public List<PlatformDevice> getDeviceMgrList(DeviceVo deviceVo) {
return deviceMapper.getDeviceMgrList(deviceVo);
}
@Override
public List<String> getCustomerNameList() {
return customerMapper.getCustomerNameList();
}
@Override
public List<String> getDeviceTypeList() {
return deviceMapper.getDeviceTypeList();
}
@Override
public int getDeviceCount() {
return deviceMapper.getDeviceCount();
}
@Override
public Map<String, Integer> getDeviceGraphData() {
return deviceMapper.getDeviceGraphData();
}
@Override
public int getDeviceCountAuth(String customerName) {
return deviceMapper.getDeviceCountAuth(customerName);
}
} }
package com.glsx.service.impl; package com.glsx.service.impl;
import com.glsx.mapper.PlatformCustomerMapper;
import com.glsx.mapper.PlatformUserMapper; import com.glsx.mapper.PlatformUserMapper;
import com.glsx.model.PlatformUser; import com.glsx.model.PlatformUser;
import com.glsx.service.UserMgrService; import com.glsx.service.UserMgrService;
import com.glsx.vo.UserVo;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -20,8 +22,26 @@ public class UserMgrServiceImpl implements UserMgrService { ...@@ -20,8 +22,26 @@ public class UserMgrServiceImpl implements UserMgrService {
@Resource @Resource
private PlatformUserMapper userMapper; private PlatformUserMapper userMapper;
@Resource
private PlatformCustomerMapper customerMapper;
@Override
public List<PlatformUser> getUserMgrList(UserVo userVo) {
return userMapper.getUserMgrList(userVo);
}
@Override
public List<String> getCustomerNameList() {
return customerMapper.getCustomerNameList();
}
@Override
public int getUserCount() {
return userMapper.getUserCount();
}
@Override @Override
public List<PlatformUser> getUserMgrList() { public int getUserCountAuth(String customerName) {
return userMapper.getUserMgrList(); return userMapper.getUserCountAuth(customerName);
} }
} }
package com.glsx.vo;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* api调用表
*/
public class ApiCallVo implements Serializable {
/**
* 访问开始时间
*/
private Date accessStartTime;
/**
* 访问结束时间
*/
private Date accessEndTime;
public Date getAccessStartTime() {
return accessStartTime;
}
public void setAccessStartTime(Date accessStartTime) {
this.accessStartTime = accessStartTime;
}
public Date getAccessEndTime() {
return accessEndTime;
}
public void setAccessEndTime(Date accessEndTime) {
this.accessEndTime = accessEndTime;
}
}
\ No newline at end of file \ No newline at end of file
package com.glsx.vo;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* 设备管理表
*/
public class DeviceVo implements Serializable {
/**
* 客户名称
*/
private String customerName;
/**
* 类型
*/
private String deviceType;
/**
* 激活开始时间
*/
private Date activatStartTime;
/**
* 激活开始时间
*/
private Date activatEndTime;
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public Date getActivatStartTime() {
return activatStartTime;
}
public void setActivatStartTime(Date activatStartTime) {
this.activatStartTime = activatStartTime;
}
public Date getActivatEndTime() {
return activatEndTime;
}
public void setActivatEndTime(Date activatEndTime) {
this.activatEndTime = activatEndTime;
}
}
\ No newline at end of file \ No newline at end of file
package com.glsx.vo;
import java.io.Serializable;
import java.util.Date;
/**
* <p>Description:
* <p>Project: shop
*
* @author wbh
* @date 2020-12-15
*/
/**
* 设备管理表
*/
public class UserVo implements Serializable {
/**
* 客户名称
*/
private String customerName;
/**
* 类型
*/
private String deviceType;
/**
* 激活开始时间
*/
private Date registerStartTime;
/**
* 激活开始时间
*/
private Date registerEndTime;
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getDeviceType() {
return deviceType;
}
public void setDeviceType(String deviceType) {
this.deviceType = deviceType;
}
public Date getRegisterStartTime() {
return registerStartTime;
}
public void setRegisterStartTime(Date registerStartTime) {
this.registerStartTime = registerStartTime;
}
public Date getRegisterEndTime() {
return registerEndTime;
}
public void setRegisterEndTime(Date registerEndTime) {
this.registerEndTime = registerEndTime;
}
}
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!