getCommunityList(@Param("customerId")String customerId, @Param("agencyId")String agencyId);
+
}
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
index bacb45d855..629adcc17a 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java
@@ -1,20 +1,3 @@
-/**
- * Copyright 2018 人人开源 https://www.renren.io
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
package com.epmet.service;
import com.epmet.commons.tools.security.dto.TokenDto;
@@ -156,4 +139,12 @@ public interface AgencyService {
*/
List getSonAgencyId(String orgId,String type);
+ /**
+ * Desc: 查询工作人员所属组织下的所有社区
+ * @param tokenDto
+ * @author zxc
+ * @date 2022/3/21 15:13
+ */
+ List getCommunityList(TokenDto tokenDto);
+
}
\ No newline at end of file
diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
index c20fd83965..00dc182535 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
+++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
@@ -798,6 +798,22 @@ public class AgencyServiceImpl implements AgencyService {
return new ArrayList<>();
}
+ /**
+ * Desc: 查询工作人员所属组织下的所有社区
+ * @param tokenDto
+ * @author zxc
+ * @date 2022/3/21 15:13
+ */
+ @Override
+ public List getCommunityList(TokenDto tokenDto) {
+ CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
+ if (null == staffInfo){
+ throw new EpmetException("未查询到工作人员信息"+staffInfo.getStaffId());
+ }
+ String agencyId = staffInfo.getAgencyId();
+ return customerAgencyDao.getCommunityList(tokenDto.getCustomerId(), agencyId);
+ }
+
private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) {
CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class);
insertEntity.setOrganizationName(formDTO.getAgencyName());
diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
index a85367052d..d8314ee8b5 100644
--- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
+++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
@@ -733,6 +733,18 @@
AND PID = #{orgId}
+
+
+
UPDATE customer_agency
SET AREA_CODE = '',
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java
index ae5ec4bacb..368db969c4 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java
@@ -1,32 +1,22 @@
package com.epmet.dto.form;
+import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
-import javax.validation.constraints.NotNull;
-import java.io.Serializable;
-
/**
* @Author zxc
* @DateTime 2022/3/18 19:00
* @DESC
*/
@Data
-public class CollectListFormDTO implements Serializable {
+public class CollectListFormDTO extends PageFormDTO {
private static final long serialVersionUID = 2106773724057183577L;
public interface CollectListForm{}
- @NotNull(message = "pageNo不能为空", groups = CollectListForm.class)
- private Integer pageNo;
-
- @NotNull(message = "pageSize不能为空", groups = CollectListForm.class)
- private Integer pageSize;
-
private String orgId;
- private String neighborHoodId;
- private String buildingId;
- private String houseId;
+
private String address;
/**
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java
index 7d6d1743af..2dccf23b59 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java
@@ -4,6 +4,10 @@ import lombok.Data;
import java.io.Serializable;
+/**
+ * 家庭成员信息
+ * 前端做校验
+ */
@Data
public class IcResiCollectMemFormDTO implements Serializable {
/**
@@ -13,25 +17,30 @@ public class IcResiCollectMemFormDTO implements Serializable {
/**
* 居住成员1姓名
*/
+ // @NotBlank(message = "姓名不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String name;
/**
* 居住成员1身份证号
*/
+ // @NotBlank(message = "身份证号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String idNum;
/**
* 居住成员1手机号
*/
+ // @NotBlank(message = "手机号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String mobile;
/**
* 居住成员1是否参加几轮全员核算检测,数字1-10
*/
+ // @NotBlank(message = "核算检测情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private String heSuanCount;
/**
* 居住成员1新冠疫苗接种情况;1:已全程接种;2:未全程接种;0未接种;
*/
+ // @NotNull(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class})
private Integer ymjz;
}
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java
new file mode 100644
index 0000000000..f74e042b77
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java
@@ -0,0 +1,48 @@
+package com.epmet.dto.result;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @Author zxc
+ * @DateTime 2022/3/18 19:00
+ * @DESC
+ */
+@Data
+public class CollectListExcelResultDTO implements Serializable {
+
+ private static final long serialVersionUID = -5659769436514116680L;
+ /**
+ * 户主姓名
+ */
+ @Excel(name = "户主姓名",width = 30, needMerge = true)
+ private String houseHolderName;
+
+ /**
+ * 居住地址
+ */
+ @Excel(name = "居住地址",width = 40, needMerge = true)
+ private String address;
+
+ /**
+ * 房屋类型,1:自有, 0:租住
+ */
+ @Excel(name = "房屋类型",replace = { "自有_1", "租住_2"}, width = 30, needMerge = true)
+ private String houseType;
+
+ /**
+ * 居住人数
+ */
+ @Excel(name = "居住成员人数",width = 30, needMerge = true)
+ private Integer totalResi;
+
+ @ExcelCollection(name="家庭成员")
+ private List listP = new ArrayList<>();
+
+
+}
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java
new file mode 100644
index 0000000000..319d11b8f0
--- /dev/null
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java
@@ -0,0 +1,48 @@
+package com.epmet.dto.result;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * desc:
+ *
+ * @author: LiuJanJun
+ * @date: 2022/3/21 5:09 下午
+ * @version: 1.0
+ */
+@Data
+public class CollectListMemberExcelResultDTO implements Serializable {
+ private static final long serialVersionUID = -4290962585956172531L;
+ /**
+ * 成员名字
+ */
+ @Excel(name = "成员姓名", width = 30)
+ private String memberName;
+
+ /**
+ * 成员身份证
+ */
+ @Excel(name = "成员身份证号", width = 30)
+ private String memberIdNum;
+
+ /**
+ * 成员电话
+ */
+ @Excel(name = "成员手机号", width = 30)
+ private String memberMobile;
+
+ /**
+ * 核酸检测次数
+ */
+ @Excel(name = "参加几轮核酸检测", width = 30)
+ private String heSuanCount = "0";
+
+ /**
+ * 疫苗是否全程接种,1:全程接种,2:未全程接种,3:为接种
+ */
+ @Excel(name = "疫苗接种情况",replace = { "全程接种_1", "未全程接种_2", "未接种_3" }, width = 30)
+ private String ymjz;
+
+}
diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java
index 9edcfa4d8d..1d61469165 100644
--- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java
+++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java
@@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.List;
/**
@@ -42,13 +41,6 @@ public class CollectListResultDTO implements Serializable {
private List list;
- public CollectListResultDTO() {
- this.houseHolderName = "";
- this.address = "";
- this.houseType = "0";
- this.totalResi = 0;
- this.list = new ArrayList<>();
- }
@Data
public static class CollectListMemberResultDTO{
@@ -77,12 +69,6 @@ public class CollectListResultDTO implements Serializable {
*/
private Integer ymjz;
- public CollectListMemberResultDTO() {
- this.memberName = "";
- this.memberIdNum = "";
- this.memberMobile = "";
- this.heSuanCount = "0";
- this.ymjz = 0;
- }
+
}
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java
index ed1227c01e..fbe82fc561 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java
@@ -2,12 +2,17 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
+import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.CollectListFormDTO;
import com.epmet.dto.form.IcResiCollectFormDTO;
+import com.epmet.dto.result.CollectListExcelResultDTO;
+import com.epmet.dto.result.CollectListMemberExcelResultDTO;
import com.epmet.dto.result.CollectListResultDTO;
import com.epmet.service.IcResiCollectService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -16,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
import java.util.List;
@@ -68,4 +75,37 @@ public class IcResiCollectController {
return new Result>().ok(icResiCollectService.getCollectList(formDTO));
}
+ /**
+ * Desc: 查询采集居民信息
+ * @param formDTO
+ * @param tokenDto
+ * @author zxc
+ * @date 2022/3/18 19:23
+ */
+ @PostMapping("export")
+ public void export(@RequestBody CollectListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception {
+ //ValidatorUtils.validateEntity(formDTO,CollectListFormDTO.CollectListForm.class);
+ //tokenDto.setUserId("73ae6280e46a6653a5605d51d5462725");
+ //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc");
+ formDTO.setUserId(tokenDto.getUserId());
+ formDTO.setCustomerId(tokenDto.getCustomerId());
+ formDTO.setPage(false);
+ PageData collectList = icResiCollectService.getCollectList(formDTO);
+ List list = ConvertUtils.sourceToTarget(collectList.getList(),CollectListExcelResultDTO.class);
+
+ collectList.getList().forEach(o->{
+ List children = new ArrayList<>();
+ o.getList().forEach(item->{
+ CollectListMemberExcelResultDTO resultDTO = ConvertUtils.sourceToTarget(item, CollectListMemberExcelResultDTO.class);
+ resultDTO.setYmjz(item.getYmjz() == null? StrConstant.EPMETY_STR:String.valueOf(item.getYmjz()));
+ children.add(resultDTO);
+ });
+ CollectListExcelResultDTO resultDTO = ConvertUtils.sourceToTarget(o, CollectListExcelResultDTO.class);
+ resultDTO.setListP(children);
+ list.add(resultDTO);
+ });
+
+ ExcelUtils.exportExcelToTarget(response, null, list, CollectListExcelResultDTO.class);
+ }
+
}
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java
index 4037180bf0..e59318dbd6 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java
@@ -86,9 +86,6 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl getCollectList(CollectListFormDTO formDTO) {
PageData result = new PageData<>(new ArrayList<>(), 0);
if (StringUtils.isBlank(formDTO.getOrgId()) &&
- StringUtils.isBlank(formDTO.getNeighborHoodId()) &&
- StringUtils.isBlank(formDTO.getBuildingId()) &&
- StringUtils.isBlank(formDTO.getHouseId()) &&
StringUtils.isBlank(formDTO.getAddress()) &&
StringUtils.isBlank(formDTO.getStartDate()) &&
StringUtils.isBlank(formDTO.getEndDate()) ){
@@ -98,9 +95,14 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl pageList = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getCollectList(formDTO));
- result.setList(pageList.getList());
- result.setTotal(Integer.valueOf(String.valueOf(pageList.getTotal())));
+ if (formDTO.isPage()){
+ PageInfo pageList = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getCollectList(formDTO));
+ result.setList(pageList.getList());
+ result.setTotal(Integer.parseInt(String.valueOf(pageList.getTotal())));
+ }else {
+ List collectList = baseDao.getCollectList(formDTO);
+ result.setList(collectList);
+ }
return result;
}
@@ -135,4 +137,4 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl
AND CONCAT(c.PIDS,':',c.AGENCY_ID) LIKE CONCAT('%',#{orgId},'%')
-
- AND c.VILLAGE_ID = #{neighborHoodId}
-
-
- AND c.BUILD_ID = #{buildingId}
-
-
- AND c.HOME_ID = #{houseId}
-
AND c.ADDRESS LIKE CONCAT('%',#{address},'%')