lmstack 3 gadi atpakaļ
vecāks
revīzija
95ac9dc08a

+ 6 - 1
src/main/java/cn/fastfun/controller/api/ApiAssetConfigureController.java

@@ -87,7 +87,11 @@ public class ApiAssetConfigureController {
         Page<AppAssetConf> page = new Page<>(appAssetConf.getIndex(), appAssetConf.getLength());
         QueryWrapper<AppAssetConf> appAssetConfQueryWrapper = new QueryWrapper<>();
         appAssetConfQueryWrapper.eq("is_delete", 0);
-        if (StringUtils.hasLength(appAssetConf.getSn())){
+        if (!StringUtils.hasLength(appAssetConf.getSn())){
+            throw new ApiRuntimeException("请输入sn");
+        }
+
+        if (StringUtils.hasLength(appAssetConf.getSn())) {
             appAssetConfQueryWrapper.like("sn", appAssetConf.getSn());
         }
         if (appAssetConf.getTableOrder() !=null){
@@ -102,6 +106,7 @@ public class ApiAssetConfigureController {
         if (appAssetConf.getTimeEnd() != null){
             appAssetConfQueryWrapper.lt("time", appAssetConf.getTimeEnd());
         }
+
         Page<AppAssetConf> page1 = appAssetConfService.page(page, appAssetConfQueryWrapper);
 
         return ApiDTO.ok("查询成功", page1);

+ 12 - 1
src/main/java/cn/fastfun/controller/api/ApiAssetProfitController.java

@@ -54,7 +54,9 @@ public class ApiAssetProfitController {
     @RequestMapping(value = "getBaseInfo", method = RequestMethod.POST)
     public ApiDTO getBaseInfo(@RequestBody @ApiParam(name = "设备信息对象", value = "传入json格式", required = true) AssetProfitParam param) throws Exception {
 
-
+        if (!StringUtils.hasLength(param.getSn())){
+            throw new ApiRuntimeException("请输入sn");
+        }
         BaseInfoDTO baseInfo = appAssetService.getBaseInfo(param);
         return ApiDTO.ok("成功", baseInfo);
     }
@@ -63,6 +65,9 @@ public class ApiAssetProfitController {
     @RequestMapping(value = "getProfitInfo", method = RequestMethod.POST)
     public ApiDTO getAssetProfitInfo(@RequestBody @ApiParam(name = "设备信息对象", value = "传入json格式", required = true) AssetProfitParam param) throws Exception {
 
+        if (!StringUtils.hasLength(param.getSn())){
+            throw new ApiRuntimeException("请输入sn");
+        }
         // 租赁信息
         Object response = null;
         if (param.getTableOrder() != null && param.getTableOrder().equals(1)) {
@@ -333,6 +338,9 @@ public class ApiAssetProfitController {
     @RequestMapping(value = "getProfitInfoFigure", method = RequestMethod.POST)
     public ApiDTO getAssetProfitInfoFigure(@RequestBody @ApiParam(name = "设备信息对象", value = "传入json格式", required = true) AssetProfitParam param) throws Exception {
 
+        if (!StringUtils.hasLength(param.getSn())){
+            throw new ApiRuntimeException("请输入sn");
+        }
         // 租赁信息
         Object response = null;
         if (param.getTableOrder() != null && param.getTableOrder().equals(1)) {
@@ -350,6 +358,9 @@ public class ApiAssetProfitController {
     @RequestMapping(value = "export", method = RequestMethod.POST)
     public void export(@RequestBody @ApiParam(name = "设备信息对象", value = "传入json格式", required = true) AssetProfitParam param, HttpServletResponse response) {
 
+        if (!StringUtils.hasLength(param.getSn())){
+            throw new ApiRuntimeException("请输入sn");
+        }
         try {
             // 租赁信息