Commit 56b157bd authored by 赵啸非's avatar 赵啸非

添加材料数量统计

parent 76d3caa3
...@@ -121,7 +121,7 @@ export default { ...@@ -121,7 +121,7 @@ export default {
size: this.size, size: this.size,
matterName: this.searchVal, matterName: this.searchVal,
}); });
let { total, data } = res.data.data; let { total, matterDatumTotal, data } = res.data.data;
// data.forEach(async (v) => { // data.forEach(async (v) => {
// v.matterDatumList = []; // v.matterDatumList = [];
// let obj = await this.getMaterialsList(1, -1, v.id); // let obj = await this.getMaterialsList(1, -1, v.id);
...@@ -132,6 +132,7 @@ export default { ...@@ -132,6 +132,7 @@ export default {
this.matterList = data; this.matterList = data;
// this.matterDatumList=data.matterDatumList // this.matterDatumList=data.matterDatumList
this.matterTotal = total; this.matterTotal = total;
this.matterDatumTotal = matterDatumTotal;
}, },
// 获取所有材料 // 获取所有材料
/* async getAllmaterials() { /* async getAllmaterials() {
......
...@@ -10,6 +10,8 @@ import com.mortals.xhx.base.system.param.service.ParamService; ...@@ -10,6 +10,8 @@ import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.MatterSourceEnum; import com.mortals.xhx.common.code.MatterSourceEnum;
import com.mortals.xhx.common.key.ParamKey; import com.mortals.xhx.common.key.ParamKey;
import com.mortals.xhx.common.utils.StringUtils; import com.mortals.xhx.common.utils.StringUtils;
import com.mortals.xhx.module.matter.model.MatterDatumQuery;
import com.mortals.xhx.module.matter.service.MatterDatumService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -42,6 +44,8 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -42,6 +44,8 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired
private MatterDatumService matterDatumService;
public MatterController(){ public MatterController(){
super.setModuleDesc( "事项"); super.setModuleDesc( "事项");
...@@ -67,8 +71,11 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -67,8 +71,11 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
@Override @Override
protected int doListAfter(MatterEntity query, Map<String, Object> model, Context context) throws AppException { protected int doListAfter(MatterEntity query, Map<String, Object> model, Context context) throws AppException {
int recommendCount = paramService.getParamIntValue(ParamKey.MATTER_RECOMMEND_COUNT); //统计材料数量
model.put("recommendCount", recommendCount); int count = matterDatumService.count(new MatterDatumQuery().siteId(query.getSiteId()), getContext());
model.put("matterDatumTotal", count);
// int recommendCount = paramService.getParamIntValue(ParamKey.MATTER_RECOMMEND_COUNT);
// model.put("matterDatumTotal", count);
return super.doListAfter(query, model, context); return super.doListAfter(query, model, context);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment