Browse Source

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

master
luyan 1 year ago
parent
commit
75dcba8670
  1. 16
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  2. 92
      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

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

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

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

Loading…
Cancel
Save