xuhy
2025-03-12 5f0cb7bfdfbbca6ff22f02ce27c43a4b41ca6bfb
bug修改
11个文件已修改
1个文件已添加
118 ■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFaultDescribeDicController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/TaskUtil.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TBillController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TFaultRepairMessageController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/dto/BatchBillDTO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TBillMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/TBillQuery.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/TBillService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TFaultDescribeDicController.java
@@ -16,6 +16,7 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.List;
/**
@@ -67,6 +68,7 @@
    @ApiOperation(value = "修改故障描述")
    @PostMapping(value = "/update")
    public R<Boolean> update(@Validated @RequestBody TFaultDescribeDic dto) {
        dto.setUpdateTime(LocalDateTime.now());
        return R.ok(faultDescribeDicService.updateById(dto));
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -156,7 +156,7 @@
    @PostMapping("/add")
    public AjaxResult add(@Validated @RequestBody SysUser user)
    {
        user.setUserName(user.getPhonenumber());
        user.setUserName(user.getUserName());
        if (!userService.checkUserNameUnique(user))
        {
            return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
ruoyi-admin/src/main/java/com/ruoyi/web/controller/task/TaskUtil.java
@@ -2,6 +2,7 @@
//
//
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.ruoyi.common.utils.SmsUtil;
//import com.ruoyi.system.mapper.TBillMapper;
//import com.ruoyi.system.model.TBill;
//import com.ruoyi.system.model.TContract;
@@ -40,7 +41,6 @@
//    // 用于更新违约金账单
//    // 每分钟执行一次的定时任务
//
////    @Scheduled(cron = "0 0 0 * * ?")
//    @Scheduled(cron = "0 * * * * ?")
//    public void dayOfProportionBill() {
//        try {
@@ -79,23 +79,5 @@
//        }
//    }
//
//    public static void main(String[] args) {
//
////        LocalDateTime now = LocalDateTime.now().minusMonths(1).withDayOfMonth(31);
////        System.err.println(now);
////        LocalDateTime now2 = now.plusMonths(1);
////        System.err.println(now2);
////
////        LocalDateTime now1 = LocalDateTime.now();
////        long days = ChronoUnit.DAYS.between(now, now1);
////        long days2 = ChronoUnit.DAYS.between(now.plusDays(1), now1);
////
////        System.err.println(days);
////        System.err.println(days2);
////        LocalDateTime endTime = now.with(TemporalAdjusters.lastDayOfMonth()).withSecond(59).withHour(23).withMinute(59);
////
////        System.err.println(endTime);
//
//    }
//
//}
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TBillController.java
@@ -1,6 +1,7 @@
package com.ruoyi.web.controller.api;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.constant.DictConstants;
@@ -10,6 +11,7 @@
import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.dto.BatchBillDTO;
import com.ruoyi.system.dto.TBillDto;
import com.ruoyi.system.dto.TInvoiceDTO;
import com.ruoyi.system.model.*;
@@ -82,6 +84,18 @@
        return R.ok(billIds);
    }
    @ApiOperation(value = "跳转批量缴费")
    @PostMapping("/batchBill")
    public R<String> batchBill(@RequestBody BatchBillDTO dto){
        String userId = tokenService.getLoginUserApplet().getUserId();
        List<String> billIds = dto.getBillIds();
        Integer count = tBillService.batchBillCount(userId, billIds);
        if(count>0){
            return R.fail("请优先缴纳水电费");
        }
        return R.ok();
    }
    @ApiOperation(value = "查看缴费账单详情")
    @GetMapping(value = "/getDetailById")
    public R<TBillVO> getDetailById(@RequestParam String id) {
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/TFaultRepairMessageController.java
@@ -134,7 +134,7 @@
            for (SysUser sysUser : sysUsers) {
                if (StringUtils.hasLength(sysUser.getPhonenumber())){
                    System.err.println("发送短信");
                    smsUtil.sendSms(sysUser.getPhonenumber(),"2375194",new String[]{""});
                    smsUtil.sendSms(sysUser.getPhonenumber(),"2375194",new String[]{});
                }
            }
        }
ruoyi-system/src/main/java/com/ruoyi/system/dto/BatchBillDTO.java
New file
@@ -0,0 +1,18 @@
package com.ruoyi.system.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
@ApiModel(value = "批量缴费校验")
public class BatchBillDTO implements Serializable {
    @ApiModelProperty(value = "账单id集合")
    private List<String> billIds;
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TBillMapper.java
@@ -44,4 +44,6 @@
    BigDecimal statisticsPayed();
    BigDecimal statisticsOverdue();
    Integer batchBillCount(@Param("userId")String userId, @Param("billIds")List<String> billIds);
}
ruoyi-system/src/main/java/com/ruoyi/system/query/TBillQuery.java
@@ -22,6 +22,11 @@
     */
    @ApiModelProperty("租户ID")
    private String userId;
    /**
     * 账单类型
     */
    @ApiModelProperty("账单类型 1=租金 2=押金 3=生活费用 4=房屋验收")
    private Integer billType;
