Browse Source

修改党员报道,web端不能按组织过滤数据的问题,修改其他已知问题;

master
luyan 1 year ago
parent
commit
75dcba8670
  1. 40
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  2. 108
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/service/impl/ReportPartyServiceImpl.java
  3. 5
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/user/service/impl/UserDjylServiceImpl.java

40
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java

@ -1694,20 +1694,23 @@ public class AppUserServiceImpl implements AppUserService {
public Result<EpdcPartyMemberRegistDTO> updateReportparty(ReportPartyDTO dto) {
EpdcPartyMemberRegistDTO partyMemberRegistDTO = new EpdcPartyMemberRegistDTO();
CityCenterFromDTO formDTO = new CityCenterFromDTO();
if (dto.getDeptId() != null) {
formDTO.setDeptId(Long.parseLong(dto.getAllDeptIds()[dto.getAllDeptIds().length - 2]));
SysDeptDTO liveDept = adminFeignClient.getDeptInfo(formDTO).getData();
partyMemberRegistDTO.setLiveAddress(liveDept.getAddress());
partyMemberRegistDTO.setLiveCommunity(liveDept.getName());
partyMemberRegistDTO.setLiveMobile(liveDept.getMobile());
partyMemberRegistDTO.setLiveSecretaryName(liveDept.getSecretaryName());
partyMemberRegistDTO.setLiveTelephone(liveDept.getTelephone());
partyMemberRegistDTO.setLiveStreetName(liveDept.getStreetName());
partyMemberRegistDTO.setLiveLongitude(liveDept.getLongitude());
partyMemberRegistDTO.setLiveLatitude(liveDept.getLatitude());
if(dto.getShiBei() == 1){
if (null != dto.getAllDeptIds() && dto.getAllDeptIds().length > 3) {
formDTO.setDeptId(Long.parseLong(dto.getAllDeptIds()[dto.getAllDeptIds().length - 2]));
SysDeptDTO liveDept = adminFeignClient.getDeptInfo(formDTO).getData();
partyMemberRegistDTO.setLiveAddress(liveDept.getAddress());
partyMemberRegistDTO.setLiveCommunity(liveDept.getName());
partyMemberRegistDTO.setLiveMobile(liveDept.getMobile());
partyMemberRegistDTO.setLiveSecretaryName(liveDept.getSecretaryName());
partyMemberRegistDTO.setLiveTelephone(liveDept.getTelephone());
partyMemberRegistDTO.setLiveStreetName(liveDept.getStreetName());
partyMemberRegistDTO.setLiveLongitude(liveDept.getLongitude());
partyMemberRegistDTO.setLiveLatitude(liveDept.getLatitude());
}
}
if (null != dto.getCouplingCommunity()) {
if (null != dto.getCouplingCommunity() && dto.getCouplingCommunity().length > 3) {
formDTO.setDeptId(Long.parseLong(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]));
dto.setDeptId(formDTO.getDeptId());
SysDeptDTO couplingDept = adminFeignClient.getDeptInfo(formDTO).getData();
partyMemberRegistDTO.setCouplingAddress(couplingDept.getAddress());
partyMemberRegistDTO.setCouplingCommunity(couplingDept.getName());
@ -1803,16 +1806,15 @@ public class AppUserServiceImpl implements AppUserService {
//如果在市北,获取网格机构详情
if (formDto.getShibei() == 1) {
if (null != formDto.getAllDeptIds()) {
if (formDto.getAllDeptIds().length > 1) {
if (formDto.getAllDeptIds().length > 3) {
//默认获取社区第一网格
deptId = Long.parseLong(formDto.getAllDeptIds()[formDto.getAllDeptIds().length - 1]);
registDTO.setGridId(Long.parseLong(formDto.getAllDeptIds()[formDto.getAllDeptIds().length - 2]));
}
completeDept = adminFeignClient.getCompleteDept(Long.parseLong(formDto.getAllDeptIds()[formDto.getAllDeptIds().length - 1])).getData();
if (null == completeDept) {
throw new RenException("查询网格信息失败");
}
}
completeDept = adminFeignClient.getCompleteDept(deptId).getData();
if (null == completeDept) {
throw new RenException("查询网格信息失败");
}
registDTO.setGridId(deptId);
//暂时关闭,此时还没有登陆
// else {
// UserDetail user = SecurityUser.getUser();

108
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/service/impl/ReportPartyServiceImpl.java

@ -24,7 +24,6 @@ import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.security.user.UserDetail;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
@ -41,7 +40,6 @@ import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 党员报道
@ -70,16 +68,23 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo
page.getRecords().forEach(entity -> {
result.getList().forEach(dto -> {
if (entity.getId().equals(dto.getId())) {
String[] ids;
if (StringUtils.isNotEmpty(entity.getAllDeptIds())) {
dto.setAllDeptIds(entity.getAllDeptIds().split(","));
}
if (StringUtils.isNotEmpty(entity.getCouplingCommunity())) {
ids = entity.getCouplingCommunity().split(",");
ParentAndAllDeptDTO deptDTO;
if (entity.getShiBei() == 1) {
String[] ids = entity.getAllDeptIds().split(",");
String deptId = ids[ids.length - 1];
ParentAndAllDeptDTO deptDTO = adminFeignClient.getParentAndAllDept(deptId).getData();
dto.setCouplingCommunityName(deptDTO.getAllDeptNames());
deptDTO = adminFeignClient.getParentAndAllDept(deptId).getData();
dto.setParentDeptNames(deptDTO.getParentDeptNames());
}else {
String[] villageNames = entity.getVillageName().split("-");
dto.setParentDeptNames(villageNames[0]);
dto.setHomeName(villageNames[1]);
}
//包联社区
deptDTO = adminFeignClient.getParentAndAllDept(entity.getDeptId()).getData();
dto.setCouplingCommunityName(deptDTO.getAllDeptNames());
if (StringUtils.isNotEmpty(entity.getIdCard())) {
String idCard = entity.getIdCard();
String temp = idCard.substring(0, 4) + tempKey + idCard.substring(idCard.length() - 3);
@ -104,11 +109,9 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo
String idCard = (String) params.get(FieldConstant.ID_CARD_HUMP);
String mobile = (String) params.get(FieldConstant.MOBILE_HUMP);
String workUnit = (String) params.get("workUnit");
String deptId = (String) params.get("deptId");
if (StringUtils.isEmpty(deptId)) {
UserDetail user = SecurityUser.getUser();
deptId = String.valueOf(user.getDeptId());
wrapper.eq(StringUtils.isNotBlank(deptId), "DEPT_ID", deptId);
Long deptId = SecurityUser.getUser().getDeptId();
if (null != deptId) {
wrapper.eq("DEPT_ID", deptId);
}
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
wrapper.like(StringUtils.isNotBlank(name), FieldConstant.NAME_HUMP, name);
@ -140,14 +143,15 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ReportPartyDTO dto) {
if (dto.getAllDeptIds().length == 0) {
setDeptId(dto);
}
ReportPartyEntity entity = ConvertUtils.sourceToTarget(dto, ReportPartyEntity.class);
Result<ParentAndAllDeptDTO> parentResult = null;
if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 1) {
entity.setDeptId(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]);
parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]);
if (null != dto.getCouplingCommunity() && dto.getCouplingCommunity().length > 3) {
entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]);
entity.setCouplingCommunity(String.join(",", dto.getCouplingCommunity()));
}
if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 3) {
entity.setDeptId(dto.getAllDeptIds()[dto.getAllDeptIds().length - 2]);
parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 2]);
} else {
parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(dto.getDeptId()));
}
@ -160,7 +164,6 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo
entity.setParentDeptIds(deptDTO.getParentDeptIds());
entity.setParentDeptNames(deptDTO.getParentDeptNames());
}
entity.setCouplingCommunity(String.join(",", dto.getCouplingCommunity()));
entity.setStatus(0);
insert(entity);
}
@ -168,32 +171,32 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ReportPartyDTO dto) {
if (dto.getAllDeptIds().length == 0) {
setDeptId(dto);
}
ReportPartyEntity entity = ConvertUtils.sourceToTarget(dto, ReportPartyEntity.class);
Result<ParentAndAllDeptDTO> parentResult = null;
if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 1) {
entity.setDeptId(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]);
parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]);
} else {
parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(dto.getDeptId()));
}
if (!parentResult.success() || parentResult.getData() == null) {
throw new RenException("获取部门信息失败");
Result<ParentAndAllDeptDTO> parentResult;
if (dto.getShiBei() == 1) {//设置居住社区
if (null != dto.getAllDeptIds() && dto.getAllDeptIds().length > 3) {
entity.setAllDeptIds(dto.getAllDeptIds().toString());
parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]);
if (!parentResult.success() || parentResult.getData() == null) {
throw new RenException("获取部门信息失败");
}
ParentAndAllDeptDTO deptDTO = parentResult.getData();
entity.setAllDeptIds(deptDTO.getAllDeptIds());
entity.setAllDeptNames(deptDTO.getAllDeptNames());
entity.setParentDeptIds(deptDTO.getParentDeptIds());
entity.setParentDeptNames(deptDTO.getParentDeptNames());
}
} else {
ParentAndAllDeptDTO deptDTO = parentResult.getData();
entity.setAllDeptIds(deptDTO.getAllDeptIds());
entity.setAllDeptNames(deptDTO.getAllDeptNames());
entity.setParentDeptIds(deptDTO.getParentDeptIds());
entity.setParentDeptNames(deptDTO.getParentDeptNames());
}
if (Objects.equals(0, entity.getStatus())) {
entity.setExamineMsg(null);
if (StringUtils.isNotEmpty(dto.getVillageName())) {
dto.setParentDeptNames(dto.getVillageName());
}
}
if (null != dto.getCouplingCommunity()) {
if (null != dto.getCouplingCommunity() && dto.getCouplingCommunity().length > 3) {
entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]);
entity.setCouplingCommunity(String.join(",", dto.getCouplingCommunity()));
}
entity.setStatus(0);
entity.setExamineMsg(null);
updateById(entity);
}
@ -230,15 +233,22 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo
ReportPartyEntity result = baseDao.getByIdCardAndName(dto.getIdCard(), dto.getName());
if (null != result && !dto.getCouplingCommunity().equals(result.getCouplingCommunity())) {
result.setCouplingCommunity(String.join(",", dto.getCouplingCommunity()));
if (result.getCouplingCommunity().length() > 3) {
result.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]);
} else {
result.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 1]);
}
result.setStatus(0);
baseDao.updateById(result);
} else {
if (dto.getAllDeptIds().length == 0) {
setDeptId(dto);
}
Result<ParentAndAllDeptDTO> parentResult;
if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 1) {
if (null != dto.getCouplingCommunity() && dto.getCouplingCommunity().length > 3) {
entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]);
entity.setCouplingCommunity(String.join(",", dto.getCouplingCommunity()));
parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(entity.getDeptId()));
} else if (null != dto.getAllDeptIds() && dto.getAllDeptIds().length > 2) {
entity.setDeptId(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]);
parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]);
parentResult = adminFeignClient.getParentAndAllDept(entity.getDeptId());
} else {
parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(dto.getDeptId()));
}
@ -251,16 +261,8 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo
entity.setParentDeptIds(deptDTO.getParentDeptIds());
entity.setParentDeptNames(deptDTO.getParentDeptNames());
}
entity.setCouplingCommunity(String.join(",", dto.getCouplingCommunity()));
entity.setStatus(0);
baseDao.insert(entity);
}
}
private void setDeptId(ReportPartyDTO dto) {
UserDetail user = SecurityUser.getUser();
String deptId = String.valueOf(user.getDeptId());
dto.setDeptId(user.getDeptId());
dto.setAllDeptIds(new String[]{deptId});
}
}

5
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/user/service/impl/UserDjylServiceImpl.java

@ -86,6 +86,9 @@ public class UserDjylServiceImpl extends BaseServiceImpl<UserDjylDao, UserDjylEn
@Transactional(rollbackFor = Exception.class)
public Result npmUserRegister(UserDTO userDto) {
UserDjylEntity entity = ConvertUtils.sourceToTarget(userDto, UserDjylEntity.class);
if(StringUtils.isNotEmpty(userDto.getNickname())){
entity.setNickname(userDto.getNickname());
}
if (StringUtils.isEmpty(userDto.getAllDeptIds())) {
if (userDto.getShibei() == 1) {
String gridId = userDto.getDeptId().toString();
@ -122,7 +125,7 @@ public class UserDjylServiceImpl extends BaseServiceImpl<UserDjylDao, UserDjylEn
entity.setAllDeptNames(deptDTO.getAllDeptNames());
entity.setParentDeptIds(deptDTO.getParentDeptIds());
entity.setParentDeptNames(deptDTO.getParentDeptNames());
entity.setDeptId(deptDTO.getGridId());
entity.setDeptId(Long.valueOf(temp[temp.length - 2]));
}
}
baseDao.updateById(entity);

Loading…
Cancel
Save