| | |
| | | } |
| | | } |
| | | ``` |
| | | <h4 id='5.3'>5.3根据区域id和订单量查询服务机构排名情况</h4> |
| | | <h4 id='5.3'>5.3 服务机构订单量</h4> |
| | | ###### 接口功能 |
| | | > 根据区域id和订单量查询服务机构排名情况 |
| | | > 服务机构订单量 |
| | | |
| | | ###### URL |
| | | > /api/fwjg/getFwjgOrderByOrderNumber |
| | |
| | | ###### 返回字段 |
| | | |返回字段|字段类型|说明 | |
| | | |:----- |:------|:----------------------------- | |
| | | | records | list | 服务机构list | |
| | | | name | String | 服务机构名称 | |
| | | | orderNumber | int | 订单量 | |
| | | ###### 接口示例 |
| | | ``` java |
| | | |
| | | |
| | | { |
| | | "success": true, |
| | | "message": "success", |
| | | "code": 200, |
| | | "timestamp": 1607822690539, |
| | | "result": [ |
| | | { |
| | | "id": "13", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "1", |
| | | "name": "康复按摩", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "21", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "2", |
| | | "name": "个人卫生服务", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "22", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "2", |
| | | "name": "喘息服务", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "23", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "2", |
| | | "name": "陪诊服务", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "24", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "2", |
| | | "name": "协助移位", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "31", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "3", |
| | | "name": "小时工", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "32", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "3", |
| | | "name": "日常保洁", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "33", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "3", |
| | | "name": "衣服拆洗缝补", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "41", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "4", |
| | | "name": "关怀服务", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "42", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "4", |
| | | "name": "生活陪伴", |
| | | "orderNumber": 0 |
| | | } |
| | | ``` |
| | | <h4 id='5.4'>5.4根据区域id和订单量查询服务机构排名情况</h4> |
| | | <h4 id='5.4'>5.4 服务领域订单量</h4> |
| | | ###### 接口功能 |
| | | > 根据区域id和订单量查询实际服务排名情况 |
| | | > 服务领域订单量 |
| | | |
| | | ###### URL |
| | | > /api/fwjg/getFuwuDetailsOrderByOrderNumber |
| | |
| | | ###### 返回字段 |
| | | |返回字段|字段类型|说明 | |
| | | |:----- |:------|:----------------------------- | |
| | | | records | list | 服务详情list | |
| | | | name | String | 服务领域名称 | |
| | | | orderNumber | int | 订单量 | |
| | | ###### 接口示例 |
| | | ``` java |
| | | |
| | | { |
| | | "success": true, |
| | | "message": "success", |
| | | "code": 200, |
| | | "timestamp": 1607823539804, |
| | | "result": [ |
| | | { |
| | | "id": "13", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "1", |
| | | "name": "康复按摩", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "21", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "2", |
| | | "name": "个人卫生服务", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "22", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "2", |
| | | "name": "喘息服务", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "23", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "2", |
| | | "name": "陪诊服务", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "24", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "2", |
| | | "name": "协助移位", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "31", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "3", |
| | | "name": "小时工", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "32", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "3", |
| | | "name": "日常保洁", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "33", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "3", |
| | | "name": "衣服拆洗缝补", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "41", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "4", |
| | | "name": "关怀服务", |
| | | "orderNumber": 0 |
| | | }, |
| | | { |
| | | "id": "42", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "4", |
| | | "name": "生活陪伴", |
| | | "orderNumber": 0 |
| | | } |
| | | ] |
| | | } |
| | | ``` |
| | | <h4 id='5.5'>5.5执行中订单</h4> |
| | | ###### 接口功能 |
| | |
| | | | orderByExecuteList | list | 执行中订单详情 | |
| | | ###### 接口示例 |
| | | ``` java |
| | | |
| | | { |
| | | "success": true, |
| | | "message": "success", |
| | | "code": 200, |
| | | "timestamp": 1607824114880, |
| | | "result": { |
| | | "orderByExecuteList": [ |
| | | { |
| | | "order": { |
| | | "id": "fds3", |
| | | "createBy": null, |
| | | "createTime": "2020-12-12 21:00:00", |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": "1", |
| | | "detailId": "11", |
| | | "detail": "指导评估", |
| | | "duixiangId": "1", |
| | | "personId": "1", |
| | | "state": 0 |
| | | }, |
| | | "fuwuPerson": { |
| | | "id": "1", |
| | | "createBy": null, |
| | | "createTime": "2020-12-11 14:17:55", |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": "1", |
| | | "name": "张三", |
| | | "age": null, |
| | | "sex": null, |
| | | "sfzhm": null, |
| | | "orgFwId": "1" |
| | | }, |
| | | "fuwuDetails": { |
| | | "id": "11", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "1", |
| | | "name": "指导评估", |
| | | "orderNumber": null |
| | | } |
| | | }, |
| | | { |
| | | "order": { |
| | | "id": "1", |
| | | "createBy": null, |
| | | "createTime": "2020-12-17 17:27:37", |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": "1", |
| | | "detailId": "11", |
| | | "detail": "指导评估", |
| | | "duixiangId": "1", |
| | | "personId": "1", |
| | | "state": 0 |
| | | }, |
| | | "fuwuPerson": { |
| | | "id": "1", |
| | | "createBy": null, |
| | | "createTime": "2020-12-11 14:17:55", |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": "1", |
| | | "name": "张三", |
| | | "age": null, |
| | | "sex": null, |
| | | "sfzhm": null, |
| | | "orgFwId": "1" |
| | | }, |
| | | "fuwuDetails": { |
| | | "id": "11", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "1", |
| | | "name": "指导评估", |
| | | "orderNumber": null |
| | | } |
| | | }, |
| | | { |
| | | "order": { |
| | | "id": "2", |
| | | "createBy": null, |
| | | "createTime": "2020-12-24 17:27:41", |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": "1", |
| | | "detailId": "12", |
| | | "detail": "功能训练", |
| | | "duixiangId": "1", |
| | | "personId": "1", |
| | | "state": 1 |
| | | }, |
| | | "fuwuPerson": { |
| | | "id": "1", |
| | | "createBy": null, |
| | | "createTime": "2020-12-11 14:17:55", |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": "1", |
| | | "name": "张三", |
| | | "age": null, |
| | | "sex": null, |
| | | "sfzhm": null, |
| | | "orgFwId": "1" |
| | | }, |
| | | "fuwuDetails": { |
| | | "id": "12", |
| | | "createBy": null, |
| | | "createTime": null, |
| | | "updateBy": null, |
| | | "updateTime": null, |
| | | "delFlag": 0, |
| | | "areaId": null, |
| | | "orgFwId": null, |
| | | "pid": "1", |
| | | "name": "功能训练", |
| | | "orderNumber": null |
| | | } |
| | | } |
| | | ], |
| | | "count": 3 |
| | | } |
| | | } |
| | | 、、、 |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author xfei |
| | |
| | | if (StrUtil.isEmpty(areaId)){ |
| | | return ResultUtil.error("缺少参数"); |
| | | } |
| | | List result = iSubsidyPersonStaticsService.getMonthAddOut(areaId,type); |
| | | return ResultUtil.data(result); |
| | | List<Map<String,Object>> result = iSubsidyPersonStaticsService.getMonthAddOut(areaId,type); |
| | | StatisVO vo = new StatisVO(); |
| | | result.forEach(e->{ |
| | | String month = (String) e.get("month"); |
| | | int mAdd = Integer.parseInt(String.valueOf(e.get("mAdd"))); |
| | | int mOut = Integer.parseInt(String.valueOf(e.get("mOut"))); |
| | | int checkNum = Integer.parseInt(String.valueOf(e.get("checkNum"))); |
| | | int totalNum = Integer.parseInt(String.valueOf(e.get("totalNum"))); |
| | | vo.month.add(0,month.split("-")[1]); |
| | | vo.mAdd.add(0,mAdd); |
| | | vo.mOut.add(0,mOut); |
| | | vo.checkNum.add(0,checkNum); |
| | | vo.totalNum.add(0,totalNum); |
| | | }); |
| | | return ResultUtil.data(vo); |
| | | |
| | | } |
| | | @Data |
| | | class StatisVO{ |
| | | //月份 |
| | | List month = new ArrayList(); |
| | | //月新增 |
| | | List mAdd = new ArrayList(); |
| | | //月退出 |
| | | List mOut = new ArrayList(); |
| | | //月复核数 |
| | | List checkNum = new ArrayList(); |
| | | //月复核数 |
| | | List totalNum = new ArrayList(); |
| | | |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | @Transactional |
| | | @CrossOrigin("*") |
| | | public class FwjgController { |
| | | @Autowired |
| | | private IAreaService iAreaService; |
| | | @Autowired |
| | | private IOrgFuwuService iOrgFuwuService; |
| | | @Autowired |
| | |
| | | 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<>(); |
| | |
| | | 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); |
| | |
| | | @RequestMapping(value = "/getFuwuDetailsOrderByOrderNumber", method = RequestMethod.GET) |
| | | @ApiOperation(value = "根据区域id和订单量查询实际服务排名情况") |
| | | public Result<Object> getFuwuDetailsOrderByOrderNumber(String areaId){ |
| | | if (StrUtil.isNotBlank(areaId)&&areaId.equals("0")){ |
| | | //如果是全市 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("0")){ |
| | | //如果是全市 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<>(); |
| | |
| | | map.put("orderByExecuteList",orderByExecuteList); |
| | | return new ResultUtil<Object>().setData(map); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import cn.cetc54.platform.zhyl.service.ISubsidyLogService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | @ApiOperation(value = "年度月度统计数据") |
| | | public Result getStatistics(String areaId,Integer type){ |
| | | Map<String,Object> resMap = new HashMap<>(); |
| | | resMap.put("monthStatistics",iSubsidyLogService.getMonthTotal(areaId,type)); |
| | | resMap.put("yearStatistics",iSubsidyLogService.getYearTotal(areaId,type)); |
| | | List<Map<String,Object>> monthList = iSubsidyLogService.getMonthTotal(areaId,type); |
| | | List<Map<String,Object>> yearList = iSubsidyLogService.getYearTotal(areaId,type); |
| | | |
| | | List<String> month = new ArrayList<>(); |
| | | List<Double> mSum = new ArrayList<>(); |
| | | monthList.forEach(e->{ |
| | | String d = (String) e.get("time"); |
| | | double s = (double) e.get("sum"); |
| | | month.add(0,d.split("-")[1]); |
| | | mSum.add(0,s); |
| | | }); |
| | | StatisticsVo mS = new StatisticsVo(); |
| | | mS.setTime(month); |
| | | mS.setSum(mSum); |
| | | |
| | | List<String> year = new ArrayList<>(); |
| | | List<Double> ySum = new ArrayList<>(); |
| | | yearList.forEach(e->{ |
| | | String d = (String) e.get("time"); |
| | | double s = (double) e.get("sum"); |
| | | year.add(0,d); |
| | | ySum.add(0,s); |
| | | }); |
| | | StatisticsVo yS = new StatisticsVo(); |
| | | yS.setTime(year); |
| | | yS.setSum(ySum); |
| | | |
| | | |
| | | resMap.put("monthStatistics",mS); |
| | | resMap.put("yearStatistics",yS); |
| | | return ResultUtil.data(resMap); |
| | | |
| | | } |
| | | @Data |
| | | class StatisticsVo{ |
| | | Object time; |
| | | Object sum; |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | @Data |
| | | public class FwjgCount { |
| | | //服务机构总数 |
| | | private Integer fwjgCount; |
| | | //服务人员总数 |
| | | private Integer fwPersonCount; |
| | | //订单总数 |
| | | private Integer orderCount; |
| | | //订单监控率 |
| | | private String orderWatch; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Select("<script>" + |
| | | "select month,SUM(month_add) as mAdd,SUM(month_out) as mOut,SUM(check_num) as checkNum,SUM(total_num) as totalName " + |
| | | "select month,SUM(month_add) as mAdd,SUM(month_out) as mOut,SUM(check_num) as checkNum,SUM(total_num) as totalNum " + |
| | | "FROM t_yl_subsidy_person_statics " + |
| | | " <where> " + |
| | | "area_id = #{areaId} " + |