|
@ -21,10 +21,7 @@ import com.alibaba.fastjson.JSON; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.AppClientConstant; |
|
|
import com.epmet.commons.tools.constant.*; |
|
|
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
import com.epmet.commons.tools.page.PageData; |
|
@ -384,7 +381,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
applyCreateGroupFormDTO.getGridId()); |
|
|
applyCreateGroupFormDTO.getGridId()); |
|
|
if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { |
|
|
if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { |
|
|
logger.info(String.format("创建小组异常:%s",EpmetErrorCode.CANNOT_CREATE_GROUP.getMsg())); |
|
|
logger.info(String.format("创建小组异常:%s",EpmetErrorCode.CANNOT_CREATE_GROUP.getMsg())); |
|
|
throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); |
|
|
if (StrConstant.SPECIAL_CUSTOMER.equals(applyCreateGroupFormDTO.getCustomerId())) { |
|
|
|
|
|
throw new RenException(8002, "只有组长才能创建小组"); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
String roleName = ""; |
|
|
String roleName = ""; |
|
|
if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ |
|
|
if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ |
|
@ -495,7 +496,12 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
Result<UserResiInfoResultDTO> result = epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); |
|
|
Result<UserResiInfoResultDTO> result = epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); |
|
|
if (!result.success() || null == result.getData() || StringUtils.isBlank(result.getData().getRegMobile())) { |
|
|
if (!result.success() || null == result.getData() || StringUtils.isBlank(result.getData().getRegMobile())) { |
|
|
logger.info(String.format("加入小组界面初始化查询成功,当前用户非注册居民,epmet-user-server接口入参%s,返回%s",JSON.toJSONString(resiUserInfoFormDTO),JSON.toJSONString(result))); |
|
|
logger.info(String.format("加入小组界面初始化查询成功,当前用户非注册居民,epmet-user-server接口入参%s,返回%s",JSON.toJSONString(resiUserInfoFormDTO),JSON.toJSONString(result))); |
|
|
throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); |
|
|
if (StrConstant.SPECIAL_CUSTOMER.equals(initApplyGroupFormDTO.getCustomerId())) { |
|
|
|
|
|
throw new RenException(8001, "只有注册学员才可以加入小组"); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -526,7 +532,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
initApplyCreatedGroupFormDTO.getGridId()); |
|
|
initApplyCreatedGroupFormDTO.getGridId()); |
|
|
if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { |
|
|
if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { |
|
|
logger.info(String.format("创建小组界面初始化查询成功,用户角色列表%s",JSON.toJSONString(userRoleDTO))); |
|
|
logger.info(String.format("创建小组界面初始化查询成功,用户角色列表%s",JSON.toJSONString(userRoleDTO))); |
|
|
throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); |
|
|
if (StrConstant.SPECIAL_CUSTOMER.equals(initApplyCreatedGroupFormDTO.getCustomerId())) { |
|
|
|
|
|
throw new RenException(8002, "只有组长才能创建小组"); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -849,7 +859,17 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
throw new RenException(ModuleConstant.PAGE_INDEX_NOT_NULL); |
|
|
throw new RenException(ModuleConstant.PAGE_INDEX_NOT_NULL); |
|
|
} |
|
|
} |
|
|
params.setPageNo((params.getPageNo() - NumConstant.ONE) * params.getPageSize()); |
|
|
params.setPageNo((params.getPageNo() - NumConstant.ONE) * params.getPageSize()); |
|
|
return new Result<List<ApplyingGroupResultDTO>>().ok(baseDao.getApplyingGroupsByCustIdAndGridId(params)); |
|
|
List<ApplyingGroupResultDTO> list = baseDao.getApplyingGroupsByCustIdAndGridId(params); |
|
|
|
|
|
if (StrConstant.SPECIAL_CUSTOMER.equals(params.getCustomerId())) { |
|
|
|
|
|
list.forEach(item -> { |
|
|
|
|
|
if (item.getMessageText().contains("热心居民")) { |
|
|
|
|
|
item.setMessageText(item.getMessageText().replace("热心居民", "组长")); |
|
|
|
|
|
} else if (item.getMessageText().contains("居民")) { |
|
|
|
|
|
item.setMessageText(item.getMessageText().replace("居民", "学员")); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
return new Result<List<ApplyingGroupResultDTO>>().ok(list); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -1234,7 +1254,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (!isWarmhearted && !isPartymember) { |
|
|
if (!isWarmhearted && !isPartymember) { |
|
|
throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode(), "只有党员和热心居民才能创建和编辑小组"); |
|
|
if (StrConstant.SPECIAL_CUSTOMER.equals(customerId)) { |
|
|
|
|
|
throw new RenException(8002, "只有组长才能创建小组"); |
|
|
|
|
|
} else { |
|
|
|
|
|
throw new RenException(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
String roleName = ""; |
|
|
String roleName = ""; |
|
|
if (isPartymember) { |
|
|
if (isPartymember) { |
|
|