|
|
@ -15,10 +15,7 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.EpmetRequestHolder; |
|
|
|
import com.epmet.commons.tools.utils.PidUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.commons.tools.utils.*; |
|
|
|
import com.epmet.dao.OrganizationMessageDao; |
|
|
|
import com.epmet.dao.OrganizationMessagePublishRangeDao; |
|
|
|
import com.epmet.dao.UserMessageDao; |
|
|
@ -79,7 +76,7 @@ public class OrganizationMessageServiceImpl extends BaseServiceImpl<Organization |
|
|
|
PageHelper.startPage(pageNo, pageSize); |
|
|
|
List<OrganizationMessageResultDTO> list = baseDao.pageList(EpmetRequestHolder.getLoginUserCustomerId(),staffOrgIdPath, publishDitch, orgId, startDate, endDate,null); |
|
|
|
PageInfo<OrganizationMessageResultDTO> pageInfo = new PageInfo<>(list); |
|
|
|
return new PageData<>(list, pageInfo.getTotal()); |
|
|
|
return new PageData<>(list, pageInfo.getTotal(),pageSize); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -92,7 +89,13 @@ public class OrganizationMessageServiceImpl extends BaseServiceImpl<Organization |
|
|
|
public OrganizationMessageResultDTO getDetail(String messageId) { |
|
|
|
List<OrganizationMessageResultDTO> list = baseDao.pageList(EpmetRequestHolder.getLoginUserCustomerId(),null, null, null, null, null,messageId); |
|
|
|
if(CollectionUtils.isNotEmpty(list)){ |
|
|
|
return list.get(NumConstant.ZERO); |
|
|
|
OrganizationMessageResultDTO resultDTO=list.get(NumConstant.ZERO); |
|
|
|
LambdaQueryWrapper<OrganizationMessagePublishRangeEntity> queryWrapper=new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(OrganizationMessagePublishRangeEntity::getMessageId,messageId) |
|
|
|
.orderByAsc(OrganizationMessagePublishRangeEntity::getCreatedTime); |
|
|
|
List<OrganizationMessagePublishRangeEntity> rangeList=organizationMessagePublishRangeDao.selectList(queryWrapper); |
|
|
|
resultDTO.setRangeList(ConvertUtils.sourceToTarget(rangeList,OrganizationMessagePublishRangeDTO.class)); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
@ -138,13 +141,12 @@ public class OrganizationMessageServiceImpl extends BaseServiceImpl<Organization |
|
|
|
organizationMessagePublishRangeDao.insert(rangeEntity); |
|
|
|
} |
|
|
|
String messageId = messageEntity.getId(); |
|
|
|
// 发送消息 发布范围下有哪些网格,网格下所有的注册居民,每人发送一条消息
|
|
|
|
sendUserMsg(messageId,formDTO.getContent(),formDTO.getPublishStaffId(),formDTO.getRangeList(),messageEntity.getCustomerId()); |
|
|
|
return messageId; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Async |
|
|
|
@Override |
|
|
|
public void sendUserMsg(String messageId, String content, String publishStaffId,List<OrganizationMessagePublishRangeDTO> rangeList, String customerId) { |
|
|
|
String result = "success"; |
|
|
|
int totalMsg = NumConstant.ZERO; |
|
|
|