Commit 20be465a authored by 刘帅's avatar 刘帅

1.增加报修状态统计接口

parent 791db583
......@@ -20,6 +20,7 @@ import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 报修
......@@ -46,6 +47,14 @@ public class ApiWxRepairsController extends BaseController {
return R.ok(iWxRepairsService.queryList(bo));
}
/**
* 查询用户报修状态统计
*/
@GetMapping("/userCountAll")
public R<Map<Integer, Long>> userCountAll() {
return R.ok(iWxRepairsService.countAll());
}
/**
* 查询维修报修列表
*/
......
......@@ -8,6 +8,7 @@ import com.propertyManagement.common.core.domain.PageQuery;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* 报修Service接口
......@@ -32,6 +33,11 @@ public interface IWxRepairsService {
*/
List<WxRepairsVo> queryList(WxRepairsBo bo);
/**
* 查询用户报修状态统计
*/
Map<Integer, Long> countAll();
/**
* 小程序新增报修
*/
......
......@@ -9,6 +9,7 @@ import com.propertyManagement.business.mapper.WxAccountMapper;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.core.domain.BaseEntity;
import com.propertyManagement.common.enums.AccountType;
import com.propertyManagement.common.enums.RepairsState;
import com.propertyManagement.common.utils.StringUtils;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.domain.PageQuery;
......@@ -24,10 +25,7 @@ import com.propertyManagement.business.mapper.WxRepairsMapper;
import com.propertyManagement.business.service.IWxRepairsService;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.*;
/**
* 报修Service业务层处理
......@@ -69,6 +67,40 @@ public class WxRepairsServiceImpl implements IWxRepairsService {
return baseMapper.selectVoList(lqw);
}
/**
* 查询用户报修状态统计
*/
@Override
public Map<Integer, Long> countAll() {
Map<Integer, Long> map = new LinkedHashMap<>();
LoginWxUser wxUser = AuthUtil.getWxUser();
LambdaQueryWrapper<WxRepairs> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper
.eq(WxRepairs::getUserId, wxUser.getId())
.eq(WxRepairs::getCommunityId, wxUser.getCommunityId())
.eq(WxRepairs::getState, RepairsState.ONE.getCode());
map.put(RepairsState.ONE.getCode(), baseMapper.selectCount(lambdaQueryWrapper));
lambdaQueryWrapper.clear();
lambdaQueryWrapper
.eq(WxRepairs::getUserId, wxUser.getId())
.eq(WxRepairs::getCommunityId, wxUser.getCommunityId())
.eq(WxRepairs::getState, RepairsState.TWO.getCode());
map.put(RepairsState.TWO.getCode(), baseMapper.selectCount(lambdaQueryWrapper));
lambdaQueryWrapper.clear();
lambdaQueryWrapper
.eq(WxRepairs::getUserId, wxUser.getId())
.eq(WxRepairs::getCommunityId, wxUser.getCommunityId())
.eq(WxRepairs::getState, RepairsState.THREE.getCode());
map.put(RepairsState.THREE.getCode(), baseMapper.selectCount(lambdaQueryWrapper));
lambdaQueryWrapper.clear();
lambdaQueryWrapper
.eq(WxRepairs::getUserId, wxUser.getId())
.eq(WxRepairs::getCommunityId, wxUser.getCommunityId())
.eq(WxRepairs::getState, RepairsState.FOUR.getCode());
map.put(RepairsState.FOUR.getCode(), baseMapper.selectCount(lambdaQueryWrapper));
return map;
}
private LambdaQueryWrapper<WxRepairs> buildQueryWrapper(WxRepairsBo bo) {
Map<String, Object> params = bo.getParams();
......
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