From 4bc3e61cd7597c8974c1274cec5ba9deb0d59810 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 19 Nov 2021 16:11:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CommunitySelfOrganizationListFormDTO.java | 49 ++++++++++ .../CommunitySelfOrganizationListDTO.java | 89 +++++++++++++++++++ ...ommunitySelfOrganizationListResultDTO.java | 28 ++++++ ...IcCommunitySelfOrganizationController.java | 15 ++++ .../dao/IcCommunitySelfOrganizationDao.java | 19 ++++ .../IcCommunitySelfOrganizationService.java | 11 +++ ...cCommunitySelfOrganizationServiceImpl.java | 34 +++++++ .../mapper/IcCommunitySelfOrganizationDao.xml | 50 +++++++++++ 8 files changed, 295 insertions(+) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListResultDTO.java diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java new file mode 100644 index 0000000000..c70e2a7055 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/CommunitySelfOrganizationListFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/11/19 1:47 下午 + * @DESC + */ +@Data +public class CommunitySelfOrganizationListFormDTO implements Serializable { + + private static final long serialVersionUID = 4202083250504143469L; + + public interface CommunitySelfOrganizationListForm{} + + /** + * 社区自组织名 + */ + private String organizationName; + + /** + * 开始时间 + */ + private String startTime; + + /** + * 结束时间 + */ + private String endTime; + + @NotNull(message = "pageNo不能为空",groups = CommunitySelfOrganizationListForm.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空",groups = CommunitySelfOrganizationListForm.class) + private Integer pageSize; + + /** + * 是否分页,默认true分页 + */ + private Boolean isPage = true; + + private String customerId; + private String agencyId; + private Integer ranking; +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java new file mode 100644 index 0000000000..47b2c02df8 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java @@ -0,0 +1,89 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dto.IcCommunitySelfOrganizationPersonnelDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/19 1:47 下午 + * @DESC + */ +@Data +public class CommunitySelfOrganizationListDTO implements Serializable { + + private static final long serialVersionUID = 3208034033470533749L; + + /** + * 排序 + */ + private Integer sort; + + /** + * 社区自组织人数 + */ + private Integer organizationPersonCount; + + /** + * 社区自组织名字 + */ + private String organizationName; + + /** + * 服务事项 + */ + private String serviceItem; + + /** + * 负责人 + */ + private String principalName; + + /** + * 负责人电话 + */ + private String principalPhone; + + /** + * 自组织创办时间 + */ + private String organizationCreatedTime; + + /** + * 经度 + */ + private String longitude; + + /** + * 纬度 + */ + private String latitude; + + /** + * 社区自组织ID + */ + private String orgId; + + /** + * 社区自组织人员 + */ + private List organizationPersonnel; + + public CommunitySelfOrganizationListDTO() { + this.sort = NumConstant.ZERO; + this.organizationPersonCount = NumConstant.ZERO; + this.organizationName = ""; + this.serviceItem = ""; + this.principalName = ""; + this.principalPhone = ""; + this.organizationCreatedTime = ""; + this.longitude = ""; + this.latitude = ""; + this.orgId = ""; + this.organizationPersonnel = new ArrayList<>(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListResultDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListResultDTO.java new file mode 100644 index 0000000000..c8cb3375fd --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/11/19 1:47 下午 + * @DESC + */ +@Data +public class CommunitySelfOrganizationListResultDTO implements Serializable { + + private static final long serialVersionUID = 3208034033470533749L; + + private Integer total; + + private List list; + + public CommunitySelfOrganizationListResultDTO() { + this.total = NumConstant.ZERO; + this.list = new ArrayList<>(); + } +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java index c80950e2e0..f805d75a72 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java @@ -30,7 +30,9 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.IcCommunitySelfOrganizationDTO; import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; import com.epmet.excel.IcCommunitySelfOrganizationExcel; import com.epmet.service.IcCommunitySelfOrganizationService; import org.springframework.beans.factory.annotation.Autowired; @@ -124,4 +126,17 @@ public class IcCommunitySelfOrganizationController { return new Result(); } + /** + * @Description 查询社区自组织列表 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2021/11/19 1:59 下午 + */ + @PostMapping("communityselforganizationlist") + public Result communitySelfOrganizationList(@LoginUser TokenDto tokenDto,@RequestBody CommunitySelfOrganizationListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, CommunitySelfOrganizationListFormDTO.CommunitySelfOrganizationListForm.class); + return new Result().ok(icCommunitySelfOrganizationService.communitySelfOrganizationList(tokenDto, formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java index e1c0e16689..b205741829 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java @@ -18,9 +18,14 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListDTO; import com.epmet.entity.IcCommunitySelfOrganizationEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 社区自组织表 @@ -31,6 +36,20 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface IcCommunitySelfOrganizationDao extends BaseDao { + /** + * @Description 自组织修改 + * @param formDTO + * @author zxc + * @date 2021/11/19 2:04 下午 + */ void updateCommunitySelfOrganization(IcCommunitySelfOrganizationEntity formDTO); + /** + * @Description 查询社区自组织列表 + * @param formDTO + * @author zxc + * @date 2021/11/19 2:05 下午 + */ + List selectCommunitySelfOrganizationList(CommunitySelfOrganizationListFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java index 530dbe671a..7de1d51965 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java @@ -22,7 +22,9 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.IcCommunitySelfOrganizationDTO; import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; +import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO; import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO; +import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; import com.epmet.entity.IcCommunitySelfOrganizationEntity; import java.util.List; @@ -113,4 +115,13 @@ public interface IcCommunitySelfOrganizationService extends BaseService objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectCommunitySelfOrganizationList(formDTO)); + result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal()))); + if (CollectionUtils.isNotEmpty(objectPageInfo.getList())){ + objectPageInfo.getList().forEach(l -> { + l.setSort(i[NumConstant.ZERO]); + i[NumConstant.ZERO]++; + }); + result.setList(objectPageInfo.getList()); + } + return result; + } + } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml index b7176f6859..ddcb270c64 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml @@ -3,6 +3,7 @@ + UPDATE ic_community_self_organization SET ORGANIZATION_NAME = #{organizationName}, @@ -18,4 +19,53 @@ WHERE DEL_FLAG = 0 AND ID = #{orgId} + + + + + + + + + + + + + + + \ No newline at end of file