diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java new file mode 100644 index 0000000000..58a1912d1f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/GridManagerListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 2:57 下午 + * @DESC + */ +@Data +public class GridManagerListFormDTO implements Serializable { + + private static final long serialVersionUID = -7624307754570242679L; + + public interface GridManagerListForm{} + + @NotBlank(message = "组织ID不能为空",groups = GridManagerListForm.class) + private String agencyId; + + @NotBlank(message = "行政区域编码不能为空",groups = GridManagerListForm.class) + private String areaCode; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java new file mode 100644 index 0000000000..831a4ee8fd --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/PatrolTrackFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:27 下午 + * @DESC + */ +@Data +public class PatrolTrackFormDTO implements Serializable { + + private static final long serialVersionUID = 5074643104620363029L; + + public interface PatrolTrackForm{} + + @NotBlank(message = "巡查记录ID不能为空",groups = PatrolTrackForm.class) + private String staffPatrolRecId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java new file mode 100644 index 0000000000..c540ddc579 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/RecordListFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:09 下午 + * @DESC + */ +@Data +public class RecordListFormDTO implements Serializable { + + private static final long serialVersionUID = 1034587652692011650L; + + public interface RecordListForm{} + + @NotBlank(message = "staffId不能为空",groups = RecordListForm.class) + private String staffId; + + @NotBlank(message = "网格ID不能为空",groups = RecordListForm.class) + private String gridId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java new file mode 100644 index 0000000000..7ea6da09f1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/GridManagerListResultDTO.java @@ -0,0 +1,52 @@ +package com.epmet.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 2:57 下午 + * @DESC + */ +@Data +public class GridManagerListResultDTO implements Serializable { + + private static final long serialVersionUID = 3606724812822179356L; + + /** + * 工作人员id + */ + private String staffId; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 网格ID + */ + private String gridId; + + /** + * 正在巡查:patrolling;否则返回空字符串 + */ + private String status; + + /** + * 网格名称,最多显示上两级 + */ + private String gridName; + + /** + * 姓名 + */ + private String staffName; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java new file mode 100644 index 0000000000..070b5a7d9a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/PatrolTrackResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:29 下午 + * @DESC + */ +@Data +public class PatrolTrackResultDTO implements Serializable { + + private static final long serialVersionUID = 5147586435344204616L; + + /** + * 纬度 + */ + private String latitude; + + /** + * 经度 + */ + private String longitude; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java new file mode 100644 index 0000000000..aab9d52ef0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/RecordListResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/6/7 3:14 下午 + * @DESC + */ +@Data +public class RecordListResultDTO implements Serializable { + + private static final long serialVersionUID = -1021736989973649009L; + + /** + * 巡查记录id + */ + private String staffPatrolRecId; + + /** + * 开始时间;yyyy-MM-dd HH:mm + */ + private String patrolStartTime; + + /** + * 结束时间;yyyy-MM-dd HH:mm + */ + private String patrolEndTime; + + /** + * 正在巡查:patrolling;已结束:end + */ + private String status; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java index c527606726..e853fa3a48 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/StaffPatrolDetailController.java @@ -1,9 +1,19 @@ package com.epmet.datareport.controller.user; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.user.StaffPatrolDetailService; +import com.epmet.user.form.GridManagerListFormDTO; +import com.epmet.user.form.PatrolTrackFormDTO; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.user.result.PatrolTrackResultDTO; +import com.epmet.user.result.RecordListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * 工作人员巡查记录明细 * @@ -11,10 +21,46 @@ import org.springframework.web.bind.annotation.*; * @since v1.0.0 2021-06-07 */ @RestController -@RequestMapping("staffpatroldetail") +@RequestMapping("staffpatrol") public class StaffPatrolDetailController { @Autowired - private StaffPatrolDetailService staffPatrolDetailService; + private StaffPatrolDetailService staffPatrolService; + + /** + * @Description 001、网格员分布 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:06 下午 + */ + @PostMapping("gridmanagerlist") + public Result> gridManagerList(@RequestBody GridManagerListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GridManagerListFormDTO.GridManagerListForm.class); + return new Result>().ok(staffPatrolService.gridManagerList(formDTO)); + } + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + @PostMapping("recordlist") + public Result> recordList(@RequestBody RecordListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, RecordListFormDTO.RecordListForm.class); + return new Result>().ok(staffPatrolService.recordList(formDTO)); + } + + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + @PostMapping("patroltrack") + public Result> patrolTrack(@RequestBody PatrolTrackFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PatrolTrackFormDTO.PatrolTrackForm.class); + return new Result>().ok(staffPatrolService.patrolTrack(formDTO)); + } } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java index 80feec8810..56e3249113 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolDetailDao.java @@ -19,7 +19,11 @@ package com.epmet.datareport.dao.user; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; +import com.epmet.user.result.PatrolTrackResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 工作人员巡查记录明细 @@ -29,5 +33,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StaffPatrolDetailDao extends BaseDao { - + + /** + * @Description 查询巡查轨迹 + * @Param staffPatrolRecId + * @author zxc + * @date 2021/6/7 5:13 下午 + */ + List selectPatrolTrack(@Param("staffPatrolRecId") String staffPatrolRecId); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java index c282d4e98d..a8637bd720 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/StaffPatrolRecordDao.java @@ -19,8 +19,12 @@ package com.epmet.datareport.dao.user; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.datareport.entity.user.StaffPatrolRecordEntity; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.RecordListResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 工作人员巡查主记录 * @@ -29,5 +33,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StaffPatrolRecordDao extends BaseDao { + + /** + * @Description 巡查记录查询 + * @Param formDTO + * @author zxc + * @date 2021/6/7 5:29 下午 + */ + List recordList(RecordListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java index 35a952b658..8afa465ea3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/StaffPatrolDetailService.java @@ -2,6 +2,14 @@ package com.epmet.datareport.service.user; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; +import com.epmet.user.form.GridManagerListFormDTO; +import com.epmet.user.form.PatrolTrackFormDTO; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.user.result.PatrolTrackResultDTO; +import com.epmet.user.result.RecordListResultDTO; + +import java.util.List; /** * 工作人员巡查记录明细 @@ -9,6 +17,30 @@ import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; * @author generator generator@elink-cn.com * @since v1.0.0 2021-06-07 */ -public interface StaffPatrolDetailService extends BaseService { +public interface StaffPatrolDetailService{ + + /** + * @Description 001、网格员分布 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:06 下午 + */ + List gridManagerList(GridManagerListFormDTO formDTO); + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + List recordList(RecordListFormDTO formDTO); + + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + List patrolTrack(PatrolTrackFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java index 90fd30694d..5c9537862f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/StaffPatrolDetailServiceImpl.java @@ -1,11 +1,21 @@ package com.epmet.datareport.service.user.impl; -import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.datareport.dao.user.StaffPatrolDetailDao; -import com.epmet.datareport.entity.user.StaffPatrolDetailEntity; +import com.epmet.datareport.dao.user.StaffPatrolRecordDao; import com.epmet.datareport.service.user.StaffPatrolDetailService; +import com.epmet.user.form.GridManagerListFormDTO; +import com.epmet.user.form.PatrolTrackFormDTO; +import com.epmet.user.form.RecordListFormDTO; +import com.epmet.user.result.GridManagerListResultDTO; +import com.epmet.user.result.PatrolTrackResultDTO; +import com.epmet.user.result.RecordListResultDTO; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; /** * 工作人员巡查记录明细 @@ -15,6 +25,53 @@ import org.springframework.stereotype.Service; */ @Service @Slf4j -public class StaffPatrolDetailServiceImpl extends BaseServiceImpl implements StaffPatrolDetailService { +public class StaffPatrolDetailServiceImpl implements StaffPatrolDetailService { + + @Autowired + private StaffPatrolDetailDao staffPatrolDetailDao; + + @Autowired + private StaffPatrolRecordDao staffPatrolRecordDao; + + /** + * @Description 001、网格员分布 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:06 下午 + */ + @Override + public List gridManagerList(GridManagerListFormDTO formDTO) { + + return null; + } + + /** + * @Description 002、查看巡查记录 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:25 下午 + */ + @Override + public List recordList(RecordListFormDTO formDTO) { + List result = staffPatrolRecordDao.recordList(formDTO); + if (!CollectionUtils.isEmpty(result)){ + return result; + } + return new ArrayList<>(); + } + /** + * @Description 003、巡查轨迹 + * @Param formDTO + * @author zxc + * @date 2021/6/7 3:35 下午 + */ + @Override + public List patrolTrack(PatrolTrackFormDTO formDTO) { + List results = staffPatrolDetailDao.selectPatrolTrack(formDTO.getStaffPatrolRecId()); + if (!CollectionUtils.isEmpty(results)){ + return results; + } + return new ArrayList<>(); + } } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml index 7b9093502a..cdc99d435b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolDetailDao.xml @@ -3,4 +3,16 @@ + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml index 511d20a355..5fef17c84a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/StaffPatrolRecordDao.xml @@ -3,4 +3,17 @@ + + \ No newline at end of file