src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java
@@ -177,4 +177,15 @@ } /** * 住户-标签 自定义分页 */ @GetMapping("/statisticalLabels") @ApiOperation(value = "统计标签", notes = "") public R<IPage<HouseholdLabelVO>> statisticalLabels(HouseholdLabelVO householdLabel, Query query) { IPage<HouseholdLabelVO> pages = householdLabelService.statisticalLabels(Condition.getPage(query), householdLabel); return R.data(pages); } } src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.java
@@ -16,11 +16,12 @@ */ package org.springblade.modules.house.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.modules.house.dto.UserHouseLabelDTO; import org.springblade.modules.house.entity.UserHouseLabelEntity; import org.springblade.modules.house.vo.HouseholdLabelVO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import java.util.List; /** @@ -42,4 +43,5 @@ List<Integer> getUserLabelList(UserHouseLabelDTO userHouseLabelDTO); List<HouseholdLabelVO> statisticalLabels(IPage page, HouseholdLabelVO householdLabel); } src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml
@@ -3,14 +3,14 @@ <mapper namespace="org.springblade.modules.house.mapper.UserHouseLabelMapper"> <resultMap type="org.springblade.modules.house.dto.UserHouseLabelDTO" id="UserHouseLabelDTOResult"> <result property="id" column="id" /> <result property="houseCode" column="house_code" /> <result property="labelId" column="label_id" /> <result property="labelName" column="label_name" /> <result property="color" column="color" /> <result property="remark" column="remark" /> <result property="userId" column="user_id" /> <result property="lableType" column="lable_type" /> <result property="id" column="id"/> <result property="houseCode" column="house_code"/> <result property="labelId" column="label_id"/> <result property="labelName" column="label_name"/> <result property="color" column="color"/> <result property="remark" column="remark"/> <result property="userId" column="user_id"/> <result property="lableType" column="lable_type"/> </resultMap> <sql id="selectUserHouseLabel"> @@ -62,28 +62,61 @@ </where> </select> <!-- <!–自定义分页查询–>--> <!-- <select id="selectHouseholdLabelPage" resultMap="householdLabelResultMap">--> <!-- select * from jczz_household_label where is_deleted = 0--> <!-- </select>--> <!-- <!–自定义分页查询–>--> <!-- <select id="selectHouseholdLabelPage" resultMap="householdLabelResultMap">--> <!-- select * from jczz_household_label where is_deleted = 0--> <!-- </select>--> <select id="getUserLabelList" resultType="java.lang.Integer" parameterType="org.springblade.modules.house.dto.UserHouseLabelDTO"> <select id="getUserLabelList" resultType="java.lang.Integer" parameterType="org.springblade.modules.house.dto.UserHouseLabelDTO"> select label_id from jczz_user_house_label <where> <if test="id != null "> and id = #{id}</if> <if test="houseCode != null and houseCode != ''"> and house_code = #{houseCode}</if> <if test="labelId != null "> and label_id = #{labelId}</if> <if test="labelName != null and labelName != ''"> and label_name = #{labelName}</if> <if test="color != null and color != ''"> and color = #{color}</if> <if test="remark != null and remark != ''"> and remark = #{remark}</if> <if test="userId != null "> and user_id = #{userId}</if> <if test="lableType != null "> and lable_type = #{lableType}</if> <if test="id != null ">and id = #{id}</if> <if test="houseCode != null and houseCode != ''">and house_code = #{houseCode}</if> <if test="labelId != null ">and label_id = #{labelId}</if> <if test="labelName != null and labelName != ''">and label_name = #{labelName}</if> <if test="color != null and color != ''">and color = #{color}</if> <if test="remark != null and remark != ''">and remark = #{remark}</if> <if test="userId != null ">and user_id = #{userId}</if> <if test="lableType != null ">and lable_type = #{lableType}</if> </where> </select> <select id="statisticalLabels" resultType="org.springblade.modules.house.vo.HouseholdLabelVO" parameterType="org.springblade.modules.house.vo.HouseholdLabelVO"> SELECT br.region_level, br.NAME regionName, jc.`street_code`, jc.NAME communityName, jc.code communityCode, ( SELECT count( 1 ) FROM jczz_user_house_label juhl LEFT JOIN jczz_label jl ON juhl.label_id = jl.id WHERE juhl.lable_type = 1 AND jl.parent_id = '103' AND juhl.household_id IS NOT NULL AND juhl.house_code IN ( SELECT jgr.house_code FROM jczz_grid jg LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id WHERE jc.`code` = jg.community_code )) numbers FROM jczz_community jc LEFT JOIN `blade_region` br ON br.`code` = jc.`street_code` WHERE jc.street_code IS NOT NULL </select> </mapper> src/main/java/org/springblade/modules/house/service/IUserHouseLabelService.java
@@ -16,13 +16,12 @@ */ package org.springblade.modules.house.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import org.springblade.modules.house.dto.UserHouseLabelDTO; import org.springblade.modules.house.entity.UserHouseLabelEntity; import org.springblade.modules.house.excel.UserHouseLabelExcel; import org.springblade.modules.house.vo.HouseholdLabelVO; import com.baomidou.mybatisplus.core.metadata.IPage; import org.springblade.modules.system.excel.UserExcel; import java.util.List; @@ -45,13 +44,16 @@ /** * 住户-标签 自定义新增或修改 * * @param householdLabel * @return */ boolean saveOrUpdateHouseholdLabel(UserHouseLabelEntity householdLabel); boolean saveOrUpdateHouseholdLabel(UserHouseLabelEntity householdLabel); List<Integer> selectUserLabelList(UserHouseLabelDTO userHouseLabelDTO); void importUserHouseLabel(List<UserHouseLabelExcel> data, Boolean isCovered); void importUserHouseLabel(List<UserHouseLabelExcel> data, Boolean isCovered); IPage<HouseholdLabelVO> statisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel); } src/main/java/org/springblade/modules/house/service/impl/UserHouseLabelServiceImpl.java
@@ -17,20 +17,19 @@ 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.springblade.core.tool.utils.BeanUtil; import org.springblade.modules.house.dto.UserHouseLabelDTO; import org.springblade.modules.house.entity.HouseholdEntity; import org.springblade.modules.house.entity.UserHouseLabelEntity; import org.springblade.modules.house.excel.UserHouseLabelExcel; import org.springblade.modules.house.vo.HouseholdLabelVO; import org.springblade.modules.house.mapper.UserHouseLabelMapper; import org.springblade.modules.house.service.IUserHouseLabelService; import org.springblade.modules.house.vo.HouseholdLabelVO; import org.springblade.modules.label.entity.LabelEntity; import org.springblade.modules.label.service.ILabelService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.metadata.IPage; import java.util.List; import java.util.Objects; @@ -90,4 +89,9 @@ this.save(userHouseLabelEntity); }); } @Override public IPage<HouseholdLabelVO> statisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel) { return page.setRecords(baseMapper.statisticalLabels(page, householdLabel)); } } src/main/java/org/springblade/modules/house/vo/HouseholdLabelVO.java
@@ -16,9 +16,9 @@ */ package org.springblade.modules.house.vo; import org.springblade.modules.house.entity.UserHouseLabelEntity; import lombok.Data; import lombok.EqualsAndHashCode; import org.springblade.modules.house.entity.UserHouseLabelEntity; /** * 住户-标签 视图实体类 @@ -31,4 +31,13 @@ public class HouseholdLabelVO extends UserHouseLabelEntity { private static final long serialVersionUID = 1L; private String communityName; private String regionName; private String communityCode; private Integer numbers; } src/main/java/org/springblade/modules/task/controller/TaskController.java
@@ -82,6 +82,17 @@ } /** * 任务表 自定义分页 */ @GetMapping("/getBailReportingPage") @ApiOperationSupport(order = 3) @ApiOperation(value = "分页", notes = "传入task") public R<IPage<TaskVO>> getBailReportingPage(TaskVO task, Query query) { IPage<TaskVO> pages = taskService.getBailReportingPage(Condition.getPage(query), task); return R.data(pages); } /** * 任务表 新增 */ @PostMapping("/save") src/main/java/org/springblade/modules/task/mapper/TaskMapper.java
@@ -38,11 +38,12 @@ * @param task * @return */ List<TaskVO> selectTaskPage(IPage page,TaskVO task); List<TaskVO> selectTaskPage(IPage page, TaskVO task); List<TaskVO> selectTaskPageBy(IPage page,TaskVO task); List<TaskVO> selectTaskPageBy(IPage page, TaskVO task); Integer selectTaskCount(TaskVO task); List<TaskVO> getBailReportingPage(IPage<TaskVO> page, TaskVO task); } src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
@@ -23,7 +23,7 @@ <select id="selectTaskPage" resultMap="taskResultMap"> SELECT IFNULL( jda.address_name, jp.location ) AS address_name, jgr.district_code aoiCode, IFNULL( jgr.district_code, ' ' ) aoiCode, jda.region_code, jg.community_code neiCode, jc.street_code streetCode, @@ -86,11 +86,19 @@ </if> <if test="task.realName != null and task.realName != null"> and bu.name = like concat('%', #{task.realName}, '%') and bu.name like concat('%', #{task.realName}, '%') </if> <if test="task.phone != null and task.phone != null"> and bu.phone = like concat('%', #{task.phone}, '%') and bu.phone like concat('%', #{task.phone}, '%') </if> <if test="task.communityName != null and task.communityName != null"> and jc.name like concat('%', #{task.communityName}, '%') </if> <if test="task.districtName != null and task.districtName != null"> and jgr.district_name like concat('%', #{task.districtName}, '%') </if> <if test="task.frequency != null and task.frequency != ''"> @@ -204,6 +212,119 @@ </select> <select id="getBailReportingPage" resultType="org.springblade.modules.task.vo.TaskVO"> SELECT IFNULL( jda.address_name, jp.location ) AS address_name, jtbre.apply_name, jgr.district_code aoiCode, jda.region_code, jg.community_code neiCode, jc.street_code streetCode, bu.name realName, bu.phone, jt.id, jt.NAME, jt.type, jt.frequency, jt.remark, jt.create_time, jt.create_user, jt.update_time, jt.update_user, jt.STATUS, jt.tenant_id, jt.create_dept, jt.is_deleted, jt.house_code, jt.report_type FROM jczz_task jt LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jt.house_code LEFT JOIN jczz_place jp ON jp.house_code = jt.house_code LEFT JOIN blade_user bu on bu.id = jt.create_user LEFT JOIN jczz_grid_range jgr on jgr.house_code= jt.house_code LEFT JOIN jczz_grid jg on jg.id = jgr.grid_id LEFT JOIN jczz_community jc on jc.`code`= jg.community_code LEFT JOIN jczz_task_bail_reporting_event jtbre on jtbre.task_id = jt.id <where> <if test="task.userId != null and task.userId != ''"> AND jt.house_code IN ( SELECT jgr.house_code FROM jczz_grid_range jgr LEFT JOIN jczz_grid jg ON jg.id = jgr.grid_id LEFT JOIN jczz_gridman jgm ON jg.id = jgm.grid_id WHERE jg.is_deleted = 0 <if test="task.communityCode != null and task.communityCode != ''"> and jg.community_code = #{task.communityCode} </if> AND jgm.user_id = #{task.userId} ) </if> <if test="task.status != null and task.status != null"> and jt.status = #{task.status} </if> <if test="task.aoiCode != null and task.aoiCode != null"> and jgr.district_code = #{task.aoiCode} </if> <if test="task.neiCode != null and task.neiCode != null"> and jg.community_code = #{task.neiCode} </if> <if test="task.streetCode != null and task.streetCode != null"> and jc.street_code = #{task.streetCode} </if> <if test="task.realName != null and task.realName != null"> and bu.name like concat('%', #{task.realName}, '%') </if> <if test="task.phone != null and task.phone != null"> and bu.phone like concat('%', #{task.phone}, '%') </if> <if test="task.communityName != null and task.communityName != null"> and jc.name like concat('%', #{task.communityName}, '%') </if> <if test="task.districtName != null and task.districtName != null"> and jgr.district_name like concat('%', #{task.districtName}, '%') </if> <if test="task.frequency != null and task.frequency != ''"> and jt.frequency = #{task.frequency} </if> <if test="task.name != null and task.name != ''"> and jt.name like concat('%', #{task.name}, '%') </if> <if test="task.id != null ">and jt.id = #{task.id}</if> <if test="task.type != null ">and jt.type = #{task.type}</if> <if test="task.remark != null and task.remark != ''">and jt.remark = #{task.remark}</if> <if test="task.createTime != null ">and jt.create_time = #{task.createTime}</if> <if test="task.createUser != null ">and jt.create_user = #{task.createUser}</if> <if test="task.updateTime != null ">and jt.update_time = #{task.updateTime}</if> <if test="task.updateUser != null ">and jt.update_user = #{task.updateUser}</if> <if test="task.tenantId != null and task.tenantId != ''">and jt.tenant_id = #{task.tenantId}</if> <if test="task.createDept != null ">and jt.create_dept = #{task.createDept}</if> <if test="task.isDeleted != null ">and jt.is_deleted = #{task.isDeleted}</if> <if test="task.houseCode != null and task.houseCode != ''">and jt.house_code = #{task.houseCode}</if> <if test="task.startTime != null and task.startTime != '' and task.endTime != null and task.endTime != '' "> AND jt.create_time BETWEEN #{task.startTime} and #{task.endTime} </if> <!-- 取保候审 或 报事报修 --> <if test="task.reportType != null and task.reportType != 2 "> and jt.report_type = #{task.reportType} </if> and jt.is_deleted = 0 and jt.house_code is not null order by jt.create_time desc </where> </select> </mapper> src/main/java/org/springblade/modules/task/mapper/TaskReportForRepairsMapper.xml
@@ -174,7 +174,7 @@ <if test="vo.confirmFlag != null"> AND jtrfr.confirm_flag = #{vo.confirmFlag} </if> <if test="vo.confirmUserId != null"> <if test="vo.confirmUserId != null and vo.roleName!='网格员'"> AND jtrfr.confirm_user_id = #{vo.confirmUserId} </if> <if test="vo.status != null"> @@ -190,19 +190,21 @@ AND jtrfr.create_time BETWEEN #{vo.startTime} and #{vo.endTime} </if> <if test="vo.regionCode != null and vo.regionCode !='' "> and jg.community_code like concat('%',#{vo.regionCode},'%') and jg.community_code like concat(#{vo.regionCode},'%') </if> <if test="vo.roleName!=null and vo.roleName!=''"> <if test="vo.roleName=='网格员'"> <choose> <when test="list != null and list.size()>0"> and jda.address_code in <foreach collection="list" item="houseCode" separator ="," open="(" close=")"> and (jda.address_code in <foreach collection="list" item="houseCode" separator="," open="(" close=")"> #{houseCode} </foreach> or jtrfr.confirm_user_id = #{vo.confirmUserId}) </when> <otherwise> and jda.address_code in ('') and (jda.address_code in ('') or jtrfr.confirm_user_id = #{vo.confirmUserId}) </otherwise> </choose> </if> src/main/java/org/springblade/modules/task/service/ITaskService.java
@@ -68,4 +68,6 @@ Object countFrequencyNumber(); Boolean removeTask(TaskEntity task); IPage<TaskVO> getBailReportingPage(IPage<TaskVO> page, TaskVO task); } src/main/java/org/springblade/modules/task/service/impl/TaskReportForRepairsServiceImpl.java
@@ -69,6 +69,7 @@ if (null != dept) { taskReportForRepairs.setRegionCode(dept.getRegionCode()); } taskReportForRepairs.setConfirmUserId(AuthUtil.getUserId()); List<String> list = new ArrayList<>(); if (null != taskReportForRepairs.getRoleName() && !taskReportForRepairs.getRoleName().equals("")) { if (taskReportForRepairs.getRoleName().equals("网格员")) { @@ -76,11 +77,8 @@ list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId()); } else if (taskReportForRepairs.getRoleName().equals("居民")) { taskReportForRepairs.setCreateUser(AuthUtil.getUserId()); taskReportForRepairs.setConfirmUserId(null); } } if (AuthUtil.getUserRole().equals("wygly")) { taskReportForRepairs.setRegionCode(""); taskReportForRepairs.setConfirmUserId(AuthUtil.getUserId()); } return page.setRecords(baseMapper.selectTaskReportForRepairsPage(page, taskReportForRepairs, list)); } src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
@@ -87,6 +87,30 @@ } } @Override public IPage<TaskVO> getBailReportingPage(IPage<TaskVO> page, TaskVO task) { Dept dept = deptService.getById(AuthUtil.getDeptId()); if (null != dept) { task.setCommunityCode(dept.getRegionCode()); } // 民警角色 if (AuthUtil.getUserRole().equals("mj")) { task.setUserId(AuthUtil.getUserId()); return page.setRecords(baseMapper.selectTaskPageBy(page, task)); } else { if (AuthUtil.getUserAccount().equals("18879306957")) { task.setCommunityCode("361102003027"); task.setUserId(null); } if (AuthUtil.getUserRole().equals("wgy")) { task.setUserId(AuthUtil.getUserId()); } // 非民警角色 List<TaskVO> taskVOS = baseMapper.getBailReportingPage(page, task); return page.setRecords(taskVOS); } } /** * 新增任务 * src/main/java/org/springblade/modules/task/vo/TaskVO.java
@@ -51,6 +51,9 @@ private String phone; private String streetCode; private String streetName; private String applyName; private String communityName; private String districtName; @ApiModelProperty("开始时间") private String startTime;