修改了车辆收费bug #1
@@ -0,0 +1,30 @@
|
||||
package org.dromara.property.domain.enums;
|
||||
|
||||
/**
|
||||
* 收费类型枚举
|
||||
*/
|
||||
public enum ChargeTypeEnum {
|
||||
/**
|
||||
* 房屋收费
|
||||
*/
|
||||
HOUS_CHARGES("房屋收费", "1"),
|
||||
/**
|
||||
* 车辆收费
|
||||
*/
|
||||
CARD_CHARGES("车辆收费", "2");
|
||||
private final String name;
|
||||
private final String value;
|
||||
|
||||
ChargeTypeEnum(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return this.value;
|
||||
}
|
||||
}
|
@@ -53,8 +53,12 @@ public class CostPayFeeAuditVo implements Serializable {
|
||||
/**
|
||||
* 房间号(如101,202)
|
||||
*/
|
||||
@ExcelProperty(value = "房间号(如101,202)")
|
||||
@ExcelProperty(value = "房间号")
|
||||
private String roomNumber;
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String carNumber;
|
||||
|
||||
/**
|
||||
* 费用项目id
|
||||
|
@@ -18,6 +18,7 @@ import org.dromara.property.domain.CostHouseCharge;
|
||||
import org.dromara.property.domain.CostPayFeeAudit;
|
||||
import org.dromara.property.domain.bo.CostPayFeeAuditBo;
|
||||
import org.dromara.property.domain.enums.ChargeStatusEnum;
|
||||
import org.dromara.property.domain.enums.ChargeTypeEnum;
|
||||
import org.dromara.property.domain.vo.*;
|
||||
import org.dromara.property.mapper.*;
|
||||
import org.dromara.property.service.ICostPayFeeAuditService;
|
||||
@@ -59,7 +60,18 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
|
||||
CostItemsVo costItemsVo = costItemsMapper.selectVoById(costPayFeeAuditVo.getItemId());
|
||||
costPayFeeAuditVo.setChargeItem(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeItem() : null);
|
||||
costPayFeeAuditVo.setChargeCycle(ObjectUtil.isNotEmpty(costItemsVo) ? costItemsVo.getChargeCycle() : null);
|
||||
//TbRoomVo roomVo = roomMapper.selectVoById(costPayFeeAuditVo.getChargeId());
|
||||
if (costPayFeeAuditVo.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) {
|
||||
CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(costPayFeeAuditVo.getChargeId());
|
||||
if (ObjectUtil.isNotEmpty(costHouseCharge)) {
|
||||
String queryRoomName = roomMapper.queryRoomName(costHouseCharge.getRoomId());
|
||||
costPayFeeAuditVo.setRoomNumber(ObjectUtil.isNotEmpty(queryRoomName) ? queryRoomName : null);
|
||||
}
|
||||
}
|
||||
if (costPayFeeAuditVo.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) {
|
||||
CostCarCharge costCarCharge = costCarChargeMapper.selectById(costPayFeeAuditVo.getChargeId());
|
||||
costPayFeeAuditVo.setCarNumber(ObjectUtil.isNotEmpty(costCarCharge) ? costCarCharge.getCarNumber() : null);
|
||||
}
|
||||
// TbRoomVo roomVo = roomMapper.selectVoById(costPayFeeAuditVo.getChargeId());
|
||||
//costPayFeeAuditVo.setRoomNumber(ObjectUtil.isNotEmpty(roomVo)? roomVo.getRoomNumber() :null );
|
||||
return costPayFeeAuditVo;
|
||||
}
|
||||
@@ -175,13 +187,13 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
|
||||
private void validEntityBeforeUpdate(CostPayFeeAudit entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
if (entity.getState().equals("1")) {
|
||||
if (entity.getChargeType().equals("1")) {
|
||||
if (entity.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) {
|
||||
CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(entity.getChargeId());
|
||||
Assert.isTrue(ObjectUtil.isNotEmpty(costHouseCharge), "该房屋收费项不存在!");
|
||||
costHouseCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_WAS_APPROVED.getValue());
|
||||
coinHouseChargeMapper.updateById(costHouseCharge);
|
||||
}
|
||||
if (entity.getChargeType().equals("2")) {
|
||||
if (entity.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) {
|
||||
|
||||
CostCarCharge costCarCharge = costCarChargeMapper.selectById(entity.getChargeId());
|
||||
Assert.isTrue(ObjectUtil.isNotEmpty(costCarCharge), "该车辆收费项为空");
|
||||
@@ -190,13 +202,13 @@ public class CostPayFeeAuditServiceImpl implements ICostPayFeeAuditService {
|
||||
}
|
||||
}
|
||||
if (entity.getState().equals("2")) {
|
||||
if (entity.getChargeType().equals("1")) {
|
||||
if (entity.getChargeType().equals(ChargeTypeEnum.HOUS_CHARGES.getValue())) {
|
||||
CostHouseCharge costHouseCharge = coinHouseChargeMapper.selectById(entity.getChargeId());
|
||||
Assert.isTrue(ObjectUtil.isNotEmpty(costHouseCharge), "该房屋收费项为空");
|
||||
costHouseCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_REVIEW_FAILED.getValue());
|
||||
coinHouseChargeMapper.updateById(costHouseCharge);
|
||||
}
|
||||
if (entity.getChargeType().equals("2")) {
|
||||
if (entity.getChargeType().equals(ChargeTypeEnum.CARD_CHARGES.getValue())) {
|
||||
CostCarCharge costCarCharge = costCarChargeMapper.selectById(entity.getChargeId());
|
||||
Assert.isTrue(ObjectUtil.isNotEmpty(costCarCharge), "该车辆收费项为空");
|
||||
costCarCharge.setChargeStatus(ChargeStatusEnum.THE_PAYMENT_REVIEW_FAILED.getValue());
|
||||
|
@@ -85,11 +85,13 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
||||
public TableDataInfo<MeetBookingVo> queryPageList(MeetBookingBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<MeetBooking> lqw = buildQueryWrapper(bo);
|
||||
Page<MeetBookingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
List<MeetBookingVo> meetBookingVoList = new ArrayList<>();
|
||||
if(CollUtil.isNotEmpty(result.getRecords())){
|
||||
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList();
|
||||
List<Long> userId = result.getRecords().stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList());
|
||||
List<ResidentPersonVo> remoteUserVos = residentPersonMapper.selectVoByIds(userId);
|
||||
// List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(userId);
|
||||
List<MeetBookingVo> meetBookingVoList = new ArrayList<>();
|
||||
|
||||
result.getRecords().stream().forEach(s -> {
|
||||
if (CollUtil.isNotEmpty(residentUnitVolist)) {
|
||||
ResidentUnitVo residentUnitVo = residentUnitVolist.stream()
|
||||
@@ -104,6 +106,7 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
|
||||
}
|
||||
meetBookingVoList.add(s);
|
||||
});
|
||||
}
|
||||
return TableDataInfo.build(new Page<MeetBookingVo>().setRecords(meetBookingVoList).setTotal(result.getTotal()));
|
||||
}
|
||||
|
||||
|
@@ -1,8 +1,10 @@
|
||||
package org.dromara.property.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@@ -12,11 +14,11 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.property.domain.MeetAttach;
|
||||
import org.dromara.property.domain.MeetBooking;
|
||||
import org.dromara.property.domain.vo.MeetAttachVo;
|
||||
import org.dromara.property.domain.vo.ResidentPersonVo;
|
||||
import org.dromara.property.mapper.MeetBookingMapper;
|
||||
import org.dromara.property.mapper.ResidentPersonMapper;
|
||||
import org.dromara.property.mapper.TbRoomMapper;
|
||||
import org.dromara.property.mapper.*;
|
||||
import org.dromara.system.api.RemoteUserService;
|
||||
import org.dromara.system.api.domain.vo.RemoteUserVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -24,7 +26,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.dromara.property.domain.bo.MeetBo;
|
||||
import org.dromara.property.domain.vo.MeetVo;
|
||||
import org.dromara.property.domain.Meet;
|
||||
import org.dromara.property.mapper.MeetMapper;
|
||||
import org.dromara.property.service.IMeetService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -48,6 +49,7 @@ import java.util.stream.Collectors;
|
||||
public class MeetServiceImpl implements IMeetService {
|
||||
|
||||
private final MeetMapper baseMapper;
|
||||
private final MeetAttachMapper meetAttachMapper;
|
||||
private final ResidentPersonMapper residentPersonMapper;
|
||||
private final TbRoomMapper roomMapper;
|
||||
private final MeetBookingMapper meetbookMapper;
|
||||
@@ -216,6 +218,10 @@ public class MeetServiceImpl implements IMeetService {
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
boolean exists = meetAttachMapper.exists(new LambdaQueryWrapper<MeetAttach>().in(MeetAttach::getMeetId, ids));
|
||||
Assert.isTrue(!exists, "会议室具有增值服务,不允许单独删除");
|
||||
boolean meetbookExists = meetbookMapper.exists(new LambdaQueryWrapper<MeetBooking>().in(MeetBooking::getMeetId, ids));
|
||||
Assert.isTrue(!meetbookExists, "会议室具有预约记录,不允许单独删除");
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user