|
@@ -20,6 +20,7 @@ import com.iden.common.service.IdenPersonService;
|
|
|
import com.iden.common.util.DateUtils;
|
|
|
import com.iden.common.util.ImgUtil;
|
|
|
import com.iden.common.util.MyBeanUtils;
|
|
|
+import com.iden.common.vo.PersonStaVO;
|
|
|
import com.iden.common.vo.PersonVO;
|
|
|
import com.iden.common.vo.PageReqVO;
|
|
|
import com.iden.common.vo.UserLoginedConvertVO;
|
|
@@ -33,10 +34,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.io.File;
|
|
|
import java.io.FileOutputStream;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
-import java.util.UUID;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
*
|
|
@@ -59,6 +57,54 @@ public class PersonService {
|
|
|
@Value("${file.url:#{null}}")
|
|
|
private String fileUrl;
|
|
|
|
|
|
+
|
|
|
+ public PersonStaVO getPersonStaVO(String type, String nameOrCred, String district, String subdistrict, Long communityId, Long crowdId, String address, String gender, String populationType, UserLoginedConvertVO loginUser) {
|
|
|
+ QueryWrapper<IdenPerson> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.lambda().like(IdenPerson::getType,type)
|
|
|
+ .like(StrUtil.isNotEmpty(address), IdenPerson::getAddress,address)
|
|
|
+ .eq(StrUtil.isNotEmpty(gender),IdenPerson::getGender,gender)
|
|
|
+ .eq(StrUtil.isNotEmpty(populationType),IdenPerson::getPopulationType,populationType)
|
|
|
+ .eq(StrUtil.isNotEmpty(district),IdenPerson::getDistrict,district)
|
|
|
+ .eq(StrUtil.isNotEmpty(subdistrict),IdenPerson::getSubdistrict,subdistrict)
|
|
|
+ .eq(communityId != null,IdenPerson::getCommunityId,communityId)
|
|
|
+ .and(StrUtil.isNotEmpty(nameOrCred),wrapper -> wrapper.like(IdenPerson::getName,nameOrCred)
|
|
|
+ .or().like(IdenPerson::getCredentialsCode,nameOrCred));
|
|
|
+ Integer personCount = this.idenPersonService.count(queryWrapper);
|
|
|
+
|
|
|
+ QueryWrapper<IdenPerson> queryWrapper1 = new QueryWrapper<>();
|
|
|
+ queryWrapper1.lambda().like(IdenPerson::getType,type)
|
|
|
+ .like(StrUtil.isNotEmpty(address), IdenPerson::getAddress,address)
|
|
|
+ .eq(StrUtil.isNotEmpty(gender),IdenPerson::getGender,gender)
|
|
|
+ .eq(StrUtil.isNotEmpty(populationType),IdenPerson::getPopulationType,populationType)
|
|
|
+ .eq(StrUtil.isNotEmpty(district),IdenPerson::getDistrict,district)
|
|
|
+ .eq(StrUtil.isNotEmpty(subdistrict),IdenPerson::getSubdistrict,subdistrict)
|
|
|
+ .eq(communityId != null,IdenPerson::getCommunityId,communityId)
|
|
|
+ .and(StrUtil.isNotEmpty(nameOrCred),wrapper -> wrapper.like(IdenPerson::getName,nameOrCred)
|
|
|
+ .or().like(IdenPerson::getCredentialsCode,nameOrCred))
|
|
|
+ .isNotNull(IdenPerson::getImage);
|
|
|
+ Integer faceImageCount = this.idenPersonService.count(queryWrapper1);
|
|
|
+
|
|
|
+ QueryWrapper<IdenPerson> queryWrapper2 = new QueryWrapper<>();
|
|
|
+ queryWrapper2.select("distinct community_id")
|
|
|
+ .lambda().like(IdenPerson::getType,type)
|
|
|
+ .like(StrUtil.isNotEmpty(address), IdenPerson::getAddress,address)
|
|
|
+ .eq(StrUtil.isNotEmpty(gender),IdenPerson::getGender,gender)
|
|
|
+ .eq(StrUtil.isNotEmpty(populationType),IdenPerson::getPopulationType,populationType)
|
|
|
+ .eq(StrUtil.isNotEmpty(district),IdenPerson::getDistrict,district)
|
|
|
+ .eq(StrUtil.isNotEmpty(subdistrict),IdenPerson::getSubdistrict,subdistrict)
|
|
|
+ .eq(communityId != null,IdenPerson::getCommunityId,communityId)
|
|
|
+ .and(StrUtil.isNotEmpty(nameOrCred),wrapper -> wrapper.like(IdenPerson::getName,nameOrCred)
|
|
|
+ .or().like(IdenPerson::getCredentialsCode,nameOrCred));
|
|
|
+
|
|
|
+ Integer communityCount = this.idenPersonService.count(queryWrapper2);
|
|
|
+
|
|
|
+ PersonStaVO vo = new PersonStaVO();
|
|
|
+ vo.setCommunityCount(communityCount);
|
|
|
+ vo.setFaceImageCount(faceImageCount);
|
|
|
+ vo.setPersonCount(personCount);
|
|
|
+ return vo;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 查询人员列表
|
|
|
* @return
|