Browse Source

事件信息分页

master
HAHA 3 years ago
parent
commit
6c0d697306
  1. 37
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/WghSjxxFormDTO.java
  2. 47
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/WghSjxxResultDTO.java
  3. 20
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/WghSjxxbController.java
  4. 16
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/WghSjxxbDao.java
  5. 12
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/WghSjxxbService.java
  6. 21
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/WghSjxxbServiceImpl.java
  7. 27
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/WghSjxxbDao.xml

37
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/form/WghSjxxFormDTO.java

@ -0,0 +1,37 @@
package com.epmet.opendata.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
import java.net.Inet4Address;
@Data
public class WghSjxxFormDTO implements Serializable {
private static final long serialVersionUID = 3208547934202974728L;
/**
* 事件来源
*/
private String infosourcename;
/**
* 事件类别
*/
private String infotypename;
/**
* 社区名称
*/
private String communityname;
/**
* 事件状态
*/
private String statusname;
private Integer page;
private Integer limit;
}

47
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/result/WghSjxxResultDTO.java

@ -0,0 +1,47 @@
package com.epmet.opendata.dto.result;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
@Data
public class WghSjxxResultDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -5318466282262952340L;
/**
* 事件来源
*/
private String infosourcename;
/**
* 事件类别
*/
private String infotypename;
/**
* 社区名称
*/
private String communityname;
/**
* 事见描述
*/
private String description;
/**
* 事见地址
*/
private String address;
/**
* 事见状态
*/
private String statusname;
/**
* 街道名称
*/
private String streetname;
}

20
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/WghSjxxbController.java

@ -1,7 +1,9 @@
package com.epmet.opendata.controller; package com.epmet.opendata.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit; import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.AssertUtils;
@ -10,6 +12,9 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.opendata.dto.form.PreserVationFormDTO; import com.epmet.opendata.dto.form.PreserVationFormDTO;
import com.epmet.opendata.dto.form.WghSjxxFormDTO;
import com.epmet.opendata.dto.result.CaLoudongResultDTO;
import com.epmet.opendata.dto.result.WghSjxxResultDTO;
import com.epmet.opendata.dto.wgh.WghSjxxbDTO; import com.epmet.opendata.dto.wgh.WghSjxxbDTO;
import com.epmet.opendata.excel.WghSjxxbExcel; import com.epmet.opendata.excel.WghSjxxbExcel;
import com.epmet.opendata.service.WghSjxxbService; import com.epmet.opendata.service.WghSjxxbService;
@ -92,4 +97,19 @@ public class WghSjxxbController {
return new Result(); return new Result();
} }
/**
* 事件信息分页
*
* @param form
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result<com.epmet.commons.tools.page.PageData < com.epmet.opendata.dto.result.WghSjxxResultDTO>>
* @author LZN
* @date 2022/6/29 10:42
*/
@PostMapping("getPage")
public Result<PageData<WghSjxxResultDTO>> getSjxxPage(@RequestBody WghSjxxFormDTO form, @LoginUser TokenDto tokenDto) {
PageData<WghSjxxResultDTO> dto = wghSjxxbService.getSjxxPage(form);
return new Result<PageData<WghSjxxResultDTO>>().ok(dto);
}
} }

16
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/WghSjxxbDao.java

@ -1,8 +1,13 @@
package com.epmet.opendata.dao; package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.dto.form.WghSjxxFormDTO;
import com.epmet.opendata.dto.result.WghSjxxResultDTO;
import com.epmet.opendata.entity.WghSjxxbEntity; import com.epmet.opendata.entity.WghSjxxbEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* 事件信息 * 事件信息
@ -14,4 +19,15 @@ import org.apache.ibatis.annotations.Mapper;
public interface WghSjxxbDao extends BaseDao<WghSjxxbEntity> { public interface WghSjxxbDao extends BaseDao<WghSjxxbEntity> {
int deleteAll(); int deleteAll();
/**
* 事件信息分页
*
* @param form
* @return java.util.List<com.epmet.opendata.dto.result.WghSjxxResultDTO>
* @author LZN
* @date 2022/6/29 10:43
*/
List<WghSjxxResultDTO> getSjxxPage(@Param("form") WghSjxxFormDTO form);
} }

12
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/WghSjxxbService.java

