From af21084fa4d1e5f8432f61fbd26a3e4e99495616 Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Thu, 11 Jan 2024 18:03:49 +0800
Subject: [PATCH] 三色任务完善

---
 src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.java                          |    7 
 src/main/java/org/springblade/modules/task/entity/TaskLabelReportingEventEntity.java             |  138 +++++--
 src/main/java/org/springblade/modules/task/service/ITaskHotelReportingService.java               |    5 
 src/main/java/org/springblade/modules/task/controller/TaskLabelReportingEventController.java     |    4 
 src/main/java/org/springblade/modules/task/entity/TaskHotelReportingEntity.java                  |   99 ++++-
 src/main/java/org/springblade/modules/place/mapper/PlaceMapper.java                              |    5 
 src/main/java/org/springblade/modules/place/service/IPlaceService.java                           |    6 
 src/main/java/org/springblade/modules/task/entity/TaskCampusReportingEventEntity.java            |   49 ++
 src/main/java/org/springblade/modules/task/vo/TaskLabelReportingEventVO.java                     |    6 
 src/main/java/org/springblade/modules/task/controller/TaskHotelReportingController.java          |   10 
 src/main/java/org/springblade/modules/task/vo/TaskHotelReportingVO.java                          |    5 
 src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java               |   10 
 src/main/java/org/springblade/modules/task/controller/TaskCampusReportingEventController.java    |    6 
 src/main/java/org/springblade/modules/task/service/impl/TaskCampusReportingEventServiceImpl.java |   16 +
 src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java                     |  293 +++++++++++++++--
 src/main/java/org/springblade/modules/task/service/impl/TaskLabelReportingEventServiceImpl.java  |   19 +
 src/main/java/org/springblade/modules/grid/entity/GridWorkLogEntity.java                         |   25 
 src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java                   |    8 
 src/main/java/org/springblade/modules/task/service/ITaskLabelReportingEventService.java          |    5 
 src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml                               |   69 ++++
 src/main/java/org/springblade/modules/task/service/impl/TaskHotelReportingServiceImpl.java       |   20 +
 src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml                           |   90 +++++
 src/main/java/org/springblade/modules/task/service/ITaskService.java                             |    5 
 src/main/java/org/springblade/modules/house/service/IHouseholdService.java                       |    7 
 src/main/java/org/springblade/xxljob/jobhandler/LabelHandleJob.java                              |    6 
 25 files changed, 739 insertions(+), 174 deletions(-)

diff --git a/src/main/java/org/springblade/modules/grid/entity/GridWorkLogEntity.java b/src/main/java/org/springblade/modules/grid/entity/GridWorkLogEntity.java
index 534cef5..74e41e6 100644
--- a/src/main/java/org/springblade/modules/grid/entity/GridWorkLogEntity.java
+++ b/src/main/java/org/springblade/modules/grid/entity/GridWorkLogEntity.java
@@ -16,10 +16,7 @@
  */
 package org.springblade.modules.grid.entity;
 
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
-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;
@@ -52,12 +49,12 @@
 	@ApiModelProperty("主键id")
 	@TableId(value = "id", type = IdType.ASSIGN_ID)
 	private Long id;
-
-	/**
-	 * 房屋编号
-	 */
-	@ApiModelProperty(value = "房屋编号")
-	private String houseCode;
+//
+//	/**
+//	 * 房屋编号
+//	 */
+//	@ApiModelProperty(value = "房屋编号")
+//	private String houseCode;
 
 	/**
 	 * 走访类型
@@ -105,10 +102,17 @@
 	private Date workTime;
 
 	/**
+	 * 来源: 1:主动上报  2:系统自动下发
+	 */
+	@ApiModelProperty(value = "来源: 1:主动上报  2:系统自动下发")
+	private Integer source;
+
+	/**
 	 * 创建人
 	 */
 	@JsonSerialize(using = ToStringSerializer.class)
 	@ApiModelProperty("创建人")
+	@TableField(fill = FieldFill.INSERT)
 	private Long createUser;
 
 	/**
@@ -117,6 +121,7 @@
 	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	@ApiModelProperty("创建时间")
+	@TableField(fill = FieldFill.INSERT)
 	private Date createTime;
 
 	/**
diff --git a/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.java b/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.java
index fd33ea5..b06f2d6 100644
--- a/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.java
+++ b/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.java
@@ -123,4 +123,11 @@
 	List<HouseholdVO> selectHouseholdList(@Param("household") HouseholdVO household);
 
 	List<HouseholdVO> getKeynotePersonnelPage(IPage<HouseholdVO> page, @Param("household") HouseholdVO household);
+
+	/**
+	 * 根据人员标签编号集合查询对应的住户(按颜色区分近多少天没有发过任务的住户)
+	 * @param list
+	 * @return
+	 */
+	List<HouseholdVO> getHouseholdListByParam(@Param("list") List<Integer> list);
 }
diff --git a/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml b/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
index 7251b49..c9c5a95 100644
--- a/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
+++ b/src/main/java/org/springblade/modules/house/mapper/HouseholdMapper.xml
@@ -845,4 +845,94 @@
         </where>
     </select>
 
+    <!--根据人员标签编号集合查询对应的住户(按颜色区分近多少天没有发过任务的住户)-->
+    <select id="getHouseholdListByParam" resultType="org.springblade.modules.house.vo.HouseholdVO">
+        select jh.* from jczz_household jh
+        left join jczz_user_house_label juhl on juhl.household_id = jh.id
+        where jh.is_deleted = 0
+        and juhl.lable_type = 1
+        and juhl.color = '#30D17C'
+        and jh.id in (
+        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=30
+        )
+        <choose>
+            <when test="list!=null and list.size()>0">
+                and juhl.label_id in
+                <foreach collection="list" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </when>
+            <otherwise>
+                and juhl.label_id in ('')
+            </otherwise>
+        </choose>
+        union all
+        (
+        select jh.* from jczz_household jh
+        left join jczz_user_house_label juhl on juhl.household_id = jh.id
+        where jh.is_deleted = 0
+        and juhl.lable_type = 1
+        and juhl.color = '#FFB42B'
+        and jh.id in (
+        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=14
+        )
+        <choose>
+            <when test="list!=null and list.size()>0">
+                and juhl.label_id in
+                <foreach collection="list" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </when>
+            <otherwise>
+                and juhl.label_id in ('')
+            </otherwise>
+        </choose>
+        )
+        union all
+        (
+        select jh.* from jczz_household jh
+        left join jczz_user_house_label juhl on juhl.household_id = jh.id
+        where jh.is_deleted = 0
+        and juhl.lable_type = 1
+        and juhl.color = '#EA1F1F'
+        and jh.id in (
+        select household_id from jczz_grid_work_log where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=7
+        )
+        <choose>
+            <when test="list!=null and list.size()>0">
+                and juhl.label_id in
+                <foreach collection="list" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </when>
+            <otherwise>
+                and juhl.label_id in ('')
+            </otherwise>
+        </choose>
+        )
+        union all
+        (
+        select jh.* from jczz_household jh
+        left join jczz_user_house_label juhl on juhl.household_id = jh.id
+        where jh.is_deleted = 0 and juhl.lable_type = 1
+        and jh.id not in (
+        select household_id from jczz_grid_work_log where is_deleted = 0
+        and household_id is not null
+        and source = 2
+        group by household_id
+        )
+        <choose>
+            <when test="list!=null and list.size()>0">
+                and juhl.label_id in
+                <foreach collection="list" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </when>
+            <otherwise>
+                and juhl.label_id in ('')
+            </otherwise>
+        </choose>
+        )
+    </select>
+
 </mapper>
