无关风月
2025-03-05 fb88391ffa5e2dbaaccccffd65ae127382df8126
Merge branch 'master' of https://gitee.com/xiaochen991015/xizang

# Conflicts:
# ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TContractServiceImpl.java
13个文件已修改
1个文件已添加
150 ■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBillController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/THouseController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/WxLoginController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-applet/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/dto/BillStatisticsDto.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TBillMapper.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/query/THouseQuery.java 2 ●●● 补丁 | 查看 | 原始文档 | 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 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDeptServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TBillController.java
@@ -116,10 +116,16 @@
    @PostMapping("cashPay")
    public R cashPay(@RequestBody CachPayDto cachPayDto){
        tBillService.cashPay(cachPayDto);
        return null;
        return R.ok();
    }
    @ApiOperation("统计")
    @GetMapping("statistics")
    public R<BillStatisticsDto> statistics(){
        BillStatisticsDto dto = tBillService.statistics();
        return R.ok(dto);
    }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/TContractController.java
@@ -124,7 +124,7 @@
                            new ImmutableMap.Builder<String, Long>().
                                    put("id", flwTask.getId())
                                    .build();
                    QuartzManager.addJob(StateProcessJob.class, (StateProcessJob.name+flwTask.getId()).toUpperCase(), TimeJobType.AUTO_AUDIT,new Date(new Date().getTime()+3*60*1000L), maps);
                    QuartzManager.addJob(StateProcessJob.class, (StateProcessJob.name+flwTask.getId()).toUpperCase(), TimeJobType.AUTO_AUDIT,new Date(new Date().getTime()+48*60*60*1000L), maps);
                }
            }
        }
ruoyi-admin/src/main/java/com/ruoyi/web/controller/api/THouseController.java
@@ -62,8 +62,8 @@
    @PreAuthorize("@ss.hasPermi('house:list:detail')")
    public R<THouse> getHouseById(@RequestParam String id) {
        THouse tHouse = tHouseService.getById(id);
        tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,tHouse.getLeaseStatus()));
        tHouse.setBusinessAttributes(DictUtils.getDictLabel(DictConstants.DICT_TYPE_BUSINESS_ATTRIBUTES,tHouse.getBusinessAttributes()));
//        tHouse.setLeaseStatus(DictUtils.getDictLabel(DictConstants.DICT_TYPE_LEASE_STATUS,tHouse.getLeaseStatus()));
//        tHouse.setBusinessAttributes(DictUtils.getDictLabel(DictConstants.DICT_TYPE_BUSINESS_ATTRIBUTES,tHouse.getBusinessAttributes()));
        return R.ok(tHouse);
    }
    @Log(title = "房屋基础信息管理-删除房屋", businessType = BusinessType.DELETE)
@@ -77,7 +77,6 @@
    @ApiOperation(value = "获取房屋分页列表")
    @PostMapping(value = "/houseList")
    @PreAuthorize("@ss.hasPermi('house:list')")
    public R<PageInfo<THouse>> houseList(@RequestBody THouseQuery query) {
        return R.ok(tHouseService.houseList(query));
    }
