fix(material): 空数据异常
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package mjkf.xinke.main.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.jgy.xxs.core.http.exp.NcHttpException;
|
||||
import com.jgy.xxs.core.http.resp.HttpResponse;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -10,6 +11,7 @@ import mjkf.xinke.main.service.MaterialResultService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -36,6 +38,9 @@ public class MaterialResultController {
|
||||
@ApiParam("名称") @RequestParam(value="name", required=false) String name
|
||||
) throws Exception{
|
||||
var query = materialResultService.getQuery(keyWord, year, month, type, materialId, name);
|
||||
if (ObjectUtil.isEmpty(query)) {
|
||||
return FuHttpResponse.Builder().dataResponse(new ArrayList()).build();
|
||||
}
|
||||
query = materialResultService.filterQuery(query, type);
|
||||
var result = materialResultService.listStatistics(query, type);
|
||||
return FuHttpResponse.Builder().dataResponse(result).build();
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package mjkf.xinke.main.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import mjkf.xinke.main.constant.MaterialTaskType;
|
||||
@@ -61,6 +62,9 @@ public class MaterialResultService {
|
||||
) throws Exception {
|
||||
LambdaQueryWrapper query;
|
||||
var service = this.getService(type);
|
||||
if (ObjectUtil.isEmpty(service)) {
|
||||
return null;
|
||||
}
|
||||
Method getQuery = service.getClass().getMethod(
|
||||
"getQuery",
|
||||
String.class, Integer.class, Integer.class, String.class, String.class
|
||||
|
Reference in New Issue
Block a user