| | |
| | | */ |
| | | package org.springblade.modules.house.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.house.entity.HouseholdEntity; |
| | | import org.springblade.modules.house.vo.HouseholdOtherVO; |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.house.excel.HouseHoldExcel; |
| | | import org.springblade.modules.house.mapper.HouseholdMapper; |
| | | import org.springblade.modules.house.service.IHouseholdService; |
| | | import org.springblade.modules.house.vo.HouseholdOtherVO; |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.house.excel.HouseHoldExcel; |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.*; |
| | |
| | | */ |
| | | @Override |
| | | public boolean saveOrUpdateHousehold(HouseholdEntity household) { |
| | | // 判断添加人是否房屋业主 |
| | | Long count = count(Wrappers.<HouseholdEntity>lambdaQuery() |
| | | .eq(HouseholdEntity::getHouseCode, household.getHouseCode()) |
| | | .eq(HouseholdEntity::getAssociatedUserId, AuthUtil.getUserId()) |
| | | .eq(HouseholdEntity::getRelationship, 1)); |
| | | if (count == 0) { |
| | | return false; |
| | | } |
| | | boolean flag = false; |
| | | household.setUpdateTime(new Date()); |
| | | household.setUpdateUser(AuthUtil.getUserId()); |
| | |
| | | // 通过手机号判断 |
| | | if (!Strings.isBlank(household.getPhoneNumber())){ |
| | | //判断用户是否存在 |
| | | |
| | | } |
| | | // 新增 |
| | | household.setCreateTime(new Date()); |
| | |
| | | // 返回 |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | | public Object getHouseHoldStatistics(String code, String roleType) { |
| | | Map<String, Object> objectObjectHashMap = new HashMap<>(); |
| | | if (roleType.equals("1")) { |
| | | List<Map<String, Object>> result = baseMapper.getHouseHoldStatistics(code, AuthUtil.getUserId()); |
| | | List<Map<String, Object>> result1 = baseMapper.getHouseHoldStatisticsAge(code, AuthUtil.getUserId()); |
| | | objectObjectHashMap.put("gender", result); |
| | | objectObjectHashMap.put("age", result1); |
| | | return objectObjectHashMap; |
| | | } else { |
| | | List<Map<String, Object>> result = baseMapper.getHouseHoldStatistics(code, null); |
| | | List<Map<String, Object>> result1 = baseMapper.getHouseHoldStatisticsAge(code, null); |
| | | objectObjectHashMap.put("gender", result); |
| | | objectObjectHashMap.put("age", result1); |
| | | return objectObjectHashMap; |
| | | } |
| | | |
| | | } |
| | | } |