ruoyi-system/src/main/java/com/ruoyi/system/service/TBillService.java
@@ -85,4 +85,6 @@
    Boolean cashPay(CachPayDto offlinePayDto);
    BillStatisticsDto statistics();
    Integer batchBillCount(String userId, List<String> billIds);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java
@@ -31,14 +31,8 @@
import com.ruoyi.common.enums.SubmitStatusEnum;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.system.mapper.TCheckAcceptRecordMapper;
import com.ruoyi.system.model.TBill;
import com.ruoyi.system.model.TCheckAcceptRecord;
import com.ruoyi.system.model.TContract;
import com.ruoyi.system.model.TContractRentType;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.TBillService;
import com.ruoyi.system.service.TContractRentTypeService;
import com.ruoyi.system.service.TContractService;
import com.ruoyi.system.model.*;
import com.ruoyi.system.service.*;
import com.ruoyi.system.task.base.QuartzManager;
import com.ruoyi.system.task.base.TimeJobType;
import com.ruoyi.system.task.jobs.StateProcessJob;
@@ -84,6 +78,7 @@
    private final TContractRentTypeService contractRentTypeService;
    private final TBillService billService;
    private final TCheckAcceptRecordMapper checkAcceptRecordMapper;
    private final THouseService houseService;
    public static void main(String[] args) {
//        LocalDate localDate1 = LocalDate.now().withYear(2025).withMonth(4).withDayOfMonth(1);
@@ -278,6 +273,12 @@
                int submitStatus = status == 0 ? 3 : (status == 1 ? 4 : 5);
                contractService.updateContractAuditStatus(processParameter.getString("projectId"), submitStatus);
                TContract contract = contractService.getById(processParameter.getString("projectId"));
                // 修改房屋状态
                THouse house = houseService.getById(contract.getHouseId());
                if(Objects.nonNull(house)){
                    house.setLeaseStatus("2");
                    houseService.updateById(house);
                }
                List<TContractRentType> contractRentTypes = contractRentTypeService.list();
                TContractRentType tContractRentType = contractRentTypes.stream().filter(e -> e.getContractId().equals(contract.getId())).findFirst().orElse(null);
@@ -387,9 +388,8 @@
                            if (beforeBill.getEndTime().plusMonths(contract.getPayType().equals("1") ? 1 : contract.getPayType().equals("2") ? 3 : 12).getDayOfMonth() <= 15) {
                                tBill.setPayableFeesTime(contract.getEndTime().toLocalDate());
                            } else {
                                tBill.setPayableFeesTime((contract.getPayType().equals("1") ?
                                        beforeBill.getEndTime().plusMonths(1).withDayOfMonth(15).toLocalDate() : contract.getPayType().equals("2") ?
                                        beforeBill.getEndTime().plusMonths(3).withDayOfMonth(15).toLocalDate() : beforeBill.getEndTime().withDayOfMonth(15).plusMonths(12).toLocalDate()));
                                tBill.setPayableFeesTime((contract.getPayType().equals("1") || contract.getPayType().equals("2")?
                                        beforeBill.getEndTime().plusMonths(1).withDayOfMonth(15).toLocalDate() : beforeBill.getEndTime().withDayOfMonth(15).plusMonths(12).toLocalDate()));
                            }
                            tBill.setContractId(contract.getId());
                            if (contract.getIsIncreasing()) {
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java
@@ -513,5 +513,10 @@
        return dto;
    }
    @Override
    public Integer batchBillCount(String userId, List<String> billIds) {
        return this.baseMapper.batchBillCount(userId,billIds);
    }
}
ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
@@ -93,6 +93,9 @@
            <if test="query.userId != null and query.userId !=''">
                and t.id = #{query.userId}
            </if>
            <if test="query.billType != null">
                and b.bill_type = #{query.billType}
            </if>
            and b.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        order by b.bill_type,b.payable_fees_time
@@ -162,4 +165,25 @@
    <select id="statisticsOverdue" resultType="java.math.BigDecimal">
        SELECT ifnull(sum(outstanding_money),0) as amount FROM t_bill where pay_fees_status=4
    </select>
    <select id="batchBillCount" resultType="java.lang.Integer">
        SELECT
            count(b.id)
        FROM
            t_bill b
        LEFT JOIN t_contract c ON c.contract_number = b.contract_number and c.disabled=0
        LEFT JOIN t_house h ON h.id = c.house_id and h.disabled=0
        LEFT JOIN t_tenant t ON t.id = c.tenant_id and t.disabled=0
        <where>
            <if test="userId != null and userId !=''">
                AND t.id = #{userId}
            </if>
            <if test="billIds != null and billIds.size() > 0">
                AND b.id NOT IN
                <foreach collection="billIds" item="item" index="index" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            AND b.bill_type = 3
        </where>
    </select>
</mapper>