| | |
| | | return R.ok(tenantService.pageListApplet(query)); |
| | | } |
| | | /** |
| | | * 获取租户管理列表 |
| | | */ |
| | | @ApiOperation(value = "获取租户详情") |
| | | @GetMapping(value = "/getTenantDetailById") |
| | | public R<TTenant> getTenantDetailById(@RequestParam String id) { |
| | | return R.ok(tenantService.getById(id)); |
| | | } |
| | | /** |
| | | * 租户详情-租房信息 |
| | | */ |
| | | @ApiOperation(value = "租户详情-租房信息列表") |
| | |
| | | @Override |
| | | public void insertFill(MetaObject metaObject) { |
| | | // 获取登录信息 |
| | | String userName = SecurityUtils.getUsernameApplet(); |
| | | if (StringUtils.isNotBlank(userName)) { |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } else { |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } |
| | | // String userName = SecurityUtils.getUsernameApplet(); |
| | | // if (StringUtils.isNotBlank(userName)) { |
| | | // this.setFieldValByName("createBy", userName, metaObject); |
| | | // this.setFieldValByName("updateBy", userName, metaObject); |
| | | // } else { |
| | | // this.setFieldValByName("createBy", userName, metaObject); |
| | | // this.setFieldValByName("updateBy", userName, metaObject); |
| | | // } |
| | | |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void updateFill(MetaObject metaObject) { |
| | | // 获取登录信息 |
| | | String userName = SecurityUtils.getUsernameApplet(); |
| | | if (StringUtils.isNotBlank(userName)){ |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } else { |
| | | this.setFieldValByName("createBy", userName, metaObject); |
| | | this.setFieldValByName("updateBy", userName, metaObject); |
| | | } |
| | | // String userName = SecurityUtils.getUsernameApplet(); |
| | | // if (StringUtils.isNotBlank(userName)){ |
| | | // this.setFieldValByName("createBy", userName, metaObject); |
| | | // this.setFieldValByName("updateBy", userName, metaObject); |
| | | // } else { |
| | | // this.setFieldValByName("createBy", userName, metaObject); |
| | | // this.setFieldValByName("updateBy", userName, metaObject); |
| | | // } |
| | | |
| | | } |
| | | } |
| | |
| | | * 新增和更新执行 |
| | | */ |
| | | @ApiModelProperty(value = "记录修改人,前端忽略") |
| | | @JsonIgnore |
| | | @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE) |
| | | private String updateBy; |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | |
| | | private String handlePerson; |
| | | |
| | | @ApiModelProperty(value = "处理时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") |
| | | @TableField("handle_time") |
| | | private LocalDateTime handleTime; |
| | | private LocalDate handleTime; |
| | | |
| | | @ApiModelProperty(value = "结果描述") |
| | | @TableField("result_describe") |
| | |
| | | |
| | | // 更新模板, version+1 |
| | | StateProcessTemplate processTemplate = new StateProcessTemplate(); |
| | | processTemplate.setId(IdUtils.simpleUUID()); |
| | | processTemplate.setId(processUpdateBO.getId()); |
| | | processTemplate.setWorkFlowId(deployId); |
| | | processTemplate.setWorkflowVersion(flwProcess.getProcessVersion()); |
| | | processTemplate.setTemplateName(processUpdateBO.getTemplateName()); |
| | |
| | | processTemplate.setUpdateBy(SecurityUtils.getLoginUser().getUsername()); |
| | | processTemplate.setUpdateTime(LocalDateTime.now()); |
| | | processTemplate.setTemplateVersion(temp.getTemplateVersion() + 1); |
| | | this.save(processTemplate); |
| | | return this.updateById(processTemplate); |
| | | |
| | | //查询版本是否绑定流程,更新 |
| | | LambdaQueryWrapper<StateProcessModule> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(StateProcessModule::getTemplateId, processUpdateBO.getId()); |
| | | List<StateProcessModule> stateProcessModules = stateProcessModuleService.list(queryWrapper); |
| | | if (Objects.isNull(stateProcessModules) || stateProcessModules.isEmpty()) { |
| | | return true; |
| | | } |
| | | for (StateProcessModule stateProcessModule : stateProcessModules) { |
| | | stateProcessModule.setTemplateId(processTemplate.getId()); |
| | | stateProcessModule.setTemplateName(processTemplate.getTemplateName()); |
| | | } |
| | | return stateProcessModuleService.updateBatchById(stateProcessModules); |
| | | // LambdaQueryWrapper<StateProcessModule> queryWrapper = new LambdaQueryWrapper<>(); |
| | | // queryWrapper.eq(StateProcessModule::getTemplateId, processUpdateBO.getId()); |
| | | // List<StateProcessModule> stateProcessModules = stateProcessModuleService.list(queryWrapper); |
| | | // if (Objects.isNull(stateProcessModules) || stateProcessModules.isEmpty()) { |
| | | // return true; |
| | | // } |
| | | // for (StateProcessModule stateProcessModule : stateProcessModules) { |
| | | // stateProcessModule.setTemplateId(processTemplate.getId()); |
| | | // stateProcessModule.setTemplateName(processTemplate.getTemplateName()); |
| | | // } |
| | | // return stateProcessModuleService.updateBatchById(stateProcessModules); |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.DictConstants; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.token.TokenService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | public PageInfo<TenantVO> pageListApplet(TTenantAppletQuery query) { |
| | | PageInfo<TenantVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TenantVO> list = this.baseMapper.pageListApplet(query,pageInfo); |
| | | List<String> ids = list.stream().map(TTenant::getId).collect(Collectors.toList()); |
| | | if(CollectionUtils.isEmpty(ids)){ |
| | | return new PageInfo<>(); |
| | | } |
| | | List<TContract> contracts = contractMapper.selectList(Wrappers.lambdaQuery(TContract.class) |
| | | .in(TContract::getTenantId, ids) |
| | | .eq(TContract::getStatus, 4)); |
| | | List<THouse> houses = new ArrayList<>(); |
| | | if(!CollectionUtils.isEmpty(contracts)){ |
| | | List<String> houseIds = contracts.stream().map(TContract::getHouseId).collect(Collectors.toList()); |
| | | houses = houseMapper.selectList(Wrappers.lambdaQuery(THouse.class) |
| | | .in(THouse::getId, houseIds)); |
| | | } |
| | | |
| | | for (TenantVO tenantVO : list) { |
| | | tenantVO.setTenantAttributesName(StringUtils.isNotBlank(tenantVO.getTenantAttributes())?DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_ATTRIBUTE,tenantVO.getTenantAttributes()):""); |
| | | tenantVO.setTenantTypeName(StringUtils.isNotBlank(tenantVO.getTenantType())?DictUtils.getDictLabel(DictConstants.DICT_TYPE_TENANT_TYPE,tenantVO.getTenantType()):""); |
| | | if(!CollectionUtils.isEmpty(houses)){ |
| | | List<TContract> contractList = contracts.stream().filter(contract -> contract.getTenantId().equals(tenantVO.getId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(contractList)){ |
| | | TContract contract = contractList.get(0); |
| | | List<THouse> houseList = houses.stream().filter(house -> house.getId().equals(contract.getHouseId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(houseList)) |
| | | tenantVO.setHouseName(houseList.get(0).getHouseName()); |
| | | } |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | |
| | | @ApiModelProperty(value = "租户类型") |
| | | private String tenantTypeName; |
| | | |
| | | @ApiModelProperty(value = "房屋名称") |
| | | private String houseName; |
| | | |
| | | } |
| | |
| | | from sys_user u |
| | | WHERE u.del_flag = 0 |
| | | <if test="names != null and names.size()>0"> |
| | | AND u.nick_name IN |
| | | AND u.user_name IN |
| | | <foreach collection="names" close=")" open="(" item="name" separator=","> |
| | | #{name} |
| | | </foreach> |