| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @param code |
| | | * @param roleType |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "网格员和物业人公司统计", notes = "") |
| | | @GetMapping("/getGridStatistics") |
| | | public R getGridStatistics(@RequestParam("code") String code, @RequestParam("roleType") String roleType) { |
| | | return R.data(gridmanService.getGridStatistics(code,roleType)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 网格员表 Mapper 接口 |
| | |
| | | * @return |
| | | */ |
| | | List<GridmanVO> getGridmanList(@Param("gridman") GridmanVO gridman); |
| | | |
| | | Integer getGridStatistics(String code, Long userId); |
| | | |
| | | Integer getCompanyStatistics(String code, Long userId); |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getGridStatistics" resultType="java.lang.Integer"> |
| | | SELECT count(1) number |
| | | FROM jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | WHERE jg.community_code = #{code} |
| | | AND jg.is_deleted = 0 |
| | | </select> |
| | | |
| | | <select id="getCompanyStatistics" resultType="java.lang.Integer"> |
| | | |
| | | SELECT |
| | | count(1) |
| | | FROM |
| | | jczz_property_company_district jpcd |
| | | LEFT JOIN jczz_district jd ON jd.id = jpcd.district_id |
| | | WHERE |
| | | jd.community_code = #{code} |
| | | and jpcd.is_deleted= 0 |
| | | <if test="userId!=null"> |
| | | AND EXISTS ( |
| | | SELECT |
| | | jda.aoi_code |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jgr.house_code |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jg.is_deleted = 0 |
| | | AND jd.aoi_code = jda.aoi_code |
| | | AND jda.aoi_code IS NOT NULL |
| | | GROUP BY |
| | | jda.aoi_code |
| | | ) |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | * @return |
| | | */ |
| | | List<GridmanVO> getGridmanList(GridmanVO gridman); |
| | | |
| | | Object getGridStatistics(String code, String roleType); |
| | | } |
| | |
| | | package org.springblade.modules.grid.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.entity.GridmanEntity; |
| | | import org.springblade.modules.grid.excel.GridmanExcel; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.vo.GridmanVO; |
| | | import org.springblade.modules.grid.mapper.GridmanMapper; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.service.IGridmanService; |
| | | import org.springblade.modules.system.entity.Dept; |
| | | import org.springblade.modules.grid.vo.GridmanVO; |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | 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; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 网格员查询 |
| | | * |
| | | * @param gridman |
| | | * @return |
| | | */ |
| | |
| | | public List<GridmanVO> getGridmanList(GridmanVO gridman) { |
| | | return baseMapper.getGridmanList(gridman); |
| | | } |
| | | |
| | | @Override |
| | | public Object getGridStatistics(String code, String roleType) { |
| | | Map<String, Object> objectObjectHashMap = new HashMap<>(); |
| | | if (roleType.equals("1")) { |
| | | Integer gridStatistics = baseMapper.getGridStatistics(code, AuthUtil.getUserId()); |
| | | Integer companyStatistics = baseMapper.getCompanyStatistics(code, AuthUtil.getUserId()); |
| | | objectObjectHashMap.put("gridStatistics", gridStatistics); |
| | | objectObjectHashMap.put("companyStatistics", companyStatistics); |
| | | } else { |
| | | Integer gridStatistics = baseMapper.getGridStatistics(code, AuthUtil.getUserId()); |
| | | Integer companyStatistics = baseMapper.getCompanyStatistics(code, null); |
| | | objectObjectHashMap.put("gridStatistics", gridStatistics); |
| | | objectObjectHashMap.put("companyStatistics", companyStatistics); |
| | | } |
| | | return objectObjectHashMap; |
| | | } |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.house.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.excel.util.ExcelUtil; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.house.entity.HouseEntity; |
| | | import org.springblade.modules.house.excel.HouseAndHoldExcel; |
| | | import org.springblade.modules.house.excel.HouseAndHoldImporter; |
| | | import org.springblade.modules.house.excel.HouseImporter; |
| | | import org.springblade.modules.house.vo.HouseParam; |
| | | import org.springblade.modules.house.excel.HouseExcel; |
| | | import org.springblade.modules.system.excel.UserExcel; |
| | | import org.springblade.modules.system.excel.UserImporter; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.house.entity.HouseEntity; |
| | | import org.springblade.modules.house.excel.HouseImporter; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | | import org.springblade.modules.house.vo.HouseParam; |
| | | import org.springblade.modules.house.vo.HouseVO; |
| | | import org.springblade.modules.house.wrapper.HouseWrapper; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 房屋 控制器 |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("getHouseStatistics") |
| | | public R getHouseStatistics(@RequestParam("code") String code, @RequestParam("roleType") String roleType) { |
| | | Map<String, Object> result = houseService.getHouseStatistics(code, roleType); |
| | | return R.data(result); |
| | | } |
| | | |
| | | } |
| | |
| | | return R.data(householdService.getHouseholdOtherInfo(household)); |
| | | } |
| | | |
| | | /** |
| | | * 用户信息统计 |
| | | * @param code |
| | | * @param roleType |
| | | * @return |
| | | */ |
| | | @GetMapping("/getHouseHoldStatistics") |
| | | @ApiOperationSupport(order = 14) |
| | | @ApiOperation(value = "用户信息统计", notes = " ") |
| | | public R getHouseHoldStatistics(@RequestParam("code") String code, @RequestParam("roleType") String roleType) { |
| | | return R.data(householdService.getHouseHoldStatistics(code,roleType)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 审核状态 0: 待确认 1: 已确认 |
| | | */ |
| | | @ApiModelProperty(value = "审核状态 0: 待确认 1: 已确认") |
| | | @ApiModelProperty(value = "审核状态 0: 待审核 1: 审核通过 2: 审核不通过 10未到期; 20即将到期 ;30 已到期") |
| | | private Integer auditStatus; |
| | | /** |
| | | * 合同附件URL |
| | |
| | | @MapKey(value = "code") |
| | | Map<String, HouseTree> getHouseTree(@Param("houseParam") HouseParam houseParam, |
| | | @Param("list") List<String> list); |
| | | |
| | | Integer getHouseStatisticsOne(String code, Long userId); |
| | | Integer getHouseStatisticsTwo(String code, Long userId); |
| | | Integer getHouseStatisticsThree(String code, Long userId); |
| | | Integer getHouseStatisticsFour(String code, Long userId); |
| | | } |
| | |
| | | unit as parentCode |
| | | FROM jczz_house jh |
| | | left join |
| | | (select nei_code,aoi_code from jczz_doorplate_address where nei_code = #{houseParam.code} group by nei_code,aoi_code) jda |
| | | (select nei_code,aoi_code from jczz_doorplate_address where nei_code = #{houseParam.code} group by |
| | | nei_code,aoi_code) jda |
| | | on jda.aoi_code = jh.district_code |
| | | WHERE jda.nei_code = #{houseParam.code} |
| | | <include refid="filterHouseGrid"/> |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="getHouseStatisticsOne" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count( 1 ) |
| | | FROM |
| | | jczz_house jh |
| | | WHERE |
| | | jh.is_deleted = 0 |
| | | AND |
| | | EXISTS ( |
| | | SELECT |
| | | jda.building_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | WHERE |
| | | jh.house_code = jda.address_code |
| | | AND jda.nei_code = #{code} |
| | | AND jda.building_code IS NOT NULL |
| | | |
| | | <if test="userId != null"> |
| | | AND EXISTS ( |
| | | SELECT |
| | | * |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jh.house_code = jgr.house_code |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | |
| | | GROUP BY |
| | | jda.building_code |
| | | ) |
| | | </select> |
| | | |
| | | |
| | | <select id="getHouseStatisticsTwo" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count( 1 ) |
| | | FROM |
| | | jczz_house jh |
| | | WHERE |
| | | jh.is_deleted = 0 |
| | | AND |
| | | EXISTS ( |
| | | SELECT |
| | | jda.address_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | WHERE |
| | | jh.house_code = jda.address_code |
| | | AND jda.nei_code = #{code} |
| | | AND jda.building_code IS NOT NULL |
| | | |
| | | <if test="userId != null"> |
| | | AND EXISTS ( |
| | | SELECT |
| | | * |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jh.house_code = jgr.house_code |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | |
| | | GROUP BY |
| | | jda.address_code |
| | | ) |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="getHouseStatisticsThree" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count(1) |
| | | FROM |
| | | jczz_household jhh |
| | | LEFT JOIN jczz_house jh ON jhh.house_code = jh.house_code |
| | | WHERE |
| | | jh.is_deleted = 0 |
| | | AND jhh.is_deleted = 0 |
| | | AND jhh.house_code IN ( |
| | | SELECT |
| | | jda.address_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | WHERE |
| | | jh.house_code = jda.address_code |
| | | AND jda.nei_code = #{code} |
| | | <if test="userId != null"> |
| | | AND EXISTS ( |
| | | SELECT |
| | | * |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jh.house_code = jgr.house_code |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | ) |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="getHouseStatisticsFour" resultType="java.lang.Integer"> |
| | | SELECT |
| | | count( 1 ) |
| | | FROM |
| | | jczz_house jh |
| | | WHERE |
| | | jh.is_deleted = 0 |
| | | AND |
| | | EXISTS ( |
| | | SELECT |
| | | jda.unit_code |
| | | FROM |
| | | jczz_doorplate_address jda |
| | | WHERE |
| | | jh.house_code = jda.address_code |
| | | AND jda.nei_code = #{code} |
| | | AND jda.building_code IS NOT NULL |
| | | |
| | | <if test="userId != null"> |
| | | AND EXISTS ( |
| | | SELECT |
| | | * |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jh.house_code = jgr.house_code |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | |
| | | GROUP BY |
| | | jda.unit_code |
| | | ) |
| | | |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <select id="selectHouseRentalPage" resultType="org.springblade.modules.house.vo.HouseRentalTenantVO"> |
| | | SELECT jhr.*,jda.address_name as houseName,b.tenantName,b.phone, |
| | | concat(jh.district_name," ",jh.building," ",unit," ",room) as address, |
| | | case when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )>= 8 then 1 |
| | | case when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )>= 8 then 1 |
| | | when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )<4 then 3 |
| | | else 2 end as dldType, |
| | | if(jhr.termination_time is null,if(date_format(jhr.due_time,'%Y-%m-%d') >= date_format(now(),'%Y-%m-%d'),0,1),2) as status |
| | |
| | | </if> |
| | | <if test="vo.auditStatus ==20"> |
| | | AND TIMESTAMPDIFF( day, now(), jhr.due_time )<30 |
| | | AND TIMESTAMPDIFF( day, now(), jhr.due_time )>= 0 |
| | | </if> |
| | | <if test="vo.auditStatus ==30"> |
| | | AND date_format(jhr.due_time,'%Y-%m-%d')< date_format(now(),'%Y-%m-%d') |
| | |
| | | </if> |
| | | <if test="vo.dldType != null"> |
| | | <if test="vo.dldType ==1 "> |
| | | AND TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )>= 8 |
| | | AND TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )>= 8 |
| | | </if> |
| | | <if test="vo.dldType ==2 "> |
| | | AND 4 <= TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time ) |
| | |
| | | import org.springblade.modules.house.excel.HouseHoldExcel; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 住户 Mapper 接口 |
| | |
| | | * @return |
| | | */ |
| | | HouseholdOtherVO getSecurity(@Param("household") HouseholdVO household); |
| | | |
| | | List<Map<String, Object>> getHouseHoldStatistics(String code, Long userId); |
| | | |
| | | List<Map<String, Object>> getHouseHoldStatisticsAge(String code, Long userId); |
| | | } |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="getHouseHoldStatistics" resultType="java.util.Map"> |
| | | |
| | | SELECT |
| | | a.gender, |
| | | count( a.gender ) numbers |
| | | FROM |
| | | ( |
| | | SELECT |
| | | CASE |
| | | |
| | | WHEN |
| | | jh.gender = 1 THEN |
| | | '男' |
| | | WHEN jh.gender = 0 THEN |
| | | '女' ELSE '未知' |
| | | END AS gender |
| | | FROM |
| | | jczz_household jh |
| | | LEFT JOIN jczz_doorplate_address jda ON jh.house_code = jda.address_code |
| | | WHERE |
| | | jda.nei_code = #{code} |
| | | AND jh.is_deleted = 0 |
| | | <if test="userId != null"> |
| | | AND EXISTS ( |
| | | SELECT |
| | | * |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jh.house_code = jgr.house_code |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | ) a |
| | | GROUP BY |
| | | a.gender |
| | | </select> |
| | | <select id="getHouseHoldStatisticsAge" resultType="java.util.Map"> |
| | | |
| | | select |
| | | case |
| | | when TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ >= ]]> 0 and TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ <= ]]> 3 then '0~3岁' |
| | | when TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ >= ]]> 4 and TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ <= ]]> 17 then '4~17岁' |
| | | when TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ >= ]]> 18 and TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ <= ]]> 39 then '18~39岁' |
| | | when TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ >= ]]> 40 and TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ <= ]]> 59 then '40~59岁' |
| | | when TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ >= ]]> 60 and TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ <= ]]> 79 then '60~79岁' |
| | | when TIMESTAMPDIFF(YEAR,STR_TO_DATE(substr(id_card,7,8),'%Y%m%d'),sysdate()) <![CDATA[ > ]]> 80 then '80岁以上' |
| | | ELSE '无身份信息' |
| | | END AS age, |
| | | count(1) as number FROM |
| | | jczz_household jh |
| | | LEFT JOIN jczz_doorplate_address jda ON jh.house_code = jda.address_code |
| | | WHERE |
| | | jda.nei_code = #{code} |
| | | AND jh.is_deleted = 0 |
| | | GROUP BY |
| | | age |
| | | <if test="userId != null"> |
| | | AND EXISTS ( |
| | | SELECT |
| | | * |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jh.house_code = jgr.house_code |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | ORDER BY |
| | | age |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | import org.springblade.modules.house.excel.HouseExcel; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 房屋 服务类 |
| | |
| | | * @param isCovered |
| | | */ |
| | | void importHouseAndHold(List<HouseAndHoldExcel> data, Boolean isCovered); |
| | | |
| | | Map<String, Object> getHouseStatistics(String code, String roleType); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Object getHouseholdOtherInfo(HouseholdVO household); |
| | | |
| | | Object getHouseHoldStatistics(String code, String roleType); |
| | | } |
| | |
| | | houseRental.setAuditStatus(2); |
| | | } |
| | | } |
| | | return page.setRecords(baseMapper.selectHouseRentalPage(page, houseRental,list)); |
| | | List<HouseRentalTenantVO> houseRentalTenantVOS = baseMapper.selectHouseRentalPage(page, houseRental, list); |
| | | for (HouseRentalTenantVO houseRentalTenantVO : houseRentalTenantVOS) { |
| | | if(houseRentalTenantVO.getStatus().equals(1)){ |
| | | houseRentalTenantVO.setAuditStatus(30); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(0)){ |
| | | houseRentalTenantVO.setAuditStatus(0); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(1)){ |
| | | houseRentalTenantVO.setAuditStatus(1); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(3)){ |
| | | houseRentalTenantVO.setAuditStatus(20); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(2)){ |
| | | houseRentalTenantVO.setAuditStatus(10); |
| | | } |
| | | } |
| | | return page.setRecords(houseRentalTenantVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | package org.springblade.modules.house.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | |
| | | import org.springblade.modules.house.entity.HouseEntity; |
| | | import org.springblade.modules.house.entity.HouseholdEntity; |
| | | import org.springblade.modules.house.excel.HouseAndHoldExcel; |
| | | import org.springblade.modules.house.excel.HouseExcel; |
| | | import org.springblade.modules.house.mapper.HouseMapper; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | | import org.springblade.modules.house.service.IHouseholdService; |
| | | import org.springblade.modules.house.vo.HouseParam; |
| | | import org.springblade.modules.house.vo.HouseTree; |
| | | import org.springblade.modules.house.vo.HouseVO; |
| | | import org.springblade.modules.house.mapper.HouseMapper; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | | import org.springblade.modules.house.excel.HouseExcel; |
| | | 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.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 房屋 服务实现类 |
| | |
| | | householdService.save(householdEntity); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> getHouseStatistics(String code, String roleType) { |
| | | Map<String, Object> objectObjectHashMap = new HashMap<>(); |
| | | if (roleType.equals("1")) { |
| | | // result1 查询楼栋数 result2 查询房屋套数 result3 查询住户数 result4 查询单元数 |
| | | Integer result1 = baseMapper.getHouseStatisticsOne(code, AuthUtil.getUserId()); |
| | | Integer result2 = baseMapper.getHouseStatisticsTwo(code, AuthUtil.getUserId()); |
| | | Integer result3 = baseMapper.getHouseStatisticsThree(code, AuthUtil.getUserId()); |
| | | Integer result4 = baseMapper.getHouseStatisticsFour(code, AuthUtil.getUserId()); |
| | | objectObjectHashMap.put("result1", result1); |
| | | objectObjectHashMap.put("result2", result2); |
| | | objectObjectHashMap.put("result3", result3); |
| | | objectObjectHashMap.put("result4", result4); |
| | | } else { |
| | | Integer result1 = baseMapper.getHouseStatisticsOne(code, null); |
| | | Integer result2 = baseMapper.getHouseStatisticsTwo(code, null); |
| | | Integer result3 = baseMapper.getHouseStatisticsThree(code, null); |
| | | Integer result4 = baseMapper.getHouseStatisticsFour(code, null); |
| | | objectObjectHashMap.put("result1", result1); |
| | | objectObjectHashMap.put("result2", result2); |
| | | objectObjectHashMap.put("result3", result3); |
| | | objectObjectHashMap.put("result4", result4); |
| | | } |
| | | return objectObjectHashMap; |
| | | } |
| | | } |
| | |
| | | */ |
| | | 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 (null!=household.getId()){ |
| | | if (null != household.getId()) { |
| | | // 更新 |
| | | flag = updateById(household); |
| | | }else { |
| | | } else { |
| | | // 往用户表中插入数据 |
| | | // 通过手机号判断 |
| | | if (!Strings.isBlank(household.getPhoneNumber())){ |
| | | if (!Strings.isBlank(household.getPhoneNumber())) { |
| | | //判断用户是否存在 |
| | | |
| | | } |
| | | // 新增 |
| | | household.setCreateTime(new Date()); |
| | |
| | | Map<String, Object> map = new HashMap<>(3); |
| | | // 查询物业 |
| | | HouseholdOtherVO propertyOtherVO = baseMapper.getProperty(household); |
| | | map.put("wy",propertyOtherVO); |
| | | map.put("wy", propertyOtherVO); |
| | | // 查询网格 |
| | | HouseholdOtherVO gridOtherVO = baseMapper.getGrid(household); |
| | | map.put("wg",gridOtherVO); |
| | | map.put("wg", gridOtherVO); |
| | | // 查询公安信息 |
| | | HouseholdOtherVO securityOtherVO = baseMapper.getSecurity(household); |
| | | map.put("ga",securityOtherVO); |
| | | map.put("ga", securityOtherVO); |
| | | // 返回 |
| | | 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; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | package org.springblade.modules.place.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.node.TreeStringNode; |
| | |
| | | import org.springblade.modules.place.entity.PlaceRelEntity; |
| | | import org.springblade.modules.place.excel.PlaceAndRelExcel; |
| | | import org.springblade.modules.place.excel.PlaceExcel; |
| | | import org.springblade.modules.place.mapper.PlaceMapper; |
| | | import org.springblade.modules.place.service.IPlaceExtService; |
| | | import org.springblade.modules.place.service.IPlacePoiLabelService; |
| | | import org.springblade.modules.place.service.IPlaceRelService; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.place.mapper.PlaceMapper; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.system.entity.User; |
| | | 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; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | } |
| | | |
| | | /** |
| | | * w网格员查询报事报修统计 |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/getReportForStatistics") |
| | | @ApiOperation(value = "查询报事报修统计" ) |
| | | public R getReportForStatistics(@RequestParam("code") String code, @RequestParam("roleType") String roleType) { |
| | | return R.data(taskReportForRepairsService.getReportForStatistics(code, roleType)); |
| | | } |
| | | |
| | | /** |
| | | * 更新状态--临时接口 |
| | | * @param gridman |
| | | * @return |
| | |
| | | */ |
| | | package org.springblade.modules.task.mapper; |
| | | |
| | | import liquibase.pro.packaged.P; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.grid.entity.GridmanEntity; |
| | | import org.springblade.modules.task.entity.TaskReportForRepairsEntity; |
| | | import org.springblade.modules.task.vo.TaskReportForRepairsVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.task.vo.TaskReportStatistics; |
| | | |
| | | import java.util.List; |
| | |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | TaskReportStatistics getStatisticsCount(@Param("userId") Long userId); |
| | | TaskReportStatistics getStatisticsCount(@Param("userId") Long userId); |
| | | |
| | | Integer getStatistics(Long userId); |
| | | Integer getStatistics(Long userId); |
| | | |
| | | /** |
| | | * 更新状态--临时接口 |
| | | * |
| | | * @param gridman |
| | | * @return |
| | | */ |
| | | int updateView(GridmanEntity gridman); |
| | | int updateView(GridmanEntity gridman); |
| | | |
| | | Integer getReportForStatistics(String code, Long userId, Integer status,Integer type); |
| | | } |
| | |
| | | </select> |
| | | |
| | | <!--统计查询,个人--> |
| | | <select id="getReportForStatistics" resultType="java.lang.Integer"> |
| | | |
| | | SELECT |
| | | COUNT( 1 ) |
| | | FROM |
| | | jczz_task_report_for_repairs jtrfr |
| | | LEFT JOIN jczz_doorplate_address jda ON jtrfr.address_code = jda.address_code |
| | | WHERE |
| | | jda.nei_code = #{code} |
| | | AND jda.unit_code IS NOT NULL |
| | | AND jtrfr.is_deleted = 0 |
| | | <if test="status != null"> |
| | | and jtrfr.confirm_flag = #{status} |
| | | </if> |
| | | <if test="type != null"> |
| | | and jtrfr.type = #{type} |
| | | </if> |
| | | |
| | | <if test="userId != null"> |
| | | AND EXISTS ( |
| | | SELECT |
| | | * |
| | | FROM |
| | | jczz_grid jg |
| | | LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id |
| | | LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id |
| | | WHERE |
| | | jgm.user_id = #{userId} |
| | | AND jtrfr.address_code = jgr.house_code |
| | | AND jg.is_deleted = 0 |
| | | ) |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="getStatisticsCount" resultType="org.springblade.modules.task.vo.TaskReportStatistics"> |
| | | SELECT |
| | | COUNT( 1 ) AS total, |
| | | ifnull(SUM( CASE WHEN STATUS = 10 THEN 1 ELSE 0 END ),0) AS handle |
| | | COUNT( 1 ) AS total, |
| | | ifnull(SUM( CASE WHEN STATUS = 10 THEN 1 ELSE 0 END ),0) AS handle |
| | | FROM jczz_task_report_for_repairs |
| | | WHERE is_deleted = 0 |
| | | <if test="userId != null"> |
| | |
| | | * @return |
| | | */ |
| | | boolean updateView(GridmanEntity gridman); |
| | | |
| | | Object getReportForStatistics(String code, String roleType); |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.task.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 报事报修任务表 服务实现类 |
| | |
| | | |
| | | /** |
| | | * 更新状态--临时接口 |
| | | * |
| | | * @param gridman |
| | | * @return |
| | | */ |
| | |
| | | baseMapper.updateView(gridman); |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public Object getReportForStatistics(String code, String roleType) { |
| | | Map<String, Object> objectObjectHashMap = new HashMap<>(); |
| | | if (roleType.equals("1")) { |
| | | Integer result = baseMapper.getReportForStatistics(code, AuthUtil.getUserId(), 1,null); |
| | | Integer result1 = baseMapper.getReportForStatistics(code, AuthUtil.getUserId(), null,null); |
| | | // result 总数 result1 已处理 result2 处理率 result3 公共维修 result4 居家维修 result5 矛盾纠纷 result6 投诉举报 |
| | | objectObjectHashMap.put("result", result); |
| | | objectObjectHashMap.put("result1", result1); |
| | | objectObjectHashMap.put("result2", result1.equals(0) ? 0 : BigDecimal.valueOf(result).divide(BigDecimal.valueOf(result1), 2, BigDecimal.ROUND_HALF_UP)); |
| | | objectObjectHashMap.put("result3", baseMapper.getReportForStatistics(code, AuthUtil.getUserId(), null,1)); |
| | | objectObjectHashMap.put("result4", baseMapper.getReportForStatistics(code, AuthUtil.getUserId(), null,2)); |
| | | objectObjectHashMap.put("result5", baseMapper.getReportForStatistics(code, AuthUtil.getUserId(), null,3)); |
| | | objectObjectHashMap.put("result6", baseMapper.getReportForStatistics(code, AuthUtil.getUserId(), null,4)); |
| | | } else { |
| | | Integer result = baseMapper.getReportForStatistics(code, null, 1,null); |
| | | Integer result1 = baseMapper.getReportForStatistics(code, null, null,null); |
| | | objectObjectHashMap.put("result", result); |
| | | objectObjectHashMap.put("result1", result1); |
| | | objectObjectHashMap.put("result2", result1.equals(0) ? 0 : BigDecimal.valueOf(result).divide(BigDecimal.valueOf(result1), 2, BigDecimal.ROUND_HALF_UP)); |
| | | objectObjectHashMap.put("result3", baseMapper.getReportForStatistics(code,null,null,1)); |
| | | objectObjectHashMap.put("result4", baseMapper.getReportForStatistics(code, null, null,2)); |
| | | objectObjectHashMap.put("result5", baseMapper.getReportForStatistics(code, null, null,3)); |
| | | objectObjectHashMap.put("result6", baseMapper.getReportForStatistics(code, null, null,4)); |
| | | } |
| | | return objectObjectHashMap; |
| | | } |
| | | } |