diff --git a/src/main/java/org/springblade/modules/house/service/IHouseholdService.java b/src/main/java/org/springblade/modules/house/service/IHouseholdService.java
index 746c4a7..525f893 100644
--- a/src/main/java/org/springblade/modules/house/service/IHouseholdService.java
+++ b/src/main/java/org/springblade/modules/house/service/IHouseholdService.java
@@ -107,4 +107,11 @@
 	List<HouseholdVO> selectHouseholdList(HouseholdVO household);
 
 	IPage<HouseholdVO> getKeynotePersonnelPage(IPage<HouseholdVO> page, HouseholdVO household);
+
+	/**
+	 * 根据人员标签编号集合查询对应的住户(按颜色区分近多少天没有发过任务的住户)
+	 * @param list
+	 * @return
+	 */
+    List<HouseholdVO> getHouseholdListByParam(List<Integer> list);
 }
diff --git a/src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java b/src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java
index f8b7a33..9a6fa2d 100644
--- a/src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java
+++ b/src/main/java/org/springblade/modules/house/service/impl/HouseholdServiceImpl.java
@@ -490,4 +490,14 @@
 		System.out.println("selectHouseholdPage:" + stopWatch.getTotalTimeMillis());
 		return page.setRecords(householdVOS);
 	}
+
+	/**
+	 * 根据人员标签编号集合查询对应的住户(按颜色区分近多少天没有发过任务的住户)
+	 * @param list
+	 * @return
+	 */
+	@Override
+	public List<HouseholdVO> getHouseholdListByParam(List<Integer> list) {
+		return baseMapper.getHouseholdListByParam(list);
+	}
 }
diff --git a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.java b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.java
index 649c88e..71537e5 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.java
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.java
@@ -110,10 +110,11 @@
 	List<PlaceEntity> placeAndRelHandle();
 
 	/**
-	 * 根据标签编号集合查询对应的场所
+	 * 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所)4部分数据(三种颜色对应的+从来没有发过的)
 	 * @param stringList
+	 * @param tableName
 	 * @return
 	 */
     List<PlaceVO> getPlaceListByParam(@Param("list") List<String> stringList,
-									  @Param("color") String color);
+									  @Param("tableName") String tableName);
 }
diff --git a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
index 37d6417..13fcf7f 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -187,10 +187,13 @@
 
     <!--根据标签编号集合查询对应的场所-->
     <select id="getPlaceListByParam" resultType="org.springblade.modules.place.vo.PlaceVO">
-        select jp.* from jczz_place jp
+        select jp.*,jppl.poi_code as label from jczz_place jp
         left join jczz_place_poi_label jppl on jppl.place_id = jp.id
         where jp.is_deleted = 0 and jppl.type = 3
-        and jppl.color = #{color}
+        and jppl.color = '#30D17C'
+        and jp.id in (
+            select place_id from ${tableName} where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=30
+        )
         <choose>
             <when test="list!=null and list.size()>0">
                 and jppl.poi_code in
@@ -202,5 +205,67 @@
                 and jppl.poi_code in ('')
             </otherwise>
         </choose>
+        union all
+        (
+        select jp.* from jczz_place jp
+        left join jczz_place_poi_label jppl on jppl.place_id = jp.id
+        where jp.is_deleted = 0 and jppl.type = 3
+        and jppl.color = '#FFB42B'
+        and jp.id in (
+            select place_id from ${tableName} where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=14
+        )
+        <choose>
+            <when test="list!=null and list.size()>0">
+                and jppl.poi_code in
+                <foreach collection="list" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </when>
+            <otherwise>
+                and jppl.poi_code in ('')
+            </otherwise>
+        </choose>
+        )
+        union all
+        (
+        select jp.* from jczz_place jp
+        left join jczz_place_poi_label jppl on jppl.place_id = jp.id
+        where jp.is_deleted = 0 and jppl.type = 3
+        and jppl.color = '#EA1F1F'
+        and jp.id in (
+            select place_id from ${tableName} where is_deleted = 0 and source = 2 and TIMESTAMPDIFF( day, now(), create_time )=7
+        )
+        <choose>
+            <when test="list!=null and list.size()>0">
+                and jppl.poi_code in
+                <foreach collection="list" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </when>
+            <otherwise>
+                and jppl.poi_code in ('')
+            </otherwise>
+        </choose>
+        )
+        union all
+        (
+        select jp.* from jczz_place jp
+        left join jczz_place_poi_label jppl on jppl.place_id = jp.id
+        where jp.is_deleted = 0 and jppl.type = 3
+        and jp.id not in (
+            select place_id from ${tableName} where is_deleted = 0 and source = 2 and place_id is not null group by place_id
+        )
+        <choose>
+            <when test="list!=null and list.size()>0">
+                and jppl.poi_code in
+                <foreach collection="list" item="id" separator="," open="(" close=")">
+                    #{id}
+                </foreach>
+            </when>
+            <otherwise>
+                and jppl.poi_code in ('')
+            </otherwise>
+        </choose>
+        )
     </select>
 </mapper>
diff --git a/src/main/java/org/springblade/modules/place/service/IPlaceService.java b/src/main/java/org/springblade/modules/place/service/IPlaceService.java
index ce93700..5ec8345 100644
--- a/src/main/java/org/springblade/modules/place/service/IPlaceService.java
+++ b/src/main/java/org/springblade/modules/place/service/IPlaceService.java
@@ -124,12 +124,12 @@
     Object placeAndRelHandle();
 
 	/**
-	 * 根据标签编号集合查询对应的场所
+	 * 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所)
 	 * @param stringList
-	 * @param color
+	 * @param tableName
 	 * @return
 	 */
-	List<PlaceVO> getPlaceListByParam(List<String> stringList,String color);
+	List<PlaceVO> getPlaceListByParam(List<String> stringList,String tableName);
 
 	/**
 	 * 删除
diff --git a/src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java b/src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java
index 1119a39..55000e5 100644
--- a/src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java
+++ b/src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java
@@ -848,14 +848,14 @@
 	}
 
 	/**
-	 * 根据标签编号集合查询对应的场所
+	 * 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所)
 	 * @param stringList
-	 * @param color
+	 * @param tableName
 	 * @return
 	 */
 	@Override
