From d7e498f5e1f13e37df52ebd08c98e8a833b9c450 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Fri, 02 Feb 2024 14:36:54 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/main/java/org/springblade/modules/taskPlaceRectification/service/ITaskPlaceRectificationService.java | 66 ++
src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.java | 67 ++
src/main/java/org/springblade/modules/taskPlaceRectification/service/impl/TaskPlaceRectificationServiceImpl.java | 145 +++++
src/main/java/org/springblade/modules/patrol/mapper/PatrolRecordMapper.xml | 9
src/main/java/org/springblade/modules/system/controller/DictBizController.java | 4
src/main/java/org/springblade/modules/subjectChoices/mapper/SubjectChoicesMapper.xml | 6
src/main/java/org/springblade/modules/place/entity/PlaceCheckEntity.java | 39 +
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.java | 18
src/main/java/org/springblade/modules/place/service/impl/PlaceCheckServiceImpl.java | 43 +
src/main/java/org/springblade/modules/system/vo/RegionVO.java | 3
src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml | 28
src/main/java/org/springblade/modules/place/service/IPlaceService.java | 32
src/main/java/org/springblade/modules/subjectChoices/service/impl/SubjectChoicesServiceImpl.java | 15
src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml | 4
src/main/java/org/springblade/modules/taskPlaceRectification/vo/TaskPlaceRectificationVO.java | 92 +++
src/main/java/org/springblade/modules/task/entity/TaskEntity.java | 2
src/main/java/org/springblade/modules/taskPlaceRectification/controller/TaskPlaceRectificationController.java | 186 ++++++
src/main/java/org/springblade/modules/taskPlaceRectification/dto/TaskPlaceRectificationDTO.java | 76 ++
src/main/java/org/springblade/modules/patrol/entity/PatrolRecord.java | 24
src/main/java/org/springblade/modules/taskPlaceRectification/entity/TaskPlaceRectificationEntity.java | 143 +++++
src/main/java/org/springblade/modules/place/service/impl/PlaceServiceImpl.java | 22
src/main/java/org/springblade/common/constant/DictConstant.java | 2
src/main/java/org/springblade/modules/place/controller/PlaceController.java | 11
src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java | 5
src/main/java/org/springblade/modules/system/mapper/DictBizMapper.java | 2
src/main/java/org/springblade/common/constant/CommonConstant.java | 4
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml | 158 +++++
src/main/java/org/springblade/modules/place/entity/PlaceEntity.java | 6
src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.xml | 312 +++++++++++
src/main/java/org/springblade/modules/system/service/IDictBizService.java | 2
src/main/java/org/springblade/modules/taskPlaceRectification/wrapper/TaskPlaceRectificationWrapper.java | 50 +
src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml | 42 +
src/main/java/org/springblade/modules/place/vo/PlaceVO.java | 9
33 files changed, 1,576 insertions(+), 51 deletions(-)
diff --git a/src/main/java/org/springblade/common/constant/CommonConstant.java b/src/main/java/org/springblade/common/constant/CommonConstant.java
index db7d63b..3042382 100644
--- a/src/main/java/org/springblade/common/constant/CommonConstant.java
+++ b/src/main/java/org/springblade/common/constant/CommonConstant.java
@@ -88,6 +88,10 @@
Integer NUMBER_THREE = 3;
+ Integer NUMBER_FOUR = 4;
+
+ Integer NUMBER_EIGHT = 8;
+
String RESIDENT = "居民";
diff --git a/src/main/java/org/springblade/common/constant/DictConstant.java b/src/main/java/org/springblade/common/constant/DictConstant.java
index ef089db..17c7657 100644
--- a/src/main/java/org/springblade/common/constant/DictConstant.java
+++ b/src/main/java/org/springblade/common/constant/DictConstant.java
@@ -53,4 +53,6 @@
String CAMPUS_SECURITY_INSPECTION= "校园安全检查";
+ String FIRE_RECTIFICATION_NOTICE = "消防整改通知";
+
}
diff --git a/src/main/java/org/springblade/modules/patrol/entity/PatrolRecord.java b/src/main/java/org/springblade/modules/patrol/entity/PatrolRecord.java
index 0bfb64f..ddab949 100644
--- a/src/main/java/org/springblade/modules/patrol/entity/PatrolRecord.java
+++ b/src/main/java/org/springblade/modules/patrol/entity/PatrolRecord.java
@@ -22,8 +22,6 @@
{
private static final long serialVersionUID = 1L;
-
-
/** 主键 */
@ApiModelProperty(value = "主键ID", example = "")
@TableId(value = "id", type = IdType.ASSIGN_ID)
@@ -44,8 +42,8 @@
@TableField("state")
private Integer state;
- /** 备注 */
- @ApiModelProperty(value = "备注", example = "")
+ /** 隐患备注 */
+ @ApiModelProperty(value = "隐患备注", example = "")
@TableField("remark")
private String remark;
@@ -62,11 +60,27 @@
/** 修改时间 */
@ApiModelProperty(value = "修改时间", example = "")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
- @TableField(value = "create_time",fill = FieldFill.INSERT)
+ @TableField("create_time")
private Date createTime;
/** 是否删除 0: 否 1:是 */
@ApiModelProperty(value = "是否删除 0: 否 1:是", example = "")
@TableField("is_deleted")
private Integer isDeleted;
+
+ /** 整改照片 */
+ @ApiModelProperty(value = "整改照片", example = "")
+ @TableField("rectification_image_urls")
+ private String rectificationImageUrls;
+
+ /** 整改描述 */
+ @ApiModelProperty(value = "整改描述", example = "")
+ @TableField("rectification_remark")
+ private String rectificationRemark;
+
+ /** 整改时间 */
+ @ApiModelProperty(value = "整改时间", example = "")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @TableField("rectification_time")
+ private Date rectificationTime;
}
diff --git a/src/main/java/org/springblade/modules/patrol/mapper/PatrolRecordMapper.xml b/src/main/java/org/springblade/modules/patrol/mapper/PatrolRecordMapper.xml
index c0e6225..6ab9ddd 100644
--- a/src/main/java/org/springblade/modules/patrol/mapper/PatrolRecordMapper.xml
+++ b/src/main/java/org/springblade/modules/patrol/mapper/PatrolRecordMapper.xml
@@ -204,6 +204,7 @@
<!-- <result property="isDeleted" column="is_deleted" />-->
<!-- </resultMap>-->
+
<sql id="selectPatrolRecord">
select
id,
@@ -214,12 +215,16 @@
image_urls,
create_user,
create_time,
- is_deleted
+ is_deleted,
+ rectification_image_urls,
+ rectification_remark,
+ rectification_time
from
jczz_patrol_record
</sql>
-<!-- <select id="selectPatrolRecordById" parameterType="long" resultMap="PatrolRecordDTOResult">-->
+
+ <!-- <select id="selectPatrolRecordById" parameterType="long" resultMap="PatrolRecordDTOResult">-->
<!-- <include refid="selectPatrolRecord"/>-->
<!-- where-->
<!-- id = #{id}-->
diff --git a/src/main/java/org/springblade/modules/place/controller/PlaceController.java b/src/main/java/org/springblade/modules/place/controller/PlaceController.java
index 90d2504..fb0a486 100644
--- a/src/main/java/org/springblade/modules/place/controller/PlaceController.java
+++ b/src/main/java/org/springblade/modules/place/controller/PlaceController.java
@@ -94,6 +94,17 @@
}
/**
+ * 九小场所档案
+ */
+ @GetMapping("/ninePage")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "传入place")
+ public R<IPage<PlaceVO>> ninePage(PlaceVO place, Query query) {
+ IPage<PlaceVO> pages = placeService.selectNinePlacePage(Condition.getPage(query), place);
+ return R.data(pages);
+ }
+
+ /**
* 场所表 新增
*/
@PostMapping("/save")
diff --git a/src/main/java/org/springblade/modules/place/entity/PlaceCheckEntity.java b/src/main/java/org/springblade/modules/place/entity/PlaceCheckEntity.java
index 3ae5457..bffdd34 100644
--- a/src/main/java/org/springblade/modules/place/entity/PlaceCheckEntity.java
+++ b/src/main/java/org/springblade/modules/place/entity/PlaceCheckEntity.java
@@ -53,10 +53,15 @@
@TableField("house_code")
private String houseCode;
- /** 其他隐患问题 */
- @ApiModelProperty(value = "其他隐患问题", example = "")
+ /** 备注 */
+ @ApiModelProperty(value = "备注", example = "")
@TableField("remark")
private String remark;
+
+ /** 照片 */
+ @ApiModelProperty(value = "照片", example = "")
+ @TableField("image_urls")
+ private String imageUrls;
/** 签名路径 */
@ApiModelProperty(value = "签名路径", example = "")
@@ -71,19 +76,33 @@
/** 创建时间 */
@ApiModelProperty(value = "创建时间", example = "")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
- @TableField(value = "create_time",fill = FieldFill.INSERT)
+ @TableField("create_time")
private Date createTime;
+
+ /** 是否下发整改通知: 0:否 1 :是 */
+ @ApiModelProperty(value = "是否下发整改通知: 0:否 1 :是 ", example = "")
+ @TableField("rectification_notice_flag")
+ private Integer rectificationNoticeFlag;
+
+ /** 是否处罚:0:否 1 :是 */
+ @ApiModelProperty(value = "是否处罚:0:否 1 :是", example = "")
+ @TableField("punish_flag")
+ private Integer punishFlag;
+
+ /** 整改截止时间 */
+ @ApiModelProperty(value = "整改截止时间", example = "")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @TableField("rectification_end_time")
+ private Date rectificationEndTime;
+
+ /** 处罚说明 */
+ @ApiModelProperty(value = "处罚说明", example = "")
+ @TableField("punish_remark")
+ private String punishRemark;
/** 是否删除 0:否 1:是 */
@ApiModelProperty(value = "是否删除 0:否 1:是", example = "")
@TableField("is_deleted")
private Integer isDeleted;
-
- /**
- * 照片
- */
- @ApiModelProperty(value = "照片")
- @TableField("image_urls")
- private String imageUrls;
}
diff --git a/src/main/java/org/springblade/modules/place/entity/PlaceEntity.java b/src/main/java/org/springblade/modules/place/entity/PlaceEntity.java
index 612bee6..7798062 100644
--- a/src/main/java/org/springblade/modules/place/entity/PlaceEntity.java
+++ b/src/main/java/org/springblade/modules/place/entity/PlaceEntity.java
@@ -77,6 +77,12 @@
@JsonSerialize(using = ToStringSerializer.class)
private String principal;
+
+ /** 场所负责人身份证号 */
+ @ApiModelProperty(value = "场所负责人身份证号", example = "")
+ @TableField("principal_id_card")
+ private String principalIdCard;
+
/**
* 场所负责人联系电话
*/
diff --git a/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml b/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
index 7cf6ed3..1b4a82e 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
@@ -19,6 +19,10 @@
<result column="principal_phone" property="principalPhone"/>
<result column="town_name" property="streetName"/>
<result column="village_name" property="communityName"/>
+ <result property="rectificationNoticeFlag" column="rectification_notice_flag" />
+ <result property="punishFlag" column="punish_flag" />
+ <result property="rectificationEndTime" column="rectification_end_time" />
+ <result property="punishRemark" column="punish_remark" />
<collection property="placePoiLabelVOList" column="jpid" javaType="java.util.List" select="selectPlacePoiLabelList"
ofType="org.springblade.modules.place.vo.PlacePoiLabelVO"
@@ -54,14 +58,17 @@
resultType="org.springblade.modules.patrol.entity.PatrolRecord">
select
id,
- item_id,
- place_check_id,
- state,
- remark,
- image_urls,
- create_user,
- create_time,
- is_deleted
+ item_id,
+ place_check_id,
+ state,
+ remark,
+ image_urls,
+ create_user,
+ create_time,
+ is_deleted,
+ rectification_image_urls,
+ rectification_remark,
+ rectification_time
from
jczz_patrol_record where place_check_id = #{id}
</select>
@@ -133,9 +140,14 @@
id,
house_code,
remark,
+ image_urls,
signature_path,
create_user,
create_time,
+ rectification_notice_flag,
+ punish_flag,
+ rectification_end_time,
+ punish_remark,
is_deleted
from
jczz_place_check
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 2c43131..e4574f1 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.java
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.java
@@ -33,6 +33,24 @@
*/
public interface PlaceMapper extends BaseMapper<PlaceEntity> {
+
+ /**
+ * 九小场所档案
+ *
+ * @param page
+ * @param place
+ * @param houseCodeList
+ * @param regionChildCodesList
+ * @param isAdministrator
+ * @return
+ */
+ List<PlaceVO> selectNinePlacePage(IPage page,
+ @Param("place") PlaceVO place,
+ @Param("houseCodeList") List<String> houseCodeList,
+ @Param("regionChildCodesList") List<String> regionChildCodesList,
+ @Param("isAdministrator") Integer isAdministrator);
+
+
/**
* 自定义分页
*
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 96c2113..2177a11 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -20,12 +20,16 @@
bu.real_name as username,bu.phone as phone,
br.town_name as townStreetName,br.name as neiName,
jpe.confirm_flag confirmFlag,
- jg.grid_name as gridName
+ jg.grid_name as gridName,
+ bus.`name` AS policeName,
+ bu.phone AS policePhone
from jczz_place jp
left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0
left join jczz_place_ext jpe on jpe.place_id=jp.id and jpe.is_deleted = 0
left join jczz_grid jg on jg.grid_code = jp.grid_code and jg.is_deleted = 0
left join blade_region br on br.code = jg.community_code
+ LEFT JOIN jczz_community jc on jc.`code`=jg.community_code
+ LEFT JOIN blade_user bus on bus.id = jc.res_police_user_id
left join (
select a.* from jczz_place_poi_label a inner join
(
@@ -55,6 +59,96 @@
<if test="place.id!=null">
and jp.id = #{place.id}
</if>
+
+ <if test="place.isNine!=null">
+ and jp.is_nine = #{place.isNine}
+ </if>
+
+ <if test="place.source!=null">
+ and jp.source = #{place.source}
+ </if>
+ <if test="place.isPerfect==1">
+ and jp.status = 1
+ </if>
+ <if test="place.isPerfect==2">
+ and jp.status = 2
+ </if>
+ <if test="houseCodeList != null and houseCodeList.size()>0">
+ and jp.house_code in
+ <foreach collection="houseCodeList" item="houseCode" separator ="," open="(" close=")">
+ #{houseCode}
+ </foreach>
+ </if>
+ <if test="isAdministrator==2">
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and jg.grid_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ <otherwise>
+ and jg.grid_code in ('')
+ </otherwise>
+ </choose>
+ </if>
+ order by jp.create_time desc,jp.id desc
+ </select>
+
+ <!--自定义分页查询-->
+ <select id="selectNinePlacePage" resultType="org.springblade.modules.place.vo.PlaceVO">
+ select
+ jp.*,
+ jpe.id as placeExtId,
+ bu.real_name as username,bu.phone as phone,
+ br.town_name as townStreetName,br.name as neiName,
+ jpe.confirm_flag confirmFlag,
+ jg.grid_name as gridName,
+ bus.`name` AS policeName,
+ bu.phone AS policePhone,
+ bd.dept_name
+ from jczz_place jp
+ left join blade_user bu on bu.id = jp.principal_user_id and bu.is_deleted = 0
+ left join jczz_place_ext jpe on jpe.place_id=jp.id and jpe.is_deleted = 0
+ left join jczz_grid jg on jg.grid_code = jp.grid_code and jg.is_deleted = 0
+ left join blade_region br on br.code = jg.community_code
+ LEFT JOIN jczz_community jc on jc.`code`=jg.community_code
+ LEFT JOIN blade_user bus on bus.id = jc.res_police_user_id
+ LEFT JOIN blade_dept bd on bd.id = bus.dept_id
+ left join (
+ select a.* from jczz_place_poi_label a inner join
+ (
+ select place_id,max(id) as id from jczz_place_poi_label b group by place_id
+ ) b on a.id = b.id
+ ) jppl on jppl.place_id = jp.id
+ where jp.is_deleted = 0 and jp.source!=3
+ and jp.place_name != ''
+ <if test="place.placeName!=null and place.placeName!=''">
+ and jp.place_name like concat('%',#{place.placeName},'%')
+ </if>
+ <if test="place.principal!=null and place.principal!=''">
+ and jp.principal like concat('%',#{place.principal},'%')
+ </if>
+ <if test="place.principalPhone!=null and place.principalPhone!=''">
+ and jp.principal_phone like concat('%',#{place.principalPhone},'%')
+ </if>
+ <if test="place.houseCode!=null and place.houseCode!=''">
+ and jp.house_code like concat('%',#{place.houseCode},'%')
+ </if>
+ <if test="place.townStreetName!=null and place.townStreetName!=''">
+ and br.town_name like concat('%',#{place.townStreetName},'%')
+ </if>
+ <if test="place.neiName!=null and place.neiName!=''">
+ and br.name like concat('%',#{place.neiName},'%')
+ </if>
+ <if test="place.id!=null">
+ and jp.id = #{place.id}
+ </if>
+
+ <if test="place.isNine!=null">
+ and jp.is_nine = #{place.isNine}
+ </if>
+
<if test="place.source!=null">
and jp.source = #{place.source}
</if>
@@ -292,4 +386,66 @@
</choose>
)
</select>
+
+ <resultMap type="org.springblade.modules.place.dto.PlaceDTO" id="PlaceDTOResult">
+ <result property="id" column="id" />
+ <result property="houseCode" column="house_code" />
+ <result property="buildingCode" column="building_code" />
+ <result property="principalUserId" column="principal_user_id" />
+ <result property="principal" column="principal" />
+ <result property="principalIdCard" column="principal_id_card" />
+ <result property="principalPhone" column="principal_phone" />
+ <result property="placeName" column="place_name" />
+ <result property="lng" column="lng" />
+ <result property="lat" column="lat" />
+ <result property="location" column="location" />
+ <result property="imageUrls" column="image_urls" />
+ <result property="gridCode" column="grid_code" />
+ <result property="source" column="source" />
+ <result property="status" column="status" />
+ <result property="isScene" column="is_scene" />
+ <result property="isNine" column="is_nine" />
+ <result property="nineType" column="nine_type" />
+ <result property="isFront" column="is_front" />
+ <result property="frontType" column="front_type" />
+ <result property="createUser" column="create_user" />
+ <result property="createTime" column="create_time" />
+ <result property="updateUser" column="update_user" />
+ <result property="updateTime" column="update_time" />
+ <result property="remark" column="remark" />
+ <result property="isDeleted" column="is_deleted" />
+ </resultMap>
+
+ <sql id="selectPlace">
+ select
+ id,
+ house_code,
+ building_code,
+ principal_user_id,
+ principal,
+ principal_id_card,
+ principal_phone,
+ place_name,
+ lng,
+ lat,
+ location,
+ image_urls,
+ grid_code,
+ source,
+ status,
+ is_scene,
+ is_nine,
+ nine_type,
+ is_front,
+ front_type,
+ create_user,
+ create_time,
+ update_user,
+ update_time,
+ remark,
+ is_deleted
+ from
+ jczz_place
+ </sql>
+
</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 5ec8345..7b6bddd 100644
--- a/src/main/java/org/springblade/modules/place/service/IPlaceService.java
+++ b/src/main/java/org/springblade/modules/place/service/IPlaceService.java
@@ -46,13 +46,15 @@
/**
* 查询场所集合信息
+ *
* @param userId
* @return
*/
- List<TreeStringNode> selectPlaceNodeList(Long userId);
+ List<TreeStringNode> selectPlaceNodeList(Long userId);
/**
* 场所信息自定义新增/修改
+ *
* @param placeVO
* @return
*/
@@ -60,6 +62,7 @@
/**
* 历史场所挂接处理-临时
+ *
* @param place
* @return
*/
@@ -67,13 +70,15 @@
/**
* 历史场所标签挂接处理-临时
+ *
* @param place
* @return
*/
- Object historyPlaceLabelHandle(PlaceVO place);
+ Object historyPlaceLabelHandle(PlaceVO place);
/**
* 场所表 自定义详情查询
+ *
* @param place
* @return
*/
@@ -81,13 +86,15 @@
/**
* 场所数据到导入
+ *
* @param data
* @param isCovered
*/
- void importPlace(List<PlaceExcel> data, Boolean isCovered);
+ void importPlace(List<PlaceExcel> data, Boolean isCovered);
/**
* 场所(商超)导入
+ *
* @param data
* @param isCovered
*/
@@ -100,6 +107,7 @@
/**
* 自定义修改
+ *
* @param placeVO
* @return
*/
@@ -108,10 +116,11 @@
/**
* 场所标签数据处理
*/
- Object placeLabelHandle();
+ Object placeLabelHandle();
/**
* 历史场所详情数据处理
+ *
* @param place
* @return
*/
@@ -119,22 +128,33 @@
/**
* 商超数据处理
+ *
* @return
*/
- Object placeAndRelHandle();
+ Object placeAndRelHandle();
/**
* 根据编号集合查询对应的场所(按颜色区分近多少天没有发过任务的场所)
+ *
* @param stringList
* @param tableName
* @return
*/
- List<PlaceVO> getPlaceListByParam(List<String> stringList,String tableName);
+ List<PlaceVO> getPlaceListByParam(List<String> stringList, String tableName);
/**
* 删除
+ *
* @param longs
* @return
*/
boolean removePlace(List<Long> longs);
+
+ /**
+ * 九小场所档案
+ * @param page
+ * @param place
+ * @return
+ */
+ IPage<PlaceVO> selectNinePlacePage(IPage<PlaceVO> page, PlaceVO place);
}
diff --git a/src/main/java/org/springblade/modules/place/service/impl/PlaceCheckServiceImpl.java b/src/main/java/org/springblade/modules/place/service/impl/PlaceCheckServiceImpl.java
index 3479ba4..1316e1f 100644
--- a/src/main/java/org/springblade/modules/place/service/impl/PlaceCheckServiceImpl.java
+++ b/src/main/java/org/springblade/modules/place/service/impl/PlaceCheckServiceImpl.java
@@ -17,22 +17,32 @@
package org.springblade.modules.place.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xxl.job.core.util.FileUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.constant.DictConstant;
+import org.springblade.common.utils.SpringUtils;
import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.modules.patrol.entity.PatrolRecord;
import org.springblade.modules.patrol.service.IPatrolRecordService;
import org.springblade.modules.place.dto.PlaceCheckDTO;
import org.springblade.modules.place.entity.PlaceCheckEntity;
+import org.springblade.modules.place.service.IPlaceService;
import org.springblade.modules.place.vo.PlaceCheckVO;
import org.springblade.modules.place.mapper.PlaceCheckMapper;
import org.springblade.modules.place.service.IPlaceCheckService;
-import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.task.service.ITaskService;
+import org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity;
+import org.springblade.modules.taskPlaceRectification.service.ITaskPlaceRectificationService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
-import java.util.stream.Collectors;
+import java.util.concurrent.atomic.AtomicReference;
/**
* 场所检查表 服务实现类
@@ -42,6 +52,8 @@
*/
@Service
public class PlaceCheckServiceImpl extends ServiceImpl<PlaceCheckMapper, PlaceCheckEntity> implements IPlaceCheckService {
+
+ private static Logger logger = LoggerFactory.getLogger(PlaceCheckServiceImpl.class);
@Override
public IPage<PlaceCheckVO> selectPlaceCheckPage(IPage<PlaceCheckVO> page, PlaceCheckVO placeCheck) {
@@ -66,12 +78,37 @@
if (save) {
IPatrolRecordService bean = SpringUtil.getBean(IPatrolRecordService.class);
List<PatrolRecord> patrolRecordVOList = placeCheck.getPatrolRecordVOList();
+ AtomicReference<Integer> number = new AtomicReference<>(0);
patrolRecordVOList.stream().forEach(item -> {
item.setPlaceCheckId(placeCheck.getId());
item.setCreateUser(AuthUtil.getUserId());
+ if (item.getState().equals(0)) {
+ number.getAndSet(number.get() + 1);
+ }
});
- boolean b = bean.saveBatch(placeCheck.getPatrolRecordVOList());
+ boolean b = bean.saveBatch(patrolRecordVOList);
if (b) {
+ // 隐患问题大于0 则创建任务
+ try {
+ Integer integer = number.get();
+ if (integer > 0) {
+ // 保存任务表
+ ITaskService bean2 = SpringUtils.getBean(ITaskService.class);
+ Long aLong = bean2.saveTask(CommonConstant.NUMBER_FOUR, DictConstant.FIRE_RECTIFICATION_NOTICE, 1,
+ "", AuthUtil.getUserId(), placeCheck.getHouseCode(), CommonConstant.NUMBER_EIGHT);
+ if (aLong > 0) {
+ // 保存任务详情表
+ ITaskPlaceRectificationService bean1 = SpringUtil.getBean(ITaskPlaceRectificationService.class);
+ TaskPlaceRectificationEntity copy = BeanUtil.copy(placeCheck, TaskPlaceRectificationEntity.class);
+ copy.setTaskId(aLong);
+ copy.setPlaceCheckId(placeCheck.getId());
+ copy.setId(null);
+ bean1.save(copy);
+ }
+ }
+ } catch (Exception e) {
+ logger.error("任务保存失败!", e);
+ }
return b;
}
throw new Exception("保存失败!");
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 26d539e..7be7498 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
@@ -1081,4 +1081,26 @@
placePoiLabelService.remove(wrapper);
}
}
+
+ /**
+ * 九小场所档案
+ * @param page
+ * @param place
+ * @return
+ */
+ @Override
+ public IPage<PlaceVO> selectNinePlacePage(IPage<PlaceVO> page, PlaceVO place) {
+ List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId());
+ Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2;
+ List<String> list = new ArrayList<>();
+ if (null!=place.getRoleName() && !place.getRoleName().equals("")){
+ if (place.getRoleName().equals("网格员")){
+ // 查询对应的房屋地址code
+ list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId());
+ }
+ }
+ List<PlaceVO> placeVOS = baseMapper.selectNinePlacePage(page, place,list,regionChildCodesList,isAdministrator);
+ // 返回
+ return page.setRecords(placeVOS);
+ }
}
diff --git a/src/main/java/org/springblade/modules/place/vo/PlaceVO.java b/src/main/java/org/springblade/modules/place/vo/PlaceVO.java
index 730f523..e335c17 100644
--- a/src/main/java/org/springblade/modules/place/vo/PlaceVO.java
+++ b/src/main/java/org/springblade/modules/place/vo/PlaceVO.java
@@ -139,4 +139,13 @@
*/
private String y;
+ @ApiModelProperty(value = "警察名称")
+ private String policeName;
+
+ @ApiModelProperty(value = "警察电话")
+ private String policePhone;
+
+ @ApiModelProperty(value = "机构名称")
+ private String deptName;
+
}
diff --git a/src/main/java/org/springblade/modules/subjectChoices/mapper/SubjectChoicesMapper.xml b/src/main/java/org/springblade/modules/subjectChoices/mapper/SubjectChoicesMapper.xml
index c66cc6b..8330fac 100644
--- a/src/main/java/org/springblade/modules/subjectChoices/mapper/SubjectChoicesMapper.xml
+++ b/src/main/java/org/springblade/modules/subjectChoices/mapper/SubjectChoicesMapper.xml
@@ -32,11 +32,9 @@
<select id="selectCircleCommentByParentId" parameterType="long"
resultType="org.springblade.modules.subjectOption.vo.SubjectOptionVO">
SELECT
- jso.*,
- jar.subject_option_id ids,
- jar.answer numbers
+ jso.*
FROM
- jczz_subject_option jso LEFT JOIN jczz_answer_record jar on jso.id = jar.subject_option_id
+ jczz_subject_option jso
WHERE
jso.subject_choices_id = #{id}
</select>
diff --git a/src/main/java/org/springblade/modules/subjectChoices/service/impl/SubjectChoicesServiceImpl.java b/src/main/java/org/springblade/modules/subjectChoices/service/impl/SubjectChoicesServiceImpl.java
index 9502cb9..9bef93a 100644
--- a/src/main/java/org/springblade/modules/subjectChoices/service/impl/SubjectChoicesServiceImpl.java
+++ b/src/main/java/org/springblade/modules/subjectChoices/service/impl/SubjectChoicesServiceImpl.java
@@ -18,6 +18,8 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.common.utils.SpringUtils;
+import org.springblade.modules.answerRecord.service.IAnswerRecordService;
import org.springblade.modules.subjectChoices.dto.SubjectChoicesDTO;
import org.springblade.modules.subjectChoices.entity.SubjectChoicesEntity;
import org.springblade.modules.subjectChoices.mapper.SubjectChoicesMapper;
@@ -38,7 +40,18 @@
@Override
public IPage<SubjectChoicesVO> selectSubjectChoicesPage(IPage<SubjectChoicesVO> page, SubjectChoicesVO subjectChoices) {
- return page.setRecords(baseMapper.selectSubjectChoicesPage(page, subjectChoices));
+ List<SubjectChoicesVO> subjectChoicesVOS = baseMapper.selectSubjectChoicesPage(page, subjectChoices);
+ IAnswerRecordService bean = SpringUtils.getBean(IAnswerRecordService.class);
+ // for (SubjectChoicesVO subjectChoicesVO : subjectChoicesVOS) {
+ // List<SubjectOptionVO> subjectOptionList = subjectChoicesVO.getSubjectOptionList();
+ // for (SubjectOptionVO subjectOptionVO : subjectOptionList) {
+ // bean.getOne(Wrappers.<AnswerRecordEntity>lambdaQuery().
+ // eq(AnswerRecordEntity::getSubjectOptionId,subjectOptionVO.getId()))
+ // subjectOptionVO.setIds();
+ // subjectOptionVO.setNumbers();
+ // }
+ // }
+ return page.setRecords(subjectChoicesVOS);
}
/**
diff --git a/src/main/java/org/springblade/modules/system/controller/DictBizController.java b/src/main/java/org/springblade/modules/system/controller/DictBizController.java
index f64c48e..89bf79c 100644
--- a/src/main/java/org/springblade/modules/system/controller/DictBizController.java
+++ b/src/main/java/org/springblade/modules/system/controller/DictBizController.java
@@ -115,8 +115,8 @@
@GetMapping("/tree")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "树形结构", notes = "树形结构")
- public R<List<DictBizVO>> tree() {
- List<DictBizVO> tree = dictService.tree();
+ public R<List<DictBizVO>> tree(@RequestParam(value = "code", required = false) String code) {
+ List<DictBizVO> tree = dictService.tree(code);
return R.data(tree);
}
diff --git a/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.java b/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.java
index a625e96..9a571ce 100644
--- a/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.java
+++ b/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.java
@@ -51,7 +51,7 @@
*
* @return
*/
- List<DictBizVO> tree();
+ List<DictBizVO> tree(String code);
/**
* 获取树形节点
diff --git a/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml b/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml
index f6c85d6..1c1c2ae 100644
--- a/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml
+++ b/src/main/java/org/springblade/modules/system/mapper/DictBizMapper.xml
@@ -37,11 +37,49 @@
</select>-->
<select id="getList" resultMap="dictResultMap">
- select id, tenant_id, parent_id, code, dict_key, dict_value, sort, remark from blade_dict_biz where code = #{param1} and parent_id > 0 and is_sealed = 0 and is_deleted = 0
+ SELECT
+ id,
+ tenant_id,
+ parent_id,
+ CODE,
+ dict_key,
+ dict_value,
+ sort,
+ remark
+ FROM
+ blade_dict_biz
+ WHERE
+ CODE = #{param1}
+ and parent_id > 0
+ and is_sealed = 0
+ and is_deleted = 0
</select>
<select id="tree" resultMap="treeNodeResultMap">
- select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict_biz where is_deleted = 0
+ SELECT
+ id,
+ parent_id,
+ dict_value AS title,
+ id AS "value",
+ dict_key AS "key",
+ (
+ SELECT
+ CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
+ FROM
+ blade_dict_biz
+ WHERE
+ parent_id = id and is_deleted = 0
+ ) AS hasChildren
+ FROM
+ blade_dict_biz
+ <where>
+ <if test="param1 != null and param1 != ''">
+ CODE = #{param1}
+ and parent_id > 0
+ </if>
+ and is_deleted = 0
+ </where>
+
</select>
<select id="parentTree" resultMap="treeNodeResultMap">
diff --git a/src/main/java/org/springblade/modules/system/service/IDictBizService.java b/src/main/java/org/springblade/modules/system/service/IDictBizService.java
index 9d40381..faafecf 100644
--- a/src/main/java/org/springblade/modules/system/service/IDictBizService.java
+++ b/src/main/java/org/springblade/modules/system/service/IDictBizService.java
@@ -37,7 +37,7 @@
*
* @return
*/
- List<DictBizVO> tree();
+ List<DictBizVO> tree(String code);
/**
* 树形结构
diff --git a/src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java b/src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java
index dbf0dc6..7b20b5e 100644
--- a/src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java
+++ b/src/main/java/org/springblade/modules/system/service/impl/DictBizServiceImpl.java
@@ -52,8 +52,9 @@
public class DictBizServiceImpl extends ServiceImpl<DictBizMapper, DictBiz> implements IDictBizService {
@Override
- public List<DictBizVO> tree() {
- return ForestNodeMerger.merge(baseMapper.tree());
+ public List<DictBizVO> tree(String code) {
+ List<DictBizVO> tree = baseMapper.tree(code);
+ return ForestNodeMerger.merge(tree);
}
@Override
diff --git a/src/main/java/org/springblade/modules/system/vo/RegionVO.java b/src/main/java/org/springblade/modules/system/vo/RegionVO.java
index ed42f88..fec1deb 100644
--- a/src/main/java/org/springblade/modules/system/vo/RegionVO.java
+++ b/src/main/java/org/springblade/modules/system/vo/RegionVO.java
@@ -28,6 +28,7 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
/**
* 行政区划表视图实体类
@@ -88,4 +89,6 @@
}
private String regionCode;
+
+ private List<Map<String, Object>> nineTypeStatistics;
}
diff --git a/src/main/java/org/springblade/modules/task/entity/TaskEntity.java b/src/main/java/org/springblade/modules/task/entity/TaskEntity.java
index f8bb14b..f4da1d9 100644
--- a/src/main/java/org/springblade/modules/task/entity/TaskEntity.java
+++ b/src/main/java/org/springblade/modules/task/entity/TaskEntity.java
@@ -63,7 +63,7 @@
private String houseCode;
/** 事件类型(1:取保候审,2旅馆 3打金店 4二手手机 5二手车 6 校园安全) */
- @ApiModelProperty(value = "事件类型(1:取保候审,2旅馆 3打金店 4二手手机 5二手车 6 校园安全 7.九小场所)", example = "")
+ @ApiModelProperty(value = "事件类型(1:取保候审,2旅馆 3打金店 4二手手机 5二手车 6 校园安全 7.九小自查任务 8 九小整改任务 )", example = "")
@TableField("report_type")
private Integer reportType;
/**
diff --git a/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml b/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
index 768ae89..eb014d3 100644
--- a/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
+++ b/src/main/java/org/springblade/modules/task/mapper/TaskMapper.xml
@@ -139,10 +139,10 @@
</if>
<!-- 场所店铺 -->
<if test="task.reportType != null and task.reportType == 2 ">
- and jt.report_type in (2,3,4,5,6,7)
+ and jt.report_type in (2,3,4,5,6,7,8)
</if>
<if test="task.reportType == null">
- and jt.report_type in (2,3,4,5,6,7)
+ and jt.report_type in (2,3,4,5,6,7,8)
</if>
and jt.is_deleted = 0
and jt.house_code is not null
diff --git a/src/main/java/org/springblade/modules/taskPlaceRectification/controller/TaskPlaceRectificationController.java b/src/main/java/org/springblade/modules/taskPlaceRectification/controller/TaskPlaceRectificationController.java
new file mode 100644
index 0000000..7645231
--- /dev/null
+++ b/src/main/java/org/springblade/modules/taskPlaceRectification/controller/TaskPlaceRectificationController.java
@@ -0,0 +1,186 @@
+/*
+ * 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.taskPlaceRectification.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+
+import javax.validation.Valid;
+
+import org.springblade.core.secure.BladeUser;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.taskPlaceRectification.dto.TaskPlaceRectificationDTO;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity;
+import org.springblade.modules.taskPlaceRectification.vo.TaskPlaceRectificationVO;
+import org.springblade.modules.taskPlaceRectification.wrapper.TaskPlaceRectificationWrapper;
+import org.springblade.modules.taskPlaceRectification.service.ITaskPlaceRectificationService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
+
+/**
+ * 场所整改任务表 控制器
+ *
+ * @author BladeX
+ * @since 2024-01-31
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("blade-taskPlaceRectification/taskPlaceRectification")
+@Api(value = "场所整改任务表", tags = "场所整改任务表接口")
+public class TaskPlaceRectificationController extends BladeController {
+
+ private final ITaskPlaceRectificationService taskPlaceRectificationService;
+
+ /**
+ * 场所整改任务表 详情
+ */
+ @GetMapping("/detail")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "详情", notes = "传入taskPlaceRectification")
+ public R<TaskPlaceRectificationVO> detail(TaskPlaceRectificationEntity taskPlaceRectification) {
+ TaskPlaceRectificationEntity detail = taskPlaceRectificationService.getOne(Condition.getQueryWrapper(taskPlaceRectification));
+ return R.data(TaskPlaceRectificationWrapper.build().entityVO(detail));
+ }
+
+ /**
+ * 场所整改任务表 分页
+ */
+ @GetMapping("/list")
+ @ApiOperationSupport(order = 2)
+ @ApiOperation(value = "分页", notes = "传入taskPlaceRectification")
+ public R<IPage<TaskPlaceRectificationVO>> list(TaskPlaceRectificationEntity taskPlaceRectification, Query query) {
+ IPage<TaskPlaceRectificationEntity> pages = taskPlaceRectificationService.page(Condition.getPage(query), Condition.getQueryWrapper(taskPlaceRectification));
+ return R.data(TaskPlaceRectificationWrapper.build().pageVO(pages));
+ }
+
+ /**
+ * 场所整改任务表 自定义分页
+ */
+ @GetMapping("/page")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "分页", notes = "传入taskPlaceRectification")
+ public R<IPage<TaskPlaceRectificationVO>> page(TaskPlaceRectificationVO taskPlaceRectification, Query query) {
+ IPage<TaskPlaceRectificationVO> pages = taskPlaceRectificationService.selectTaskPlaceRectificationPage(Condition.getPage(query), taskPlaceRectification);
+ return R.data(pages);
+ }
+
+ /**
+ * 场所整改任务表 新增
+ */
+ @PostMapping("/save")
+ @ApiOperationSupport(order = 4)
+ @ApiOperation(value = "新增", notes = "传入taskPlaceRectification")
+ public R save(@Valid @RequestBody TaskPlaceRectificationEntity taskPlaceRectification) {
+ return R.status(taskPlaceRectificationService.save(taskPlaceRectification));
+ }
+
+ /**
+ * 场所整改任务表 修改
+ */
+ @PostMapping("/update")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "修改", notes = "传入taskPlaceRectification")
+ public R update(@Valid @RequestBody TaskPlaceRectificationEntity taskPlaceRectification) {
+ return R.status(taskPlaceRectificationService.updateById(taskPlaceRectification));
+ }
+
+ /**
+ * 场所整改任务表 新增或修改
+ */
+ @PostMapping("/submit")
+ @ApiOperationSupport(order = 6)
+ @ApiOperation(value = "新增或修改", notes = "传入taskPlaceRectification")
+ public R submit(@Valid @RequestBody TaskPlaceRectificationEntity taskPlaceRectification) {
+ return R.status(taskPlaceRectificationService.saveOrUpdate(taskPlaceRectification));
+ }
+
+ /**
+ * 场所整改任务表 删除
+ */
+ @PostMapping("/remove")
+ @ApiOperationSupport(order = 7)
+ @ApiOperation(value = "逻辑删除", notes = "传入ids")
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+ return R.status(taskPlaceRectificationService.removeBatchByIds(Func.toLongList(ids)));
+ }
+
+ /**
+ * 场所整改任务表 详情
+ */
+ @GetMapping("/detailByTaskId")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "详情", notes = "传入taskPlaceRectification")
+ public R<TaskPlaceRectificationVO> detailById(TaskPlaceRectificationEntity taskPlaceRectification) {
+ TaskPlaceRectificationEntity detail = taskPlaceRectificationService.selectTaskPlaceRectificationById(taskPlaceRectification.getTaskId());
+ return R.data(TaskPlaceRectificationWrapper.build().entityVO(detail));
+ }
+
+
+ /**
+ * 场所整改任务表 详情
+ */
+ @GetMapping("/getTaskPlaceRectificationList")
+ @ApiOperationSupport(order = 1)
+ @ApiOperation(value = "消防隐患整改情况登记表", notes = "传入taskPlaceRectification")
+ public R<IPage<TaskPlaceRectificationVO>> getTaskPlaceRectificationList(TaskPlaceRectificationDTO taskPlaceRectification, Query query) {
+ IPage<TaskPlaceRectificationVO> taskPlaceRectificationDTOS = taskPlaceRectificationService.selectTaskPlaceRectificationList(Condition.getPage(query), taskPlaceRectification);
+ return R.data(taskPlaceRectificationDTOS);
+ }
+
+
+ /**
+ * 场所整改任务表 修改
+ */
+ @PostMapping("/updateRectification")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "场所负责人整改", notes = "传入taskPlaceRectification")
+ public R updateRectification(@Valid @RequestBody TaskPlaceRectificationVO taskPlaceRectification) {
+ return R.status(taskPlaceRectificationService.updateRectification(taskPlaceRectification));
+ }
+
+ /**
+ * 民警审核
+ */
+ @PostMapping("/applyRectification")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "民警审核", notes = "传入taskPlaceRectification")
+ public R applyRectification(@Valid @RequestBody TaskPlaceRectificationVO taskPlaceRectification) {
+ return R.status(taskPlaceRectificationService.applyRectification(taskPlaceRectification));
+ }
+
+
+ /**
+ * 民警审核
+ */
+ @GetMapping("/rectificationStatistics")
+ @ApiOperationSupport(order = 5)
+ @ApiOperation(value = "九小场所类型隐患数量统计", notes = "传入taskPlaceRectification")
+ public R rectificationStatistics() {
+ return R.data(taskPlaceRectificationService.rectificationStatistics());
+ }
+
+
+}
diff --git a/src/main/java/org/springblade/modules/taskPlaceRectification/dto/TaskPlaceRectificationDTO.java b/src/main/java/org/springblade/modules/taskPlaceRectification/dto/TaskPlaceRectificationDTO.java
new file mode 100644
index 0000000..8f58c6b
--- /dev/null
+++ b/src/main/java/org/springblade/modules/taskPlaceRectification/dto/TaskPlaceRectificationDTO.java
@@ -0,0 +1,76 @@
+/*
+ * 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.taskPlaceRectification.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.modules.patrol.entity.PatrolRecord;
+import org.springblade.modules.place.vo.PlacePoiLabelVO;
+import org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * 场所整改任务表 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2024-01-31
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TaskPlaceRectificationDTO extends TaskPlaceRectificationEntity {
+ private static final long serialVersionUID = 1L;
+ private List<PatrolRecord> patrolRecordVOList;
+
+ private List<PlacePoiLabelVO> placePoiLabelVOList ;
+
+ @ApiModelProperty(value = "场所名称", example = "")
+ private String placeName;
+
+ @ApiModelProperty(value = "场所地址", example = "")
+ private String location;
+
+ @ApiModelProperty(value = "负责人", example = "")
+ private String principal;
+
+ @ApiModelProperty(value = "网格名称", example = "")
+ private String gridName;
+
+ @ApiModelProperty(value = "负责人电话", example = "")
+ private String principalPhone;
+
+ @ApiModelProperty(value = "街道名称", example = "")
+ private String streetName;
+
+ @ApiModelProperty(value = "社区名称", example = "")
+ private String communityName;
+
+ @ApiModelProperty(value = "法人", example = "")
+ private String legalPerson;
+
+ @ApiModelProperty(value = "法人电话", example = "")
+ private String legalTel;
+
+ @ApiModelProperty(value = "检查人名称", example = "")
+ private String name;
+
+ @ApiModelProperty(value = "隐患数量", example = "")
+ private Integer number;
+
+
+}
diff --git a/src/main/java/org/springblade/modules/taskPlaceRectification/entity/TaskPlaceRectificationEntity.java b/src/main/java/org/springblade/modules/taskPlaceRectification/entity/TaskPlaceRectificationEntity.java
new file mode 100644
index 0000000..c7a3a4e
--- /dev/null
+++ b/src/main/java/org/springblade/modules/taskPlaceRectification/entity/TaskPlaceRectificationEntity.java
@@ -0,0 +1,143 @@
+/*
+ * 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.taskPlaceRectification.entity;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import liquibase.pro.packaged.L;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 场所整改任务表 实体类
+ *
+ * @author BladeX
+ * @since 2024-01-31
+ */
+@Data
+@TableName("jczz_task_place_rectification")
+@ApiModel(value = "TaskPlaceRectification对象", description = "场所整改任务表")
+public class TaskPlaceRectificationEntity {
+
+ /** id */
+ @ApiModelProperty(value = "主键ID", example = "")
+ @TableId(value = "id", type = IdType.ASSIGN_ID)
+ private Long id;
+
+ /** 场所检查id */
+ @ApiModelProperty(value = "场所检查id", example = "")
+ @TableField("place_check_id")
+ private Long placeCheckId;
+
+ /** 任务id */
+ @ApiModelProperty(value = "任务id", example = "")
+ @TableField("task_id")
+ private Long taskId;
+
+ /** 任务状态: 1:待接收 2:审核中 3:审核通过 4:审核不通过 */
+ @ApiModelProperty(value = "状态 1:待审核 2:审核通过 3:审核不通过 4:待上报(场所负责人完善,由系统下发的任务)", example = "")
+ @TableField("status")
+ private Integer status;
+
+ /** 任务名称 */
+ @ApiModelProperty(value = "任务名称", example = "")
+ @TableField("task_name")
+ private String taskName;
+
+ /** 场所名称 */
+ @ApiModelProperty(value = "场所名称", example = "")
+ @TableField("place_name")
+ private String placeName;
+
+ /** 隐患内容 */
+ @ApiModelProperty(value = "隐患内容", example = "")
+ @TableField("remark")
+ private String remark;
+
+ /** 更新时间 */
+ @ApiModelProperty(value = "更新时间", example = "")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @TableField("update_time")
+ private Date updateTime;
+
+ /** 创建时间 */
+ @ApiModelProperty(value = "创建时间", example = "")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @TableField(value = "create_time",fill = FieldFill.INSERT)
+ private Date createTime;
+
+ /** 门牌地址编码 */
+ @ApiModelProperty(value = "门牌地址编码", example = "")
+ @TableField("house_code")
+ private String houseCode;
+
+ /** 是否下发整改通知: 1:否 2 :是 */
+ @ApiModelProperty(value = "是否下发整改通知: 1:否 2 :是 ", example = "")
+ @TableField("rectification_notice_flag")
+ private Integer rectificationNoticeFlag;
+
+ /** 整改截止时间 */
+ @ApiModelProperty(value = "整改截止时间", example = "")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @TableField("rectification_end_time")
+ private Date rectificationEndTime;
+
+ /** 整改完成时间 */
+ @ApiModelProperty(value = "整改完成时间", example = "")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ @TableField("rectification_complete_time")
+ private Date rectificationCompleteTime;
+
+ /** 是否整改完毕:1:否 2 :是 */
+ @ApiModelProperty(value = "是否整改完毕:1:否 2 :是", example = "")
+ @TableField("rectification_flag")
+ private Integer rectificationFlag;
+
+ /** 是否处罚:1:否 2 :是 */
+ @ApiModelProperty(value = "是否处罚:1:否 2 :是", example = "")
+ @TableField("punish_flag")
+ private Integer punishFlag;
+
+ /** 派出所 */
+ @ApiModelProperty(value = "派出所", example = "")
+ @TableField("police_station")
+ private String policeStation;
+
+ /** 整改通知书地址 */
+ @ApiModelProperty(value = "整改通知书地址", example = "")
+ @TableField("rectification_notice_img_url")
+ private String rectificationNoticeImgUrl;
+
+ /** 签名路径 */
+ @ApiModelProperty(value = "签名路径", example = "")
+ @TableField("signature_path")
+ private String signaturePath;
+
+ /** 创建人 */
+ @ApiModelProperty(value = "创建人", example = "")
+ @TableField("create_user")
+ private Long createUser;
+
+ /** 照片 */
+ @ApiModelProperty(value = "照片", example = "")
+ @TableField("image_urls")
+ private String imageUrls;
+
+}
diff --git a/src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.java b/src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.java
new file mode 100644
index 0000000..b0771c1
--- /dev/null
+++ b/src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.java
@@ -0,0 +1,67 @@
+/*
+ * 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.taskPlaceRectification.mapper;
+
+import org.apache.ibatis.annotations.MapKey;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.taskPlaceRectification.dto.TaskPlaceRectificationDTO;
+import org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity;
+import org.springblade.modules.taskPlaceRectification.vo.TaskPlaceRectificationVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 场所整改任务表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2024-01-31
+ */
+public interface TaskPlaceRectificationMapper extends BaseMapper<TaskPlaceRectificationEntity> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param taskPlaceRectification
+ * @return
+ */
+ List<TaskPlaceRectificationVO> selectTaskPlaceRectificationPage(IPage page, TaskPlaceRectificationVO taskPlaceRectification);
+
+ /**
+ * 查询场所整改任务表
+ *
+ * @param taskId 场所整改任务表ID
+ * @return 场所整改任务表
+ */
+ public TaskPlaceRectificationVO selectTaskPlaceRectificationById(@Param("taskId") Long taskId);
+
+ /**
+ * 查询场所整改任务表列表
+ *
+ * @param taskPlaceRectificationDTO 场所整改任务表
+ * @return 场所整改任务表集合
+ */
+ public List<TaskPlaceRectificationVO> selectTaskPlaceRectificationList(IPage page,
+ @Param("taskPalce") TaskPlaceRectificationDTO taskPlaceRectificationDTO,
+ @Param("regionChildCodesList") List<String> regionChildCodesList,
+ @Param("isAdministrator") Integer isAdministrator);
+
+ List<Map<String, Object>> getNineTypeStatistics(List<String> regionChildCodesList, Integer isAdministrator);
+}
diff --git a/src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.xml b/src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.xml
new file mode 100644
index 0000000..b58a51a
--- /dev/null
+++ b/src/main/java/org/springblade/modules/taskPlaceRectification/mapper/TaskPlaceRectificationMapper.xml
@@ -0,0 +1,312 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.modules.taskPlaceRectification.mapper.TaskPlaceRectificationMapper">
+
+ <!-- 通用查询映射结果 -->
+ <resultMap id="taskPlaceRectificationResultMap"
+ type="org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity">
+ </resultMap>
+
+
+ <select id="selectTaskPlaceRectificationPage" resultMap="taskPlaceRectificationResultMap">
+ select * from jczz_task_place_rectification where is_deleted = 0
+ </select>
+
+ <resultMap type="org.springblade.modules.taskPlaceRectification.vo.TaskPlaceRectificationVO"
+ id="TaskPlaceRectificationDTOResult">
+ <result property="id" column="id"/>
+ <result property="placeCheckId" column="place_check_id"/>
+ <result property="taskId" column="task_id"/>
+ <result property="status" column="status"/>
+ <result property="taskName" column="task_name"/>
+ <result property="placeName" column="place_name"/>
+ <result property="remark" column="remark"/>
+ <result property="updateTime" column="update_time"/>
+ <result property="createTime" column="create_time"/>
+ <result property="houseCode" column="house_code"/>
+ <result property="rectificationNoticeFlag" column="rectification_notice_flag"/>
+ <result property="rectificationEndTime" column="rectification_end_time"/>
+ <result property="rectificationCompleteTime" column="rectification_complete_time"/>
+ <result property="rectificationFlag" column="rectification_flag"/>
+ <result property="punishFlag" column="punish_flag"/>
+ <result property="policeStation" column="police_station"/>
+ <result property="rectificationNoticeImgUrl" column="rectification_notice_img_url"/>
+ <result property="signaturePath" column="signature_path"/>
+ <result property="createUser" column="create_user"/>
+ <result property="imageUrls" column="image_urls"/>
+
+ <collection property="placePoiLabelVOList" column="jpid" javaType="java.util.List"
+ select="selectPlacePoiLabelList"
+ ofType="org.springblade.modules.place.vo.PlacePoiLabelVO"
+ autoMapping="true">
+ </collection>
+
+ <collection property="patrolRecordVOList" column="place_check_id" select="selectPatrolRecordList"
+ javaType="java.util.List" ofType="org.springblade.modules.patrol.vo.PatrolRecordVO"
+ autoMapping="true">
+ </collection>
+
+
+ </resultMap>
+
+ <select id="selectPlacePoiLabelList" parameterType="Long"
+ resultType="org.springblade.modules.place.vo.PlacePoiLabelVO">
+ SELECT
+ jppl.id,
+ jppl.place_id,
+ jppl.poi_code,
+ jppl.type,
+ jppl.color,
+ jppl.remark,
+ jc.category_name labelName
+ FROM
+ jczz_place_poi_label jppl
+ LEFT JOIN jczz_category jc ON jppl.poi_code = jc.category_no
+ WHERE
+ jppl.type = '3'
+ and place_id = #{jpid}
+ </select>
+
+
+ <select id="selectPatrolRecordList" parameterType="Long"
+ resultType="org.springblade.modules.patrol.vo.PatrolRecordVO">
+ select
+ jpr.id,
+ jpr.item_id,
+ jpr.place_check_id,
+ jpr.state,
+ jpr.remark,
+ jpr.image_urls,
+ jpr.create_user,
+ jpr.create_time,
+ jpr.is_deleted,
+ jpr.rectification_image_urls,
+ jpr.rectification_remark,
+ jpr.rectification_time,
+ jpgi.items_name
+ from
+ jczz_patrol_record jpr
+ LEFT JOIN jczz_patrol_group_item jpgi on jpr.item_id= jpgi.id
+ where place_check_id = #{id}
+ </select>
+
+ <sql id="selectTaskPlaceRectification">
+ select
+ id,
+ place_check_id,
+ task_id,
+ status,
+ task_name,
+ place_name,
+ remark,
+ update_time,
+ create_time,
+ house_code,
+ rectification_notice_flag,
+ rectification_end_time,
+ rectification_complete_time,
+ rectification_flag,
+ punish_flag,
+ police_station,
+ rectification_notice_img_url,
+ signature_path,
+ create_user,
+ image_urls
+ from
+ jczz_task_place_rectification
+ </sql>
+
+ <select id="selectTaskPlaceRectificationById" parameterType="long" resultMap="TaskPlaceRectificationDTOResult">
+ SELECT
+ jtpr.*,
+ jp.id jpid,
+ jp.place_name,
+ jp.location,
+ jg.grid_name,
+ jp.principal,
+ jp.principal_phone,
+ br.town_name,
+ br.village_name,
+ bu.`name`,
+ jpe.legal_tel,
+ jpe.legal_person,
+ jt.remark reasonFailure
+ FROM
+ jczz_task_place_rectification jtpr
+ LEFT JOIN jczz_task jt on jt.id = jtpr.task_id
+ LEFT JOIN jczz_place jp ON jtpr.house_code = jp.house_code
+ LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code
+ LEFT JOIN blade_region br ON br.`code` = jg.community_code
+ LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id
+ LEFT JOIN blade_user bu ON bu.id = jtpr.create_user
+ WHERE jtpr.task_id = #{taskId}
+ </select>
+
+ <select id="selectTaskPlaceRectificationList"
+ parameterType="org.springblade.modules.taskPlaceRectification.vo.TaskPlaceRectificationVO"
+ resultMap="TaskPlaceRectificationDTOResult">
+ SELECT
+ jtpr.id,
+ jtpr.place_check_id,
+ jtpr.task_id,
+ jtpr.STATUS,
+ jtpr.task_name,
+ jtpr.remark,
+ jtpr.update_time,
+ jtpr.create_time,
+ jtpr.house_code,
+ jtpr.rectification_notice_flag,
+ jtpr.rectification_end_time,
+ jtpr.rectification_complete_time,
+ jtpr.rectification_flag,
+ jtpr.punish_flag,
+ jtpr.police_station,
+ jtpr.rectification_notice_img_url,
+ jtpr.signature_path,
+ jtpr.create_user,
+ jtpr.image_urls,
+ bd.dept_name,
+ jp.id jpid,
+ jp.place_name,
+ jp.location,
+ jg.grid_name,
+ jp.principal,
+ jp.principal_phone,
+ jp.nine_type,
+ br.town_name,
+ br.village_name,
+ bu.`name`,
+ jpe.legal_tel,
+ jpe.legal_person
+ FROM
+ jczz_task_place_rectification jtpr
+ LEFT JOIN jczz_place jp ON jtpr.house_code = jp.house_code
+ LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code
+ LEFT JOIN blade_region br ON br.`code` = jg.community_code
+ LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id
+ LEFT JOIN blade_user bu ON bu.id = jtpr.create_user
+ LEFT JOIN blade_dept bd ON bu.dept_id = bd.id
+ <where>
+ <if test="taskPalce.id != null ">and id = #{taskPalce.id}</if>
+ <if test="taskPalce.placeCheckId != null ">and place_check_id = #{taskPalce.placeCheckId}</if>
+ <if test="taskPalce.taskId != null ">and task_id = #{taskPalce.taskId}</if>
+ <if test="taskPalce.status != null ">and status = #{taskPalce.status}</if>
+ <if test="taskPalce.taskName != null and taskPalce.taskName != ''">and task_name = #{taskPalce.taskName}
+ </if>
+ <if test="taskPalce.placeName != null and taskPalce.placeName != ''">and place_name =
+ #{taskPalce.placeName}
+ </if>
+ <if test="taskPalce.remark != null and taskPalce.remark != ''">and remark = #{taskPalce.remark}</if>
+ <if test="taskPalce.updateTime != null ">and update_time = #{taskPalce.updateTime}</if>
+ <if test="taskPalce.createTime != null ">and create_time = #{taskPalce.createTime}</if>
+ <if test="taskPalce.houseCode != null and taskPalce.houseCode != ''">and house_code =
+ #{taskPalce.houseCode}
+ </if>
+ <if test="taskPalce.rectificationNoticeFlag != null ">and rectification_notice_flag =
+ #{taskPalce.rectificationNoticeFlag}
+ </if>
+ <if test="taskPalce.rectificationEndTime != null ">and rectification_end_time =
+ #{taskPalce.rectificationEndTime}
+ </if>
+ <if test="taskPalce.rectificationCompleteTime != null ">and rectification_complete_time =
+ #{taskPalce.rectificationCompleteTime}
+ </if>
+ <if test="taskPalce.rectificationFlag != null ">and rectification_flag = #{taskPalce.rectificationFlag}</if>
+ <if test="taskPalce.punishFlag != null ">and punish_flag = #{taskPalce.punishFlag}</if>
+ <if test="taskPalce.policeStation != null and taskPalce.policeStation != ''">and police_station =
+ #{taskPalce.policeStation}
+ </if>
+ <if test="taskPalce.rectificationNoticeImgUrl != null and taskPalce.rectificationNoticeImgUrl != ''">and
+ rectification_notice_img_url = #{taskPalce.rectificationNoticeImgUrl}
+ </if>
+ <if test="taskPalce.signaturePath != null and taskPalce.signaturePath != ''">and signature_path =
+ #{taskPalce.signaturePath}
+ </if>
+ <if test="taskPalce.createUser != null ">and create_user = #{taskPalce.createUser}</if>
+ <if test="taskPalce.imageUrls != null and taskPalce.imageUrls != ''">and image_urls =
+ #{taskPalce.imageUrls}
+ </if>
+ <if test="isAdministrator==2">
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and jg.grid_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ </choose>
+ </if>
+ </where>
+ </select>
+
+
+ <select id="getNineTypeStatistics1" resultType="list">
+ SELECT
+ bd.dict_key,
+ bd.dict_value,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_place jp
+ LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code
+ <where>
+ <if test="isAdministrator==2">
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and jg.grid_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ </choose>
+ </if>
+ and jp.nine_type = bd.dict_key
+ </where>
+ ) number
+ FROM
+ blade_dict_biz bd
+ WHERE
+ bd.`code` = 'nineType'
+ AND bd.is_sealed = 0
+ AND bd.dict_key > 0
+
+
+ </select>
+ <select id="getNineTypeStatistics" resultType="java.util.Map">
+
+ SELECT
+ bd.dict_key,
+ bd.dict_value,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_place jp
+ LEFT JOIN jczz_grid jg ON jg.grid_code = jp.grid_code
+ <where>
+ <if test="isAdministrator==2">
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and jg.grid_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ </choose>
+ </if>
+ and jp.nine_type = bd.dict_key
+ </where>
+ ) number
+ FROM
+ blade_dict_biz bd
+ WHERE
+ bd.code = 'nineType'
+ AND bd.is_sealed = 0
+ AND bd.dict_key > 0
+ order by bd.sort desc
+
+ </select>
+
+
+</mapper>
diff --git a/src/main/java/org/springblade/modules/taskPlaceRectification/service/ITaskPlaceRectificationService.java b/src/main/java/org/springblade/modules/taskPlaceRectification/service/ITaskPlaceRectificationService.java
new file mode 100644
index 0000000..96e8128
--- /dev/null
+++ b/src/main/java/org/springblade/modules/taskPlaceRectification/service/ITaskPlaceRectificationService.java
@@ -0,0 +1,66 @@
+/*
+ * 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.taskPlaceRectification.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.modules.taskPlaceRectification.dto.TaskPlaceRectificationDTO;
+import org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity;
+import org.springblade.modules.taskPlaceRectification.vo.TaskPlaceRectificationVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+
+/**
+ * 场所整改任务表 服务类
+ *
+ * @author BladeX
+ * @since 2024-01-31
+ */
+public interface ITaskPlaceRectificationService extends IService<TaskPlaceRectificationEntity> {
+
+ /**
+ * 自定义分页
+ *
+ * @param page
+ * @param taskPlaceRectification
+ * @return
+ */
+ IPage<TaskPlaceRectificationVO> selectTaskPlaceRectificationPage(IPage<TaskPlaceRectificationVO> page, TaskPlaceRectificationVO taskPlaceRectification);
+
+ /**
+ * 查询场所整改任务表
+ *
+ * @param taskId 场所整改任务表ID
+ * @return 场所整改任务表
+ */
+ public TaskPlaceRectificationVO selectTaskPlaceRectificationById(Long taskId);
+
+ /**
+ * 查询场所整改任务表列表
+ *
+ * @param taskPlaceRectificationDTO 场所整改任务表
+ * @return 场所整改任务表集合
+ */
+ public IPage<TaskPlaceRectificationVO> selectTaskPlaceRectificationList(IPage<TaskPlaceRectificationVO> page, TaskPlaceRectificationDTO taskPlaceRectificationDTO);
+
+ Boolean updateRectification(TaskPlaceRectificationVO taskPlaceRectification);
+
+ Boolean applyRectification(TaskPlaceRectificationVO taskPlaceRectification);
+
+ Object rectificationStatistics();
+}
diff --git a/src/main/java/org/springblade/modules/taskPlaceRectification/service/impl/TaskPlaceRectificationServiceImpl.java b/src/main/java/org/springblade/modules/taskPlaceRectification/service/impl/TaskPlaceRectificationServiceImpl.java
new file mode 100644
index 0000000..9f4077d
--- /dev/null
+++ b/src/main/java/org/springblade/modules/taskPlaceRectification/service/impl/TaskPlaceRectificationServiceImpl.java
@@ -0,0 +1,145 @@
+/*
+ * 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.taskPlaceRectification.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.common.cache.SysCache;
+import org.springblade.common.utils.SpringUtils;
+import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.patrol.entity.PatrolRecord;
+import org.springblade.modules.patrol.service.IPatrolRecordService;
+import org.springblade.modules.patrol.vo.PatrolRecordVO;
+import org.springblade.modules.system.entity.DictBiz;
+import org.springblade.modules.system.entity.Region;
+import org.springblade.modules.system.service.IDeptService;
+import org.springblade.modules.system.service.IDictBizService;
+import org.springblade.modules.system.service.IRegionService;
+import org.springblade.modules.system.vo.RegionVO;
+import org.springblade.modules.task.entity.TaskEntity;
+import org.springblade.modules.task.service.ITaskService;
+import org.springblade.modules.taskPlaceRectification.dto.TaskPlaceRectificationDTO;
+import org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity;
+import org.springblade.modules.taskPlaceRectification.vo.TaskPlaceRectificationVO;
+import org.springblade.modules.taskPlaceRectification.mapper.TaskPlaceRectificationMapper;
+import org.springblade.modules.taskPlaceRectification.service.ITaskPlaceRectificationService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 场所整改任务表 服务实现类
+ *
+ * @author BladeX
+ * @since 2024-01-31
+ */
+@Service
+public class TaskPlaceRectificationServiceImpl extends ServiceImpl<TaskPlaceRectificationMapper, TaskPlaceRectificationEntity> implements ITaskPlaceRectificationService {
+
+ @Override
+ public IPage<TaskPlaceRectificationVO> selectTaskPlaceRectificationPage(IPage<TaskPlaceRectificationVO> page, TaskPlaceRectificationVO taskPlaceRectification) {
+ return page.setRecords(baseMapper.selectTaskPlaceRectificationPage(page, taskPlaceRectification));
+ }
+
+
+ /**
+ * 查询场所整改任务表
+ *
+ * @param taskId 场所整改任务表ID
+ * @return 场所整改任务表
+ */
+ @Override
+ public TaskPlaceRectificationVO selectTaskPlaceRectificationById(Long taskId) {
+ return this.baseMapper.selectTaskPlaceRectificationById(taskId);
+ }
+
+ /**
+ * 查询场所整改任务表列表
+ *
+ * @param taskPlaceRectificationDTO 场所整改任务表
+ * @return 场所整改任务表集合
+ */
+ @Override
+ public IPage<TaskPlaceRectificationVO> selectTaskPlaceRectificationList(IPage<TaskPlaceRectificationVO> page, TaskPlaceRectificationDTO taskPlaceRectificationDTO) {
+ // 数据过滤
+ List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId());
+ Integer isAdministrator = AuthUtil.isAdmin() == true ? 1 : 2;
+ List<TaskPlaceRectificationVO> taskPlaceRectificationVOS = baseMapper.selectTaskPlaceRectificationList(page, taskPlaceRectificationDTO, regionChildCodesList, isAdministrator);
+ for (TaskPlaceRectificationVO taskPlaceRectificationVO : taskPlaceRectificationVOS) {
+ StringBuilder builder = new StringBuilder("");
+ List<PatrolRecordVO> patrolRecordVOList = taskPlaceRectificationVO.getPatrolRecordVOList();
+ for (PatrolRecordVO patrolRecordVO : patrolRecordVOList) {
+ builder.append(patrolRecordVO.getItemsName()).append(";");
+ }
+ taskPlaceRectificationVO.setHiddenDanger(builder.toString());
+ }
+ return page.setRecords(taskPlaceRectificationVOS);
+ }
+
+ @Override
+ public Boolean updateRectification(TaskPlaceRectificationVO taskPlaceRectification) {
+ // 更新隐患项记录
+ IPatrolRecordService patrolRecordService = SpringUtils.getBean(IPatrolRecordService.class);
+ List<PatrolRecordVO> patrolRecordVOList = taskPlaceRectification.getPatrolRecordVOList();
+ boolean b = patrolRecordService.updateBatchById(BeanUtil.copy(patrolRecordVOList, PatrolRecord.class));
+ if (b) {
+ // 更新任务状态
+ ITaskService bean = SpringUtils.getBean(ITaskService.class);
+ boolean update = bean.update(Wrappers.<TaskEntity>lambdaUpdate()
+ .set(TaskEntity::getStatus, taskPlaceRectification.getStatus())
+ .eq(TaskEntity::getId, taskPlaceRectification.getTaskId()));
+ // 更新任务详情状态
+ boolean b1 = updateById(taskPlaceRectification);
+ return b1;
+ }
+ return false;
+ }
+
+ @Override
+ public Boolean applyRectification(TaskPlaceRectificationVO taskPlaceRectification) {
+ // 更新任务状态
+ ITaskService bean = SpringUtils.getBean(ITaskService.class);
+ boolean update = bean.update(Wrappers.<TaskEntity>lambdaUpdate()
+ .set(TaskEntity::getStatus, taskPlaceRectification.getStatus())
+ .set(TaskEntity::getRemark,taskPlaceRectification.getReasonFailure())
+ .eq(TaskEntity::getId, taskPlaceRectification.getTaskId()));
+ // 更新任务详情状态
+ boolean b1 = updateById(taskPlaceRectification);
+ return b1;
+ }
+
+ @Override
+ public Object rectificationStatistics() {
+ List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId());
+ Integer isAdministrator = AuthUtil.isAdmin() == true ? 1 : 2;
+ // 统计九小场所类型隐患统计
+ IRegionService bean = SpringUtils.getBean(IRegionService.class);
+ List<Region> list = bean.list(Wrappers.<Region>lambdaQuery()
+ .like(Region::getCode, "361102")
+ .eq(Region::getRegionLevel, 4));
+ List<RegionVO> copy = BeanUtil.copy(list, RegionVO.class);
+ for (RegionVO regionVO : copy) {
+ List<Map<String, Object>> nineTypeStatistics = baseMapper.getNineTypeStatistics(regionChildCodesList, isAdministrator);
+ regionVO.setNineTypeStatistics(nineTypeStatistics);
+ }
+ return copy;
+ }
+}
diff --git a/src/main/java/org/springblade/modules/taskPlaceRectification/vo/TaskPlaceRectificationVO.java b/src/main/java/org/springblade/modules/taskPlaceRectification/vo/TaskPlaceRectificationVO.java
new file mode 100644
index 0000000..6a29330
--- /dev/null
+++ b/src/main/java/org/springblade/modules/taskPlaceRectification/vo/TaskPlaceRectificationVO.java
@@ -0,0 +1,92 @@
+/*
+ * 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.taskPlaceRectification.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.springblade.modules.patrol.entity.PatrolRecord;
+import org.springblade.modules.patrol.vo.PatrolRecordVO;
+import org.springblade.modules.place.vo.PlacePoiLabelVO;
+import org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity;
+import org.springblade.core.tool.node.INode;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.List;
+
+/**
+ * 场所整改任务表 视图实体类
+ *
+ * @author BladeX
+ * @since 2024-01-31
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class TaskPlaceRectificationVO extends TaskPlaceRectificationEntity {
+ private static final long serialVersionUID = 1L;
+
+ @ApiModelProperty(value = "隐患项目", example = "")
+ private List<PatrolRecordVO> patrolRecordVOList;
+
+ @ApiModelProperty(value = "场所标签", example = "")
+ private List<PlacePoiLabelVO> placePoiLabelVOList ;
+
+ @ApiModelProperty(value = "场所名称", example = "")
+ private String placeName;
+
+ @ApiModelProperty(value = "场所地址", example = "")
+ private String location;
+
+ @ApiModelProperty(value = "负责人", example = "")
+ private String principal;
+
+ @ApiModelProperty(value = "网格名称", example = "")
+ private String gridName;
+
+ @ApiModelProperty(value = "负责人电话", example = "")
+ private String principalPhone;
+
+ @ApiModelProperty(value = "街道名称", example = "")
+ private String streetName;
+
+ @ApiModelProperty(value = "社区名称", example = "")
+ private String communityName;
+
+ @ApiModelProperty(value = "法人", example = "")
+ private String legalPerson;
+
+ @ApiModelProperty(value = "法人电话", example = "")
+ private String legalTel;
+
+ @ApiModelProperty(value = "检查人名称", example = "")
+ private String name;
+
+ @ApiModelProperty(value = "隐患数量", example = "")
+ private Integer number;
+
+ @ApiModelProperty(value = "机构名称", example = "")
+ private String deptName;
+
+ @ApiModelProperty(value = "九小场所类型 业务字典:nineType", example = "")
+ private String nineType;
+
+ @ApiModelProperty(value = "隐患问题", example = "")
+ private String hiddenDanger;
+
+ @ApiModelProperty(value = "不通过原因", example = "")
+ private String reasonFailure;
+
+}
diff --git a/src/main/java/org/springblade/modules/taskPlaceRectification/wrapper/TaskPlaceRectificationWrapper.java b/src/main/java/org/springblade/modules/taskPlaceRectification/wrapper/TaskPlaceRectificationWrapper.java
new file mode 100644
index 0000000..111fc8a
--- /dev/null
+++ b/src/main/java/org/springblade/modules/taskPlaceRectification/wrapper/TaskPlaceRectificationWrapper.java
@@ -0,0 +1,50 @@
+/*
+ * 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.taskPlaceRectification.wrapper;
+
+import org.springblade.core.mp.support.BaseEntityWrapper;
+import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.taskPlaceRectification.entity.TaskPlaceRectificationEntity;
+import org.springblade.modules.taskPlaceRectification.vo.TaskPlaceRectificationVO;
+import java.util.Objects;
+
+/**
+ * 场所整改任务表 包装类,返回视图层所需的字段
+ *
+ * @author BladeX
+ * @since 2024-01-31
+ */
+public class TaskPlaceRectificationWrapper extends BaseEntityWrapper<TaskPlaceRectificationEntity, TaskPlaceRectificationVO> {
+
+ public static TaskPlaceRectificationWrapper build() {
+ return new TaskPlaceRectificationWrapper();
+ }
+
+ @Override
+ public TaskPlaceRectificationVO entityVO(TaskPlaceRectificationEntity taskPlaceRectification) {
+ TaskPlaceRectificationVO taskPlaceRectificationVO = Objects.requireNonNull(BeanUtil.copy(taskPlaceRectification, TaskPlaceRectificationVO.class));
+
+ //User createUser = UserCache.getUser(taskPlaceRectification.getCreateUser());
+ //User updateUser = UserCache.getUser(taskPlaceRectification.getUpdateUser());
+ //taskPlaceRectificationVO.setCreateUserName(createUser.getName());
+ //taskPlaceRectificationVO.setUpdateUserName(updateUser.getName());
+
+ return taskPlaceRectificationVO;
+ }
+
+
+}
--
Gitblit v1.9.3