diff --git a/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxCommentController.java b/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxCommentController.java index fc76c4a75d47c7f8e19dbcc9b5b439410356f599..5eb6ec7f39c1645561d14436d500046ec6a4de1e 100644 --- a/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxCommentController.java +++ b/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxCommentController.java @@ -1,7 +1,5 @@ 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> userCountAll() { + return R.ok(iWxCommentService.userCountAll()); + } + /** * 获取表扬与投诉详细信息 diff --git a/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxCommunityController.java b/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxCommunityController.java index d4e49616a0b2de82ec62ba667eb530c9fd2f950a..4ef6bd5a8bb0b350ce5e44ca50252ee7a9ff8ccd 100644 --- a/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxCommunityController.java +++ b/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxCommunityController.java @@ -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()); /** * 查询车位信息 */ diff --git a/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxLiveBillController.java b/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxLiveBillController.java index b3113a3b8e9e9862c578433959d972180fbff791..7f5666d4156f26773c70d09e98d5a41945b0f548 100644 --- a/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxLiveBillController.java +++ b/propertyManagement-admin/src/main/java/com/propertyManagement/web/controller/business/api/ApiWxLiveBillController.java @@ -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> listAll(@NotEmpty(message = "类型不能为空") Integer type) { + public R> 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 add(WxLiveBillBo bo) { + public R add(@Validated(AddGroup.class) @RequestBody WxLiveBillBo bo) { return R.ok(iWxLiveBillService.add(bo)); } diff --git a/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/bo/WxLiveBillBo.java b/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/bo/WxLiveBillBo.java index 29275737e79f80f0f944f55b4650a5472dd94ecf..1e30895edb6291b44be1d82cd9496dee3fd0482c 100644 --- a/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/bo/WxLiveBillBo.java +++ b/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/bo/WxLiveBillBo.java @@ -107,6 +107,7 @@ public class WxLiveBillBo extends BaseEntity { /** * 金额 */ + @NotNull(message = "金额不能为空") private BigDecimal money; /** diff --git a/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/vo/LoginWxUser.java b/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/vo/LoginWxUser.java index bf680b5db082027f9d10268b86774c34574e9e0a..3fcb9d52b5449a4d84aad5045fe8c686b1092e81 100644 --- a/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/vo/LoginWxUser.java +++ b/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/vo/LoginWxUser.java @@ -50,6 +50,9 @@ public class LoginWxUser implements Serializable { /** 房间面积 */ private BigDecimal sqm; + /** 物业月费 */ + private BigDecimal monthMoney; + /** 车位列表 */ private List carportVoList; diff --git a/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/vo/WxCommentVo.java b/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/vo/WxCommentVo.java index 19c0f0cf57dfaaee6a5faa7f49b72e8f74b2e10c..a52a84e58409db1bd5d229f51bf47a95c7013757 100644 --- a/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/vo/WxCommentVo.java +++ b/propertyManagement-business/src/main/java/com/propertyManagement/business/domain/vo/WxCommentVo.java @@ -1,6 +1,9 @@ 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; + } diff --git a/propertyManagement-business/src/main/java/com/propertyManagement/business/service/IWxCommentService.java b/propertyManagement-business/src/main/java/com/propertyManagement/business/service/IWxCommentService.java index 150b252a1e08a46230f0317e0d7686c6e34ecc72..9cf8d4825189eaf684e7512af35873468c448352 100644 --- a/propertyManagement-business/src/main/java/com/propertyManagement/business/service/IWxCommentService.java +++ b/propertyManagement-business/src/main/java/com/propertyManagement/business/service/IWxCommentService.java @@ -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 userCountAll(); + /** * 查询表扬与投诉列表 */ diff --git a/propertyManagement-business/src/main/java/com/propertyManagement/business/service/impl/WxCommentServiceImpl.java b/propertyManagement-business/src/main/java/com/propertyManagement/business/service/impl/WxCommentServiceImpl.java index 8bb6891abb39e38aecaf3ff9ff1078c95d215ef4..9d86153d3930897611ea045c5685bb183fc199c3 100644 --- a/propertyManagement-business/src/main/java/com/propertyManagement/business/service/impl/WxCommentServiceImpl.java +++ b/propertyManagement-business/src/main/java/com/propertyManagement/business/service/impl/WxCommentServiceImpl.java @@ -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 userCountAll() { + Map map = new LinkedHashMap<>(); + LoginWxUser wxUser = AuthUtil.getWxUser(); + LambdaQueryWrapper 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; + } + /** * 查询表扬与投诉列表 */ diff --git a/propertyManagement-business/src/main/java/com/propertyManagement/business/service/impl/WxLiveBillServiceImpl.java b/propertyManagement-business/src/main/java/com/propertyManagement/business/service/impl/WxLiveBillServiceImpl.java index bfb0ef6bf6a6dbedb0e9d55e2f247ee444d5a43a..ec193ba69e100d481528e408d8200b24a37cfc9a 100644 --- a/propertyManagement-business/src/main/java/com/propertyManagement/business/service/impl/WxLiveBillServiceImpl.java +++ b/propertyManagement-business/src/main/java/com/propertyManagement/business/service/impl/WxLiveBillServiceImpl.java @@ -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; } diff --git a/propertyManagement-common/src/main/java/com/propertyManagement/common/enums/LiveBillState.java b/propertyManagement-common/src/main/java/com/propertyManagement/common/enums/LiveBillState.java index ff35bbd8a7ac3ca1cf26377faac240fd7ead2d0a..31a689d255259df1175b8c5748f613504cefdb76 100644 --- a/propertyManagement-common/src/main/java/com/propertyManagement/common/enums/LiveBillState.java +++ b/propertyManagement-common/src/main/java/com/propertyManagement/common/enums/LiveBillState.java @@ -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;