Browse Source

修改经纬度

dev
HAHA 3 years ago
parent
commit
2ca203c43b
  1. 28
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/LonAndLatFormDTO.java
  2. 20
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcVolunteerPolyController.java
  3. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcVolunteerPolyDao.java
  4. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcVolunteerPolyService.java
  5. 22
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcVolunteerPolyServiceImpl.java
  6. 7
      epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml

28
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;
}

20
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<List<VolunteerPolyPieResultDTO>> getStatistics(@RequestBody VolunteerPolyPieFormDTO form,@LoginUser TokenDto tokenDto) {
public Result<List<VolunteerPolyPieResultDTO>> getStatistics(@RequestBody VolunteerPolyPieFormDTO form, @LoginUser TokenDto tokenDto) {
form.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(form);
List<VolunteerPolyPieResultDTO> dto = icVolunteerPolyService.getStatistics(form);
return new Result<List<VolunteerPolyPieResultDTO>>().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();
}
}

4
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<IcVolunteerPolyEntity> {
void deleteCategoryByCustomerId(@Param("customerId") String customerId);
List<VolunteerPolyPieResultDTO> getStatistics(VolunteerPolyPieFormDTO form);
void updateLonAndLat(@Param("form") LonAndLatFormDTO form);
}

11
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<IcVolunteerPolyEntit
* @date 2022/5/19 17:21
*/
List<VolunteerPolyPieResultDTO> getStatistics(VolunteerPolyPieFormDTO form);
/**
* 修改经纬度
*
* @param form
* @return void
* @author LZN
* @date 2022/5/24 15:07
*/
void updateLonAndLat(LonAndLatFormDTO form);
}

22
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<IcVolunteerPolyD
*/
@Override
public List<VolunteerPolyMapDataResultDTO> getMapData(VolunteerPolyMapDataFormDTO form) {
List<VolunteerPolyMapDataResultDTO> dto = baseDao.getMapData(form.getCode(), form.getCustomerId(),form.getAgencyId());
List<VolunteerPolyMapDataResultDTO> 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<IcVolunteerPolyD
@Override
public PageData getList(VolunteerPolyListFormDTO form) {
PageHelper.startPage(form.getPageNo(), form.getPageSize());
List<VolunteerPolyListResultDTO> result = baseDao.getList(form.getCode(), form.getCustomerId(),form.getAgencyId());
List<VolunteerPolyListResultDTO> result = baseDao.getList(form.getCode(), form.getCustomerId(), form.getAgencyId());
PageInfo<VolunteerPolyListResultDTO> info = new PageInfo<>(result);
return new PageData<>(result, info.getTotal());
}
@ -469,4 +466,17 @@ public class IcVolunteerPolyServiceImpl extends BaseServiceImpl<IcVolunteerPolyD
}).collect(Collectors.toList());
}
/**
* 修改经纬度
*
* @param form
* @return void
* @author LZN
* @date 2022/5/24 15:08
*/
@Override
public void updateLonAndLat(LonAndLatFormDTO form) {
baseDao.updateLonAndLat(form);
}
}

7
epmet-user/epmet-user-server/src/main/resources/mapper/IcVolunteerPolyDao.xml

@ -21,6 +21,13 @@
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
</resultMap>
<update id="updateLonAndLat">
UPDATE ic_volunteer_poly p
SET p.LONGITUDE = #{form.longitude},
p.LATITUDE = #{form.latitude}
WHERE
p.IC_RESI_USER = #{form.icResiUser}
</update>
<select id="getMapData" resultType="com.epmet.dto.result.VolunteerPolyMapDataResultDTO">
SELECT
u.id,

Loading…
Cancel
Save