|
|
@ -6,6 +6,7 @@ import com.epmet.commons.tools.exception.EpmetException; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.dao.IcResiCollectDao; |
|
|
|
import com.epmet.dao.IcResiMemberDao; |
|
|
|
import com.epmet.dto.IcNeighborHoodDTO; |
|
|
|
import com.epmet.dto.form.IcResiCollectFormDTO; |
|
|
|
import com.epmet.entity.IcResiCollectEntity; |
|
|
@ -28,7 +29,8 @@ import java.util.List; |
|
|
|
public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao, IcResiCollectEntity> implements IcResiCollectService { |
|
|
|
@Autowired |
|
|
|
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IcResiMemberDao icResiMemberDao; |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@ -36,14 +38,20 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl<IcResiCollectDao, |
|
|
|
IcResiCollectEntity origin=baseDao.selectByAddress(formDTO.getAddress()); |
|
|
|
if(null==origin){ |
|
|
|
//插入主表、成员表
|
|
|
|
IcResiCollectEntity insert=ConvertUtils.sourceToTarget(formDTO,IcResiCollectEntity.class); |
|
|
|
if("internal".equals(formDTO.getOrigin())){ |
|
|
|
//查询楼栋个信息
|
|
|
|
IcNeighborHoodDTO neighborHoodDTO=queryIcNeighborHood(formDTO.getVillageId()); |
|
|
|
|
|
|
|
IcResiCollectEntity insert = ConvertUtils.sourceToTarget(formDTO, IcResiCollectEntity.class); |
|
|
|
if ("internal".equals(formDTO.getOrigin())) { |
|
|
|
//根据小区id查询网格相关信息
|
|
|
|
IcNeighborHoodDTO neighborHoodDTO = queryIcNeighborHood(formDTO.getVillageId()); |
|
|
|
insert.setGridId(neighborHoodDTO.getGridId()); |
|
|
|
insert.setAgencyId(neighborHoodDTO.getAgencyId()); |
|
|
|
insert.setPids(neighborHoodDTO.getAgencyPids()); |
|
|
|
} |
|
|
|
List<IcResiMemberEntity> memberList=ConvertUtils.sourceToTarget(formDTO.getMemberList(),IcResiMemberEntity.class); |
|
|
|
|
|
|
|
baseDao.insert(insert); |
|
|
|
List<IcResiMemberEntity> memberList = ConvertUtils.sourceToTarget(formDTO.getMemberList(), IcResiMemberEntity.class); |
|
|
|
memberList.forEach(mem -> { |
|
|
|
mem.setIcResiCollectId(insert.getId()); |
|
|
|
icResiMemberDao.insert(mem); |
|
|
|
}); |
|
|
|
}else{ |
|
|
|
//查询成员表
|
|
|
|
|
|
|
|