diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java
new file mode 100644
index 0000000000..51396f47b7
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolRecordFormDTO.java
@@ -0,0 +1,125 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * @Author sun
+ * @Description 新增场所巡查记录
+ **/
+@Data
+public class AddPlacePatrolRecordFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 组织Id
+ */
+ private String agencyId;
+
+ /**
+ * agency_id的所有上级
+ */
+ private String pids;
+
+ /**
+ * 网格Id【场所区域】
+ */
+ @NotBlank(message = "场所区域不能为空", groups = {Add.class})
+ private String gridId;
+ /**
+ * 场所类型【admin库sys_dict_data表九小场所value值】
+ */
+ @NotBlank(message = "场所类型不能为空", groups = {Add.class})
+ private String ninePlaceVal;
+
+ /**
+ * 场所下的组织Id
+ */
+ @NotBlank(message = "场所名称不能为空", groups = {Add.class})
+ private String placeOrgId;
+
+ /**
+ * 场所下分队(place_patrolteam)表Id
+ */
+ @NotBlank(message = "分队名称不能为空", groups = {Add.class})
+ private String placePatrolTeamId;
+
+ /**
+ * 分队下检查人员Id,分号分隔
+ */
+ @NotBlank(message = "检察人员不能为空", groups = {Add.class})
+ private String inspectors;
+
+ /**
+ * 首次巡查时间
+ */
+ @NotBlank(message = "首次巡查时间不能为空", groups = {Add.class})
+ private Date firstTime;
+
+ /**
+ * 隐患明细
+ */
+ @NotBlank(message = "隐患明细不能为空", groups = {Add.class})
+ //@Length(max = 200, message = "隐患明细不能超过200个字符", groups = {Add.class})
+ private String detailed;
+
+ /**
+ * 首次检查结果【0:合格 1:不合格】
+ */
+ @NotBlank(message = "首次检查结果不能为空", groups = {Add.class})
+ private String firstResult;
+
+ /**
+ * 拟复查时间
+ */
+ private Date reviewTime;
+
+ /**
+ * 最终检查结果【0:合格 1:不合格】初始数据默认和首次检查结果相同
+ */
+ private String finalResult;
+
+ /**
+ * 最新复查时间【初始数据默认和首次巡查时间相同】
+ */
+ private Date finalTime;
+
+ /**
+ * 备注
+ */
+ private String remarks;
+
+
+ //token中userId
+ private String staffId;
+
+ public interface Add {}
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java
new file mode 100644
index 0000000000..ba2fc30592
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolReviewRecordFormDTO.java
@@ -0,0 +1,83 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+
+
+/**
+ * @Author sun
+ * @Description 新增巡查复查记录
+ **/
+@Data
+public class AddPlacePatrolReviewRecordFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户Id
+ */
+ private String customerId;
+
+ /**
+ * 巡查记录主(place_patrol_record)表Id
+ */
+ @NotBlank(message = "巡查记录Id不能为空", groups = {Add.class})
+ private String placePatrolRecordId;
+
+ /**
+ * 场所下分队(place_patrol_team)表Id
+ */
+ @NotBlank(message = "分队名称不能为空", groups = {Add.class})
+ private String placePatrolTeamId;
+
+ /**
+ * 检查人员Id,逗号分隔
+ */
+ @NotBlank(message = "检查人员不能为空", groups = {Add.class})
+ private String inspectors;
+
+ /**
+ * 复查时间
+ */
+ @NotBlank(message = "复查时间不能为空", groups = {Add.class})
+ private Date reviewTime;
+
+ /**
+ * 复查隐患明细
+ */
+ private String detailed;
+
+ /**
+ * 复查检查结果【0:合格 1:不合格】
+ */
+ @NotBlank(message = "复查检查结果不能为空", groups = {Add.class})
+ private String reviewResult;
+
+ /**
+ * 备注
+ */
+ private String remarks;
+
+ public interface Add { }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java
index 672fee597f..c3f4ed0d06 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddPlacePatrolTeamFormDTO.java
@@ -56,12 +56,12 @@ public class AddPlacePatrolTeamFormDTO implements Serializable {
* 网格Id【场所区域】
*/
@NotBlank(message = "场所区域不能为空", groups = {Add.class})
- private String gridId;
+ private String gridIds;
/**
* 场所类型【admin库sys_dict_data表九小场所value值】
*/
@NotBlank(message = "场所类型不能为空", groups = {Add.class})
- private String ninePlaceVal;
+ private String ninePlaceVals;
/**
* 分队名称
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolRecordFormDTO.java
new file mode 100644
index 0000000000..ea24f0613b
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolRecordFormDTO.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * @Author sun
+ * @Description 删除、详情场所巡查记录
+ **/
+@Data
+public class EditPlacePatrolRecordFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ /**
+ * 巡查记录Id
+ */
+ @NotBlank(message = "巡查记录Id不能为空", groups = {Del.class, Detail.class})
+ private String placePatrolRecordId;
+
+
+ public interface Del { }
+ public interface Detail { }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java
new file mode 100644
index 0000000000..fbdd4047b9
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolReviewRecordFormDTO.java
@@ -0,0 +1,77 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form;
+
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+
+/**
+ * @Author sun
+ * @Description 修改、删除、详情巡查复查记录
+ **/
+@Data
+public class EditPlacePatrolReviewRecordFormDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ /**
+ * 复查记录Id
+ */
+ @NotBlank(message = "复查记录Id不能为空", groups = {Edit.class, Del.class, Detail.class})
+ private String placePatrolReviewRecordId;
+
+ /**
+ * 场所下分队(place_patrol_team)表Id
+ */
+ private String placePatrolTeamId;
+
+ /**
+ * 检查人员Id,逗号分隔
+ */
+ private String inspectors;
+
+ /**
+ * 复查时间
+ */
+ private Date reviewTime;
+
+ /**
+ * 复查隐患明细
+ */
+ private String detailed;
+
+ /**
+ * 复查检查结果【0:合格 1:不合格】
+ */
+ private String reviewResult;
+
+ /**
+ * 备注
+ */
+ private String remarks;
+
+ public interface Edit { }
+ public interface Del { }
+ public interface Detail { }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java
index 90d154008b..0da30dfdce 100644
--- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditPlacePatrolTeamFormDTO.java
@@ -43,11 +43,11 @@ public class EditPlacePatrolTeamFormDTO implements Serializable {
/**
* 网格Id【场所区域】
*/
- private String gridId;
+ private String gridIds;
/**
* 场所类型【admin库sys_dict_data表九小场所value值】
*/
- private String ninePlaceVal;
+ private String ninePlaceVals;
/**
* 分队名称
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java
new file mode 100644
index 0000000000..a043750c6f
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java
@@ -0,0 +1,54 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import java.io.Serializable;
+
+
+/**
+ * @Author sun
+ * @Description 场所巡查记录列表查询
+ **/
+@Data
+public class GetListPlacePatrolRecordFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ //场所名称
+ private String placeOrgName;
+ //首次检查结果【0:合格 1:不合格】
+ private String firstResult;
+ //场所区域【网格Id】
+ private String gridId;
+ //场所类型【九小场所Value值】
+ private String ninePlacsVal;
+ //最终检查结果【0:合格 1:不合格】
+ private String finalResult;
+ //页码
+ @Min(1)
+ private Integer pageNo;
+ //每页多少条
+ private Integer pageSize = 20;
+ //token中客户Id
+ private String customerId;
+ //巡查记录Id
+ private String placePatrolRecordId;
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java
new file mode 100644
index 0000000000..596bad17d4
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java
@@ -0,0 +1,48 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto.form;
+
+import lombok.Data;
+
+import javax.validation.constraints.Min;
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+
+/**
+ * @Author sun
+ * @Description 巡查复查记录列表查询
+ **/
+@Data
+public class GetListPlacePatrolReviewRecordFormDTO implements Serializable {
+ private static final long serialVersionUID = 1L;
+ //巡查记录Id
+ private String placePatrolRecordId;
+ //复查记录Id
+ @NotBlank(message = "复查记录Id不能为空", groups = {GetData.class})
+ private String placePatrolReviewRecordId;
+ //页码
+ @Min(1)
+ private Integer pageNo;
+ //每页多少条
+ private Integer pageSize = 20;
+ //token中客户Id
+ private String customerId;
+ public interface GetData { }
+
+}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java
new file mode 100644
index 0000000000..0ef22dfa52
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java
@@ -0,0 +1,19 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Author sun
+ * @Description 场所巡查记录列表查询
+ **/
+@Data
+public class GetListPlacePatrolRecordResultDTO implements Serializable {
+ //集合总条数
+ private Integer total;
+ //社会组织信息
+ private List list;
+
+}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java
new file mode 100644
index 0000000000..9caca08bd1
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java
@@ -0,0 +1,19 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Author sun
+ * @Description 巡查复查记录列表查询
+ **/
+@Data
+public class GetListPlacePatrolReviewRecordResultDTO implements Serializable {
+ //集合总条数
+ private Integer total;
+ //社会组织信息
+ private List list;
+
+}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolRecordDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolRecordDetailResultDTO.java
new file mode 100644
index 0000000000..93450c6cfa
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolRecordDetailResultDTO.java
@@ -0,0 +1,50 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author sun
+ * @Description 场所巡查记录详情
+ **/
+@Data
+public class PlacePatrolRecordDetailResultDTO implements Serializable {
+ //所属组织Id
+ private String agencyId;
+ //巡查Id
+ private String placePatrolRecordId;
+ //网格Id【场所区域】
+ private String gridId;
+ //网格名称【场所区域】
+ private String gridName;
+ //场所下的组织Id
+ private String placeOrgId;
+ //场所下的组织名称
+ private String placeOrgName;
+ //场所类型【admin库sys_dict_data表九小场所value值】
+ private String ninePlaceVal;
+ //场所类型名称
+ private String ninePlaceName;
+ //场所下分队(place_patrolteam)表Id
+ private String placePatrolTeamId;
+ //场所下分队名称
+ private String placePatrolTeamName;
+ //分队下检查人员Id,分号分隔
+ private String inspectors;
+ //分队下检查人员名称
+ private String inspectorsNames;
+ //首次巡查时间
+ private String firstTime;
+ //隐患明细
+ private String detailed;
+ //首次检查结果【0:合格 1:不合格】
+ private String firstResult;
+ //拟复查时间
+ private String reviewTime;
+ //最新结果【0:合格 1:不合格】
+ private String finalResult;
+ //最新检查时间
+ private String finalTime;
+
+}
diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolReviewRecordDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolReviewRecordDetailResultDTO.java
new file mode 100644
index 0000000000..47da9065f7
--- /dev/null
+++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolReviewRecordDetailResultDTO.java
@@ -0,0 +1,32 @@
+package com.epmet.dto.result;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @Author sun
+ * @Description 巡查复查记录详情
+ **/
+@Data
+public class PlacePatrolReviewRecordDetailResultDTO implements Serializable {
+ //复查记录Id
+ private String placePatrolReviewRecordId;
+ //巡查记录Id
+ private String placePatrolRecordId;
+ //分队id
+ private String placePatrolTeamId;
+ //分队名称
+ private String placePatrolTeamName;
+ //检查人员Id,分号分隔
+ private String inspectors;
+ //检查人员姓名,分号分隔
+ private String inspectorsNames;
+ //复查时间
+ private String reviewTime;
+ //复查隐患明细
+ private String detailed;
+ //复查检查结果【0:合格 1:不合格】
+ private String reviewResult;
+
+}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java
index 5c80607590..0f57a4bad0 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java
@@ -17,23 +17,21 @@
package com.epmet.controller;
-import com.epmet.commons.tools.page.PageData;
-import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
-import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
-import com.epmet.commons.tools.validator.group.AddGroup;
-import com.epmet.commons.tools.validator.group.UpdateGroup;
-import com.epmet.commons.tools.validator.group.DefaultGroup;
-import com.epmet.dto.IcPlacePatrolRecordDTO;
-import com.epmet.excel.IcPlacePatrolRecordExcel;
+import com.epmet.dto.form.AddPlacePatrolRecordFormDTO;
+import com.epmet.dto.form.EditPlacePatrolRecordFormDTO;
+import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO;
+import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO;
+import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO;
import com.epmet.service.IcPlacePatrolRecordService;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-import java.util.Map;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
/**
@@ -45,50 +43,53 @@ import java.util.Map;
@RestController
@RequestMapping("placepatrolrecord")
public class IcPlacePatrolRecordController {
-
+
@Autowired
private IcPlacePatrolRecordService placePatrolRecordService;
- @GetMapping("page")
- public Result> page(@RequestParam Map params){
- PageData page = placePatrolRecordService.page(params);
- return new Result>().ok(page);
- }
-
- @GetMapping("{id}")
- public Result get(@PathVariable("id") String id){
- IcPlacePatrolRecordDTO data = placePatrolRecordService.get(id);
- return new Result().ok(data);
- }
-
- @PostMapping
- public Result save(@RequestBody IcPlacePatrolRecordDTO dto){
- //效验数据
- ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
- placePatrolRecordService.save(dto);
+ /**
+ * @Author sun
+ * @Description 新增场所巡查记录
+ **/
+ @PostMapping("add")
+ public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolRecordFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, AddPlacePatrolRecordFormDTO.Add.class);
+ formDTO.setCustomerId(tokenDto.getToken());
+ formDTO.setStaffId(tokenDto.getUserId());
+ placePatrolRecordService.add(formDTO);
return new Result();
}
- @PutMapping
- public Result update(@RequestBody IcPlacePatrolRecordDTO dto){
- //效验数据
- ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
- placePatrolRecordService.update(dto);
+ /**
+ * @Author sun
+ * @Description 删除场所巡查记录
+ **/
+ @PostMapping("del")
+ public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolRecordFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, EditPlacePatrolRecordFormDTO.Del.class);
+ placePatrolRecordService.del(tokenDto.getUserId(), formDTO.getPlacePatrolRecordId());
return new Result();
}
- @DeleteMapping
- public Result delete(@RequestBody String[] ids){
- //效验数据
- AssertUtils.isArrayEmpty(ids, "id");
- placePatrolRecordService.delete(ids);
- return new Result();
+ /**
+ * @Author sun
+ * @Description 场所巡查记录详情
+ **/
+ @PostMapping("detail")
+ public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolRecordFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, EditPlacePatrolRecordFormDTO.Detail.class);
+ return new Result().ok(placePatrolRecordService.detail(formDTO.getPlacePatrolRecordId()));
}
- @GetMapping("export")
- public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
- List list = placePatrolRecordService.list(params);
- ExcelUtils.exportExcelToTarget(response, null, list, IcPlacePatrolRecordExcel.class);
+ /**
+ * @Author sun
+ * @Description 场所巡查记录列表查询
+ **/
+ @PostMapping("getlist")
+ public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolRecordFormDTO formDTO) {
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ return new Result().ok(placePatrolRecordService.getList(formDTO));
}
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java
index 7e174799d3..9583e8a178 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolReviewRecordController.java
@@ -17,23 +17,21 @@
package com.epmet.controller;
-import com.epmet.commons.tools.page.PageData;
-import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
-import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
-import com.epmet.commons.tools.validator.group.AddGroup;
-import com.epmet.commons.tools.validator.group.UpdateGroup;
-import com.epmet.commons.tools.validator.group.DefaultGroup;
-import com.epmet.dto.IcPlacePatrolReviewRecordDTO;
-import com.epmet.excel.IcPlacePatrolReviewRecordExcel;
+import com.epmet.dto.form.AddPlacePatrolReviewRecordFormDTO;
+import com.epmet.dto.form.EditPlacePatrolReviewRecordFormDTO;
+import com.epmet.dto.form.GetListPlacePatrolReviewRecordFormDTO;
+import com.epmet.dto.result.GetListPlacePatrolReviewRecordResultDTO;
+import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO;
import com.epmet.service.IcPlacePatrolReviewRecordService;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
-
-import javax.servlet.http.HttpServletResponse;
-import java.util.List;
-import java.util.Map;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
/**
@@ -45,50 +43,64 @@ import java.util.Map;
@RestController
@RequestMapping("placepatrolreviewrecord")
public class IcPlacePatrolReviewRecordController {
-
+
@Autowired
private IcPlacePatrolReviewRecordService placePatrolReviewRecordService;
- @GetMapping("page")
- public Result> page(@RequestParam Map params){
- PageData page = placePatrolReviewRecordService.page(params);
- return new Result>().ok(page);
- }
-
- @GetMapping("{id}")
- public Result get(@PathVariable("id") String id){
- IcPlacePatrolReviewRecordDTO data = placePatrolReviewRecordService.get(id);
- return new Result().ok(data);
+ /**
+ * @Author sun
+ * @Description 新增巡查复查记录
+ **/
+ @PostMapping("add")
+ public Result add(@LoginUser TokenDto tokenDto, @RequestBody AddPlacePatrolReviewRecordFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, AddPlacePatrolReviewRecordFormDTO.Add.class);
+ formDTO.setCustomerId(tokenDto.getToken());
+ placePatrolReviewRecordService.add(formDTO);
+ return new Result();
}
- @PostMapping
- public Result save(@RequestBody IcPlacePatrolReviewRecordDTO dto){
- //效验数据
- ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
- placePatrolReviewRecordService.save(dto);
+ /**
+ * @Author sun
+ * @Description 修改巡查复查记录
+ **/
+ @PostMapping("edit")
+ public Result edit(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Edit.class);
+ placePatrolReviewRecordService.edit(formDTO);
return new Result();
}
- @PutMapping
- public Result update(@RequestBody IcPlacePatrolReviewRecordDTO dto){
- //效验数据
- ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
- placePatrolReviewRecordService.update(dto);
+ /**
+ * @Author sun
+ * @Description 删除巡查复查记录
+ **/
+ @PostMapping("del")
+ public Result del(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Del.class);
+ placePatrolReviewRecordService.del(formDTO.getPlacePatrolReviewRecordId());
return new Result();
}
- @DeleteMapping
- public Result delete(@RequestBody String[] ids){
- //效验数据
- AssertUtils.isArrayEmpty(ids, "id");
- placePatrolReviewRecordService.delete(ids);
- return new Result();
+ /**
+ * @Author sun
+ * @Description 巡查复查记录详情
+ **/
+ @PostMapping("detail")
+ public Result detail(@LoginUser TokenDto tokenDto, @RequestBody EditPlacePatrolReviewRecordFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, EditPlacePatrolReviewRecordFormDTO.Detail.class);
+ return new Result().ok(placePatrolReviewRecordService.detail(formDTO.getPlacePatrolReviewRecordId()));
}
- @GetMapping("export")
- public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
- List list = placePatrolReviewRecordService.list(params);
- ExcelUtils.exportExcelToTarget(response, null, list, IcPlacePatrolReviewRecordExcel.class);
+ /**
+ * @Author sun
+ * @Description 巡查复查记录列表查询
+ **/
+ @PostMapping("getlist")
+ public Result getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolReviewRecordFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, GetListPlacePatrolReviewRecordFormDTO.GetData.class);
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ return new Result().ok(placePatrolReviewRecordService.getList(formDTO));
}
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamStaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamStaffController.java
index 0ed87c6e42..9d3750d7b8 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamStaffController.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamStaffController.java
@@ -17,23 +17,20 @@
package com.epmet.controller;
-import com.epmet.commons.tools.page.PageData;
-import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.annotation.LoginUser;
+import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
-import com.epmet.commons.tools.validator.AssertUtils;
-import com.epmet.commons.tools.validator.ValidatorUtils;
-import com.epmet.commons.tools.validator.group.AddGroup;
-import com.epmet.commons.tools.validator.group.UpdateGroup;
-import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcPlacePatrolTeamStaffDTO;
-import com.epmet.excel.IcPlacePatrolTeamStaffExcel;
+import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO;
+import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO;
import com.epmet.service.IcPlacePatrolTeamStaffService;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
-import javax.servlet.http.HttpServletResponse;
import java.util.List;
-import java.util.Map;
/**
@@ -49,46 +46,14 @@ public class IcPlacePatrolTeamStaffController {
@Autowired
private IcPlacePatrolTeamStaffService placePatrolTeamStaffService;
- @GetMapping("page")
- public Result> page(@RequestParam Map params){
- PageData page = placePatrolTeamStaffService.page(params);
- return new Result>().ok(page);
- }
-
- @GetMapping("{id}")
- public Result get(@PathVariable("id") String id){
- IcPlacePatrolTeamStaffDTO data = placePatrolTeamStaffService.get(id);
- return new Result().ok(data);
- }
-
- @PostMapping
- public Result save(@RequestBody IcPlacePatrolTeamStaffDTO dto){
- //效验数据
- ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
- placePatrolTeamStaffService.save(dto);
- return new Result();
- }
-
- @PutMapping
- public Result update(@RequestBody IcPlacePatrolTeamStaffDTO dto){
- //效验数据
- ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
- placePatrolTeamStaffService.update(dto);
- return new Result();
- }
-
- @DeleteMapping
- public Result delete(@RequestBody String[] ids){
- //效验数据
- AssertUtils.isArrayEmpty(ids, "id");
- placePatrolTeamStaffService.delete(ids);
- return new Result();
- }
- @GetMapping("export")
- public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
- List list = placePatrolTeamStaffService.list(params);
- ExcelUtils.exportExcelToTarget(response, null, list, IcPlacePatrolTeamStaffExcel.class);
+ /**
+ * @Author sun
+ * @Description 查询分队下人员列表数据
+ **/
+ @PostMapping("getlist")
+ public Result> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolTeamFormDTO formDTO) {
+ return new Result>().ok(placePatrolTeamStaffService.getList(formDTO.getTeamId()));
}
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java
index 9d2f51de8c..be3bd364f2 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolRecordDao.java
@@ -18,9 +18,13 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO;
+import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO;
import com.epmet.entity.IcPlacePatrolRecordEntity;
import org.apache.ibatis.annotations.Mapper;
+import java.util.List;
+
/**
* 场所巡查记录
*
@@ -29,5 +33,6 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcPlacePatrolRecordDao extends BaseDao {
-
+
+ List getList(GetListPlacePatrolRecordFormDTO dto);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolReviewRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolReviewRecordDao.java
index 8c7fb0703e..0b6c476228 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolReviewRecordDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolReviewRecordDao.java
@@ -18,8 +18,13 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.form.GetListPlacePatrolReviewRecordFormDTO;
+import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO;
import com.epmet.entity.IcPlacePatrolReviewRecordEntity;
import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
/**
* 场所巡查复查记录
@@ -29,5 +34,16 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcPlacePatrolReviewRecordDao extends BaseDao {
-
+
+ /**
+ * @Author sun
+ * @Description 删除巡查记录对应的复查记录
+ **/
+ int delByPatrolRecordId(@Param("staffId") String staffId, @Param("placePatrolRecordId") String placePatrolRecordId);
+
+ /**
+ * @Author sun
+ * @Description 查询巡查记录对应的复查记录数据
+ **/
+ List getList(GetListPlacePatrolReviewRecordFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java
index c5af8a717f..56dee8582f 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPlacePatrolTeamStaffDao.java
@@ -42,7 +42,13 @@ public interface IcPlacePatrolTeamStaffDao extends BaseDao getByTeamId(@Param("teamId") String teamId);
+
+ /**
+ * @Author sun
+ * @Description 批量查询分队下人员信息
+ **/
+ List selectByTeamIds(@Param("teamIds") List teamIds);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java
index 3c0ed4b02c..3b0c2c6e12 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolRecordService.java
@@ -18,13 +18,12 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
-import com.epmet.commons.tools.page.PageData;
-import com.epmet.dto.IcPlacePatrolRecordDTO;
+import com.epmet.dto.form.AddPlacePatrolRecordFormDTO;
+import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO;
+import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO;
+import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO;
import com.epmet.entity.IcPlacePatrolRecordEntity;
-import java.util.List;
-import java.util.Map;
-
/**
* 场所巡查记录
*
@@ -34,62 +33,26 @@ import java.util.Map;
public interface IcPlacePatrolRecordService extends BaseService {
/**
- * 默认分页
- *
- * @param params
- * @return PageData
- * @author generator
- * @date 2021-11-18
- */
- PageData page(Map params);
-
- /**
- * 默认查询
- *
- * @param params
- * @return java.util.List
- * @author generator
- * @date 2021-11-18
- */
- List list(Map params);
-
- /**
- * 单条查询
- *
- * @param id
- * @return PlacePatrolRecordDTO
- * @author generator
- * @date 2021-11-18
- */
- IcPlacePatrolRecordDTO get(String id);
+ * @Author sun
+ * @Description 新增场所巡查记录
+ **/
+ void add(AddPlacePatrolRecordFormDTO formDTO);
/**
- * 默认保存
- *
- * @param dto
- * @return void
- * @author generator
- * @date 2021-11-18
- */
- void save(IcPlacePatrolRecordDTO dto);
+ * @Author sun
+ * @Description 删除场所巡查记录
+ **/
+ void del(String staffId, String placePatrolRecordId);
/**
- * 默认更新
- *
- * @param dto
- * @return void
- * @author generator
- * @date 2021-11-18
- */
- void update(IcPlacePatrolRecordDTO dto);
+ * @Author sun
+ * @Description 场所巡查记录详情
+ **/
+ PlacePatrolRecordDetailResultDTO detail(String placePatrolRecordId);
/**
- * 批量删除
- *
- * @param ids
- * @return void
- * @author generator
- * @date 2021-11-18
- */
- void delete(String[] ids);
+ * @Author sun
+ * @Description 场所巡查记录列表查询
+ **/
+ GetListPlacePatrolRecordResultDTO getList(GetListPlacePatrolRecordFormDTO formDTO);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java
index 6def5ab3f0..2ab44dd930 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolReviewRecordService.java
@@ -18,13 +18,13 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
-import com.epmet.commons.tools.page.PageData;
-import com.epmet.dto.IcPlacePatrolReviewRecordDTO;
+import com.epmet.dto.form.AddPlacePatrolReviewRecordFormDTO;
+import com.epmet.dto.form.EditPlacePatrolReviewRecordFormDTO;
+import com.epmet.dto.form.GetListPlacePatrolReviewRecordFormDTO;
+import com.epmet.dto.result.GetListPlacePatrolReviewRecordResultDTO;
+import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO;
import com.epmet.entity.IcPlacePatrolReviewRecordEntity;
-import java.util.List;
-import java.util.Map;
-
/**
* 场所巡查复查记录
*
@@ -34,62 +34,38 @@ import java.util.Map;
public interface IcPlacePatrolReviewRecordService extends BaseService {
/**
- * 默认分页
- *
- * @param params
- * @return PageData
- * @author generator
- * @date 2021-11-18
- */
- PageData page(Map params);
+ * @Author sun
+ * @Description 新增巡查复查记录
+ **/
+ void add(AddPlacePatrolReviewRecordFormDTO formDTO);
/**
- * 默认查询
- *
- * @param params
- * @return java.util.List
- * @author generator
- * @date 2021-11-18
- */
- List list(Map params);
+ * @Author sun
+ * @Description 修改巡查复查记录
+ **/
+ void edit(EditPlacePatrolReviewRecordFormDTO formDTO);
/**
- * 单条查询
- *
- * @param id
- * @return PlacePatrolReviewRecordDTO
- * @author generator
- * @date 2021-11-18
- */
- IcPlacePatrolReviewRecordDTO get(String id);
+ * @Author sun
+ * @Description 删除巡查复查记录
+ **/
+ void del(String placePatrolReviewRecordId);
/**
- * 默认保存
- *
- * @param dto
- * @return void
- * @author generator
- * @date 2021-11-18
- */
- void save(IcPlacePatrolReviewRecordDTO dto);
+ * @Author sun
+ * @Description 巡查复查记录详情
+ **/
+ PlacePatrolReviewRecordDetailResultDTO detail(String placePatrolReviewRecordId);
/**
- * 默认更新
- *
- * @param dto
- * @return void
- * @author generator
- * @date 2021-11-18
- */
- void update(IcPlacePatrolReviewRecordDTO dto);
+ * @Author sun
+ * @Description 巡查复查记录列表查询
+ **/
+ GetListPlacePatrolReviewRecordResultDTO getList(GetListPlacePatrolReviewRecordFormDTO formDTO);
/**
- * 批量删除
- *
- * @param ids
- * @return void
- * @author generator
- * @date 2021-11-18
- */
- void delete(String[] ids);
+ * @Author sun
+ * @Description 删除巡查记录对应的复查记录
+ **/
+ int delByPatrolRecordId(String staffId, String placePatrolRecordId);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java
index ec3fea917a..32fd96e962 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPlacePatrolTeamStaffService.java
@@ -18,12 +18,11 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
-import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcPlacePatrolTeamStaffDTO;
+import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO;
import com.epmet.entity.IcPlacePatrolTeamStaffEntity;
import java.util.List;
-import java.util.Map;
/**
* 场所分队下人员管理
@@ -33,69 +32,15 @@ import java.util.Map;
*/
public interface IcPlacePatrolTeamStaffService extends BaseService {
- /**
- * 默认分页
- *
- * @param params
- * @return PageData
- * @author generator
- * @date 2021-11-18
- */
- PageData page(Map params);
-
- /**
- * 默认查询
- *
- * @param params
- * @return java.util.List
- * @author generator
- * @date 2021-11-18
- */
- List list(Map params);
-
- /**
- * 单条查询
- *
- * @param id
- * @return PlacePatrolTeamStaffDTO
- * @author generator
- * @date 2021-11-18
- */
- IcPlacePatrolTeamStaffDTO get(String id);
-
- /**
- * 默认保存
- *
- * @param dto
- * @return void
- * @author generator
- * @date 2021-11-18
- */
- void save(IcPlacePatrolTeamStaffDTO dto);
-
- /**
- * 默认更新
- *
- * @param dto
- * @return void
- * @author generator
- * @date 2021-11-18
- */
- void update(IcPlacePatrolTeamStaffDTO dto);
-
- /**
- * 批量删除
- *
- * @param ids
- * @return void
- * @author generator
- * @date 2021-11-18
- */
- void delete(String[] ids);
-
/**
* @Author sun
* @Description 删除分队下成员信息
**/
int delByTeamId(String teamId);
+
+ /**
+ * @Author sun
+ * @Description 查询分队下人员列表数据
+ **/
+ List getList(String teamId);
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java
index 1f1eae6568..ab8d20776f 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java
@@ -17,23 +17,45 @@
package com.epmet.service.impl;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
-import com.epmet.commons.tools.constant.FieldConstant;
-import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
+import com.epmet.commons.tools.dto.result.OptionResultDTO;
+import com.epmet.commons.tools.exception.RenException;
+import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcPlacePatrolRecordDao;
-import com.epmet.dto.IcPlacePatrolRecordDTO;
+import com.epmet.dao.IcPlacePatrolTeamStaffDao;
+import com.epmet.dto.CustomerGridDTO;
+import com.epmet.dto.IcPlacePatrolTeamStaffDTO;
+import com.epmet.dto.form.AddPlacePatrolRecordFormDTO;
+import com.epmet.dto.form.GetListPlacePatrolRecordFormDTO;
+import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO;
+import com.epmet.dto.result.*;
+import com.epmet.entity.IcHouseEntity;
import com.epmet.entity.IcPlacePatrolRecordEntity;
+import com.epmet.entity.IcPlacePatrolTeamEntity;
+import com.epmet.entity.IcPlacePatrolTeamStaffEntity;
+import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.service.IcPlacePatrolRecordService;
+import com.epmet.service.IcPlacePatrolReviewRecordService;
+import com.epmet.service.IcPlacePatrolTeamService;
+import com.epmet.service.IcPlacePatrolTeamStaffService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
-import java.util.Arrays;
+import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
+import java.util.stream.Collectors;
/**
* 场所巡查记录
@@ -43,58 +65,124 @@ import java.util.Map;
*/
@Service
public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl implements IcPlacePatrolRecordService {
-
-
- @Override
- public PageData page(Map params) {
- IPage page = baseDao.selectPage(
- getPage(params, FieldConstant.CREATED_TIME, false),
- getWrapper(params)
- );
- return getPageData(page, IcPlacePatrolRecordDTO.class);
- }
-
- @Override
- public List list(Map params) {
- List entityList = baseDao.selectList(getWrapper(params));
-
- return ConvertUtils.sourceToTarget(entityList, IcPlacePatrolRecordDTO.class);
- }
-
- private QueryWrapper getWrapper(Map params){
- String id = (String)params.get(FieldConstant.ID_HUMP);
-
- QueryWrapper wrapper = new QueryWrapper<>();
- wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
-
- return wrapper;
- }
-
- @Override
- public IcPlacePatrolRecordDTO get(String id) {
- IcPlacePatrolRecordEntity entity = baseDao.selectById(id);
- return ConvertUtils.sourceToTarget(entity, IcPlacePatrolRecordDTO.class);
- }
-
+ private static final Logger log = LoggerFactory.getLogger(IcPlaceOrgServiceImpl.class);
+ @Autowired
+ private IcPlacePatrolReviewRecordService icPlacePatrolReviewRecordService;
+ @Autowired
+ private EpmetAdminOpenFeignClient epmetAdminOpenFeignClient;
+ @Autowired
+ private IcPlacePatrolTeamStaffDao icPlacePatrolTeamStaffDao;
+
+
+ /**
+ * @Author sun
+ * @Description 新增场所巡查记录
+ **/
@Override
@Transactional(rollbackFor = Exception.class)
- public void save(IcPlacePatrolRecordDTO dto) {
- IcPlacePatrolRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcPlacePatrolRecordEntity.class);
+ public void add(AddPlacePatrolRecordFormDTO formDTO) {
+ IcPlacePatrolRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolRecordEntity.class);
+ CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
+ entity.setAgencyId(staffInfoCache.getAgencyId());
+ entity.setPids(staffInfoCache.getAgencyPIds());
+ entity.setFinalResult(entity.getFirstResult());
+ entity.setFinalTime(entity.getFirstTime());
insert(entity);
}
+ /**
+ * @Author sun
+ * @Description 删除场所巡查记录
+ **/
@Override
@Transactional(rollbackFor = Exception.class)
- public void update(IcPlacePatrolRecordDTO dto) {
- IcPlacePatrolRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcPlacePatrolRecordEntity.class);
- updateById(entity);
+ public void del(String staffId, String placePatrolRecordId) {
+ //1.删除巡查记录主表数据
+ if (baseDao.deleteById(placePatrolRecordId) < NumConstant.ONE) {
+ throw new RenException(String.format("删除场所巡查记录信息失败,巡查Id->%s", placePatrolRecordId));
+ }
+ //2.删除复查记录附表数据
+ icPlacePatrolReviewRecordService.delByPatrolRecordId(staffId, placePatrolRecordId);
}
+ /**
+ * @Author sun
+ * @Description 场所巡查记录详情
+ **/
@Override
- @Transactional(rollbackFor = Exception.class)
- public void delete(String[] ids) {
- // 逻辑删除(@TableLogic 注解)
- baseDao.deleteBatchIds(Arrays.asList(ids));
+ public PlacePatrolRecordDetailResultDTO detail(String placePatrolRecordId) {
+ PlacePatrolRecordDetailResultDTO resultDTO = new PlacePatrolRecordDetailResultDTO();
+ //1.查询场所基础信息
+ GetListPlacePatrolRecordFormDTO dto = new GetListPlacePatrolRecordFormDTO();
+ dto.setPlacePatrolRecordId(placePatrolRecordId);
+ List result = baseDao.getList(dto);
+ if (CollectionUtils.isEmpty(result)) {
+ return resultDTO;
+ }
+ resultDTO = result.get(0);
+
+ //2.查询九小场所信息
+ Result> nineList = epmetAdminOpenFeignClient.getNineSmallPlacesOption();
+ if (!nineList.success()) {
+ throw new RenException("获取九小场所基本信息失败......");
+ }
+
+ //3.封装九小场所数据
+ for (OptionResultDTO n : nineList.getData()){
+ if(resultDTO.getNinePlaceVal().equals(n.getValue())){
+ resultDTO.setNinePlaceName(n.getLabel());
+ }
+ }
+
+ return resultDTO;
}
+ /**
+ * @Author sun
+ * @Description 场所巡查记录列表查询
+ **/
+ @Override
+ public GetListPlacePatrolRecordResultDTO getList(GetListPlacePatrolRecordFormDTO formDTO) {
+ GetListPlacePatrolRecordResultDTO resultDTO = new GetListPlacePatrolRecordResultDTO();
+ //1.根据条件查询巡查记录数据
+ PageInfo result =
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO));
+ if (CollectionUtils.isEmpty(result.getList())) {
+ return resultDTO;
+ }
+ resultDTO.setTotal((int) result.getTotal());
+
+ //2.查询九小场所信息
+ Result> nineList = epmetAdminOpenFeignClient.getNineSmallPlacesOption();
+ if (!nineList.success()) {
+ throw new RenException("获取九小场所基本信息失败......");
+ }
+
+ //3.查询所有分队下人员名单
+ List teamIds = result.getList().stream().map(PlacePatrolRecordDetailResultDTO::getPlacePatrolTeamId).collect(Collectors.toList());
+ teamIds = teamIds.stream().distinct().collect(Collectors.toList());
+ List teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds);
+ //4.封装九小场所、分队人员数据
+ for (PlacePatrolRecordDetailResultDTO dto : result.getList()){
+ //九小场所
+ nineList.getData().forEach(n->{
+ if(dto.getNinePlaceVal().equals(n.getValue())){
+ dto.setNinePlaceName(n.getLabel());
+ }
+ });
+ //分队成员
+ StringBuffer inspectorsNames = new StringBuffer("");
+ for (String str : dto.getInspectors().split(",")) {
+ teamDTOList.forEach(r -> {
+ if (str.equals(r.getId())) {
+ inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName());
+ }
+ });
+ }
+ dto.setInspectorsNames(inspectorsNames.toString());
+ }
+
+ resultDTO.setList(result.getList());
+ return resultDTO;
+ }
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
index 8f42a76201..0a5f0f1c41 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolReviewRecordServiceImpl.java
@@ -17,23 +17,42 @@
package com.epmet.service.impl;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
-import com.epmet.commons.tools.constant.FieldConstant;
-import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.constant.NumConstant;
+import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
+import com.epmet.commons.tools.dto.result.OptionResultDTO;
+import com.epmet.commons.tools.exception.RenException;
+import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcPlacePatrolReviewRecordDao;
-import com.epmet.dto.IcPlacePatrolReviewRecordDTO;
+import com.epmet.dao.IcPlacePatrolTeamStaffDao;
+import com.epmet.dto.IcPlacePatrolTeamStaffDTO;
+import com.epmet.dto.form.*;
+import com.epmet.dto.result.GetListPlacePatrolRecordResultDTO;
+import com.epmet.dto.result.GetListPlacePatrolReviewRecordResultDTO;
+import com.epmet.dto.result.PlacePatrolRecordDetailResultDTO;
+import com.epmet.dto.result.PlacePatrolReviewRecordDetailResultDTO;
+import com.epmet.entity.IcPlacePatrolRecordEntity;
import com.epmet.entity.IcPlacePatrolReviewRecordEntity;
+import com.epmet.entity.IcPlacePatrolTeamEntity;
+import com.epmet.entity.IcPlacePatrolTeamStaffEntity;
+import com.epmet.feign.EpmetAdminOpenFeignClient;
+import com.epmet.service.IcPlacePatrolRecordService;
import com.epmet.service.IcPlacePatrolReviewRecordService;
-import org.apache.commons.lang3.StringUtils;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
-import java.util.Arrays;
+import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
+import java.util.stream.Collectors;
/**
* 场所巡查复查记录
@@ -43,58 +62,149 @@ import java.util.Map;
*/
@Service
public class IcPlacePatrolReviewRecordServiceImpl extends BaseServiceImpl implements IcPlacePatrolReviewRecordService {
+ private static final Logger log = LoggerFactory.getLogger(IcPlaceOrgServiceImpl.class);
+ @Autowired
+ private IcPlacePatrolRecordService icPlacePatrolRecordService;
+ @Autowired
+ private IcPlacePatrolTeamStaffDao icPlacePatrolTeamStaffDao;
+ /**
+ * @Author sun
+ * @Description 新增巡查复查记录
+ **/
@Override
- public PageData page(Map params) {
- IPage page = baseDao.selectPage(
- getPage(params, FieldConstant.CREATED_TIME, false),
- getWrapper(params)
- );
- return getPageData(page, IcPlacePatrolReviewRecordDTO.class);
- }
-
- @Override
- public List list(Map params) {
- List entityList = baseDao.selectList(getWrapper(params));
+ @Transactional(rollbackFor = Exception.class)
+ public void add(AddPlacePatrolReviewRecordFormDTO formDTO) {
+ //1.复查记录表新增数据
+ IcPlacePatrolReviewRecordEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolReviewRecordEntity.class);
+ insert(entity);
+ //2.修改巡查记录数据最新巡查时间和结果
+ IcPlacePatrolRecordEntity recordEntity = new IcPlacePatrolRecordEntity();
+ recordEntity.setId(entity.getPlacePatrolRecordId());
+ recordEntity.setFinalResult(entity.getReviewResult());
+ recordEntity.setFinalTime(entity.getReviewTime());
+ icPlacePatrolRecordService.updateById(recordEntity);
- return ConvertUtils.sourceToTarget(entityList, IcPlacePatrolReviewRecordDTO.class);
}
- private QueryWrapper getWrapper(Map params){
- String id = (String)params.get(FieldConstant.ID_HUMP);
-
- QueryWrapper wrapper = new QueryWrapper<>();
- wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+ /**
+ * @Author sun
+ * @Description 修改巡查复查记录
+ **/
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void edit(EditPlacePatrolReviewRecordFormDTO formDTO) {
+ //1.修改复查记录表数据
+ IcPlacePatrolReviewRecordEntity entity = baseDao.selectById(formDTO.getPlacePatrolReviewRecordId());
+ if (null == entity) {
+ throw new RenException(String.format("修改巡查复查记录,复查记录不存在,复查记录Id->%s", formDTO.getPlacePatrolReviewRecordId()));
+ }
+ entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolReviewRecordEntity.class);
+ baseDao.updateById(entity);
+ //2.复查记录修改了复查时间或复查结果时对应修改巡查记录数据最新巡查时间和结果
+ if (StringUtils.isNotEmpty(formDTO.getReviewResult()) || StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) {
+ IcPlacePatrolRecordEntity recordEntity = new IcPlacePatrolRecordEntity();
+ recordEntity.setId(entity.getPlacePatrolRecordId());
+ if (StringUtils.isNotEmpty(formDTO.getReviewResult()) || StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) {
+ recordEntity.setFinalResult(entity.getReviewResult());
+ }
+ if (StringUtils.isNotEmpty(formDTO.getReviewTime().toString())) {
+ recordEntity.setFinalTime(entity.getReviewTime());
+ }
+ icPlacePatrolRecordService.updateById(recordEntity);
+ }
- return wrapper;
}
+ /**
+ * @Author sun
+ * @Description 删除巡查复查记录
+ **/
@Override
- public IcPlacePatrolReviewRecordDTO get(String id) {
- IcPlacePatrolReviewRecordEntity entity = baseDao.selectById(id);
- return ConvertUtils.sourceToTarget(entity, IcPlacePatrolReviewRecordDTO.class);
+ @Transactional(rollbackFor = Exception.class)
+ public void del(String placePatrolReviewRecordId) {
+ if (baseDao.deleteById(placePatrolReviewRecordId) < NumConstant.ONE) {
+ throw new RenException(String.format("删除巡查复查记录信息失败,复查记录Id->%s", placePatrolReviewRecordId));
+ }
}
+ /**
+ * @Author sun
+ * @Description 巡查复查记录详情
+ **/
@Override
- @Transactional(rollbackFor = Exception.class)
- public void save(IcPlacePatrolReviewRecordDTO dto) {
- IcPlacePatrolReviewRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcPlacePatrolReviewRecordEntity.class);
- insert(entity);
+ public PlacePatrolReviewRecordDetailResultDTO detail(String placePatrolReviewRecordId) {
+ PlacePatrolReviewRecordDetailResultDTO resultDTO = new PlacePatrolReviewRecordDetailResultDTO();
+ //1.查询场所基础信息
+ GetListPlacePatrolReviewRecordFormDTO dto = new GetListPlacePatrolReviewRecordFormDTO();
+ dto.setPlacePatrolReviewRecordId(placePatrolReviewRecordId);
+ List result = baseDao.getList(dto);
+ if (CollectionUtils.isEmpty(result)) {
+ return resultDTO;
+ }
+ resultDTO = result.get(0);
+
+ //2.查询所有分队下人员名单
+ List teamDTOList = icPlacePatrolTeamStaffDao.getByTeamId(resultDTO.getPlacePatrolTeamId());
+ //3.封装九小场所数据
+ StringBuffer inspectorsNames = new StringBuffer("");
+ for (String str : resultDTO.getInspectors().split(",")) {
+ teamDTOList.forEach(r -> {
+ if (str.equals(r.getId())) {
+ inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName());
+ }
+ });
+ }
+ resultDTO.setInspectorsNames(inspectorsNames.toString());
+
+ return resultDTO;
}
+ /**
+ * @Author sun
+ * @Description 巡查复查记录列表查询
+ **/
@Override
- @Transactional(rollbackFor = Exception.class)
- public void update(IcPlacePatrolReviewRecordDTO dto) {
- IcPlacePatrolReviewRecordEntity entity = ConvertUtils.sourceToTarget(dto, IcPlacePatrolReviewRecordEntity.class);
- updateById(entity);
+ public GetListPlacePatrolReviewRecordResultDTO getList(GetListPlacePatrolReviewRecordFormDTO formDTO) {
+ GetListPlacePatrolReviewRecordResultDTO resultDTO = new GetListPlacePatrolReviewRecordResultDTO();
+ //1.查询巡查记录对应的复查记录数据
+ PageInfo result =
+ PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO));
+ if (CollectionUtils.isEmpty(result.getList())) {
+ return resultDTO;
+ }
+ resultDTO.setTotal((int) result.getTotal());
+
+ //2.查询所有分队下人员名单
+ List teamIds = result.getList().stream().map(PlacePatrolReviewRecordDetailResultDTO::getPlacePatrolTeamId).collect(Collectors.toList());
+ teamIds = teamIds.stream().distinct().collect(Collectors.toList());
+ List teamDTOList = icPlacePatrolTeamStaffDao.selectByTeamIds(teamIds);
+
+ //3.封装各分队人员数据
+ for (PlacePatrolReviewRecordDetailResultDTO dto : result.getList()) {
+ //分队成员
+ StringBuffer inspectorsNames = new StringBuffer("");
+ for (String str : dto.getInspectors().split(",")) {
+ teamDTOList.forEach(r -> {
+ if (str.equals(r.getId())) {
+ inspectorsNames.append("".equals(inspectorsNames) ? r.getName() : "," + r.getName());
+ }
+ });
+ }
+ dto.setInspectorsNames(inspectorsNames.toString());
+ }
+
+ resultDTO.setList(result.getList());
+ return resultDTO;
}
+ /**
+ * @Author sun
+ * @Description 删除巡查记录对应的复查记录
+ **/
@Override
- @Transactional(rollbackFor = Exception.class)
- public void delete(String[] ids) {
- // 逻辑删除(@TableLogic 注解)
- baseDao.deleteBatchIds(Arrays.asList(ids));
+ public int delByPatrolRecordId(String staffId, String placePatrolRecordId) {
+ return baseDao.delByPatrolRecordId(staffId, placePatrolRecordId);
}
-
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java
index 21e1733726..f8ca6fc890 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamStaffServiceImpl.java
@@ -17,23 +17,16 @@
package com.epmet.service.impl;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
-import com.epmet.commons.tools.constant.FieldConstant;
-import com.epmet.commons.tools.page.PageData;
-import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcPlacePatrolTeamStaffDao;
import com.epmet.dto.IcPlacePatrolTeamStaffDTO;
+import com.epmet.dto.form.GetListPlacePatrolTeamFormDTO;
+import com.epmet.dto.result.GetListPlacePatrolTeamResultDTO;
import com.epmet.entity.IcPlacePatrolTeamStaffEntity;
import com.epmet.service.IcPlacePatrolTeamStaffService;
-import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
-import java.util.Arrays;
import java.util.List;
-import java.util.Map;
/**
* 场所分队下人员管理
@@ -45,57 +38,6 @@ import java.util.Map;
public class IcPlacePatrolTeamStaffServiceImpl extends BaseServiceImpl implements IcPlacePatrolTeamStaffService {
- @Override
- public PageData page(Map params) {
- IPage page = baseDao.selectPage(
- getPage(params, FieldConstant.CREATED_TIME, false),
- getWrapper(params)
- );
- return getPageData(page, IcPlacePatrolTeamStaffDTO.class);
- }
-
- @Override
- public List list(Map params) {
- List entityList = baseDao.selectList(getWrapper(params));
-
- return ConvertUtils.sourceToTarget(entityList, IcPlacePatrolTeamStaffDTO.class);
- }
-
- private QueryWrapper getWrapper(Map params){
- String id = (String)params.get(FieldConstant.ID_HUMP);
-
- QueryWrapper wrapper = new QueryWrapper<>();
- wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
-
- return wrapper;
- }
-
- @Override
- public IcPlacePatrolTeamStaffDTO get(String id) {
- IcPlacePatrolTeamStaffEntity entity = baseDao.selectById(id);
- return ConvertUtils.sourceToTarget(entity, IcPlacePatrolTeamStaffDTO.class);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void save(IcPlacePatrolTeamStaffDTO dto) {
- IcPlacePatrolTeamStaffEntity entity = ConvertUtils.sourceToTarget(dto, IcPlacePatrolTeamStaffEntity.class);
- insert(entity);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void update(IcPlacePatrolTeamStaffDTO dto) {
- IcPlacePatrolTeamStaffEntity entity = ConvertUtils.sourceToTarget(dto, IcPlacePatrolTeamStaffEntity.class);
- updateById(entity);
- }
-
- @Override
- @Transactional(rollbackFor = Exception.class)
- public void delete(String[] ids) {
- // 逻辑删除(@TableLogic 注解)
- baseDao.deleteBatchIds(Arrays.asList(ids));
- }
/**
* @Author sun
@@ -106,4 +48,9 @@ public class IcPlacePatrolTeamStaffServiceImpl extends BaseServiceImpl getList(String teamId) {
+ return baseDao.getByTeamId(teamId);
+ }
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml
index cefa44a1a5..efde00da1e 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml
@@ -3,6 +3,46 @@
-
+
+ SELECT
+ a.id placePatrolRecordId,
+ a.agency_id agencyId,
+ a.grid_id gridId,
+ b.grid_name gridName,
+ a.place_org_id placeOrgId,
+ c.place_org_name placeOrgName,
+ a.place_patrol_team_id placePatrolTeamId,
+ d.team_name placePatrolTeamName,
+ a.nine_placs_val ninePlaceVal,
+ a.inspectors inspectors,
+ a.first_time firstTime,
+ a.first_result firstResult,
+ a.detailed detailed,
+ a.review_time reviewTime,
+ a.final_time finalTime,
+ a.final_result finalResult
+ FROM
+ ic_place_patrol_record a
+ LEFT JOIN customer_grid b ON a.grid_id = b.id
+ LEFT JOIN ic_place_org c ON a.place_org_id = c.id
+ LEFT JOIN ic_place_patrol_team d ON a.place_patrol_team_id = d.id
+ WHERE
+ a.del_flag = '0'
+ AND a.customer_id = ''
+
+ AND a.customer_id = #{customerId}
+
+
+ AND a.grid_id = #{gridId}
+
+
+ AND a.nine_place_val = #{ninePlacsVal}
+
+
+ AND a.place_org_id IN (select id from ic_place_org where place_org_name like concat('%', #{placeOrgName}, '%'))
+
+ ORDER BY
+ a.created_time DESC
+
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml
index 4151b45687..5151dfe91b 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolReviewRecordDao.xml
@@ -3,6 +3,43 @@
+
+ UPDATE
+ ic_place_patrol_review_record
+ SET
+ del_flag = '1',
+ updated_by = #{staffId},
+ updated_time = NOW()
+ WHERE
+ place_patrol_record_id = #{placePatrolRecordId}
+
+
+ SELECT
+ a.id placePatrolReviewRecordId,
+ a.place_patrol_record_id placePatrolRecordId,
+ a.place_patrol_team_id placePatrolTeamId,
+ b.team_name placePatrolTeamName,
+ a.inspectors inspectors,
+ a.review_time reviewTime,
+ a.detailed detailed,
+ a.review_result reviewResult
+ FROM
+ ic_place_patrol_review_record a
+ LEFT JOIN ic_place_patrol_team b ON a.place_patrol_team_id = b.id
+ WHERE
+ a.del_flag = '0'
+
+ AND a.customer_id = #{customerId}
+
+
+ AND a.place_patrol_record_id = #{placePatrolRecordId}
+
+
+ AND a.id = #{placePatrolReviewRecordId}
+
+ ORDER BY
+ a.created_time DESC
+
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml
index 5e63b8ee6d..7dddc8e731 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamStaffDao.xml
@@ -22,4 +22,18 @@
ORDER BY created_time DESC
+
+ SELECT
+ *
+ FROM
+ ic_place_patrol_team_staff
+ WHERE
+ del_flag = '0'
+
+ #{teamId}
+
+ ORDER BY
+ place_patrol_team_id ASC
+
+
\ No newline at end of file