From a0c41029992f7dc390c125247e84d0bfac972706 Mon Sep 17 00:00:00 2001 From: xuefei <564615061@qq.com> Date: 星期日, 13 十二月 2020 14:23:26 +0800 Subject: [PATCH] 养老机构页面 --- platform-modules/platform-zhyl/src/main/java/cn/cetc54/platform/zhyl/api/FwjgController.java | 74 ++++++++++++++++++++++++++++--------- 1 files changed, 56 insertions(+), 18 deletions(-) diff --git a/platform-modules/platform-zhyl/src/main/java/cn/cetc54/platform/zhyl/api/FwjgController.java b/platform-modules/platform-zhyl/src/main/java/cn/cetc54/platform/zhyl/api/FwjgController.java index efd88cb..86d24d0 100644 --- a/platform-modules/platform-zhyl/src/main/java/cn/cetc54/platform/zhyl/api/FwjgController.java +++ b/platform-modules/platform-zhyl/src/main/java/cn/cetc54/platform/zhyl/api/FwjgController.java @@ -9,6 +9,7 @@ import cn.cetc54.platform.zhyl.entity.vo.FwnlAndOrderCount; import cn.cetc54.platform.zhyl.entity.vo.OrderByExecute; import cn.cetc54.platform.zhyl.service.*; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; @@ -32,8 +33,6 @@ @CrossOrigin("*") public class FwjgController { @Autowired - private IAreaService iAreaService; - @Autowired private IOrgFuwuService iOrgFuwuService; @Autowired private IFuwuPersonService iFuwuPersonService; @@ -46,19 +45,35 @@ @RequestMapping(value = "/getCountByAreaId", method = RequestMethod.GET) @ApiOperation(value = "鏍规嵁鍖哄煙id鑾峰彇鍖哄煙涓嬫墍鏈夋満鏋勫拰浜哄憳鏁伴噺浠ュ強璁㈠崟鎬绘暟") public Result<Object> getCountByAreaId(String areaId){ + if (StrUtil.isNotBlank(areaId)&&areaId.equals("130100")){ + //濡傛灉鏄叏甯� areaId璁剧疆鏈┖ + areaId = null; + } QueryWrapper<OrgFuwu> wrapper = new QueryWrapper<>(); - wrapper.eq("area_id",areaId); + if (StrUtil.isNotEmpty(areaId)){ + wrapper.eq("area_id",areaId); + } int orgFuwuCount = iOrgFuwuService.count(wrapper); + QueryWrapper<FuwuPerson> wrapper1 = new QueryWrapper<>(); - wrapper1.eq("area_id",areaId); + if (StrUtil.isNotEmpty(areaId)){ + wrapper1.eq("area_id",areaId); + } int fuwuPersonCount = iFuwuPersonService.count(wrapper1); + QueryWrapper<Order> wrapper2 = new QueryWrapper<>(); - wrapper2.eq("area_id",areaId); + if (StrUtil.isNotEmpty(areaId)){ + wrapper2.eq("area_id",areaId); + } int orderCount = iOrderService.count(wrapper2); + QueryWrapper<Order> wrapper3 = new QueryWrapper<>(); - wrapper2.eq("area_id",areaId); - wrapper2.eq("state",0); + if (StrUtil.isNotEmpty(areaId)){ + wrapper3.eq("area_id",areaId); + } + wrapper3.eq("state",0); int orderCount2 = iOrderService.count(wrapper3); + FwjgCount fwjgCount=new FwjgCount(); fwjgCount.setFwjgCount(orgFuwuCount); fwjgCount.setFwPersonCount(fuwuPersonCount); @@ -70,9 +85,14 @@ @RequestMapping(value = "/getFwnlByAreaId", method = RequestMethod.GET) @ApiOperation(value = "鏍规嵁鍖哄煙id鑾峰彇鍖哄煙涓嬫墍鏈夊疄闄呮湇鍔′互鍙婃湇鍔¤鍗曟暟") public Result<Object> getFwnlByAreaId(String areaId){ + if (StrUtil.isNotBlank(areaId)&&areaId.equals("130100")){ + //濡傛灉鏄叏甯� areaId璁剧疆鏈┖ + areaId = null; + } QueryWrapper<FuwuDetails> wrapper = new QueryWrapper<>(); wrapper.isNull("pid"); List<FuwuDetails> list = iFuwuDetailsService.list(wrapper); + List<FwnlAndOrderCount> fwnlAndOrderCountList=new ArrayList<>(); for (FuwuDetails fuwuDetails : list) { QueryWrapper<FuwuDetails> wrapper1 = new QueryWrapper<>(); @@ -80,7 +100,9 @@ List<FuwuDetails> list1 = iFuwuDetailsService.list(wrapper1); for (FuwuDetails details : list1) { QueryWrapper<Order> wrapper2 = new QueryWrapper<>(); - wrapper2.eq("area_id",areaId); + if (StrUtil.isNotBlank(areaId)){ + wrapper2.eq("area_id",areaId); + } wrapper2.eq("detail_id",details.getId()); int count = iOrderService.count(wrapper2); details.setOrderNumber(count); @@ -96,8 +118,14 @@ @RequestMapping(value = "/getFwjgOrderByOrderNumber", method = RequestMethod.GET) @ApiOperation(value = "鏍规嵁鍖哄煙id鍜岃鍗曢噺鏌ヨ鏈嶅姟鏈烘瀯鎺掑悕鎯呭喌") public Result<Object> getFwjgOrderByOrderNumber(String areaId){ + if (StrUtil.isNotBlank(areaId)&&areaId.equals("130100")){ + //濡傛灉鏄叏甯� areaId璁剧疆鏈┖ + areaId = null; + } QueryWrapper<OrgFuwu> wrapper = new QueryWrapper<>(); - wrapper.eq("area_id",areaId); + if (StrUtil.isNotEmpty(areaId)){ + wrapper.eq("area_id",areaId); + } List<OrgFuwu> list = iOrgFuwuService.list(wrapper); for (OrgFuwu orgFuwu : list) { QueryWrapper<FuwuDetails> wrapper1 = new QueryWrapper<>(); @@ -128,28 +156,42 @@ @RequestMapping(value = "/getFuwuDetailsOrderByOrderNumber", method = RequestMethod.GET) @ApiOperation(value = "鏍规嵁鍖哄煙id鍜岃鍗曢噺鏌ヨ瀹為檯鏈嶅姟鎺掑悕鎯呭喌") public Result<Object> getFuwuDetailsOrderByOrderNumber(String areaId){ + if (StrUtil.isNotBlank(areaId)&&areaId.equals("130100")){ + //濡傛灉鏄叏甯� areaId璁剧疆鏈┖ + areaId = null; + } QueryWrapper<FuwuDetails> wrapper = new QueryWrapper<>(); wrapper.isNotNull("pid"); wrapper.eq("del_flag",0); List<FuwuDetails> list = iFuwuDetailsService.list(wrapper); for (FuwuDetails fuwuDetails : list) { QueryWrapper<Order> wrapper3 = new QueryWrapper<>(); - wrapper3.eq("area_id",areaId); + if (StrUtil.isNotBlank(areaId)){ + wrapper3.eq("area_id",areaId); + } wrapper3.eq("detail_id",fuwuDetails.getId()); int count = iOrderService.count(wrapper3); fuwuDetails.setOrderNumber(count); } List<FuwuDetails> collectList = list.stream().sorted(Comparator.comparing(FuwuDetails::getOrderNumber)).collect(Collectors.toList()); - return new ResultUtil<Object>().setData(collectList.subList(0,10)); + List<FuwuDetails> resList = collectList.size()>10?collectList.subList(0,10):collectList; + return ResultUtil.data(resList); } @RequestMapping(value = "/getOrder", method = RequestMethod.GET) @ApiOperation(value = "鎵ц涓鍗�") public Result<Object> getOrder(String areaId){ + if (StrUtil.isNotBlank(areaId)&&areaId.equals("130100")){ + //濡傛灉鏄叏甯� areaId璁剧疆鏈┖ + areaId = null; + } QueryWrapper<Order> wrapper = new QueryWrapper<>(); - wrapper.eq("area_id",areaId); - wrapper.eq("state",0); - wrapper.orderByAsc("creat_time"); + if (StrUtil.isNotBlank(areaId)){ + wrapper.eq("area_id",areaId); + } + +// wrapper.eq("state",0); + wrapper.orderByAsc("create_time"); List<Order> list = iOrderService.list(wrapper); int count = iOrderService.count(wrapper); List<OrderByExecute> orderByExecuteList=new ArrayList<>(); @@ -167,8 +209,4 @@ map.put("orderByExecuteList",orderByExecuteList); return new ResultUtil<Object>().setData(map); } - - - - } -- Gitblit v1.9.1