src/main/java/org/springblade/modules/grid/entity/GridWorkLogEntity.java
@@ -108,6 +108,12 @@ private Integer source; /** * 状态 1:待处理 2:已处理 */ @ApiModelProperty(value = "状态 1:待处理 2:已处理") private Integer status; /** * 创建人 */ @JsonSerialize(using = ToStringSerializer.class) src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.java
@@ -40,5 +40,11 @@ */ List<GridWorkLogVO> selectGridWorkLogPage(IPage page,@Param("gridWorkLog") GridWorkLogVO gridWorkLog); /** * 走访日志数量统计 * @param gridId 网格id * @param status 状态 * @return */ Integer getGridWorkCountHandleCount(@Param("gridId") Integer gridId,@Param("status") Integer status); } src/main/java/org/springblade/modules/grid/mapper/GridWorkLogMapper.xml
@@ -2,19 +2,6 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="org.springblade.modules.grid.mapper.GridWorkLogMapper"> <!-- 通用查询映射结果 --> <resultMap id="gridWorkLogResultMap" type="org.springblade.modules.grid.entity.GridWorkLogEntity"> <result column="id" property="id"/> <result column="house_code" property="houseCode"/> <result column="name" property="name"/> <result column="phone" property="phone"/> <result column="context" property="context"/> <result column="url" property="url"/> <result column="create_time" property="createTime"/> <result column="create_user" property="createUser"/> <result column="is_deleted" property="isDeleted"/> </resultMap> <!--自定义分页查询--> <select id="selectGridWorkLogPage" resultType="org.springblade.modules.grid.vo.GridWorkLogVO"> select @@ -35,8 +22,17 @@ <if test="gridWorkLog.type !=null"> and jgwl.type = #{gridWorkLog.type} </if> <if test="gridWorkLog.source !=null"> and jgwl.source = #{gridWorkLog.source} </if> <if test="gridWorkLog.status !=null"> and jgwl.status = #{gridWorkLog.status} </if> <if test="gridWorkLog.personType !=null"> and jgwl.person_type = #{gridWorkLog.personType} </if> <if test="gridWorkLog.gridId !=null"> and jgr.grid_id = #{gridWorkLog.gridId} </if> <if test="gridWorkLog.name !=null and gridWorkLog.name!=''"> and jh.name like concat('%',#{gridWorkLog.name},'%') @@ -55,5 +51,18 @@ </if> </select> <!--走访日志数量统计--> <select id="getGridWorkCountHandleCount" resultType="java.lang.Integer"> select count(*) from jczz_grid_work_log jgwl left join jczz_household jh on jgwl.household_id = jh.id and jh.is_deleted = 0 left join jczz_grid_range jgr on jgr.house_code=jh.house_code where jgwl.is_deleted = 0 <if test="status!=null"> and jgwl.status = #{status} </if> <if test="gridId!=null"> and jgr.grid_id = #{gridId} </if> </select> </mapper> src/main/java/org/springblade/modules/grid/service/IGridWorkLogService.java
@@ -40,4 +40,11 @@ IPage<GridWorkLogVO> selectGridWorkLogPage(IPage<GridWorkLogVO> page, GridWorkLogVO gridWorkLog); /** * 走访日志数量统计 * @param gridId 网格id * @param status 状态 * @return */ Integer getGridWorkCountHandleCount(Integer gridId, Integer status); } src/main/java/org/springblade/modules/grid/service/impl/GridWorkLogServiceImpl.java
@@ -16,9 +16,14 @@ */ package org.springblade.modules.grid.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.logging.log4j.util.Strings; import org.springblade.common.utils.SpringUtils; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.modules.grid.entity.GridWorkLogEntity; import org.springblade.modules.grid.entity.GridmanEntity; import org.springblade.modules.grid.service.IGridmanService; import org.springblade.modules.grid.vo.GridWorkLogVO; import org.springblade.modules.grid.mapper.GridWorkLogMapper; import org.springblade.modules.grid.service.IGridWorkLogService; @@ -28,6 +33,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.core.metadata.IPage; import java.util.List; /** * 网格工作日志表 服务实现类 @@ -48,8 +55,33 @@ if (null!=dept){ gridWorkLog.setRegionCode(dept.getRegionCode()); } if (!Strings.isBlank(gridWorkLog.getRoleName()) && gridWorkLog.getRoleName().equals("网格员")){ gridWorkLog.setGridId(getGridId()); } return page.setRecords(baseMapper.selectGridWorkLogPage(page, gridWorkLog)); } /** * 获取网格员id * @return */ private Integer getGridId() { QueryWrapper<GridmanEntity> wrapper = new QueryWrapper<>(); wrapper.eq("is_deleted",0).eq("user_id",AuthUtil.getUserId()); List<GridmanEntity> list = SpringUtils.getBean(IGridmanService.class).list(wrapper); if (list.size()>0){ return list.get(0).getGridId(); } return null; } /** * 走访日志数量统计 * @param gridId 网格id * @param status 状态 * @return */ @Override public Integer getGridWorkCountHandleCount(Integer gridId, Integer status) { return baseMapper.getGridWorkCountHandleCount(gridId,status); } } src/main/java/org/springblade/modules/grid/vo/GridWorkLogVO.java
@@ -66,6 +66,11 @@ private String gridName; /** * 网格id */ private Integer gridId; /** * 创建人姓名 */ @ApiModelProperty(value = "创建人姓名") @@ -76,4 +81,9 @@ */ private String regionCode; /** * 角色名称 */ private String roleName; } src/main/java/org/springblade/modules/task/controller/TaskController.java
@@ -1,19 +1,3 @@ /* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * Neither the name of the dreamlu.net developer nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * Author: Chill 庄骞 (smallchill@163.com) */ package org.springblade.modules.task.controller; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -22,7 +6,6 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.tool.api.R; @@ -32,7 +15,6 @@ import org.springblade.modules.task.vo.TaskVO; import org.springblade.modules.task.wrapper.TaskWrapper; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; /** @@ -45,7 +27,7 @@ @AllArgsConstructor @RequestMapping("blade-task/task") @Api(value = "任务表", tags = "任务表接口") public class TaskController extends BladeController { public class TaskController{ private final ITaskService taskService; @@ -129,7 +111,7 @@ @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { return R.status(taskService.deleteLogic(Func.toLongList(ids))); return R.status(taskService.removeByIds(Func.toLongList(ids))); } @GetMapping("/countNumber") src/main/java/org/springblade/modules/task/entity/TaskCampusReportingEventEntity.java
@@ -25,6 +25,7 @@ import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.util.Date; /** @@ -36,7 +37,9 @@ @Data @TableName("jczz_task_campus_reporting_event") @ApiModel(value = "TaskCampusReportingEvent对象", description = "校园安全检查任务表") public class TaskCampusReportingEventEntity { public class TaskCampusReportingEventEntity implements Serializable { private static final long serialVersionUID = 1L; /** 主键id */ @ApiModelProperty(value = "主键ID", example = "") src/main/java/org/springblade/modules/task/entity/TaskEntity.java
@@ -16,13 +16,15 @@ */ package org.springblade.modules.task.entity; import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import lombok.Data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import java.util.Date; import lombok.EqualsAndHashCode; import org.springblade.core.tenant.mp.TenantEntity; @@ -37,23 +39,42 @@ @Data @TableName("jczz_task") @ApiModel(value = "Task对象", description = "任务表") @EqualsAndHashCode(callSuper = true) public class TaskEntity extends TenantEntity { public class TaskEntity implements Serializable { private static final long serialVersionUID = 1L; /** * 主键 */ @JsonSerialize(using = ToStringSerializer.class) @ApiModelProperty("主键id") @TableId(value = "id", type = IdType.ASSIGN_ID) private Long id; /** * 任务名称 */ @ApiModelProperty(value = "任务名称") private String name; /** * 任务类型 1:综治任务 2: 住建任务 3: 公安任务 * 门牌地址编码 */ @ApiModelProperty(value = "任务类型 1:综治任务 2: 住建任务 3: 公安任务") @ApiModelProperty(value = "门牌地址编码") private String houseCode; /** 事件类型(1:取保候审,2旅馆 3打金店 4二手手机 5二手车 6 校园安全) */ @ApiModelProperty(value = "事件类型(1:取保候审,2旅馆 3打金店 4二手手机 5二手车 6 校园安全)", example = "") @TableField("report_type") private Integer reportType; /** * 类型 1:综治任务 2: 住建任务 3: 公安任务 */ @ApiModelProperty(value = "类型 1:综治任务 2: 住建任务 3: 公安任务") private Integer type; /** * 任务频次 1:一次性 2:周期性 * 频次 1:一次性 2:周期性 */ @ApiModelProperty(value = "任务频次 1:一次性 2:周期性") @ApiModelProperty(value = "频次 1:一次性 2:周期性") private Integer frequency; /** * 备注 @@ -62,27 +83,56 @@ private String remark; /** * 门牌地址编码 * 来源: 1:主动上报 2:系统自动下发 */ @ApiModelProperty(value = "门牌地址编码") private String houseCode; @ApiModelProperty(value = "来源: 1:主动上报 2:系统自动下发") private Integer source; @TableField(fill = FieldFill.INSERT) @ApiModelProperty(value = "创建时间") /** * 创建时间 */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @ApiModelProperty("创建时间") @TableField(fill = FieldFill.INSERT) private Date createTime; /** * 创建人 */ @JsonSerialize(using = ToStringSerializer.class) @ApiModelProperty("创建人") @TableField(fill = FieldFill.INSERT) private Long createUser; /** * 更新人 */ @JsonSerialize(using = ToStringSerializer.class) @ApiModelProperty("更新人") @TableField(fill = FieldFill.UPDATE) private Long updateUser; /** * 更新时间 */ @TableField(fill = FieldFill.UPDATE) @ApiModelProperty(value = "更新时间") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; /** * 状态 1:待审核 2:审核通过 3:审核不通过 4:待上报(场所负责人完善,由系统下发的任务) */ @ApiModelProperty(value = "状态 1:待审核 2:审核通过 3:审核不通过 4:待上报(场所负责人完善,由系统下发的任务)", example = "") private Integer status; /** 事件类型(1:取保候审,2旅馆 3打金店 4二手手机 5二手车 6 校园安全) */ @ApiModelProperty(value = "事件类型(1:取保候审,2旅馆 3打金店 4二手手机 5二手车 6 校园安全)", example = "") @TableField("report_type") private Integer reportType; /** * 是否已删除 0:否 1:是 */ @ApiModelProperty("是否已删除") private Integer isDeleted; } src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
@@ -39,8 +39,7 @@ jt.update_time, jt.update_user, jt.STATUS, jt.tenant_id, jt.create_dept, jt.source, jt.is_deleted, jt.house_code, jt.report_type @@ -118,8 +117,6 @@ <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 != '' "> src/main/java/org/springblade/modules/task/service/ITaskService.java
@@ -17,6 +17,7 @@ package org.springblade.modules.task.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import org.springblade.core.mp.base.BaseService; import org.springblade.modules.task.entity.TaskEntity; import org.springblade.modules.task.vo.TaskVO; @@ -27,7 +28,7 @@ * @author BladeX * @since 2023-11-06 */ public interface ITaskService extends BaseService<TaskEntity> { public interface ITaskService extends IService<TaskEntity> { /** * 自定义分页 src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
@@ -22,16 +22,18 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import liquibase.pro.packaged.W; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; import org.springblade.common.constant.DictConstant; import org.springblade.common.utils.SpringUtils; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.modules.category.entity.CategoryEntity; import org.springblade.modules.category.service.ICategoryService; import org.springblade.modules.grid.entity.GridWorkLogEntity; import org.springblade.modules.grid.entity.GridmanEntity; import org.springblade.modules.grid.service.IGridWorkLogService; import org.springblade.modules.grid.service.IGridmanService; import org.springblade.modules.house.service.IHouseRentalService; import org.springblade.modules.house.service.IHouseholdService; import org.springblade.modules.house.vo.HouseRentalTenantVO; @@ -59,7 +61,7 @@ * @since 2023-11-06 */ @Service public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, TaskEntity> implements ITaskService { public class TaskServiceImpl extends ServiceImpl<TaskMapper, TaskEntity> implements ITaskService { @Autowired private IPlaceService placeService; @@ -205,6 +207,8 @@ taskVO.setNeiCode(neiCode); taskVO.setReportType(2); taskVO.setIsDeleted(0); // 查询网格员对应的网格id Integer gridId = getGridId(); // 标签事件 Integer bqsj = baseMapper.selectTaskCount(taskVO); taskVO.setReportType(1); @@ -221,13 +225,31 @@ Integer czsh = iHouseRentalService.getStatisticsCount(houseRentalTenantVO); // 场所审核 Integer cssh = SpringUtils.getBean(IPlaceExtService.class).selectCount(roleType > 0 ? AuthUtil.getUserId() : null, neiCode, 1); // 走访日志 Integer zfrw = SpringUtils.getBean(IGridWorkLogService.class).getGridWorkCountHandleCount(gridId,1); // 设置 objectObjectHashMap.put("qbhs", qbhs); objectObjectHashMap.put("bqsj", bqsj); objectObjectHashMap.put("bsbx", bsbx); objectObjectHashMap.put("zhsh", zhsh); objectObjectHashMap.put("czsh", czsh); objectObjectHashMap.put("cssh", cssh); objectObjectHashMap.put("zfrw", zfrw); return objectObjectHashMap; } /** * 获取网格员id * @return */ private Integer getGridId() { QueryWrapper<GridmanEntity> wrapper = new QueryWrapper<>(); wrapper.eq("is_deleted",0).eq("user_id",AuthUtil.getUserId()); List<GridmanEntity> list = SpringUtils.getBean(IGridmanService.class).list(wrapper); if (list.size()>0){ return list.get(0).getGridId(); } return null; } @Override @@ -344,9 +366,11 @@ GridWorkLogEntity gridWorkLogEntity = new GridWorkLogEntity(); gridWorkLogEntity.setHouseholdId(household.getId()); gridWorkLogEntity.setType(2); gridWorkLogEntity.setPersonType(20); gridWorkLogEntity.setPersonType(1006); // 系统下发 gridWorkLogEntity.setSource(2); // 待处理 gridWorkLogEntity.setStatus(1); // 新增 gridWorkLogService.save(gridWorkLogEntity); } @@ -534,6 +558,8 @@ taskEntity.setCreateTime(new Date()); taskEntity.setHouseCode(houseCode); taskEntity.setReportType(reportType); // 系统下发 taskEntity.setSource(2); // 待场所负责人上报完善处理 taskEntity.setStatus(4); // 新增