@ -3,6 +3,8 @@ package com.epmet.opendata.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.opendata.dto.form.PreserVationFormDTO; import com.epmet.opendata.dto.form.PreserVationFormDTO;
import com.epmet.opendata.dto.form.WghSjxxFormDTO;
import com.epmet.opendata.dto.result.WghSjxxResultDTO;
import com.epmet.opendata.dto.wgh.WghSjxxbDTO; import com.epmet.opendata.dto.wgh.WghSjxxbDTO;
import com.epmet.opendata.entity.WghSjxxbEntity; import com.epmet.opendata.entity.WghSjxxbEntity;
@ -86,4 +88,14 @@ public interface WghSjxxbService extends BaseService<WghSjxxbEntity> {
* @date 2022/6/14 16:02 * @date 2022/6/14 16:02
*/ */
void getPreserSjxxVation(PreserVationFormDTO dto); void getPreserSjxxVation(PreserVationFormDTO dto);
/**
* 事件信息分页
*
* @param form
* @return com.epmet.commons.tools.page.PageData<com.epmet.opendata.dto.result.WghSjxxResultDTO>
* @author LZN
* @date 2022/6/29 10:43
*/
PageData<WghSjxxResultDTO> getSjxxPage(WghSjxxFormDTO form);
} }

21
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/WghSjxxbServiceImpl.java

@ -14,12 +14,17 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.opendata.dao.WghSjxxbDao; import com.epmet.opendata.dao.WghSjxxbDao;
import com.epmet.opendata.dto.constant.CaWghDataConstant; import com.epmet.opendata.dto.constant.CaWghDataConstant;
import com.epmet.opendata.dto.form.PreserVationFormDTO; import com.epmet.opendata.dto.form.PreserVationFormDTO;
import com.epmet.opendata.dto.form.WghSjxxFormDTO;
import com.epmet.opendata.dto.result.CaLoudongResultDTO;
import com.epmet.opendata.dto.result.WghSjxxResultDTO;
import com.epmet.opendata.dto.wgh.WghSjxxbDTO; import com.epmet.opendata.dto.wgh.WghSjxxbDTO;
import com.epmet.opendata.entity.CaLoudongEntity; import com.epmet.opendata.entity.CaLoudongEntity;
import com.epmet.opendata.entity.WghSjxxbEntity; import com.epmet.opendata.entity.WghSjxxbEntity;
import com.epmet.opendata.redis.WghSjxxbRedis; import com.epmet.opendata.redis.WghSjxxbRedis;
import com.epmet.opendata.service.WghSjxxbService; import com.epmet.opendata.service.WghSjxxbService;
import com.epmet.opendata.util.AesUtils; import com.epmet.opendata.util.AesUtils;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -130,6 +135,22 @@ public class WghSjxxbServiceImpl extends BaseServiceImpl<WghSjxxbDao, WghSjxxbEn
} }
/**
* 事件信息分页
*
* @param form
* @return com.epmet.commons.tools.page.PageData<com.epmet.opendata.dto.result.WghSjxxResultDTO>
* @author LZN
* @date 2022/6/29 10:43
*/
@Override
public PageData<WghSjxxResultDTO> getSjxxPage(WghSjxxFormDTO form) {
PageHelper.startPage(form.getPage(), form.getLimit());
List<WghSjxxResultDTO> result = baseDao.getSjxxPage(form);
PageInfo<WghSjxxResultDTO> info = new PageInfo<>(result);
return new PageData<>(result, info.getTotal());
}
private int listLouDong(PreserVationFormDTO dto) throws Exception { private int listLouDong(PreserVationFormDTO dto) throws Exception {
String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY); String aes = AesUtils.encryptByAES(JSONObject.toJSONString(dto), CaWghDataConstant.AESKEY);

27
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/WghSjxxbDao.xml

@ -23,6 +23,33 @@
<delete id="deleteAll"> <delete id="deleteAll">
delete from wgh_sjxxb delete from wgh_sjxxb
</delete> </delete>
<select id="getSjxxPage" resultType="com.epmet.opendata.dto.result.WghSjxxResultDTO">
SELECT
INFOSOURCENAME,
INFOTYPENAME,
COMMUNITYNAME,
DESCRIPTION,
ADDRESS,
STATUSNAME,
STREETNAME
FROM
wgh_sjxxb
<where>
1=1
<if test="form.infosourcename != null and form.infosourcename != ''">
AND INFOSOURCENAME = #{form.infosourcename}
</if>
<if test="form.infotypename != null and form.infotypename != ''">
AND INFOTYPENAME = #{form.infotypename}
</if>
<if test="form.communityname != null and form.communityname != ''">
AND COMMUNITYNAME = #{form.communityname}
</if>
<if test="form.statusname != null and form.statusname != ''">
AND STATUSNAME = #{form.statusname}
</if>
</where>
</select>
</mapper> </mapper>

Loading…
Cancel
Save