Browse Source

hebing

dev_shibei_match
yinzuomei 4 years ago
parent
commit
e9ba326ede
  1. 29
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

29
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

@ -31,9 +31,11 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.EventConstant;
import com.epmet.dao.ResiEventAttachmentDao;
import com.epmet.dao.ResiEventDao;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.ResiEventAttachmentEntity;
import com.epmet.entity.ResiEventEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
@ -69,7 +71,8 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private ResiEventAttachmentDao resiEventAttachmentDao;
/**
* @Description 群众直报待处理处理中已办结列表
@ -138,7 +141,6 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
resiEventEntity.setAgencyId(gridInfoRes.getData().getParentAgencyId());
resiEventEntity.setPids(gridInfoRes.getData().getPids());
resiEventEntity.setReportUserId(formDTO.getUserId());
//todo
Result<Boolean> partyRes=epmetUserOpenFeignClient.selectIsPartyMemberByUserId(formDTO.getUserId());
if(!partyRes.success()||null==partyRes.getData()){
throw new RenException("查询用户是否是党员异常");
@ -153,9 +155,13 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
resiEventEntity.setLatestOperatedTime(new Date());
resiEventEntity.setCreatedTime(resiEventEntity.getLatestOperatedTime());
resiEventEntity.setUpdatedTime(resiEventEntity.getLatestOperatedTime());
baseDao.insert(resiEventEntity);
//4、插入主表resi_event
baseDao.insert(resiEventEntity);
//5、插入附件表
List<ResiEventAttachmentEntity> attachmentEntityList=getAttList(formDTO.getCustomerId(),resiEventEntity.getId(),formDTO.getAttachmentList());
attachmentEntityList.forEach(attachmentEntity->{
resiEventAttachmentDao.insert(attachmentEntity);
});
//6、插入组织表
//7、插入艾特人表
//8、插入log日志
@ -164,6 +170,23 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
return null;
}
private List<ResiEventAttachmentEntity> getAttList(String customerId,String resiEventId, List<FileCommonDTO> attachmentList) {
List<ResiEventAttachmentEntity> list=new ArrayList<>();
int sort=1;
for(FileCommonDTO img:attachmentList){
ResiEventAttachmentEntity entity=new ResiEventAttachmentEntity();
entity.setCustomerId(customerId);
entity.setResiEventId(resiEventId);
entity.setAttachmentName(img.getName());
entity.setAttachmentFormat(img.getFormat());
entity.setAttachmentType(img.getType());
entity.setAttachmentUrl(img.getUrl());
entity.setSort(sort);
sort++;
}
return list;
}
private void scanContent(String eventContent, List<FileCommonDTO> attachmentList) {
//事件内容
if (StringUtils.isNotBlank(eventContent)) {

Loading…
Cancel
Save