ruoyi-applet/src/main/java/com/ruoyi/web/controller/api/WxLoginController.java
@@ -118,8 +118,8 @@
        appletUserDecodeData.setOpenId(openid);
        // 先使用openId和当前手机号进行查询
        TTenant tenant = tTenantService.getOne(Wrappers.lambdaQuery(TTenant.class)
                .eq(TTenant::getOpenId, appletUserDecodeData.getOpenId())
                .eq(TTenant::getPhone, appletUserDecodeData.getPhoneNumber()));
                .and(e->e.eq(TTenant::getOpenId, appletUserDecodeData.getOpenId()).or()
                .eq(TTenant::getPhone, appletUserDecodeData.getPhoneNumber())));
        if (tenant==null){
//            appUser.setTenantAttributes();
//            appUser.setTenantType();
ruoyi-applet/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -9,6 +9,7 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.core.domain.model.LoginUserApplet;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.SmsUtil;
import com.ruoyi.framework.web.service.TokenService;
@@ -101,16 +102,8 @@
    {
        AjaxResult ajax = AjaxResult.success();
        // 生成令牌
        LoginUser loginUser = loginService.loginCode(loginBody.getUsername(), loginBody.getCode());
        ajax.put(Constants.TOKEN, tokenService.createToken(loginUser));
        List<SysRole> roles = loginUser.getUser().getRoles();
        if(CollectionUtils.isEmpty(roles)){
            return AjaxResult.error("请关联角色!");
        }
        List<SysMenu> menus = roleService.roleInfoFromUserId(loginUser.getUserId());
        ajax.put("menus",menus);
        ajax.put("roleName",roles.get(0).getRoleName());
        LoginUserApplet loginUser = loginService.loginCodeApplet(loginBody.getUsername(), loginBody.getCode());
        ajax.put(Constants.TOKEN, tokenService.createTokenApplet(loginUser));
        ajax.put("userInfo",loginUser);
        return ajax;
    }
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
@@ -2,8 +2,14 @@
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.core.domain.entity.TTenantResp;
import com.ruoyi.common.core.domain.model.LoginUserApplet;
import com.ruoyi.common.enums.UserStatus;
import com.ruoyi.system.model.TTenant;
import com.ruoyi.system.service.TTenantService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
@@ -52,6 +58,8 @@
    
    @Autowired
    private ISysUserService userService;
    @Autowired
    private TTenantService tenantService;
    @Autowired
    private ISysConfigService configService;
@@ -127,8 +135,6 @@
     */
    public LoginUser loginCode(String username,String code)
    {
        // 登录前置校验
        if (StringUtils.isEmpty(username)){
            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
@@ -163,6 +169,43 @@
        return loginUser;
    }
    /**
     * 登录验证
     *
     * @param username 用户名
     * @param code 验证码
     * @return 结果
     */
    public LoginUserApplet loginCodeApplet(String username, String code)
    {
        // 登录前置校验
        if (StringUtils.isEmpty(username)){
            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
            throw new UserNotExistsException();
        }
        // 用户验证
        TTenant user = tenantService.getOne(Wrappers.<TTenant>lambdaQuery().eq(TTenant::getAccount,username));
        if (StringUtils.isNull(user)){
            log.info("登录用户:{} 不存在.", username);
            throw new ServiceException(MessageUtils.message("user.not.exists"));
        } else if (user.getDisabled()) {
            log.info("登录用户:{} 已被删除.", username);
            throw new ServiceException(MessageUtils.message("user.password.delete"));
        }
        // 校验验证码
        Object cacheObject = redisCache.getCacheObject(user.getAccount());
        if(!code.equals(String.valueOf(cacheObject))){
            log.info("登录用户:{} 短信验证码错误{}", username,code);
            throw new ServiceException("短信验证码错误");
        }
        AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
        TTenantResp tTenantResp = new TTenantResp();
        BeanUtils.copyProperties(user,tTenantResp);
        LoginUserApplet loginUser = new LoginUserApplet(user.getId(), null, tTenantResp, null);
        // 生成token
        return loginUser;
    }
    /**
     * 校验验证码
ruoyi-system/src/main/java/com/ruoyi/system/dto/BillStatisticsDto.java
New file
@@ -0,0 +1,20 @@
package com.ruoyi.system.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class BillStatisticsDto implements Serializable {
    @ApiModelProperty("应收租金")
    private BigDecimal rent;
    @ApiModelProperty("待缴费")
    private BigDecimal nopay;
    @ApiModelProperty("已缴费")
    private BigDecimal payed;
    @ApiModelProperty("已逾期")
    private BigDecimal overdue;
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/TBillMapper.java
@@ -9,6 +9,7 @@
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.math.BigDecimal;
import java.util.List;
/**
@@ -35,4 +36,12 @@
    List<TBillDto> invoiceList(@Param("query")TBillQuery query, @Param("pageInfo")PageInfo<TBillDto> pageInfo);
    TBillDto selectDetailByBillId(@Param("billId") String billId);
    BigDecimal statisticsAllRent();
    BigDecimal statisticsNoPay();
    BigDecimal statisticsPayed();
    BigDecimal statisticsOverdue();
}
ruoyi-system/src/main/java/com/ruoyi/system/query/THouseQuery.java
@@ -16,6 +16,6 @@
    private String propertyRightPerson;
    @ApiModelProperty(value = "租赁状态 1=待出租 2=已出租 3=维修中")
    private Integer leaseStatus;
    private String leaseStatus;
}
ruoyi-system/src/main/java/com/ruoyi/system/service/TBillService.java
@@ -83,4 +83,6 @@
    TBillDto getDetailByBillId(@NotEmpty String id);
    Boolean cashPay(CachPayDto offlinePayDto);
    BillStatisticsDto statistics();
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FlowListenerService.java
@@ -116,7 +116,7 @@
                            new ImmutableMap.Builder<String, Long>().
                                    put("id", flwTask.getId())
                                    .build();
                    QuartzManager.addJob(StateProcessJob.class, (StateProcessJob.name+flwTask.getId()).toUpperCase(), TimeJobType.AUTO_AUDIT,new Date(new Date().getTime()+3*60*1000L), maps);
                    QuartzManager.addJob(StateProcessJob.class, (StateProcessJob.name+flwTask.getId()).toUpperCase(), TimeJobType.AUTO_AUDIT,new Date(new Date().getTime()+48*60*60*1000L), maps);
                    //对比发起人和节点审批人
@@ -167,7 +167,7 @@
                            new ImmutableMap.Builder<String, Long>().
                                    put("id", flwTask.getId())
                                    .build();
                    QuartzManager.addJob(StateProcessJob.class, (StateProcessJob.name+flwTask.getId()).toUpperCase(), TimeJobType.AUTO_AUDIT,new Date(new Date().getTime()+3*60*1000L), maps);
                    QuartzManager.addJob(StateProcessJob.class, (StateProcessJob.name+flwTask.getId()).toUpperCase(), TimeJobType.AUTO_AUDIT,new Date(new Date().getTime()+48*60*60*1000L), maps);
                    //对比发起人和节点审批人
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TBillServiceImpl.java
@@ -501,5 +501,15 @@
        return true;
    }
    @Override
    public BillStatisticsDto statistics() {
        BillStatisticsDto dto = new BillStatisticsDto();
        dto.setRent(getBaseMapper().statisticsAllRent());
        dto.setNopay(getBaseMapper().statisticsNoPay());
        dto.setPayed(getBaseMapper().statisticsPayed());
        dto.setOverdue(getBaseMapper().statisticsOverdue());
        return dto;
    }
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TDeptServiceImpl.java
@@ -2,7 +2,6 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruoyi.common.basic.PageInfo;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.mapper.SysMenuMapper;
import com.ruoyi.system.model.TDept;
import com.ruoyi.system.mapper.TDeptMapper;
@@ -12,6 +11,7 @@
import com.ruoyi.system.vo.DeptVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.List;
@@ -30,7 +30,7 @@
    private SysMenuMapper sysMenuMapper;
    @Override
    public boolean isExit(TDept dto) {
        if(StringUtils.isNotEmpty(dto.getDeptId())){
        if(StringUtils.hasLength(dto.getId())){
            // 修改
            return this.count(Wrappers.lambdaQuery(TDept.class).ne(TDept::getId, dto.getId()).eq(TDept::getDeptId, dto.getDeptId())) > 0;
        }else {
ruoyi-system/src/main/resources/mapper/system/TBillMapper.xml
@@ -63,7 +63,7 @@
                and t.id = #{query.userId}
            </if>
        </where>
        order by b.create_time desc
        order by b.payable_fees_time
    </select>
    <select id="getBillList" resultType="com.ruoyi.system.dto.TBillDto">
        SELECT
@@ -95,7 +95,7 @@
            </if>
            and b.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        order by b.payable_fees_time
        order by b.bill_type,b.payable_fees_time
    </select>
    <select id="invoiceList" resultType="com.ruoyi.system.dto.TBillDto">
        SELECT
@@ -146,4 +146,20 @@
        LEFT JOIN t_tenant t ON t.id = c.tenant_id and t.disabled=0
        where b.id = #{billId}
    </select>
    <select id="statisticsAllRent" resultType="java.math.BigDecimal">
        SELECT sum(payable_fees_money) as amount FROM t_bill
    </select>
    <select id="statisticsNoPay" resultType="java.math.BigDecimal">
        SELECT sum(outstanding_money) as amount FROM t_bill where pay_fees_status!=3
    </select>
    <select id="statisticsPayed" resultType="java.math.BigDecimal">
        SELECT sum(pay_fees_money) as amount FROM t_bill
    </select>
    <select id="statisticsOverdue" resultType="java.math.BigDecimal">
        SELECT sum(outstanding_money) as amount FROM t_bill where pay_fees_status=4
    </select>
</mapper>