-	public List<PlaceVO> getPlaceListByParam(List<String> stringList,String color) {
-		return baseMapper.getPlaceListByParam(stringList,color);
+	public List<PlaceVO> getPlaceListByParam(List<String> stringList,String tableName) {
+		return baseMapper.getPlaceListByParam(stringList,tableName);
 	}
 
 	/**
diff --git a/src/main/java/org/springblade/modules/task/controller/TaskCampusReportingEventController.java b/src/main/java/org/springblade/modules/task/controller/TaskCampusReportingEventController.java
index 92f08cb..ff06ea4 100644
--- a/src/main/java/org/springblade/modules/task/controller/TaskCampusReportingEventController.java
+++ b/src/main/java/org/springblade/modules/task/controller/TaskCampusReportingEventController.java
@@ -46,7 +46,7 @@
 @AllArgsConstructor
 @RequestMapping("blade-taskCampusReportingEvent/taskCampusReportingEvent")
 @Api(value = "校园安全检查任务表", tags = "校园安全检查任务表接口")
-public class TaskCampusReportingEventController extends BladeController {
+public class TaskCampusReportingEventController{
 
 	private final ITaskCampusReportingEventService taskCampusReportingEventService;
 
@@ -56,9 +56,9 @@
 	@GetMapping("/detail")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入taskCampusReportingEvent")
-	public R<TaskCampusReportingEventVO> detail(TaskCampusReportingEventEntity taskCampusReportingEvent) {
+	public R<TaskCampusReportingEventEntity> detail(TaskCampusReportingEventEntity taskCampusReportingEvent) {
 		TaskCampusReportingEventEntity detail = taskCampusReportingEventService.getOne(Condition.getQueryWrapper(taskCampusReportingEvent));
-		return R.data(TaskCampusReportingEventWrapper.build().entityVO(detail));
+		return R.data(detail);
 	}
 	/**
 	 * 校园安全检查任务表 分页
diff --git a/src/main/java/org/springblade/modules/task/controller/TaskHotelReportingController.java b/src/main/java/org/springblade/modules/task/controller/TaskHotelReportingController.java
index 93d7ccc..8b107ed 100644
--- a/src/main/java/org/springblade/modules/task/controller/TaskHotelReportingController.java
+++ b/src/main/java/org/springblade/modules/task/controller/TaskHotelReportingController.java
@@ -46,7 +46,7 @@
 @AllArgsConstructor
 @RequestMapping("blade-taskHotelReporting/taskHotelReporting")
 @Api(value = "旅馆安全自查任务", tags = "旅馆安全自查任务接口")
-public class TaskHotelReportingController extends BladeController {
+public class TaskHotelReportingController{
 
 	private final ITaskHotelReportingService taskHotelReportingService;
 
@@ -56,9 +56,9 @@
 	@GetMapping("/detail")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入taskHotelReporting")
-	public R<TaskHotelReportingVO> detail(TaskHotelReportingEntity taskHotelReporting) {
+	public R<TaskHotelReportingEntity> detail(TaskHotelReportingEntity taskHotelReporting) {
 		TaskHotelReportingEntity detail = taskHotelReportingService.getOne(Condition.getQueryWrapper(taskHotelReporting));
-		return R.data(TaskHotelReportingWrapper.build().entityVO(detail));
+		return R.data(detail);
 	}
 	/**
 	 * 旅馆安全自查任务 分页
@@ -98,7 +98,7 @@
 	@PostMapping("/update")
 	@ApiOperationSupport(order = 5)
 	@ApiOperation(value = "修改", notes = "传入taskHotelReporting")
-	public R update(@Valid @RequestBody TaskHotelReportingEntity taskHotelReporting) throws Exception {
+	public R update(@Valid @RequestBody TaskHotelReportingVO taskHotelReporting) throws Exception {
 		return R.status(taskHotelReportingService.updateHotelReporting(taskHotelReporting));
 	}
 
@@ -119,7 +119,7 @@
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "逻辑删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(taskHotelReportingService.deleteLogic(Func.toLongList(ids)));
+		return R.status(taskHotelReportingService.removeByIds(Func.toLongList(ids)));
 	}
 
 
diff --git a/src/main/java/org/springblade/modules/task/controller/TaskLabelReportingEventController.java b/src/main/java/org/springblade/modules/task/controller/TaskLabelReportingEventController.java
index 0daf64a..fef6404 100644
--- a/src/main/java/org/springblade/modules/task/controller/TaskLabelReportingEventController.java
+++ b/src/main/java/org/springblade/modules/task/controller/TaskLabelReportingEventController.java
@@ -98,7 +98,7 @@
 	@PostMapping("/update")
 	@ApiOperationSupport(order = 5)
 	@ApiOperation(value = "修改", notes = "传入taskLabelReportingEvent")
-	public R update(@Valid @RequestBody TaskLabelReportingEventEntity taskLabelReportingEvent) throws Exception {
+	public R update(@Valid @RequestBody TaskLabelReportingEventVO taskLabelReportingEvent) throws Exception {
 		return R.status(taskLabelReportingEventService.updateLabelReporting(taskLabelReportingEvent));
 	}
 
@@ -119,7 +119,7 @@
 	@ApiOperationSupport(order = 7)
 	@ApiOperation(value = "逻辑删除", notes = "传入ids")
 	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
-		return R.status(taskLabelReportingEventService.deleteLogic(Func.toLongList(ids)));
+		return R.status(taskLabelReportingEventService.removeByIds(Func.toLongList(ids)));
 	}
 
 
diff --git a/src/main/java/org/springblade/modules/task/entity/TaskCampusReportingEventEntity.java b/src/main/java/org/springblade/modules/task/entity/TaskCampusReportingEventEntity.java
index 93a41a9..a978680 100644
--- a/src/main/java/org/springblade/modules/task/entity/TaskCampusReportingEventEntity.java
+++ b/src/main/java/org/springblade/modules/task/entity/TaskCampusReportingEventEntity.java
@@ -41,7 +41,7 @@
 	/** 主键id */
 	@ApiModelProperty(value = "主键ID", example = "")
 	@TableId(value = "id", type = IdType.AUTO)
-	private Integer id;
+	private Long id;
 
 	/** 任务ID */
 	@ApiModelProperty(value = "任务ID", example = "")
@@ -53,15 +53,15 @@
 	@TableField("place_id")
 	private Long placeId;
 
-	/** 小区ID */
-	@ApiModelProperty(value = "小区ID", example = "")
-	@TableField("district_id")
-	private String districtId;
-
-	/** 小区名称 */
-	@ApiModelProperty(value = "小区名称", example = "")
-	@TableField("district_name")
-	private String districtName;
+//	/** 小区ID */
+//	@ApiModelProperty(value = "小区ID", example = "")
+//	@TableField("district_id")
+//	private String districtId;
+//
+//	/** 小区名称 */
+//	@ApiModelProperty(value = "小区名称", example = "")
+//	@TableField("district_name")
+//	private String districtName;
 
 	/** 自查时间 */
 	@ApiModelProperty(value = "自查时间", example = "")
@@ -125,8 +125,10 @@
 	@TableField("confirm_notion")
 	private String confirmNotion;
 
-	/** 确认标记 */
-	@ApiModelProperty(value = "确认标记", example = "")
+	/**
+	 * 确认标记 1:待审核  2:审核通过  3:审核不通过  4:待上报(场所负责人完善,由系统下发的任务)
+	 */
+	@ApiModelProperty(value = "确认标记 1:待审核  2:审核通过  3:审核不通过  4:待上报(场所负责人完善,由系统下发的任务)", example = "")
 	@TableField("confirm_flag")
 	private String confirmFlag;
 
@@ -215,6 +217,12 @@
 	private String foImageUrls;
 
 	/**
+	 * 来源: 1:主动上报  2:系统自动下发
+	 */
+	@ApiModelProperty(value = "来源: 1:主动上报  2:系统自动下发")
+	private Integer source;
+
+	/**
 	 * 创建时间
 	 */
 	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@@ -232,10 +240,21 @@
 	private Long createUser;
 
 	/**
-	 * 来源: 1:主动上报  2:系统自动下发
+	 * 更新人
 	 */
-	@ApiModelProperty(value = "来源: 1:主动上报  2:系统自动下发")
-	private Integer source;
+	@JsonSerialize(using = ToStringSerializer.class)
+	@ApiModelProperty("更新人")
+	@TableField(fill = FieldFill.UPDATE)
+	private String 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;
 
 	/**
 	 * 是否已删除 0:否  1:是
diff --git a/src/main/java/org/springblade/modules/task/entity/TaskHotelReportingEntity.java b/src/main/java/org/springblade/modules/task/entity/TaskHotelReportingEntity.java
index e3a83c8..5fb45d2 100644
--- a/src/main/java/org/springblade/modules/task/entity/TaskHotelReportingEntity.java
+++ b/src/main/java/org/springblade/modules/task/entity/TaskHotelReportingEntity.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,8 +39,17 @@
 @Data
 @TableName("jczz_task_hotel_reporting")
 @ApiModel(value = "TaskHotelReporting对象", description = "旅馆安全自查任务")
-@EqualsAndHashCode(callSuper = true)
-public class TaskHotelReportingEntity extends TenantEntity {
+public class TaskHotelReportingEntity implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@JsonSerialize(using = ToStringSerializer.class)
+	@ApiModelProperty("主键id")
+	@TableId(value = "id", type = IdType.ASSIGN_ID)
+	private Long id;
 
 	/**
 	 * 任务id
@@ -55,16 +66,16 @@
 	 */
 	@ApiModelProperty(value = "场所ID")
 	private Long placeId;
-	/**
-	 * 小区ID
-	 */
-	@ApiModelProperty(value = "小区ID")
-	private String districtId;
-	/**
-	 * 小区名称
-	 */
-	@ApiModelProperty(value = "小区名称")
-	private String districtName;
+//	/**
+//	 * 小区ID
+//	 */
+//	@ApiModelProperty(value = "小区ID")
+//	private String districtId;
+//	/**
+//	 * 小区名称
+//	 */
+//	@ApiModelProperty(value = "小区名称")
+//	private String districtName;
 	/**
 	 * 自查时间
 	 */
@@ -148,6 +159,11 @@
 	@ApiModelProperty(value = "是否完全实名制登记")
 	private String realName;
 	/**
+	 * 安全通道有无
+	 */
+	@ApiModelProperty(value = "安全通道有无")
+	private String scFlag;
+	/**
 	 * 确认时间
 	 */
 	@ApiModelProperty(value = "确认时间")
@@ -160,36 +176,65 @@
 	@ApiModelProperty(value = "确认用户ID")
 	private Long confirmUserId;
 	/**
-	 * 确认用户ID
+	 * 确认用户姓名
 	 */
-	@ApiModelProperty(value = "确认用户ID")
+	@ApiModelProperty(value = "确认用户姓名")
 	private String confirmUserName;
-	/**
-	 * 安全通道有无
-	 */
-	@ApiModelProperty(value = "安全通道有无")
-	private String scFlag;
 	/**
 	 * 确认意见
 	 */
 	@ApiModelProperty(value = "确认意见")
 	private String confirmNotion;
-	/**
-	 * 确认标记
-	 */
-	@ApiModelProperty(value = "确认标记")
-	private String confirmFlag;
 
+	/**
+	 * 确认标记 1:待审核  2:审核通过  3:审核不通过  4:待上报(场所负责人完善,由系统下发的任务)
+	 */
+	@ApiModelProperty(value = "确认标记 1:待审核  2:审核通过  3:审核不通过 4:待上报(场所负责人完善,由系统下发的任务)")
+	private String confirmFlag;
+	/**
+	 * 来源: 1:主动上报  2:系统自动下发
+	 */
+	@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")
 	private Date createTime;
 
+	/**
+	 * 创建人
+	 */
+	@JsonSerialize(using = ToStringSerializer.class)
+	@ApiModelProperty("创建人")
+	@TableField(fill = FieldFill.INSERT)
+	private String createUser;
+
+	/**
+	 * 更新人
+	 */
+	@JsonSerialize(using = ToStringSerializer.class)
+	@ApiModelProperty("更新人")
+	@TableField(fill = FieldFill.UPDATE)
+	private String 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;
 
+	/**
+	 * 是否已删除 0:否  1:是
+	 */
+	@ApiModelProperty("是否已删除")
+	private Integer isDeleted;
+
 }
