Commit d7b7e399 authored by 刘帅's avatar 刘帅

1.调整

parent 20be465a
package com.propertyManagement.web.controller.business.api;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.business.domain.WxComment;
import com.propertyManagement.business.domain.bo.WxCommentBo;
import com.propertyManagement.business.domain.vo.LoginWxUser;
......@@ -9,27 +7,19 @@ import com.propertyManagement.business.domain.vo.WxCommentVo;
import com.propertyManagement.business.mapper.WxCommentMapper;
import com.propertyManagement.business.service.IWxCommentService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.enums.RepairsState;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 表扬与投诉
......@@ -57,6 +47,14 @@ public class ApiWxCommentController extends BaseController {
return R.ok(iWxCommentService.queryList(bo));
}
/**
* 查询用户历史工单状态统计
*/
@GetMapping("/userCountAll")
public R<Map<Integer, Long>> userCountAll() {
return R.ok(iWxCommentService.userCountAll());
}
/**
* 获取表扬与投诉详细信息
......
......@@ -17,10 +17,8 @@ import com.propertyManagement.business.service.IWxCommunityService;
import com.propertyManagement.business.service.WxUserTokenService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.LoginResult;
import com.propertyManagement.common.core.domain.R;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -92,6 +90,7 @@ public class ApiWxCommunityController extends BaseController {
wxUser.setRoom(proprietorLedger.getRoom());
wxUser.setName(proprietorLedger.getName());
wxUser.setSqm(proprietorLedger.getSqm());
wxUser.setMonthMoney(proprietorLedger.getMonthMoney());
/**
* 查询车位信息
*/
......
......@@ -7,13 +7,12 @@ import com.propertyManagement.business.service.IWxLiveBillService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.enums.LiveBillState;
import com.propertyManagement.common.enums.LiveBillType;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotEmpty;
import java.util.List;
......@@ -36,12 +35,19 @@ public class ApiWxLiveBillController extends BaseController {
* 查询待缴账单列表
*/
@GetMapping("/listAll")
public R<List<WxLiveBillVo>> listAll(@NotEmpty(message = "类型不能为空") Integer type) {
public R<List<WxLiveBillVo>> listAll(@NotEmpty(message = "类型不能为空") Integer type, Long carportId) {
LoginWxUser wxUser = AuthUtil.getWxUser();
WxLiveBillBo wxLiveBillBo = new WxLiveBillBo();
wxLiveBillBo.setProprietorId(wxUser.getProprietorId());
wxLiveBillBo.setType(type);
wxLiveBillBo.setState(LiveBillState.NO.getCode());
if (type.equals(LiveBillType.carport_manage.getCode())) {
if (carportId == null) {
throw new RuntimeException("车位ID不能为空");
}else {
wxLiveBillBo.setCarportId(carportId);
}
}
wxLiveBillBo.setType(type);
return R.ok(iWxLiveBillService.queryList(wxLiveBillBo));
}
......@@ -49,7 +55,7 @@ public class ApiWxLiveBillController extends BaseController {
* 创建缴费账单
*/
@PostMapping("/add")
public R<WxLiveBillBo> add(WxLiveBillBo bo) {
public R<WxLiveBillBo> add(@Validated(AddGroup.class) @RequestBody WxLiveBillBo bo) {
return R.ok(iWxLiveBillService.add(bo));
}
......
......@@ -107,6 +107,7 @@ public class WxLiveBillBo extends BaseEntity {
/**
* 金额
*/
@NotNull(message = "金额不能为空")
private BigDecimal money;
/**
......
......@@ -50,6 +50,9 @@ public class LoginWxUser implements Serializable {
/** 房间面积 */
private BigDecimal sqm;
/** 物业月费 */
private BigDecimal monthMoney;
/** 车位列表 */
private List<WxCarportVo> carportVoList;
......
package com.propertyManagement.business.domain.vo;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
......@@ -93,5 +96,11 @@ public class WxCommentVo implements Serializable {
@ExcelProperty(value = "关闭时间")
private Date closeTime;
/**
* 创建时间
*/
@ExcelProperty(value = "创建时间")
private Date createTime;
}
......@@ -8,6 +8,7 @@ import com.propertyManagement.common.core.domain.PageQuery;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* 表扬与投诉Service接口
......@@ -22,6 +23,11 @@ public interface IWxCommentService {
*/
WxCommentVo queryById(Long id);
/**
* 查询表扬与投诉
*/
Map<Integer, Long> userCountAll();
/**
* 查询表扬与投诉列表
*/
......
......@@ -3,6 +3,7 @@ package com.propertyManagement.business.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.propertyManagement.business.domain.vo.LoginWxUser;
import com.propertyManagement.business.support.util.AuthUtil;
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;
......@@ -17,6 +18,7 @@ import com.propertyManagement.business.domain.WxComment;
import com.propertyManagement.business.mapper.WxCommentMapper;
import com.propertyManagement.business.service.IWxCommentService;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Collection;
......@@ -41,6 +43,34 @@ public class WxCommentServiceImpl implements IWxCommentService {
return baseMapper.selectVoById(id);
}
/**
* 查询表扬与投诉
*/
@Override
public Map<Integer, Long> userCountAll() {
Map<Integer, Long> map = new LinkedHashMap<>();
LoginWxUser wxUser = AuthUtil.getWxUser();
LambdaQueryWrapper<WxComment> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper
.eq(WxComment::getUserId, wxUser.getId())
.eq(WxComment::getCommunityId, wxUser.getCommunityId())
.eq(WxComment::getState, 1);
map.put(1, baseMapper.selectCount(lambdaQueryWrapper));
lambdaQueryWrapper.clear();
lambdaQueryWrapper
.eq(WxComment::getUserId, wxUser.getId())
.eq(WxComment::getCommunityId, wxUser.getCommunityId())
.eq(WxComment::getState, 2);
map.put(2, baseMapper.selectCount(lambdaQueryWrapper));
lambdaQueryWrapper.clear();
lambdaQueryWrapper
.eq(WxComment::getUserId, wxUser.getId())
.eq(WxComment::getCommunityId, wxUser.getCommunityId())
.eq(WxComment::getState, 3);
map.put(3, baseMapper.selectCount(lambdaQueryWrapper));
return map;
}
/**
* 查询表扬与投诉列表
*/
......
......@@ -76,6 +76,7 @@ public class WxLiveBillServiceImpl implements IWxLiveBillService {
// lqw.eq(StringUtils.isNotBlank(bo.getMonth()), WxLiveBill::getMonth, bo.getMonth());
lqw.eq(bo.getType() != null, WxLiveBill::getType, bo.getType());
lqw.eq(bo.getState() != null, WxLiveBill::getState, bo.getState());
lqw.eq(bo.getCarportId() != null, WxLiveBill::getCarportId, bo.getCarportId());
lqw.orderByDesc(WxLiveBill::getCreateTime);
return lqw;
}
......
......@@ -6,8 +6,8 @@ package com.propertyManagement.common.enums;
* @author liushuai
*/
public enum LiveBillState {
NO(0, "待缴纳"),
YES(1, "已缴纳");
NO(1, "待缴纳"),
YES(2, "已缴纳");
private final Integer code;
......
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