diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LonAndLatFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LonAndLatFormDTO.java new file mode 100644 index 0000000000..1828a04c8c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LonAndLatFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class LonAndLatFormDTO implements Serializable { + + private static final long serialVersionUID = -4097378626418182909L; + + private String customerId; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 关联关系 + */ + private String icResiUser; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java index 70fc542106..755205671a 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java @@ -12,6 +12,7 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.dto.form.LonAndLatFormDTO; import com.epmet.dto.form.VolunteerPolyListFormDTO; import com.epmet.dto.form.VolunteerPolyMapDataFormDTO; import com.epmet.dto.form.VolunteerPolyPieFormDTO; @@ -143,11 +144,28 @@ public class IcVolunteerPolyController { * @date 2022/5/19 17:21 */ @PostMapping("statistics") - public Result> getStatistics(@RequestBody VolunteerPolyPieFormDTO form,@LoginUser TokenDto tokenDto) { + public Result> getStatistics(@RequestBody VolunteerPolyPieFormDTO form, @LoginUser TokenDto tokenDto) { form.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(form); List dto = icVolunteerPolyService.getStatistics(form); return new Result>().ok(dto); } + /** + * 修改经纬度 + * + * @param tokenDto + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author LZN + * @date 2022/5/24 15:07 + */ + @PostMapping("LonAndLat") + public Result LonAndLat(@LoginUser TokenDto tokenDto, @RequestBody LonAndLatFormDTO form) { + form.setIcResiUser(tokenDto.getUserId()); + form.setCustomerId(tokenDto.getCustomerId()); + icVolunteerPolyService.updateLonAndLat(form); + return new Result(); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java index c4d63dc49e..04fa1977b0 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java @@ -1,6 +1,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.LonAndLatFormDTO; import com.epmet.dto.form.VolunteerPolyPieFormDTO; import com.epmet.dto.result.VolunteerPolyListResultDTO; import com.epmet.dto.result.VolunteerPolyMapDataResultDTO; @@ -40,4 +41,7 @@ public interface IcVolunteerPolyDao extends BaseDao { void deleteCategoryByCustomerId(@Param("customerId") String customerId); List getStatistics(VolunteerPolyPieFormDTO form); + + void updateLonAndLat(@Param("form") LonAndLatFormDTO form); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java index 6297a12546..6a2b9f8f73 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java @@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcVolunteerPolyDTO; +import com.epmet.dto.form.LonAndLatFormDTO; import com.epmet.dto.form.VolunteerPolyListFormDTO; import com.epmet.dto.form.VolunteerPolyMapDataFormDTO; import com.epmet.dto.form.VolunteerPolyPieFormDTO; @@ -131,4 +132,14 @@ public interface IcVolunteerPolyService extends BaseService getStatistics(VolunteerPolyPieFormDTO form); + + /** + * 修改经纬度 + * + * @param form + * @return void + * @author LZN + * @date 2022/5/24 15:07 + */ + void updateLonAndLat(LonAndLatFormDTO form); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java index 373f7613fc..a2d33d2db2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java @@ -24,10 +24,7 @@ import com.epmet.dao.IcVolunteerPolyDao; import com.epmet.dao.UserBaseInfoDao; import com.epmet.dto.IcVolunteerPolyDTO; import com.epmet.dto.VolunteerInfoDTO; -import com.epmet.dto.form.IcFormOptionsQueryFormDTO; -import com.epmet.dto.form.VolunteerPolyListFormDTO; -import com.epmet.dto.form.VolunteerPolyMapDataFormDTO; -import com.epmet.dto.form.VolunteerPolyPieFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; import com.epmet.dto.result.VolunteerPolyListResultDTO; import com.epmet.dto.result.VolunteerPolyMapDataResultDTO; @@ -141,7 +138,7 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl getMapData(VolunteerPolyMapDataFormDTO form) { - List dto = baseDao.getMapData(form.getCode(), form.getCustomerId(),form.getAgencyId()); + List dto = baseDao.getMapData(form.getCode(), form.getCustomerId(), form.getAgencyId()); // 获取gridName for (VolunteerPolyMapDataResultDTO item : dto) { if (StringUtils.isNotEmpty(item.getGridId())) { @@ -172,7 +169,7 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl result = baseDao.getList(form.getCode(), form.getCustomerId(),form.getAgencyId()); + List result = baseDao.getList(form.getCode(), form.getCustomerId(), form.getAgencyId()); PageInfo info = new PageInfo<>(result); return new PageData<>(result, info.getTotal()); } @@ -469,4 +466,17 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl + + UPDATE ic_volunteer_poly p + SET p.LONGITUDE = #{form.longitude}, + p.LATITUDE = #{form.latitude} + WHERE + p.IC_RESI_USER = #{form.icResiUser} +