Browse Source

1、修复已知bug;2、解偶党建e家小程序;

master
luyan 1 year ago
parent
commit
c181fd0c90
  1. 2
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java
  2. 2
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java
  3. 2
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java
  4. 2
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java
  5. 17
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java
  6. 1
      esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/user/dto/UserDTO.java
  7. 2
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/user/controller/EpdcAppUserController.java
  8. 366
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/user/entity/UserDjylEntity.java
  9. 2
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/user/service/UserDjylService.java
  10. 65
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/user/service/impl/UserDjylServiceImpl.java
  11. 17
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDjlyDao.xml

2
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiAppUserController.java

@ -158,7 +158,7 @@ public class ApiAppUserController {
*/
@PostMapping("user/npm/update")
public Result<String> npmUserUpdate(@RequestBody EpdcUserNpmRegisterFormDTO formDto) {
public Result npmUserUpdate(@RequestBody EpdcUserNpmRegisterFormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
return appUserService.npmUserUpdate(formDto);
}

2
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/UserFeignClient.java

@ -558,7 +558,7 @@ public interface UserFeignClient {
Result nmpUserRegister(UserDTO userDTO);
@PostMapping("app-user/epdc-app/user/npmUpdate")
Result<String> npmUserUpdate(UserDTO userDTO);
Result npmUserUpdate(UserDTO userDTO);
@PostMapping("app-user/epdc-app/user/updatePassword")
Result updatePassword(UserDTO userDTO);

2
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/UserFeignClientFallback.java

@ -309,7 +309,7 @@ public class UserFeignClientFallback implements UserFeignClient {
}
@Override
public Result<String> npmUserUpdate(UserDTO userDTO) {
public Result npmUserUpdate(UserDTO userDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_USER_SERVER, "npmUserUpdate", userDTO);
}

2
esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/AppUserService.java

@ -394,7 +394,7 @@ public interface AppUserService {
*/
Result<EpdcAppRegisterCallbackDTO> npmUserRegister(EpdcUserNpmRegisterFormDTO formDto);
Result<String> npmUserUpdate(EpdcUserNpmRegisterFormDTO formDto);
Result npmUserUpdate(EpdcUserNpmRegisterFormDTO formDto);
Result getByIdCardAndName(ReportPartyDTO dto);

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

@ -716,20 +716,9 @@ public class AppUserServiceImpl implements AppUserService {
@Override
public Result<EpdcUserInfoResultDTO> getNamInfoById(TokenDto userDetail) {
PointLogFormDTO pointLogFormDTO = new PointLogFormDTO();
pointLogFormDTO.setType(BehaviorEnum.POINTS_SIGN_RULES.getValue());
pointLogFormDTO.setUserId(userDetail.getUserId());
String isSignIn = pointFeignClient.getIsSignIn(pointLogFormDTO).getData();
Result<EpdcUserInfoResultDTO> infoById = userFeignClient.getNamInfoById(userDetail.getUserId());
EpdcUserInfoResultDTO data = infoById.getData();
data.setIsSignUp(isSignIn);
//查询有无关联企业
Result<EnterpriseInfoResultDTO> enterInfo = customFeignClient.getEnterpriseInfoByUserId(data.getId());
if (enterInfo.success() && null != enterInfo.getData()) {
data.setHaveEnterprise(true);
} else {
data.setHaveEnterprise(false);
}
data.setIsSignUp("0");
return new Result<EpdcUserInfoResultDTO>().ok(data);
}
@ -1779,12 +1768,12 @@ public class AppUserServiceImpl implements AppUserService {
}
@Override
public Result<String> npmUserUpdate(EpdcUserNpmRegisterFormDTO formDto) {
public Result npmUserUpdate(EpdcUserNpmRegisterFormDTO formDto) {
UserDTO user = ConvertUtils.sourceToTarget(formDto, UserDTO.class);
user.setAllDeptIds(StringUtils.join(formDto.getAllDeptIds(), ","));
return userFeignClient.npmUserUpdate(user);
}
/**
* 分离原油代码的注册封装逻辑避免代码污染
*

1
esua-epdc/epdc-module/epdc-user/epdc-user-client/src/main/java/com/elink/esua/epdc/user/dto/UserDTO.java

@ -365,7 +365,6 @@ public class UserDTO implements Serializable {
private String driverFlag;
/**
* 工作单位
*/

2
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/user/controller/EpdcAppUserController.java

@ -131,7 +131,7 @@ public class EpdcAppUserController {
* @param userDto
*/
@PostMapping("npmUpdate")
public Result<String> npmUserUpdate(@RequestBody UserDTO userDto) {
public Result npmUserUpdate(@RequestBody UserDTO userDto) {
return djylService.npmUserUpdate(userDto);
}

366
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/user/entity/UserDjylEntity.java

@ -3,18 +3,18 @@ package com.elink.esua.epdc.user.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.elink.esua.epdc.commons.mybatis.entity.DeptScope;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;
import java.util.Date;
/**
* 党建引领用户信息表
*
* @author yan Lu
* @description 描述
* @create 2023/8/8 10:07
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("epdc_user_djyl")
public class UserDjylEntity extends DeptScope {
@ -281,4 +281,366 @@ public class UserDjylEntity extends DeptScope {
* 包联单位
*/
private String couplingCommunity;
public void setNickname(String nickname) {
if (StringUtils.isNotEmpty(nickname)) {
this.nickname = mobile;
} else {
this.nickname = null;
}
}
public void setMobile(String mobile) {
if (StringUtils.isNotEmpty(mobile)) {
this.mobile = mobile;
} else {
this.mobile = null;
}
}
public void setPassword(String password) {
if (StringUtils.isNotEmpty(password)) {
this.password = password;
} else {
this.password = null;
}
}
public void setFaceImg(String faceImg) {
if (StringUtils.isNotEmpty(faceImg)) {
this.faceImg = faceImg;
} else {
this.faceImg = null;
}
}
public void setSex(String sex) {
if (StringUtils.isNotEmpty(sex)) {
this.sex = sex;
} else {
this.sex = null;
}
}
public void setEmail(String email) {
if (StringUtils.isNotEmpty(email)) {
this.email = email;
} else {
this.email = null;
}
}
public void setTelephone(String telephone) {
if (StringUtils.isNotEmpty(telephone)) {
this.telephone = telephone;
} else {
this.telephone = null;
}
}
public void setZipCode(String zipCode) {
if (StringUtils.isNotEmpty(zipCode)) {
this.zipCode = zipCode;
} else {
this.zipCode = null;
}
}
public void setProfession(String profession) {
if (StringUtils.isNotEmpty(profession)) {
this.profession = profession;
} else {
this.profession = null;
}
}
public void setHobbies(String hobbies) {
if (StringUtils.isNotEmpty(hobbies)) {
this.hobbies = hobbies;
} else {
this.hobbies = null;
}
}
public void setUserSign(String userSign) {
if (StringUtils.isNotEmpty(userSign)) {
this.userSign = userSign;
} else {
this.userSign = null;
}
}
public void setInvitationCode(String invitationCode) {
if (StringUtils.isNotEmpty(invitationCode)) {
this.invitationCode = invitationCode;
} else {
this.invitationCode = null;
}
}
public void setLastLoginIp(String lastLoginIp) {
if (StringUtils.isNotEmpty(lastLoginIp)) {
this.lastLoginIp = lastLoginIp;
} else {
this.lastLoginIp = null;
}
}
public void setLastLongitude(String lastLongitude) {
if (StringUtils.isNotEmpty(lastLongitude)) {
this.lastLongitude = lastLongitude;
} else {
this.lastLongitude = null;
}
}
public void setLastLatitude(String lastLatitude) {
if (StringUtils.isNotEmpty(lastLatitude)) {
this.lastLatitude = lastLatitude;
} else {
this.lastLatitude = null;
}
}
public void setRealName(String realName) {
if (StringUtils.isNotEmpty(realName)) {
this.realName = realName;
} else {
this.realName = null;
}
}
public void setIdentityNo(String identityNo) {
if (StringUtils.isNotEmpty(identityNo)) {
this.identityNo = identityNo;
} else {
this.identityNo = null;
}
}
public void setRoad(String road) {
if (StringUtils.isNotEmpty(road)) {
this.road = road;
} else {
this.road = null;
}
}
public void setVillageName(String villageName) {
if (StringUtils.isNotEmpty(villageName)) {
this.villageName = villageName;
} else {
this.villageName = null;
}
}
public void setDwellingPlace(String dwellingPlace) {
if (StringUtils.isNotEmpty(dwellingPlace)) {
this.dwellingPlace = dwellingPlace;
} else {
this.dwellingPlace = null;
}
}
public void setAddress(String address) {
if (StringUtils.isNotEmpty(address)) {
this.address = address;
} else {
this.address = null;
}
}
public void setWxOpenId(String wxOpenId) {
if (StringUtils.isNotEmpty(wxOpenId)) {
this.wxOpenId = wxOpenId;
} else {
this.wxOpenId = null;
}
}
public void setWxUnionId(String wxUnionId) {
if (StringUtils.isNotEmpty(wxUnionId)) {
this.wxUnionId = wxUnionId;
} else {
this.wxUnionId = null;
}
}
public void setPartyFlag(String partyFlag) {
if (StringUtils.isNotEmpty(partyFlag)) {
this.partyFlag = partyFlag;
} else {
this.partyFlag = null;
}
}
public void setRegisterWay(String registerWay) {
if (StringUtils.isNotEmpty(registerWay)) {
this.registerWay = registerWay;
} else {
this.registerWay = null;
}
}
public void setRegisterSource(String registerSource) {
if (StringUtils.isNotEmpty(registerSource)) {
this.registerSource = registerSource;
} else {
this.registerSource = null;
}
}
public void setMobileProvince(String mobileProvince) {
if (StringUtils.isNotEmpty(mobileProvince)) {
this.mobileProvince = mobileProvince;
} else {
this.mobileProvince = null;
}
}
public void setMobileCity(String mobileCity) {
if (StringUtils.isNotEmpty(mobileCity)) {
this.mobileCity = mobileCity;
} else {
this.mobileCity = null;
}
}
public void setMobileCarrier(String mobileCarrier) {
if (StringUtils.isNotEmpty(mobileCarrier)) {
this.mobileCarrier = mobileCarrier;
} else {
this.mobileCarrier = null;
}
}
public void setInviteUserId(String inviteUserId) {
if (StringUtils.isNotEmpty(inviteUserId)) {
this.inviteUserId = inviteUserId;
} else {
this.inviteUserId = null;
}
}
public void setState(String state) {
if (StringUtils.isNotEmpty(state)) {
this.state = state;
} else {
this.state = null;
}
}
public void setLastName(String lastName) {
if (StringUtils.isNotEmpty(lastName)) {
this.lastName = lastName;
} else {
this.lastName = null;
}
}
public void setFirstName(String firstName) {
if (StringUtils.isNotEmpty(firstName)) {
this.firstName = firstName;
} else {
this.firstName = null;
}
}
public void setRemark(String remark) {
if (StringUtils.isNotEmpty(remark)) {
this.remark = remark;
} else {
this.remark = null;
}
}
public void setParentDeptIds(String parentDeptIds) {
if (StringUtils.isNotEmpty(parentDeptIds)) {
this.parentDeptIds = parentDeptIds;
} else {
this.parentDeptIds = null;
}
}
public void setParentDeptNames(String parentDeptNames) {
if (StringUtils.isNotEmpty(parentDeptNames)) {
this.parentDeptNames = parentDeptNames;
} else {
this.parentDeptNames = null;
}
}
public void setAllDeptIds(String allDeptIds) {
if (StringUtils.isNotEmpty(allDeptIds)) {
this.allDeptIds = allDeptIds;
} else {
this.allDeptIds = null;
}
}
public void setAllDeptNames(String allDeptNames) {
if (StringUtils.isNotEmpty(allDeptNames)) {
this.allDeptNames = allDeptNames;
} else {
this.allDeptNames = null;
}
}
public void setRentFlag(String rentFlag) {
if (StringUtils.isNotEmpty(rentFlag)) {
this.rentFlag = rentFlag;
} else {
this.rentFlag = null;
}
}
public void setDriverFlag(String driverFlag) {
if (StringUtils.isNotEmpty(driverFlag)) {
this.driverFlag = driverFlag;
} else {
this.driverFlag = null;
}
}
public void setWorkUnit(String workUnit) {
if (StringUtils.isNotEmpty(workUnit)) {
this.workUnit = workUnit;
} else {
this.workUnit = null;
}
}
public void setWorkType(String workType) {
if (StringUtils.isNotEmpty(workType)) {
this.workType = workType;
} else {
this.workType = null;
}
}
public void setWorkIndustry(String workIndustry) {
if (StringUtils.isNotEmpty(workIndustry)) {
this.workIndustry = workIndustry;
} else {
this.workIndustry = null;
}
}
public void setWorkIndustryText(String workIndustryText) {
if (StringUtils.isNotEmpty(workIndustryText)) {
this.workIndustryText = workIndustryText;
} else {
this.workIndustryText = null;
}
}
public void setCouplingCommunity(String couplingCommunity) {
if (StringUtils.isNotEmpty(couplingCommunity)) {
this.couplingCommunity = couplingCommunity;
} else {
this.couplingCommunity = null;
}
}
}

2
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/user/service/UserDjylService.java

@ -51,7 +51,7 @@ public interface UserDjylService extends BaseService<UserDjylEntity> {
* @param userDto
* @return
*/
Result<String> npmUserUpdate(UserDTO userDto);
Result npmUserUpdate(UserDTO userDto);
Result<CachingUserInfoDTO> queryNpmCachingUserInfo(EpdcAppQueryUserInfoFormDTO formDTO);

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

@ -19,9 +19,7 @@ package com.elink.esua.epdc.user.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.elink.esua.epdc.commons.dynamic.datasource.annotation.DataSource;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
@ -87,52 +85,49 @@ public class UserDjylServiceImpl extends BaseServiceImpl<UserDjylDao, UserDjylEn
@Override
@Transactional(rollbackFor = Exception.class)
public Result npmUserRegister(UserDTO userDto) {
//修改数据库结构
if (null != userDto.getGridId()) {
Result<ParentAndAllDeptDTO> parentAndAllDeptDTOResult = adminFeignClient.getParentAndAllDept(userDto.getGridId().toString());
if (!parentAndAllDeptDTOResult.success()) {
return new Result<EpdcUserRegisterInfoResultDTO>().error(parentAndAllDeptDTOResult.getMsg());
UserDjylEntity entity = ConvertUtils.sourceToTarget(userDto, UserDjylEntity.class);
if (StringUtils.isNotEmpty(userDto.getAllDeptIds())) {
if (userDto.getShibei() == 1) {
String temp[] = StringUtils.split(userDto.getAllDeptIds(), ",");
String gridId = temp[temp.length - 1];
Result<ParentAndAllDeptDTO> DeptDTOResult = adminFeignClient.getParentAndAllDept(gridId);
if (!DeptDTOResult.success()) {
return new Result<String>().error(DeptDTOResult.getMsg());
}
ParentAndAllDeptDTO deptDTO = DeptDTOResult.getData();
entity.setAllDeptIds(deptDTO.getAllDeptIds());
entity.setAllDeptNames(deptDTO.getAllDeptNames());
entity.setParentDeptIds(deptDTO.getParentDeptIds());
entity.setParentDeptNames(deptDTO.getParentDeptNames());
entity.setDeptId(deptDTO.getGridId());
}
UserGridRelationDTO dto = new UserGridRelationDTO();
dto.setUserId(userDto.getUserId());
dto.setAllDeptNames(parentAndAllDeptDTOResult.getData().getAllDeptNames());
dto.setAllDeptIds(parentAndAllDeptDTOResult.getData().getAllDeptIds());
dto.setParentDeptNames(parentAndAllDeptDTOResult.getData().getParentDeptNames());
dto.setParentDeptIds(parentAndAllDeptDTOResult.getData().getParentDeptIds());
dto.setGridId(parentAndAllDeptDTOResult.getData().getGridId());
dto.setGrid(parentAndAllDeptDTOResult.getData().getGrid());
dto.setSwitchedTime(new Date());
userGridRelationService.save(dto);
userDto.setAllDeptIds(parentAndAllDeptDTOResult.getData().getAllDeptIds());
}
UserDjylEntity entity = ConvertUtils.sourceToTarget(userDto, UserDjylEntity.class);
insert(entity);
return new Result().ok(userDto);
}
@Override
public Result<String> npmUserUpdate(UserDTO userDto) {
public Result npmUserUpdate(UserDTO userDto) {
UserDjylEntity entity = ConvertUtils.sourceToTarget(userDto, UserDjylEntity.class);
entity.setId(userDto.getUserId());
if (StringUtils.isNotEmpty(userDto.getAllDeptIds())) {
String gridId = userDto.getAllDeptIds().substring(userDto.getAllDeptIds().length() - 1);
Result<ParentAndAllDeptDTO> parentAndAllDeptDTOResult = adminFeignClient.getParentAndAllDept(gridId);
if (!parentAndAllDeptDTOResult.success()) {
return new Result<String>().error(parentAndAllDeptDTOResult.getMsg());
if (userDto.getShibei() == 1) {
String temp[] = StringUtils.split(userDto.getAllDeptIds(), ",");
String gridId = temp[temp.length - 1];
Result<ParentAndAllDeptDTO> DeptDTOResult = adminFeignClient.getParentAndAllDept(gridId);
if (!DeptDTOResult.success()) {
return new Result<String>().error(DeptDTOResult.getMsg());
}
ParentAndAllDeptDTO deptDTO = DeptDTOResult.getData();
entity.setAllDeptIds(deptDTO.getAllDeptIds());
entity.setAllDeptNames(deptDTO.getAllDeptNames());
entity.setParentDeptIds(deptDTO.getParentDeptIds());
entity.setParentDeptNames(deptDTO.getParentDeptNames());
entity.setDeptId(deptDTO.getGridId());
}
UserGridRelationEntity gridRelation = new UserGridRelationEntity();
gridRelation.setAllDeptIds(parentAndAllDeptDTOResult.getData().getAllDeptIds());
gridRelation.setAllDeptNames(parentAndAllDeptDTOResult.getData().getAllDeptNames());
gridRelation.setParentDeptIds(parentAndAllDeptDTOResult.getData().getParentDeptIds());
gridRelation.setParentDeptNames(parentAndAllDeptDTOResult.getData().getParentDeptNames());
gridRelation.setGridId(parentAndAllDeptDTOResult.getData().getGridId());
gridRelation.setGrid(parentAndAllDeptDTOResult.getData().getGrid());
LambdaUpdateWrapper<UserGridRelationEntity> updateWrapper = Wrappers.lambdaUpdate();
updateWrapper.eq(UserGridRelationEntity::getUserId, entity.getId());
userGridRelationService.update(gridRelation, updateWrapper);
}
baseDao.updateById(entity);
return new Result<String>().ok("修改成功");
return new Result().ok("修改成功");
}
@Override

17
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/UserDjlyDao.xml

@ -109,7 +109,7 @@
eu.FACE_IMG AS faceImg,
eu.MOBILE AS mobile,
eu.IDENTITY_NO AS identityNo,
eugr.ALL_DEPT_NAMES AS deptName,
eu.ALL_DEPT_NAMES AS deptName,
eu.REAL_NAME AS realName,
eu.ROAD AS road,
eu.VILLAGE_NAME AS villageName,
@ -119,18 +119,15 @@
eu.WORK_UNIT AS workUnit,
eu.WORK_TYPE AS workType,
eu.WORK_INDUSTRY AS workIndustry,
eugr.GRID_ID AS gridId,
eugr.GRID AS gridName,
eugr.PARENT_DEPT_IDS AS parentDeptIds,
eugr.PARENT_DEPT_NAMES AS parentDeptNames,
eugr.ALL_DEPT_IDS AS allDeptIds,
eugr.ALL_DEPT_NAMES AS allDeptNames,
eu.DEPT_ID AS gridId,
eu.PARENT_DEPT_IDS AS parentDeptIds,
eu.PARENT_DEPT_NAMES AS parentDeptNames,
eu.ALL_DEPT_IDS AS allDeptIds,
eu.ALL_DEPT_NAMES AS allDeptNames,
eu.COUPLING_COMMUNITY,
eu.HOBBIES
FROM epdc_user_djyl eu
Left Join (select * from epdc_user_grid_relation
where USER_ID = #{id} order by UPDATED_TIME desc limit 0,1) eugr on(eu.id=eugr.USER_ID)
WHERE eu.ID = #{id}
WHERE eu.ID = #{id} And eu.DEL_FLAG = 0
</select>
<select id="selectByMobileAndIdentityNo" resultType="com.elink.esua.epdc.user.dto.UserDTO">

Loading…
Cancel
Save