| | |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.flowable.idm.engine.impl.persistence.entity.UserEntity; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | | import org.springblade.modules.property.entity.PropertyCompanyDistrictEntity; |
| | | import org.springblade.modules.property.entity.PropertyDistrictUserEntity; |
| | | import org.springblade.modules.property.service.IPropertyDistrictUserService; |
| | | import org.springblade.modules.property.vo.PropertyCompanyDistrictVO; |
| | | import org.springblade.modules.property.mapper.PropertyCompanyDistrictMapper; |
| | | import org.springblade.modules.property.service.IPropertyCompanyDistrictService; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.entity.UserDept; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | * |
| | | * @param page |
| | | * @param propertyCompanyDistrict |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 物业派驻小区表 自定义新增或修改 |
| | | * |
| | | * @param propertyCompanyDistrict |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveOrUpdatePropertyCompanyDistrict(PropertyCompanyDistrictEntity propertyCompanyDistrict) { |
| | | IUserService bean = SpringUtil.getBean(IUserService.class); |
| | | User user = bean.getOne(Wrappers.<User>lambdaQuery().eq(User::getId, propertyCompanyDistrict.getPrincipal())); |
| | | if (StringUtils.isNotBlank(user.getRoleId())) { |
| | | if (!user.getRoleId().contains("1747504028253229058")) { |
| | | user.setRoleId(user.getRoleId() + ",1747504028253229058"); |
| | | } |
| | | } else { |
| | | user.setRoleId("1747504028253229058"); |
| | | } |
| | | if (null != propertyCompanyDistrict.getId()) { |
| | | bean.updateById(user); |
| | | return updateById(propertyCompanyDistrict) && submitPropertyDistrictUser(propertyCompanyDistrict); |
| | | }else { |
| | | } else { |
| | | bean.updateById(user); |
| | | return save(propertyCompanyDistrict) && submitPropertyDistrictUser(propertyCompanyDistrict); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 关联关系维护 |
| | | * |
| | | * @param propertyCompanyDistrict |
| | | * @return |
| | | */ |