Merge branch 'master' of https://gitee.com/xiaochen991015/xizang
# Conflicts:
# ruoyi-system/src/main/java/com/ruoyi/system/service/impl/TContractServiceImpl.java
| | |
| | | @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); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | @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) |
| | |
| | | @ApiOperation(value = "获取房屋分页列表") |
| | | @PostMapping(value = "/houseList") |
| | | @PreAuthorize("@ss.hasPermi('house:list')") |
| | | |
| | | public R<PageInfo<THouse>> houseList(@RequestBody THouseQuery query) { |
| | | return R.ok(tHouseService.houseList(query)); |
| | | } |
| | |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | { |
| | | 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; |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | @Autowired |
| | | private TTenantService tenantService; |
| | | |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | |
| | | */ |
| | | public LoginUser loginCode(String username,String code) |
| | | { |
| | | |
| | | |
| | | // 登录前置校验 |
| | | if (StringUtils.isEmpty(username)){ |
| | | AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null"))); |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 校验验证码 |
New file |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | 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(); |
| | | } |
| | |
| | | private String propertyRightPerson; |
| | | |
| | | @ApiModelProperty(value = "租赁状态 1=待出租 2=已出租 3=维修中") |
| | | private Integer leaseStatus; |
| | | private String leaseStatus; |
| | | |
| | | } |
| | |
| | | TBillDto getDetailByBillId(@NotEmpty String id); |
| | | |
| | | Boolean cashPay(CachPayDto offlinePayDto); |
| | | |
| | | BillStatisticsDto statistics(); |
| | | } |
| | |
| | | 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); |
| | | |
| | | |
| | | //对比发起人和节点审批人 |
| | |
| | | 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); |
| | | |
| | | |
| | | //对比发起人和节点审批人 |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | 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; |
| | | |
| | |
| | | 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 { |
| | |
| | | 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 |
| | |
| | | </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 |
| | |
| | | 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> |