| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.AllArgsConstructor; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.flowable.idm.engine.impl.persistence.entity.UserEntity; |
| | | import org.springblade.common.cache.DictCache; |
| | |
| | | import org.springblade.modules.grid.service.IGridmanService; |
| | | import org.springblade.modules.house.entity.HouseholdEntity; |
| | | import org.springblade.modules.house.service.IHouseholdService; |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.police.entity.PoliceAffairsGridEntity; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.policeAlarmRecords.entity.PoliceAlarmRecordsEntity; |
| | | import org.springblade.modules.policeAlarmRecords.service.IPoliceAlarmRecordsService; |
| | | import org.springblade.modules.property.entity.PropertyCompanyEntity; |
| | | import org.springblade.modules.property.service.IPropertyCompanyDistrictService; |
| | | import org.springblade.modules.property.service.IPropertyCompanyService; |
| | | import org.springblade.modules.system.entity.*; |
| | | import org.springblade.modules.system.excel.PoliceUserExcel; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<UserExcel> exportUser(Wrapper<User> queryWrapper) { |
| | | List<UserExcel> userList = baseMapper.exportUser(queryWrapper); |
| | | public List<UserExcel> exportUser(Wrapper<User> queryWrapper, String deptId) { |
| | | if (Strings.isBlank(deptId) && !AuthUtil.isAdministrator() && !AuthUtil.isAdmin()) { |
| | | deptId = AuthUtil.getDeptId(); |
| | | } |
| | | List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | | List<UserExcel> userList = baseMapper.exportUser(queryWrapper, deptIdList); |
| | | userList.forEach(user -> { |
| | | user.setUserTypeName(DictCache.getValue(DictEnum.USER_TYPE, user.getUserType())); |
| | | user.setRoleName(StringUtil.join(SysCache.getRoleNames(user.getRoleId()))); |
| | |
| | | IGridmanService bean = SpringUtil.getBean(IGridmanService.class); |
| | | return bean.getGridManByCode(houseCode); |
| | | } else { |
| | | // IPropertyCompanyDistrictService bean1 = SpringUtil.getBean(IPropertyCompanyDistrictService.class); |
| | | // return bean1.getDistictUserByCode(houseCode); |
| | | String deptId = AuthUtil.getDeptId(); |
| | | List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | | return baseMapper.selectUserByDept(deptIdList); |
| | | IPropertyCompanyDistrictService bean1 = SpringUtil.getBean(IPropertyCompanyDistrictService.class); |
| | | return bean1.getDistictUserByCode(houseCode); |
| | | // 通过huosecode 查询物业工作人员 |
| | | // String deptId = AuthUtil.getDeptId(); |
| | | // List<Long> deptIdList = SysCache.getDeptChildIds(deptId); |
| | | // return baseMapper.selectUserByDept(deptIdList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通过小区id查询物业人员 |
| | | * |
| | | * @param districtId |
| | | * @param building |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<UserEntity> getUserInfoByDistrictId(String districtId, String building) { |
| | | return baseMapper.getUserInfoByDistrictId(districtId, building); |
| | | } |
| | | |
| | | @Override |
| | | public List<User> getUserInfoByDistrictIds(String districtIds) { |
| | | List<String> list = JSON.parseArray(districtIds).toJavaList(String.class); |
| | | return baseMapper.getUserInfoByDistrictIds(list); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 处理漏绑定的user_dept |
| | |
| | | @Override |
| | | public List<User> getPoliceUser(String longitude, String latitude, String houseCode) { |
| | | List<User> policeUser = baseMapper.getPoliceUser(longitude, latitude); |
| | | // todo 自动生成警单 |
| | | IPoliceAlarmRecordsService policeAlarmRecordsService = SpringUtil.getBean(IPoliceAlarmRecordsService.class); |
| | | PoliceAlarmRecordsEntity policeAlarmRecordsEntity = new PoliceAlarmRecordsEntity(); |
| | | policeAlarmRecordsEntity.setHouseCode(houseCode); |
| | | if (policeUser != null && policeUser.size() == 1) { |
| | | policeAlarmRecordsEntity.setPoliceId(policeUser.get(0).getId()); |
| | | } |
| | | policeAlarmRecordsService.save(policeAlarmRecordsEntity); |
| | | // 自动生成警单 |
| | | // if (StringUtils.isNotBlank(houseCode)) { |
| | | // IPoliceAlarmRecordsService policeAlarmRecordsService = SpringUtil.getBean(IPoliceAlarmRecordsService.class); |
| | | // PoliceAlarmRecordsEntity policeAlarmRecordsEntity = new PoliceAlarmRecordsEntity(); |
| | | // policeAlarmRecordsEntity.setHouseCode(houseCode); |
| | | // if (policeUser != null && policeUser.size() == 1) { |
| | | // policeAlarmRecordsEntity.setPoliceId(policeUser.get(0).getId()); |
| | | // } |
| | | // policeAlarmRecordsService.save(policeAlarmRecordsEntity); |
| | | // } |
| | | return policeUser; |
| | | } |
| | | } |