diff --git a/src/main/java/org/springblade/modules/task/entity/TaskLabelReportingEventEntity.java b/src/main/java/org/springblade/modules/task/entity/TaskLabelReportingEventEntity.java
index ebd151f..75b779c 100644
--- a/src/main/java/org/springblade/modules/task/entity/TaskLabelReportingEventEntity.java
+++ b/src/main/java/org/springblade/modules/task/entity/TaskLabelReportingEventEntity.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 java.lang.Double;
 import lombok.EqualsAndHashCode;
@@ -38,9 +40,17 @@
 @Data
 @TableName("jczz_task_label_reporting_event")
 @ApiModel(value = "TaskLabelReportingEvent对象", description = "打金店报事")
-@EqualsAndHashCode(callSuper = true)
-public class TaskLabelReportingEventEntity extends TenantEntity {
+public class TaskLabelReportingEventEntity implements Serializable {
 
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	@JsonSerialize(using = ToStringSerializer.class)
+	@ApiModelProperty("主键id")
+	@TableId(value = "id", type = IdType.ASSIGN_ID)
+	private Long id;
 	/**
 	 * 任务id
 	 */
@@ -51,16 +61,16 @@
 	 */
 	@ApiModelProperty(value = "场所ID")
 	private Long placeId;
-	/**
-	 * 房屋ID
-	 */
-	@ApiModelProperty(value = "房屋ID")
-	private String houseId;
-	/**
-	 * 社区ID
-	 */
-	@ApiModelProperty(value = "社区ID")
-	private String districtId;
+//	/**
+//	 * 房屋ID
+//	 */
+//	@ApiModelProperty(value = "房屋ID")
+//	private String houseId;
+//	/**
+//	 * 社区ID
+//	 */
+//	@ApiModelProperty(value = "社区ID")
+//	private String districtId;
 	/**
 	 * 发生时间
 	 */
@@ -75,25 +85,31 @@
 	@ApiModelProperty(value = "用户ID")
 	private Long userId;
 	/**
+	 * 用户姓名
+	 */
+	@ApiModelProperty(value = "用户姓名")
+	private String owner;
+	/**
+	 * 用户手机号
+	 */
+	@ApiModelProperty(value = "用户手机号")
+	private String phoneNumber;
+	/**
 	 * 身份证图片URLS
 	 */
 	@ApiModelProperty(value = "身份证图片URLS")
 	private String imageUrls;
 	/**
-	 * 社区名称
+	 * 场所名称
 	 */
-	@ApiModelProperty(value = "社区名称")
+	@ApiModelProperty(value = "场所名称")
 	private String districtName;
 	/**
-	 * 事件类型
+	 * 事件类型 1:打金店 2:二手手机 3:二手车
 	 */
 	@ApiModelProperty(value = "事件类型")
 	private String eventType;
-	/**
-	 * 确认标记
-	 */
-	@ApiModelProperty(value = "确认标记")
-	private String confirmFlag;
+
 	/**
 	 * 确认人ID
 	 */
@@ -106,36 +122,35 @@
 	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	private Date confirmTime;
-	/**
-	 * 位置
-	 */
-	@ApiModelProperty(value = "位置")
-	private String localtion;
+
 	/**
 	 * 确认意见
 	 */
 	@ApiModelProperty(value = "确认意见")
 	private String confirmNotion;
+
 	/**
-	 * 业主
+	 * 确认标记 1:待审核  2:审核通过  3:审核不通过  4:待上报(场所负责人完善,由系统下发的任务)
 	 */
-	@ApiModelProperty(value = "业主")
-	private String owner;
+	@ApiModelProperty(value = "确认标记 1:待审核  2:审核通过  3:审核不通过  4:待上报(场所负责人完善,由系统下发的任务)")
+	private String confirmFlag;
+
 	/**
-	 * 手机号
+	 * 位置
 	 */
-	@ApiModelProperty(value = "手机号")
-	private String phoneNumber;
-	/**
-	 * 房屋名称
-	 */
-	@ApiModelProperty(value = "房屋名称")
-	private String houseName;
-	/**
-	 * 任务名称
-	 */
-	@ApiModelProperty(value = "任务名称")
-	private String taskName;
+	@ApiModelProperty(value = "位置")
+	private String localtion;
+//
+//	/**
+//	 * 房屋名称
+//	 */
+//	@ApiModelProperty(value = "房屋名称")
+//	private String houseName;
+//	/**
+//	 * 任务名称
+//	 */
+//	@ApiModelProperty(value = "任务名称")
+//	private String taskName;
 	/**
 	 * 对象电话
 	 */
@@ -172,16 +187,51 @@
 	@ApiModelProperty(value = "标签名称")
 	private String labelName;
 
+	/**
+	 * 来源: 1:主动上报  2:系统自动下发
+	 */
+	@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")
 	private Date createTime;
 
+	/**
+	 * 创建人
+	 */
+	@JsonSerialize(using = ToStringSerializer.class)
+	@ApiModelProperty("创建人")
+	@TableField(fill = FieldFill.INSERT)
+	private String createUser;
+
+
+	/**
+	 * 更新人
+	 */
+	@JsonSerialize(using = ToStringSerializer.class)
+	@ApiModelProperty("更新人")
+	@TableField(fill = FieldFill.UPDATE)
+	private String 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;
 
+
+	/**
+	 * 是否已删除 0:否  1:是
+	 */
+	@ApiModelProperty("是否已删除")
+	private Integer isDeleted;
+
+
+
 }
diff --git a/src/main/java/org/springblade/modules/task/service/ITaskHotelReportingService.java b/src/main/java/org/springblade/modules/task/service/ITaskHotelReportingService.java
index deb674e..0282741 100644
--- a/src/main/java/org/springblade/modules/task/service/ITaskHotelReportingService.java
+++ b/src/main/java/org/springblade/modules/task/service/ITaskHotelReportingService.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.dto.TaskHotelReportingDTO;
 import org.springblade.modules.task.entity.TaskHotelReportingEntity;
@@ -28,7 +29,7 @@
  * @author BladeX
  * @since 2023-11-06
  */
-public interface ITaskHotelReportingService extends BaseService<TaskHotelReportingEntity> {
+public interface ITaskHotelReportingService extends IService<TaskHotelReportingEntity> {
 
 	/**
 	 * 自定义分页
@@ -47,5 +48,5 @@
 	 */
 	boolean saveHotelReporting(TaskHotelReportingDTO taskHotelReporting);
 
-	Boolean updateHotelReporting(TaskHotelReportingEntity taskHotelReporting) throws Exception;
+	Boolean updateHotelReporting(TaskHotelReportingVO taskHotelReporting) throws Exception;
 }
diff --git a/src/main/java/org/springblade/modules/task/service/ITaskLabelReportingEventService.java b/src/main/java/org/springblade/modules/task/service/ITaskLabelReportingEventService.java
index 99d72b5..418e77f 100644
--- a/src/main/java/org/springblade/modules/task/service/ITaskLabelReportingEventService.java
+++ b/src/main/java/org/springblade/modules/task/service/ITaskLabelReportingEventService.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.dto.TaskLabelReportingEventDTO;
 import org.springblade.modules.task.entity.TaskLabelReportingEventEntity;
@@ -28,7 +29,7 @@
  * @author BladeX
  * @since 2023-11-06
  */
-public interface ITaskLabelReportingEventService extends BaseService<TaskLabelReportingEventEntity> {
+public interface ITaskLabelReportingEventService extends IService<TaskLabelReportingEventEntity> {
 
 	/**
 	 * 自定义分页
@@ -42,5 +43,5 @@
 
 	Boolean saveReportingEven(TaskLabelReportingEventDTO taskLabelReportingEvent);
 
-	Boolean updateLabelReporting(TaskLabelReportingEventEntity taskLabelReportingEvent) throws Exception;
+	Boolean updateLabelReporting(TaskLabelReportingEventVO taskLabelReportingEvent) throws Exception;
 }
diff --git a/src/main/java/org/springblade/modules/task/service/ITaskService.java b/src/main/java/org/springblade/modules/task/service/ITaskService.java
index 3faf77f..bd6ed8f 100644
--- a/src/main/java/org/springblade/modules/task/service/ITaskService.java
+++ b/src/main/java/org/springblade/modules/task/service/ITaskService.java
@@ -73,9 +73,8 @@
 
 	/**
 	 * 根据类型创建任务
-	 * @param reportType 任务/事件类型
-	 * @param color 参数
+	 * @param param 参数
 	 * @return
 	 */
-    boolean createTaskJob(Integer reportType, String color);
+    boolean createTaskJob(String param);
 }
diff --git a/src/main/java/org/springblade/modules/task/service/impl/TaskCampusReportingEventServiceImpl.java b/src/main/java/org/springblade/modules/task/service/impl/TaskCampusReportingEventServiceImpl.java
index f89b723..862a924 100644
--- a/src/main/java/org/springblade/modules/task/service/impl/TaskCampusReportingEventServiceImpl.java
+++ b/src/main/java/org/springblade/modules/task/service/impl/TaskCampusReportingEventServiceImpl.java
@@ -16,11 +16,14 @@
  */
 package org.springblade.modules.task.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.commons.lang3.StringUtils;
 import org.springblade.common.constant.DictConstant;
 import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.modules.place.entity.PlaceEntity;
+import org.springblade.modules.place.service.IPlaceService;
 import org.springblade.modules.task.dto.TaskCampusReportingEventDTO;
 import org.springblade.modules.task.entity.TaskCampusReportingEventEntity;
 import org.springblade.modules.task.mapper.TaskCampusReportingEventMapper;
@@ -47,16 +50,29 @@
 	@Lazy
 	private ITaskService taskService;
 
+	@Autowired
+	private IPlaceService placeService;
+
 	@Override
 	public IPage<TaskCampusReportingEventVO> selectTaskCampusReportingEventPage(IPage<TaskCampusReportingEventVO> page, TaskCampusReportingEventVO taskCampusReportingEvent) {
 		return page.setRecords(baseMapper.selectTaskCampusReportingEventPage(page, taskCampusReportingEvent));
 	}
 
 
+	/**
+	 * 自定义新增
+	 * @param reporting
+	 * @return
+	 */
 	@Override
 	public Boolean saveCampusReporting(TaskCampusReportingEventDTO reporting) {
 		Long aLong = taskService.saveTask(1, DictConstant.CAMPUS_SECURITY_INSPECTION, 1 , "", AuthUtil.getUserId(),reporting.getHouseCode(),reporting.getReportType());
 		if (aLong > 0) {
+			// 通过houseCode 获取场所id
+			QueryWrapper<PlaceEntity> queryWrapper = new QueryWrapper<>();
+			queryWrapper.eq("is_deleted",0).eq("house_code",reporting.getHouseCode());
+			PlaceEntity placeEntity = placeService.getOne(queryWrapper);
+			reporting.setPlaceId(placeEntity.getId());
 			reporting.setTaskId(aLong);
 			reporting.setCheckUserId(AuthUtil.getUserId());
 			return baseMapper.insert(reporting) > 0;
diff --git a/src/main/java/org/springblade/modules/task/service/impl/TaskHotelReportingServiceImpl.java b/src/main/java/org/springblade/modules/task/service/impl/TaskHotelReportingServiceImpl.java
index 102ea8b..65cb5c9 100644
--- a/src/main/java/org/springblade/modules/task/service/impl/TaskHotelReportingServiceImpl.java
+++ b/src/main/java/org/springblade/modules/task/service/impl/TaskHotelReportingServiceImpl.java
@@ -16,16 +16,21 @@
  */
 package org.springblade.modules.task.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.common.constant.DictConstant;
-import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.modules.place.entity.PlaceEntity;
+import org.springblade.modules.place.service.IPlaceService;
 import org.springblade.modules.task.dto.TaskHotelReportingDTO;
 import org.springblade.modules.task.entity.TaskHotelReportingEntity;
 import org.springblade.modules.task.mapper.TaskHotelReportingMapper;
 import org.springblade.modules.task.service.ITaskHotelReportingService;
 import org.springblade.modules.task.service.ITaskService;
 import org.springblade.modules.task.vo.TaskHotelReportingVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -39,10 +44,14 @@
  * @since 2023-11-06
  */
 @Service
-public class TaskHotelReportingServiceImpl extends BaseServiceImpl<TaskHotelReportingMapper, TaskHotelReportingEntity> implements ITaskHotelReportingService {
+public class TaskHotelReportingServiceImpl extends ServiceImpl<TaskHotelReportingMapper, TaskHotelReportingEntity> implements ITaskHotelReportingService {
 
 	@Resource
+	@Lazy
 	private ITaskService taskService;
+
+	@Autowired
+	private IPlaceService placeService;
 
 	@Override
 	public IPage<TaskHotelReportingVO> selectTaskHotelReportingPage(IPage<TaskHotelReportingVO> page, TaskHotelReportingVO taskHotelReporting) {
@@ -54,6 +63,11 @@
 	public boolean saveHotelReporting(TaskHotelReportingDTO taskHotelReporting) {
 		Long aLong = taskService.saveTask(2, DictConstant.HOTEL_SECURITY, 1, "", AuthUtil.getUserId(), taskHotelReporting.getHouseCode(), taskHotelReporting.getReportType());
 		if (aLong > 0) {
+			// 通过houseCode 获取场所id
+			QueryWrapper<PlaceEntity> queryWrapper = new QueryWrapper<>();
+			queryWrapper.eq("is_deleted",0).eq("house_code",taskHotelReporting.getHouseCode());
+			PlaceEntity placeEntity = placeService.getOne(queryWrapper);
+			taskHotelReporting.setPlaceId(placeEntity.getId());
 			taskHotelReporting.setTaskId(aLong);
 			taskHotelReporting.setCheckUserId(AuthUtil.getUserId());
 			return baseMapper.insert(taskHotelReporting) > 0;
@@ -64,7 +78,7 @@
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public Boolean updateHotelReporting(TaskHotelReportingEntity taskHotelReporting) throws Exception {
+	public Boolean updateHotelReporting(TaskHotelReportingVO taskHotelReporting) throws Exception {
 		Long aLong = taskService.updateTask(null, null, null, "", AuthUtil.getUserId(), taskHotelReporting.getTaskId(), taskHotelReporting.getStatus());
 		if (aLong > 0) {
 			taskHotelReporting.setConfirmFlag(taskHotelReporting.getStatus().toString());
diff --git a/src/main/java/org/springblade/modules/task/service/impl/TaskLabelReportingEventServiceImpl.java b/src/main/java/org/springblade/modules/task/service/impl/TaskLabelReportingEventServiceImpl.java
index 114aba3..fba319b 100644
--- a/src/main/java/org/springblade/modules/task/service/impl/TaskLabelReportingEventServiceImpl.java
+++ b/src/main/java/org/springblade/modules/task/service/impl/TaskLabelReportingEventServiceImpl.java
@@ -16,16 +16,22 @@
  */
 package org.springblade.modules.task.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.common.constant.DictConstant;
 import org.springblade.core.mp.base.BaseServiceImpl;
 import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.modules.place.entity.PlaceEntity;
+import org.springblade.modules.place.service.IPlaceService;
 import org.springblade.modules.task.dto.TaskLabelReportingEventDTO;
 import org.springblade.modules.task.entity.TaskLabelReportingEventEntity;
 import org.springblade.modules.task.mapper.TaskLabelReportingEventMapper;
 import org.springblade.modules.task.service.ITaskLabelReportingEventService;
 import org.springblade.modules.task.service.ITaskService;
 import org.springblade.modules.task.vo.TaskLabelReportingEventVO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -38,10 +44,14 @@
  * @since 2023-11-06
  */
 @Service
-public class TaskLabelReportingEventServiceImpl extends BaseServiceImpl<TaskLabelReportingEventMapper, TaskLabelReportingEventEntity> implements ITaskLabelReportingEventService {
+public class TaskLabelReportingEventServiceImpl extends ServiceImpl<TaskLabelReportingEventMapper, TaskLabelReportingEventEntity> implements ITaskLabelReportingEventService {
 
 	@Resource
+	@Lazy
 	private ITaskService taskService;
+
+	@Autowired
+	private IPlaceService placeService;
 
 	@Override
 	public IPage<TaskLabelReportingEventVO> selectTaskLabelReportingEventPage(IPage<TaskLabelReportingEventVO> page, TaskLabelReportingEventVO taskLabelReportingEvent) {
@@ -66,6 +76,11 @@
 		}
 		Long aLong = taskService.saveTask(1, name, 1, "", AuthUtil.getUserId(),taskLabelReportingEvent.getHouseCode(),taskLabelReportingEvent.getReportType());
 		if (aLong > 0) {
+			// 通过houseCode 获取场所id
+			QueryWrapper<PlaceEntity> queryWrapper = new QueryWrapper<>();
+			queryWrapper.eq("is_deleted",0).eq("house_code",taskLabelReportingEvent.getHouseCode());
+			PlaceEntity placeEntity = placeService.getOne(queryWrapper);
+			taskLabelReportingEvent.setPlaceId(placeEntity.getId());
 			taskLabelReportingEvent.setTaskId(aLong);
 			taskLabelReportingEvent.setUserId(AuthUtil.getUserId());
 			taskLabelReportingEvent.setLabelName(name);
@@ -76,7 +91,7 @@
 
 
 	@Override
-	public Boolean updateLabelReporting(TaskLabelReportingEventEntity taskLabelReportingEvent) throws Exception {
+	public Boolean updateLabelReporting(TaskLabelReportingEventVO taskLabelReportingEvent) throws Exception {
 		Long aLong = taskService.updateTask(null, null, null, "", AuthUtil.getUserId(),
 			taskLabelReportingEvent.getTaskId(), taskLabelReportingEvent.getStatus());
 		if (aLong > 0) {
diff --git a/src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java b/src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
index 73c5687..4c7bdfa 100644
--- a/src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
+++ b/src/main/java/org/springblade/modules/task/service/impl/TaskServiceImpl.java
@@ -16,20 +16,26 @@
  */
 package org.springblade.modules.task.service.impl;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 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.service.IGridWorkLogService;
 import org.springblade.modules.house.service.IHouseRentalService;
 import org.springblade.modules.house.service.IHouseholdService;
 import org.springblade.modules.house.vo.HouseRentalTenantVO;
+import org.springblade.modules.house.vo.HouseholdVO;
 import org.springblade.modules.place.service.IPlaceExtService;
 import org.springblade.modules.place.service.IPlaceService;
 import org.springblade.modules.place.vo.PlaceVO;
@@ -43,10 +49,7 @@
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 /**
@@ -75,6 +78,15 @@
 
 	@Autowired
 	private ITaskCampusReportingEventService taskCampusReportingEventService;
+
+	@Autowired
+	private ITaskLabelReportingEventService taskLabelReportingEventService;
+
+	@Autowired
+	private ITaskHotelReportingService taskHotelReportingService;
+
+	@Autowired
+	private IGridWorkLogService gridWorkLogService;
 
 	@Override
 	public IPage<TaskVO> selectTaskPage(IPage<TaskVO> page, TaskVO task) {
@@ -284,48 +296,247 @@
 
 	/**
 	 * 根据类型创建任务
-	 * @param reportType 任务/事件类型
-	 * @param color 参数
+	 * @param param 参数
 	 * @return
 	 */
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public boolean createTaskJob(Integer reportType, String color) {
+	public boolean createTaskJob(String param) {
+		// 解析参数
+		JSONObject jsonParam = JSON.parseObject(param);
+//		String params = jsonParam.getString("params");
 		boolean flag = false;
-		if (reportType==6){
-			// 校园安全自查,查询标签为教育的场所 parentNo = 1601
-			String parentNo = "1601";
-			QueryWrapper<CategoryEntity> wrapper = new QueryWrapper<>();
-			wrapper.eq("is_deleted",0).eq("parent_no",parentNo);
-			List<CategoryEntity> categoryEntityList = categoryService.list(wrapper);
-			// 取出编号集合
-			List<String> stringList = categoryEntityList.stream().map(categoryEntity -> categoryEntity.getCategoryNo()).collect(Collectors.toList());
-			// 根据编号集合查询对应的场所
-			List<PlaceVO> placeVOList = placeService.getPlaceListByParam(stringList,color);
-			// 生成任务
-			for (PlaceVO placeVO : placeVOList) {
-				TaskEntity taskEntity = new TaskEntity();
-				taskEntity.setType(1);
-				taskEntity.setName(DictConstant.CAMPUS_SECURITY_INSPECTION);
-				taskEntity.setFrequency(2);
-				taskEntity.setCreateTime(new Date());
-				taskEntity.setHouseCode(placeVO.getHouseCode());
-				taskEntity.setReportType(reportType);
-				// 新增
-				flag = save(taskEntity);
-				// 同时新增校园安全检查任务
-				TaskCampusReportingEventEntity campusReportingEventEntity = new TaskCampusReportingEventEntity();
-				campusReportingEventEntity.setTaskId(taskEntity.getId());
-				campusReportingEventEntity.setPlaceId(placeVO.getId());
-				campusReportingEventEntity.setCheckUserId(placeVO.getPrincipalUserId());
-				campusReportingEventEntity.setCheckUserName(placeVO.getPrincipal());
-				campusReportingEventEntity.setCheckTelephone(placeVO.getPrincipalPhone());
-				// 系统下发
-				campusReportingEventEntity.setSource(2);
-				// 新增
-				taskCampusReportingEventService.save(campusReportingEventEntity);
-			}
-		}
+		// 校园安全自查任务生成
+		createCampusReportingTask();
+		// 打金店/二手车/二手手机任务生成
+		createLabelReportingTask();
+		// 旅馆安全自查任务生成
+		createHotelReportingTask();
+		// 人员类-肇事肇祸精神障碍患者走访任务生成
+		createGridWordTask();
+		// 返回
 		return flag;
 	}
+
+
+	/**
+	 * 人员类-肇事肇祸精神障碍患者走访任务生成
+	 */
+	public void createGridWordTask() {
+		// 肇事肇祸精神障碍患者走访任务生成,查询标签为:20
+		List<Integer> list = new ArrayList<Integer>(){{
+			add(20);
+		}};
+		// 根据人员标签编号集合查询对应的住户(按颜色区分近多少天没有发过任务的住户)
+		List<HouseholdVO> householdVOList = iHouseholdService.getHouseholdListByParam(list);
+		// 生成任务
+		for (HouseholdVO household : householdVOList) {
+			// 新增走访任务
+			saveGridWordTask(household);
+		}
+	}
+
+	/**
+	 * 新增走访任务
+	 * @param household
+	 */
+	public void saveGridWordTask(HouseholdVO household) {
+		GridWorkLogEntity gridWorkLogEntity = new GridWorkLogEntity();
+		gridWorkLogEntity.setHouseholdId(household.getId());
+		gridWorkLogEntity.setType(2);
+		gridWorkLogEntity.setPersonType(20);
+		// 系统下发
+		gridWorkLogEntity.setSource(2);
+		// 新增
+		gridWorkLogService.save(gridWorkLogEntity);
+	}
+
+	/**
+	 * 打金店/二手车/二手手机任务生成
+	 */
+	public void createLabelReportingTask() {
+		// 打金店/二手车/二手手机任务生成,标签:130808/140304/130604
+		List<String> stringList = new ArrayList<String>(){{
+			add("130808");
+			add("140304");
+			add("130604");
+		}};
+		String tableName = "jczz_task_label_reporting_event";
+		// 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所)
+		List<PlaceVO> placeVOList = placeService.getPlaceListByParam(stringList,tableName);
+		// 生成任务
+		for (PlaceVO placeVO : placeVOList) {
+			String taskName = "";
+			Integer reportType = 3;
+			if (placeVO.getLabel().equals("130808")){
+				taskName = DictConstant.DA_JIN_DIAN;
+				reportType = 3;
+			}
+			if (placeVO.getLabel().equals("130604")){
+				taskName = DictConstant.USED_MOBILE_PHONES;
+				reportType = 4;
+			}
+			if (placeVO.getLabel().equals("140304")){
+				taskName = DictConstant.USED_CAR;
+				reportType = 5;
+			}
+			// 新增任务
+			TaskEntity taskEntity = saveTaskEntity(placeVO.getHouseCode(), 1, taskName, 2, reportType);
+			// 同时新增打金店/二手车/二手手机任务
+			saveGoldShop(placeVO, taskEntity,taskName,reportType);
+		}
+	}
+
+	/**
+	 * 旅馆安全自查任务生成
+	 */
+	public void createHotelReportingTask() {
+		// 旅馆标签为
+		List<String> stringList = new ArrayList<String>(){{
+			add("120101");
+			add("120102");
+			add("120103");
+			add("120104");
+		}};
+		String tableName = "jczz_task_hotel_reporting";
+		// 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所)
+		List<PlaceVO> placeVOList = placeService.getPlaceListByParam(stringList,tableName);
+		// 生成任务
+		for (PlaceVO placeVO : placeVOList) {
+			// 新增任务
+			TaskEntity taskEntity = saveTaskEntity(placeVO.getHouseCode(), 1, DictConstant.HOTEL_SECURITY, 2, 2);
+			// 同时新增校园安全检查任务
+			saveHotel(placeVO, taskEntity);
+		}
+	}
+
+	/**
+	 * 校园安全自查任务生成
+	 */
+	public void createCampusReportingTask() {
+		// 校园安全自查,查询标签为教育的场所 parentNo = 1601
+		String parentNo = "1601";
+		QueryWrapper<CategoryEntity> wrapper = new QueryWrapper<>();
+		wrapper.eq("is_deleted",0).eq("parent_no",parentNo);
+		List<CategoryEntity> categoryEntityList = categoryService.list(wrapper);
+		// 取出编号集合
+		List<String> stringList = categoryEntityList.stream().map(categoryEntity -> categoryEntity.getCategoryNo()).collect(Collectors.toList());
+		// 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所)
+		String tableName = "jczz_task_campus_reporting_event";
+		List<PlaceVO> placeVOList = placeService.getPlaceListByParam(stringList,tableName);
+		// 生成任务
+		for (PlaceVO placeVO : placeVOList) {
+			// 新增任务
+			TaskEntity taskEntity = saveTaskEntity(placeVO.getHouseCode(), 1, DictConstant.CAMPUS_SECURITY_INSPECTION, 2, 6);
+			// 同时新增校园安全检查任务
+			saveCampus(placeVO, taskEntity);
+		}
+	}
+
+	/**
+	 * 新增校园安全检查任务
+	 * @param placeVO
+	 * @param taskEntity
+	 */
+	private void saveCampus(PlaceVO placeVO, TaskEntity taskEntity) {
+		TaskCampusReportingEventEntity campusReportingEventEntity = new TaskCampusReportingEventEntity();
+		campusReportingEventEntity.setTaskId(taskEntity.getId());
+		campusReportingEventEntity.setPlaceId(placeVO.getId());
+		campusReportingEventEntity.setCampusName(placeVO.getPlaceName());
+		campusReportingEventEntity.setCheckUserId(placeVO.getPrincipalUserId());
+		campusReportingEventEntity.setCheckUserName(placeVO.getPrincipal());
+		campusReportingEventEntity.setCheckTelephone(placeVO.getPrincipalPhone());
+		// 系统下发
+		campusReportingEventEntity.setSource(2);
+		// 待完善
+		campusReportingEventEntity.setConfirmFlag("4");
+		// 新增
+		taskCampusReportingEventService.save(campusReportingEventEntity);
+	}
+
+	/**
+	 * 新增旅馆安全检查任务
+	 * @param placeVO
+	 * @param taskEntity
+	 */
+	private void saveHotel(PlaceVO placeVO, TaskEntity taskEntity) {
+		TaskHotelReportingEntity taskHotelReportingEntity = new TaskHotelReportingEntity();
+		taskHotelReportingEntity.setTaskId(taskEntity.getId());
+		taskHotelReportingEntity.setPlaceId(placeVO.getId());
+		taskHotelReportingEntity.setHotelName(placeVO.getPlaceName());
+		taskHotelReportingEntity.setCheckUserId(placeVO.getPrincipalUserId());
+		taskHotelReportingEntity.setCheckUserName(placeVO.getPrincipal());
+		taskHotelReportingEntity.setCheckTelephone(placeVO.getPrincipalPhone());
+		// 系统下发
+		taskHotelReportingEntity.setSource(2);
+		// 待完善
+		taskHotelReportingEntity.setConfirmFlag("4");
+		// 新增
+		taskHotelReportingService.save(taskHotelReportingEntity);
+	}
+
+
+	/**
+	 * 新增打金店/二手车/二手手机任务
+	 * @param placeVO
+	 * @param taskEntity
+	 * @param taskName
+	 * @param reportType
+	 */
+	private void saveGoldShop(PlaceVO placeVO, TaskEntity taskEntity,String taskName,Integer reportType) {
+		TaskLabelReportingEventEntity taskLabelReportingEventEntity = new TaskLabelReportingEventEntity();
+		taskLabelReportingEventEntity.setTaskId(taskEntity.getId());
+		taskLabelReportingEventEntity.setPlaceId(placeVO.getId());
+		taskLabelReportingEventEntity.setDistrictName(placeVO.getPlaceName());
+		taskLabelReportingEventEntity.setUserId(placeVO.getPrincipalUserId());
+		taskLabelReportingEventEntity.setOwner(placeVO.getPrincipal());
+		taskLabelReportingEventEntity.setPhoneNumber(placeVO.getPrincipalPhone());
+		taskLabelReportingEventEntity.setLabelName(taskName);
+		// 打金店
+		if (reportType==3){
+			taskLabelReportingEventEntity.setEventType("1");
+		}
+		// 二手车
+		if (reportType==4){
+			taskLabelReportingEventEntity.setEventType("3");
+		}
+		// 二手手机
+		if (reportType==5){
+			taskLabelReportingEventEntity.setEventType("2");
+		}
+		taskLabelReportingEventEntity.setEventType(taskName);
+		// 系统下发
+		taskLabelReportingEventEntity.setSource(2);
+		// 待完善
+		taskLabelReportingEventEntity.setConfirmFlag("4");
+		// 新增
+		taskLabelReportingEventService.save(taskLabelReportingEventEntity);
+	}
+
+	/**
+	 * 插入任务信息
+	 * @param houseCode
+	 * @param type
+	 * @param taskName
+	 * @param frequency
+	 * @param reportType
+	 * @return
+	 */
+	private TaskEntity saveTaskEntity(String houseCode,
+									  Integer type,
+									  String taskName,
+									  Integer frequency,
+									  Integer reportType) {
+		TaskEntity taskEntity = new TaskEntity();
+		taskEntity.setType(type);
+		taskEntity.setName(taskName);
+		taskEntity.setFrequency(frequency);
+		taskEntity.setCreateTime(new Date());
+		taskEntity.setHouseCode(houseCode);
+		taskEntity.setReportType(reportType);
+		// 新增
+		save(taskEntity);
+		// 返回
+		return taskEntity;
+	}
 }
diff --git a/src/main/java/org/springblade/modules/task/vo/TaskHotelReportingVO.java b/src/main/java/org/springblade/modules/task/vo/TaskHotelReportingVO.java
index 38127d4..061a4f2 100644
--- a/src/main/java/org/springblade/modules/task/vo/TaskHotelReportingVO.java
+++ b/src/main/java/org/springblade/modules/task/vo/TaskHotelReportingVO.java
@@ -32,4 +32,9 @@
 public class TaskHotelReportingVO extends TaskHotelReportingEntity {
 	private static final long serialVersionUID = 1L;
 
+	/**
+	 * 状态
+	 */
+	private Integer status;
+
 }
diff --git a/src/main/java/org/springblade/modules/task/vo/TaskLabelReportingEventVO.java b/src/main/java/org/springblade/modules/task/vo/TaskLabelReportingEventVO.java
index c189ef0..1f7e020 100644
--- a/src/main/java/org/springblade/modules/task/vo/TaskLabelReportingEventVO.java
+++ b/src/main/java/org/springblade/modules/task/vo/TaskLabelReportingEventVO.java
@@ -32,4 +32,10 @@
 public class TaskLabelReportingEventVO extends TaskLabelReportingEventEntity {
 	private static final long serialVersionUID = 1L;
 
+
+	/**
+	 * 状态
+	 */
+	private Integer status;
+
 }
diff --git a/src/main/java/org/springblade/xxljob/jobhandler/LabelHandleJob.java b/src/main/java/org/springblade/xxljob/jobhandler/LabelHandleJob.java
index 014dfe2..fdd6ef8 100644
--- a/src/main/java/org/springblade/xxljob/jobhandler/LabelHandleJob.java
+++ b/src/main/java/org/springblade/xxljob/jobhandler/LabelHandleJob.java
@@ -40,12 +40,10 @@
     @XxlJob("campusSecurityJobHandler")
     public void campusSecurityJobHandler (String param){
 		XxlJobHelper.log("开始执行任务...");
-		JSONObject jsonParam = JSON.parseObject(param);
-		String color = jsonParam.getString("color");
+
 		// 校园安全检查
-		Integer reportType = 6;
 		// 根据类型创建任务
-		boolean result = taskService.createTaskJob(reportType,color);
+		boolean result = taskService.createTaskJob(param);
 		XxlJobHelper.log("任务响应结果..." + result);
 		// 创建外呼短信发送任务记录
 		XxlJobHelper.log("结束自动创建任务...");

--
Gitblit v1.9.3